2016-01-06 00:01:46 +03:00
|
|
|
/* 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/. */
|
|
|
|
|
2016-03-04 16:32:24 +03:00
|
|
|
add_task(function* () {
|
2016-01-06 00:01:46 +03:00
|
|
|
for (let i = 0; i < 3; ++i) {
|
2016-01-20 02:29:00 +03:00
|
|
|
let tab = gBrowser.addTab("http://example.com/", {userContextId: i});
|
2016-01-06 00:01:46 +03:00
|
|
|
let browser = tab.linkedBrowser;
|
|
|
|
|
|
|
|
yield promiseBrowserLoaded(browser);
|
|
|
|
|
2016-01-20 02:29:00 +03:00
|
|
|
let tab2 = gBrowser.duplicateTab(tab);
|
|
|
|
let browser2 = tab2.linkedBrowser;
|
|
|
|
yield promiseTabRestored(tab2)
|
|
|
|
|
2016-03-04 16:32:24 +03:00
|
|
|
yield ContentTask.spawn(browser2, { expectedId: i }, function* (args) {
|
|
|
|
let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
|
|
|
|
Assert.equal(loadContext.originAttributes.userContextId,
|
|
|
|
args.expectedId, "The docShell has the correct userContextId");
|
|
|
|
});
|
2016-01-06 00:01:46 +03:00
|
|
|
|
|
|
|
yield promiseRemoveTab(tab);
|
2016-01-20 02:29:00 +03:00
|
|
|
yield promiseRemoveTab(tab2);
|
2016-01-06 00:01:46 +03:00
|
|
|
}
|
|
|
|
});
|
2016-01-20 02:29:00 +03:00
|
|
|
|