// test adding
ok(
test(() => ss.setCustomTabValue(tab, key, value)), "store a tab value"
);
// test retrieving
is(ss.getCustomTabValue(tab, key), value, "stored tab value match original");
// test deleting
ok(
test(() => ss.deleteCustomTabValue(tab, key)), "delete the tab value"
);
// value should not exist post-delete
is(ss.getCustomTabValue(tab, key), "", "tab value was deleted");
// test deleting a non-existent value
ok(
test(() => ss.deleteCustomTabValue(tab, key)), "delete non-existent tab value"
);
// clean up
await promiseRemoveTabAndSessionState(tab);
/** *getClosedTabCountForWindow,undoCloseTab
*/
// get closed tab count
let count = ss.getClosedTabCountForWindow(window);
let max_tabs_undo = Services.prefs.getIntPref( "browser.sessionstore.max_tabs_undo"
);
ok( 0 <= count && count <= max_tabs_undo, "getClosedTabCountForWindow returns zero or at most max_tabs_undo"
);
// create a new tab
let testURL = "about:mozilla";
tab = BrowserTestUtils.addTab(gBrowser, testURL);
await promiseBrowserLoaded(tab.linkedBrowser);
// make sure that the next closed tab will increase getClosedTabCountForWindow
Services.prefs.setIntPref( "browser.sessionstore.max_tabs_undo",
max_tabs_undo + 1
);
registerCleanupFunction(() =>
Services.prefs.clearUserPref("browser.sessionstore.max_tabs_undo")
);
// getClosedTabCountForWindow
let newcount = ss.getClosedTabCountForWindow(window); Assert.greater(
newcount,
count, "after closing a tab, getClosedTabCountForWindow has been incremented"
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.