diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/aboutdebugging/test/browser_service_workers_not_compatible.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/aboutdebugging/test/browser_service_workers_not_compatible.js')
-rw-r--r-- | devtools/client/aboutdebugging/test/browser_service_workers_not_compatible.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/devtools/client/aboutdebugging/test/browser_service_workers_not_compatible.js b/devtools/client/aboutdebugging/test/browser_service_workers_not_compatible.js new file mode 100644 index 000000000..6221230b5 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser_service_workers_not_compatible.js @@ -0,0 +1,60 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that Service Worker section should show warning message in +// about:debugging if any of following conditions is met: +// 1. service worker is disabled +// 2. the about:debugging pannel is openned in private browsing mode +// 3. the about:debugging pannel is openned in private content window + +var imgClass = ".service-worker-disabled .warning"; + +add_task(function* () { + yield new Promise(done => { + info("disable service workers"); + let options = {"set": [ + ["dom.serviceWorkers.enabled", false], + ]}; + SpecialPowers.pushPrefEnv(options, done); + }); + + let { tab, document } = yield openAboutDebugging("workers"); + // Check that the warning img appears in the UI + let img = document.querySelector(imgClass); + ok(img, "warning message is rendered"); + + yield closeAboutDebugging(tab); +}); + +add_task(function* () { + yield new Promise(done => { + info("set private browsing mode as default"); + let options = {"set": [ + ["browser.privatebrowsing.autostart", true], + ]}; + SpecialPowers.pushPrefEnv(options, done); + }); + + let { tab, document } = yield openAboutDebugging("workers"); + // Check that the warning img appears in the UI + let img = document.querySelector(imgClass); + ok(img, "warning message is rendered"); + + yield closeAboutDebugging(tab); +}); + +add_task(function* () { + info("Opening a new private window"); + let win = OpenBrowserWindow({private: true}); + yield waitForDelayedStartupFinished(win); + + let { tab, document } = yield openAboutDebugging("workers", win); + // Check that the warning img appears in the UI + let img = document.querySelector(imgClass); + ok(img, "warning message is rendered"); + + yield closeAboutDebugging(tab); + win.close(); +}); |