Bug 1446639 - Update policy tests to show URLs. r=jaws, a=test-only
authorMichael Kaply <mozilla@kaply.com>
Mon, 20 May 2019 15:12:06 +0000
changeset 536962 3a8f7e393a82c6301358eb65f3775a1ef18fa232
parent 536961 ce736296e7690befb9d2e6dd59525446b675fd62
child 536963 0d88fa07b01fe9f98e50832e6a209f24f8b69a32
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, test-only
bugs1446639
milestone68.0
Bug 1446639 - Update policy tests to show URLs. r=jaws, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D31657
browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_addons.js
browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_config.js
browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_profiles.js
browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_support.js
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_addons.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_addons.js
@@ -9,18 +9,18 @@ add_task(async function setup() {
                                     },
                                   });
 });
 
 add_task(async function test_about_addons() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:addons", false);
 
   await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    ok(content.document.documentURI.startsWith("about:neterror"),
-       "about:addons should display the net error page");
+    ok(content.document.documentURI.startsWith("about:neterror?e=blockedByPolicy"),
+       content.document.documentURI + "should start with about:neterror?e=blockedByPolicy");
 
     // There is currently a testing-specific race condition that causes this test
     // to fail, but it is not a problem if we test after the first page load.
     // Until the race condition is fixed, just make sure to test this *after*
     // testing the page load.
     is(Services.policies.isAllowed("about:addons"), false,
        "Policy Engine should report about:addons as not allowed");
   });
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_config.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_config.js
@@ -7,18 +7,18 @@ add_task(async function test_about_confi
                                     "policies": {
                                       "BlockAboutConfig": true,
                                     },
                                   });
 
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:config", false);
 
   await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    ok(content.document.documentURI.startsWith("about:neterror"),
-       "about:config should display the net error page");
+    ok(content.document.documentURI.startsWith("about:neterror?e=blockedByPolicy"),
+       content.document.documentURI + "should start with about:neterror?e=blockedByPolicy");
 
     // There is currently a testing-specific race condition that causes this test
     // to fail, but it is not a problem if we test after the first page load.
     // Until the race condition is fixed, just make sure to test this *after*
     // testing the page load.
     is(Services.policies.isAllowed("about:config"), false,
        "Policy Engine should report about:config as not allowed");
   });
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_profiles.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_profiles.js
@@ -9,18 +9,18 @@ add_task(async function setup() {
                                     },
                                   });
 });
 
 add_task(async function test_about_profiles() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:profiles", false);
 
   await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    ok(content.document.documentURI.startsWith("about:neterror"),
-       "about:profiles should display the net error page");
+    ok(content.document.documentURI.startsWith("about:neterror?e=blockedByPolicy"),
+       content.document.documentURI + "should start with about:neterror?e=blockedByPolicy");
 
     // There is currently a testing-specific race condition that causes this test
     // to fail, but it is not a problem if we test after the first page load.
     // Until the race condition is fixed, just make sure to test this *after*
     // testing the page load.
     is(Services.policies.isAllowed("about:profiles"), false,
        "Policy Engine should report about:profiles as not allowed");
   });
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_support.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_block_about_support.js
@@ -9,18 +9,18 @@ add_task(async function setup() {
                                     },
                                   });
 });
 
 add_task(async function test_about_support() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:support", false);
 
   await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    ok(content.document.documentURI.startsWith("about:neterror"),
-       "about:support should display the net error page");
+    ok(content.document.documentURI.startsWith("about:neterror?e=blockedByPolicy"),
+       content.document.documentURI + "should start with about:neterror?e=blockedByPolicy");
 
     // There is currently a testing-specific race condition that causes this test
     // to fail, but it is not a problem if we test after the first page load.
     // Until the race condition is fixed, just make sure to test this *after*
     // testing the page load.
     is(Services.policies.isAllowed("about:support"), false,
        "Policy Engine should report about:support as not allowed");
   });