Bug 1349152 - Add Persistent-Storage permission in PermissionPrompts mozscreenshots, r=johannh
authorFischer.json <fischer.json@gmail.com>
Mon, 06 Feb 2017 16:50:54 +0800
changeset 406493 9233d2abdfc241478a6971be5fa44530eb18eb01
parent 406492 e35828da3a2ef86c2f053c187275faf42cb775da
child 406494 340b02a5a42cba525c0433a823bf4b09b3f21623
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1349152
milestone55.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 1349152 - Add Persistent-Storage permission in PermissionPrompts mozscreenshots, r=johannh MozReview-Commit-ID: 8lRPKdCrQIW
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
browser/tools/mozscreenshots/mozscreenshots/extension/lib/permissionPrompts.html
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
@@ -14,16 +14,17 @@ Cu.import("resource:///modules/E10SUtils
 Cu.import("resource://testing-common/ContentTask.jsm");
 Cu.import("resource://testing-common/BrowserTestUtils.jsm");
 
 const URL = "https://test1.example.com/extensions/mozscreenshots/browser/chrome/mozscreenshots/lib/permissionPrompts.html";
 let lastTab = null;
 
 this.PermissionPrompts = {
   init(libDir) {
+    Services.prefs.setBoolPref("browser.storageManager.enabled", true);
     Services.prefs.setBoolPref("media.navigator.permission.fake", true);
     Services.prefs.setCharPref("media.getusermedia.screensharing.allowed_domains",
                                "test1.example.com");
     Services.prefs.setBoolPref("extensions.install.requireBuiltInCerts", false);
     Services.prefs.setBoolPref("signon.rememberSignons", true);
   },
 
   configurations: {
@@ -57,59 +58,66 @@ this.PermissionPrompts = {
 
     geo: {
       applyConfig: Task.async(function*() {
         yield closeLastTab();
         yield clickOn("#geo");
       }),
     },
 
+    persistentStorage: {
+      applyConfig: Task.async(function*() {
+        yield closeLastTab();
+        yield clickOn("#persistent-storage");
+      }),
+    },
+
     loginCapture: {
       applyConfig: Task.async(function*() {
         yield closeLastTab();
-        yield clickOn("#login-capture", URL);
+        yield clickOn("#login-capture");
       }),
     },
 
     notifications: {
       applyConfig: Task.async(function*() {
         yield closeLastTab();
-        yield clickOn("#web-notifications", URL);
+        yield clickOn("#web-notifications");
       }),
     },
 
     addons: {
       applyConfig: Task.async(function*() {
         Services.prefs.setBoolPref("xpinstall.whitelist.required", true);
 
         yield closeLastTab();
-        yield clickOn("#addons", URL);
+        yield clickOn("#addons");
       }),
     },
 
     addonsNoWhitelist: {
       applyConfig: Task.async(function*() {
         Services.prefs.setBoolPref("xpinstall.whitelist.required", false);
 
         let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
         let notification = browserWindow.document.getElementById("addon-install-confirmation-notification");
 
         yield closeLastTab();
-        yield clickOn("#addons", URL);
+        yield clickOn("#addons");
 
         // We want to skip the progress-notification, so we wait for
         // the install-confirmation screen to be "not hidden" = shown.
         yield BrowserTestUtils.waitForCondition(() => !notification.hasAttribute("hidden"),
                                                 "addon install confirmation did not show", 200);
       }),
     },
   },
 };
 
-function* closeLastTab(selector) {
+function* closeLastTab() {
   if (!lastTab) {
     return;
   }
   yield BrowserTestUtils.removeTab(lastTab);
   lastTab = null;
 }
 
 function* clickOn(selector) {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/permissionPrompts.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/permissionPrompts.html
@@ -1,16 +1,17 @@
 <!DOCTYPE html>
 <html>
 <head>
   <meta charset="utf-8">
   <title>Permission Prompts</title>
 </head>
 <body>
   <button id="geo" onclick="navigator.geolocation.getCurrentPosition(() => {})">Geolocation</button>
+  <button id="persistent-storage" onclick="navigator.storage.persist()">Persistent Storage</button>
   <button id="webRTC-shareDevices" onclick="shareDevice({video: true, fake: true});">Video</button>
   <button id="webRTC-shareMicrophone" onclick="shareDevice({audio: true, fake: true});">Audio</button>
   <button id="webRTC-shareDevices2" onclick="shareDevice({audio: true, video: true, fake: true});">Audio and Video</button>
   <button id="webRTC-shareScreen" onclick="shareDevice({video: {mediaSource: 'screen'}});">Screen</button>
   <button id="web-notifications" onclick="Notification.requestPermission()">web-notifications</button>
   <a id="addons" href="borderify.xpi">Install Add-On</a>
   <form>
     <input type="email" id="email" value="email@example.com" />