зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1193854 - Restoring userContextIds with the browser session - part 3 - tests, r=ttaubert
This commit is contained in:
Родитель
d1a7df53c6
Коммит
72360793f4
|
@ -219,3 +219,4 @@ skip-if = os == "mac"
|
|||
run-if = e10s
|
||||
[browser_async_window_flushing.js]
|
||||
[browser_forget_async_closings.js]
|
||||
[browser_sessionStoreContainer.js]
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function retrieveUserContextId(browser) {
|
||||
return ContentTask.spawn(browser, null, function* () {
|
||||
return docShell.userContextId;
|
||||
});
|
||||
}
|
||||
|
||||
add_task(function() {
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
let tab = gBrowser.addTab("about:blank");
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
yield promiseBrowserLoaded(browser);
|
||||
yield promiseTabState(tab, { userContextId: i, entries: [{ url: "http://example.com/" }] });
|
||||
|
||||
let userContextId = yield retrieveUserContextId(browser);
|
||||
is(userContextId, i, "The docShell has the correct userContextId");
|
||||
|
||||
yield promiseRemoveTab(tab);
|
||||
}
|
||||
});
|
Загрузка…
Ссылка в новой задаче