Bug 1378377 Part 3: Make sure domains whitelisted for file:// URI use run in file contest process. r=Gijs
authorBob Owen <bobowencode@gmail.com>
Wed, 19 Jul 2017 09:37:25 +0100
changeset 418412 078a6b523cc1b53c8e55a286dc405e28e609a892
parent 418411 137cb6b5df6772b2b34ba91b40ed8e58a1d7d74c
child 418413 d649fe4b821a0ae81664672df699bc71b68130e4
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1378377
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1378377 Part 3: Make sure domains whitelisted for file:// URI use run in file contest process. r=Gijs
browser/base/content/test/tabs/browser.ini
browser/base/content/test/tabs/browser_new_file_whitelisted_http_tab.js
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -8,15 +8,17 @@ support-files =
 [browser_contextmenu_openlink_after_tabnavigated.js]
 [browser_isLocalAboutURI.js]
 [browser_tabCloseProbes.js]
 [browser_tabSpinnerProbe.js]
 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]
 [browser_reload_deleted_file.js]
 [browser_tabswitch_updatecommands.js]
 [browser_viewsource_of_data_URI_in_file_process.js]
 [browser_open_newtab_start_observer_notification.js]
new file mode 100644
--- /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.");
+  });
+});