Bug 1328829 Part 2: Check that related browser is not copied when switching remote type. r=gijs

This commit is contained in:
Bob Owen 2017-01-30 10:36:37 +00:00
Родитель 76579c1821
Коммит 859f18b493
2 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@ -2,6 +2,7 @@
support-files = support-files =
dummy_page.html dummy_page.html
[browser_allow_process_switches_despite_related_browser.js]
[browser_tabSpinnerProbe.js] [browser_tabSpinnerProbe.js]
skip-if = !e10s # Tab spinner is e10s only. skip-if = !e10s # Tab spinner is e10s only.
[browser_tabSwitchPrintPreview.js] [browser_tabSwitchPrintPreview.js]

Просмотреть файл

@ -0,0 +1,32 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
const DUMMY_FILE = "dummy_page.html";
// Test for bug 1328829.
add_task(function* () {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser,
"data:text/html,Hi");
registerCleanupFunction(function* () {
yield BrowserTestUtils.removeTab(tab);
});
let promiseTab =
BrowserTestUtils.waitForNewTab(gBrowser, "view-source:data:text/html,Hi");
BrowserViewSource(tab.linkedBrowser);
let viewSourceTab = yield promiseTab;
registerCleanupFunction(function* () {
yield BrowserTestUtils.removeTab(viewSourceTab);
});
let dummyPage = getChromeDir(getResolvedURI(gTestPath));
dummyPage.append(DUMMY_FILE);
const uriString = Services.io.newFileURI(dummyPage).spec;
let viewSourceBrowser = viewSourceTab.linkedBrowser;
viewSourceBrowser.loadURI(uriString);
let href = yield BrowserTestUtils.browserLoaded(viewSourceBrowser);
is(href, uriString,
"Check file:// URI loads in a browser that was previously for view-source");
});