Bug 1455078: Make ServiceWorker test check interface availability with lowered privileges r=asuth
authorYaron Tausky <ytausky@mozilla.com>
Wed, 22 Aug 2018 13:12:52 +0000
changeset 490604 9e44b02e94ca5f7e896be3eb02b6d27a40d7054b
parent 490603 3f29d9aef185203912597b32bd1270d78d9e499d
child 490605 7472e52f6d1288b773d771918cd23ed951464bf5
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1455078
milestone63.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 1455078: Make ServiceWorker test check interface availability with lowered privileges r=asuth The test as it is currently written checks whether navigator.serviceWorker exists with system privileges. By using eval(), this commit makes it perform the check with the content's privileges. Differential Revision: https://phabricator.services.mozilla.com/D3596
dom/serviceworkers/test/test_privateBrowsing.html
--- a/dom/serviceworkers/test/test_privateBrowsing.html
+++ b/dom/serviceworkers/test/test_privateBrowsing.html
@@ -40,17 +40,17 @@ function setupWindow() {
 
 var wN;
 var registration;
 var wP;
 
 function testPrivateWindow() {
   testOnWindow(true, function(aWin) {
     wP = aWin;
-    ok(!("serviceWorker" in wP.content.navigator), "ServiceWorkers are not available for private windows");
+    ok(!wP.content.eval('"serviceWorker" in navigator'), "ServiceWorkers are not available for private windows");
     runTest();
   });
 }
 
 function doTests() {
   testOnWindow(false, function(aWin) {
     wN = aWin;
     ok("serviceWorker" in wN.content.navigator, "ServiceWorkers are available for normal windows");