Bug 1349152 - Add Persistent-Storage permission in PermissionPrompts mozscreenshots, r?johannh
MozReview-Commit-ID: 8lRPKdCrQIW
--- 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" />