diff --git a/browser/base/content/test/tabs/browser.ini b/browser/base/content/test/tabs/browser.ini index f8d5b51d9bb1..4b6641084eb9 100644 --- a/browser/base/content/test/tabs/browser.ini +++ b/browser/base/content/test/tabs/browser.ini @@ -13,6 +13,8 @@ skip-if = !e10s # Tab spinner is e10s only. [browser_tabSwitchPrintPreview.js] skip-if = os == 'mac' [browser_navigatePinnedTab.js] +[browser_new_file_whitelisted_http_tab.js] +skip-if = !e10s # Test only relevant for e10s. [browser_new_web_tab_in_file_process_pref.js] skip-if = !e10s # Pref and test only relevant for e10s. [browser_opened_file_tab_navigated_to_web.js] diff --git a/browser/base/content/test/tabs/browser_new_file_whitelisted_http_tab.js b/browser/base/content/test/tabs/browser_new_file_whitelisted_http_tab.js new file mode 100644 index 000000000000..8e0d99458de6 --- /dev/null +++ b/browser/base/content/test/tabs/browser_new_file_whitelisted_http_tab.js @@ -0,0 +1,27 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ + +const TEST_HTTP = "http://example.org/"; + +// Test for bug 1378377. +add_task(async function() { + // Set prefs to ensure file content process. + await SpecialPowers.pushPrefEnv( + {set: [["browser.tabs.remote.separateFileUriProcess", true]]}); + + await BrowserTestUtils.withNewTab(TEST_HTTP, async function(fileBrowser) { + is(fileBrowser.remoteType, E10SUtils.WEB_REMOTE_TYPE, + "Check that tab normally has web remote type."); + }); + + // Set prefs to whitelist TEST_HTTP for file:// URI use. + await SpecialPowers.pushPrefEnv( + {set: [["capability.policy.policynames", "allowFileURI"], + ["capability.policy.allowFileURI.sites", TEST_HTTP], + ["capability.policy.allowFileURI.checkloaduri.enabled", "allAccess"]]}); + + await BrowserTestUtils.withNewTab(TEST_HTTP, async function(fileBrowser) { + is(fileBrowser.remoteType, E10SUtils.FILE_REMOTE_TYPE, + "Check that tab now has file remote type."); + }); +});