dom/devicestorage/test/test_app_permissions.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/devicestorage/test/test_app_permissions.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,661 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=805322
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Permission test for Device Storage</title>
    1.12 +  <script type="application/javascript"
    1.13 +           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.14 +  <link rel="stylesheet" type="text/css"
    1.15 +         href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
    1.16 +</head>
    1.17 +<body>
    1.18 +<a target="_blank"
    1.19 +    href="https://bugzilla.mozilla.org/show_bug.cgi?id=805322">Mozilla Bug 805322</a>
    1.20 +<p id="display"></p>
    1.21 +<div id="content">
    1.22 +  
    1.23 +</div>
    1.24 +<pre id="test">
    1.25 +<script type="application/javascript;version=1.7">
    1.26 +
    1.27 +function randomFilename(l) {
    1.28 +  var set = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";
    1.29 +  var result = "";
    1.30 +  for (var i=0; i<l; i++) {
    1.31 +    var r = Math.floor(set.length * Math.random());
    1.32 +    result += set.substring(r, r + 1);
    1.33 +  }
    1.34 +  return result;
    1.35 +}
    1.36 +
    1.37 +var MockPermissionPrompt = SpecialPowers.MockPermissionPrompt;
    1.38 +MockPermissionPrompt.init();
    1.39 +
    1.40 +SimpleTest.waitForExplicitFinish();
    1.41 +
    1.42 +function TestAdd(iframe, data) {
    1.43 +
    1.44 +  var storage = iframe.contentDocument.defaultView.navigator.getDeviceStorage(data.type);
    1.45 +  isnot(storage, null, "Should be able to get storage object for " + data.type);
    1.46 +
    1.47 +  var blob = new Blob(["Kyle Huey is not a helicopter."], {type: data.mimeType});
    1.48 +
    1.49 +  request = storage.addNamed(blob, randomFilename(100) + "hi" + data.fileExtension);
    1.50 +  isnot(request, null, "Should be able to get request");
    1.51 +
    1.52 +  request.onsuccess = function() {
    1.53 +    is(data.shouldPass, true, "onsuccess was called for type " + data.type);
    1.54 +    testComplete(iframe, data);
    1.55 +  };
    1.56 +
    1.57 +  request.onerror = function(e) {
    1.58 +    isnot(data.shouldPass, true, "onfailure was called for type " + data.type + " Error: " + e.target.error.name);
    1.59 +    is(e.target.error.name, "SecurityError", "onerror should fire a SecurityError");
    1.60 +    testComplete(iframe, data);
    1.61 +  };
    1.62 +}
    1.63 +
    1.64 +function TestGet(iframe, data) {
    1.65 +
    1.66 +  createTestFile(data.fileExtension);
    1.67 +
    1.68 +  var storage = iframe.contentDocument.defaultView.navigator.getDeviceStorage(data.type);
    1.69 +  isnot(storage, null, "Should be able to get storage object for " + data.type);
    1.70 +
    1.71 +  request = storage.get("testfile" + data.fileExtension);
    1.72 +  isnot(request, null, "Should be able to get request");
    1.73 +
    1.74 +  request.onsuccess = function() {
    1.75 +    is(data.shouldPass, true, "onsuccess was called for type " + data.type);
    1.76 +    testComplete(iframe, data);
    1.77 +  };
    1.78 +
    1.79 +  request.onerror = function(e) {
    1.80 +    isnot(data.shouldPass, true, "onfailure was called for type " + data.type + " Error: " + e.target.error.name);
    1.81 +    testComplete(iframe, data);
    1.82 +  };
    1.83 +}
    1.84 +
    1.85 +function TestDelete(iframe, data) {
    1.86 +
    1.87 +  createTestFile(data.fileExtension);
    1.88 +
    1.89 +  var storage = iframe.contentDocument.defaultView.navigator.getDeviceStorage(data.type);
    1.90 +  isnot(storage, null, "Should be able to get storage object for " + data.type);
    1.91 +
    1.92 +  request = storage.delete("testfile" + data.fileExtension);
    1.93 +  isnot(request, null, "Should be able to get request");
    1.94 +
    1.95 +  request.onsuccess = function() {
    1.96 +    is(data.shouldPass, true, "onsuccess was called for type " + data.type);
    1.97 +    testComplete(iframe, data);
    1.98 +  };
    1.99 +
   1.100 +  request.onerror = function(e) {
   1.101 +    isnot(data.shouldPass, true, "onfailure was called for type " + data.type + " Error: " + e.target.error.name);
   1.102 +    is(e.target.error.name, "SecurityError", "onerror should fire a SecurityError");
   1.103 +    testComplete(iframe, data);
   1.104 +  };
   1.105 +}
   1.106 +
   1.107 +function TestEnumerate(iframe, data) {
   1.108 +
   1.109 +  createTestFile(data.fileExtension);
   1.110 +
   1.111 +  var storage = iframe.contentDocument.defaultView.navigator.getDeviceStorage(data.type);
   1.112 +  isnot(storage, null, "Should be able to get storage object for " + data.type);
   1.113 +
   1.114 +  request = storage.enumerate();
   1.115 +  isnot(request, null, "Should be able to get request");
   1.116 +
   1.117 +  request.onsuccess = function(e) {
   1.118 +    is(data.shouldPass, true, "onsuccess was called for type " + data.type);
   1.119 +
   1.120 +    if (e.target.result == null) {
   1.121 +      testComplete(iframe, data);
   1.122 +      return;
   1.123 +    }
   1.124 +    e.target.continue();
   1.125 +  };
   1.126 +
   1.127 +  request.onerror = function(e) {
   1.128 +    isnot(data.shouldPass, true, "onfailure was called for type " + data.type + " Error: " + e.target.error.name);
   1.129 +    is(e.target.error.name, "SecurityError", "onerror should fire a SecurityError");
   1.130 +    testComplete(iframe, data);
   1.131 +  };
   1.132 +}
   1.133 +
   1.134 +var gTestUri = "https://example.com/tests/dom/devicestorage/test/test_app_permissions.html"
   1.135 +
   1.136 +var gData = [
   1.137 +
   1.138 +  // Get
   1.139 +  // Web applications with no permissions
   1.140 +  {
   1.141 +    type: 'pictures',
   1.142 +    shouldPass: false,
   1.143 +    fileExtension: '.png',
   1.144 +    test: TestGet
   1.145 +  },
   1.146 +  {
   1.147 +    type: 'videos',
   1.148 +    shouldPass: false,
   1.149 +    fileExtension: '.ogv',
   1.150 +    test: TestGet
   1.151 +  },
   1.152 +  {
   1.153 +    type: 'music',
   1.154 +    shouldPass: false,
   1.155 +    fileExtension: '.ogg',
   1.156 +    test: TestGet
   1.157 +  },
   1.158 +  {
   1.159 +    type: 'sdcard',
   1.160 +    shouldPass: false,
   1.161 +    fileExtension: '.txt',
   1.162 +    test: TestGet
   1.163 +  },
   1.164 +
   1.165 +  // Web applications with permission granted
   1.166 +  {
   1.167 +    type: 'pictures',
   1.168 +    shouldPass: true,
   1.169 +    fileExtension: '.png',
   1.170 +
   1.171 +    permissions: ["device-storage:pictures"],
   1.172 +
   1.173 +    test: TestGet
   1.174 +  },
   1.175 +  {
   1.176 +    type: 'videos',
   1.177 +    shouldPass: true,
   1.178 +    fileExtension: '.ogv',
   1.179 +
   1.180 +    permissions: ["device-storage:videos"],
   1.181 +
   1.182 +    test: TestGet
   1.183 +  },
   1.184 +  {
   1.185 +    type: 'music',
   1.186 +    shouldPass: true,
   1.187 +    fileExtension: '.ogg',
   1.188 +
   1.189 +    permissions: ["device-storage:music"],
   1.190 +
   1.191 +    test: TestGet
   1.192 +  },
   1.193 +  {
   1.194 +    type: 'sdcard',
   1.195 +    shouldPass: true,
   1.196 +    fileExtension: '.txt',
   1.197 +
   1.198 +    permissions: ["device-storage:sdcard"],
   1.199 +
   1.200 +    test: TestGet
   1.201 +  },
   1.202 +
   1.203 +  // Certified application with permision granted
   1.204 +  {
   1.205 +    type: 'pictures',
   1.206 +    shouldPass: true,
   1.207 +    fileExtension: '.png',
   1.208 +
   1.209 +    app: "https://example.com/manifest_cert.webapp",
   1.210 +    permissions: ["device-storage:pictures"],
   1.211 +
   1.212 +    test: TestGet
   1.213 +  },
   1.214 +  {
   1.215 +    type: 'videos',
   1.216 +    shouldPass: true,
   1.217 +    fileExtension: '.ogv',
   1.218 +
   1.219 +    app: "https://example.com/manifest_cert.webapp",
   1.220 +    permissions: ["device-storage:videos"],
   1.221 +
   1.222 +    test: TestGet
   1.223 +  },
   1.224 +  {
   1.225 +    type: 'music',
   1.226 +    shouldPass: true,
   1.227 +    fileExtension: '.ogg',
   1.228 +
   1.229 +    app: "https://example.com/manifest_cert.webapp",
   1.230 +    permissions: ["device-storage:music"],
   1.231 +
   1.232 +    test: TestGet
   1.233 +  },
   1.234 +  {
   1.235 +    type: 'sdcard',
   1.236 +    shouldPass: true,
   1.237 +    fileExtension: '.txt',
   1.238 +
   1.239 +    app: "https://example.com/manifest_cert.webapp",
   1.240 +    permissions: ["device-storage:sdcard"],
   1.241 +
   1.242 +    test: TestGet
   1.243 +  },
   1.244 +
   1.245 +
   1.246 +  // Add
   1.247 +
   1.248 +
   1.249 +  // Web applications with no permissions
   1.250 +  {
   1.251 +    type: 'pictures',
   1.252 +    mimeType: 'image/png',
   1.253 +    fileExtension: '.png',
   1.254 +    shouldPass: false,
   1.255 +    test: TestAdd
   1.256 +  },
   1.257 +  {
   1.258 +    type: 'videos',
   1.259 +    mimeType: 'video/ogv',
   1.260 +    fileExtension: '.ogv',
   1.261 +    shouldPass: false,
   1.262 +    test: TestAdd
   1.263 +  },
   1.264 +  {
   1.265 +    type: 'music',
   1.266 +    mimeType: 'audio/ogg',
   1.267 +    fileExtension: '.ogg',
   1.268 +    shouldPass: false,
   1.269 +    test: TestAdd
   1.270 +  },
   1.271 +  {
   1.272 +    type: 'sdcard',
   1.273 +    mimeType: 'text/plain',
   1.274 +    fileExtension: '.txt',
   1.275 +    shouldPass: false,
   1.276 +    test: TestAdd
   1.277 +  },
   1.278 +
   1.279 +  // Web applications with permission granted
   1.280 +  {
   1.281 +    type: 'pictures',
   1.282 +    mimeType: 'image/png',
   1.283 +    fileExtension: '.png',
   1.284 +    shouldPass: true,
   1.285 +
   1.286 +    permissions: ["device-storage:pictures"],
   1.287 +
   1.288 +    test: TestAdd
   1.289 +  },
   1.290 +  {
   1.291 +    type: 'videos',
   1.292 +    mimeType: 'video/ogv',
   1.293 +    fileExtension: '.ogv',
   1.294 +    shouldPass: true,
   1.295 +
   1.296 +    permissions: ["device-storage:videos"],
   1.297 +
   1.298 +    test: TestAdd
   1.299 +  },
   1.300 +  {
   1.301 +    type: 'music',
   1.302 +    mimeType: 'audio/ogg',
   1.303 +    fileExtension: '.ogg',
   1.304 +    shouldPass: true,
   1.305 +
   1.306 +    permissions: ["device-storage:music"],
   1.307 +
   1.308 +    test: TestAdd
   1.309 +  },
   1.310 +  {
   1.311 +    type: 'sdcard',
   1.312 +    mimeType: 'text/plain',
   1.313 +    fileExtension: '.txt',
   1.314 +    shouldPass: true,
   1.315 +
   1.316 +    permissions: ["device-storage:sdcard"],
   1.317 +
   1.318 +    test: TestAdd
   1.319 +  },
   1.320 +
   1.321 +  // Certified application with permision granted
   1.322 +  {
   1.323 +    type: 'pictures',
   1.324 +    mimeType: 'image/png',
   1.325 +    fileExtension: '.png',
   1.326 +    shouldPass: true,
   1.327 +
   1.328 +    app: "https://example.com/manifest_cert.webapp",
   1.329 +    permissions: ["device-storage:pictures"],
   1.330 +
   1.331 +    test: TestAdd
   1.332 +  },
   1.333 +  {
   1.334 +    type: 'videos',
   1.335 +    mimeType: 'video/ogv',
   1.336 +    fileExtension: '.ogv',
   1.337 +    shouldPass: true,
   1.338 +
   1.339 +    app: "https://example.com/manifest_cert.webapp",
   1.340 +    permissions: ["device-storage:videos"],
   1.341 +
   1.342 +    test: TestAdd
   1.343 +  },
   1.344 +  {
   1.345 +    type: 'music',
   1.346 +    mimeType: 'audio/ogg',
   1.347 +    fileExtension: '.ogg',
   1.348 +    shouldPass: true,
   1.349 +
   1.350 +    app: "https://example.com/manifest_cert.webapp",
   1.351 +    permissions: ["device-storage:music"],
   1.352 +
   1.353 +    test: TestAdd
   1.354 +  },
   1.355 +  {
   1.356 +    type: 'sdcard',
   1.357 +    mimeType: 'text/plain',
   1.358 +    fileExtension: '.txt',
   1.359 +    shouldPass: true,
   1.360 +
   1.361 +    app: "https://example.com/manifest_cert.webapp",
   1.362 +    permissions: ["device-storage:sdcard"],
   1.363 +
   1.364 +    test: TestAdd
   1.365 +  },
   1.366 +
   1.367 +
   1.368 +// Delete 
   1.369 +
   1.370 +  // Web applications with no permissions
   1.371 +  {
   1.372 +    type: 'pictures',
   1.373 +    shouldPass: false,
   1.374 +    fileExtension: '.png',
   1.375 +    test: TestDelete
   1.376 +  },
   1.377 +  {
   1.378 +    type: 'videos',
   1.379 +    shouldPass: false,
   1.380 +    fileExtension: '.ogv',
   1.381 +    test: TestDelete
   1.382 +  },
   1.383 +  {
   1.384 +    type: 'music',
   1.385 +    shouldPass: false,
   1.386 +    fileExtension: '.ogg',
   1.387 +    test: TestDelete
   1.388 +  },
   1.389 +  {
   1.390 +    type: 'sdcard',
   1.391 +    shouldPass: false,
   1.392 +    fileExtension: '.txt',
   1.393 +    test: TestDelete
   1.394 +  },
   1.395 +
   1.396 +  // Web applications with permission granted
   1.397 +  {
   1.398 +    type: 'pictures',
   1.399 +    shouldPass: true,
   1.400 +    fileExtension: '.png',
   1.401 +
   1.402 +    permissions: ["device-storage:pictures"],
   1.403 +
   1.404 +    test: TestDelete
   1.405 +  },
   1.406 +  {
   1.407 +    type: 'videos',
   1.408 +    shouldPass: true,
   1.409 +    fileExtension: '.ogv',
   1.410 +
   1.411 +    permissions: ["device-storage:videos"],
   1.412 +
   1.413 +    test: TestDelete
   1.414 +  },
   1.415 +  {
   1.416 +    type: 'music',
   1.417 +    shouldPass: true,
   1.418 +    fileExtension: '.ogg',
   1.419 +
   1.420 +    permissions: ["device-storage:music"],
   1.421 +
   1.422 +    test: TestDelete
   1.423 +  },
   1.424 +  {
   1.425 +    type: 'sdcard',
   1.426 +    shouldPass: true,
   1.427 +    fileExtension: '.txt',
   1.428 +
   1.429 +    permissions: ["device-storage:sdcard"],
   1.430 +
   1.431 +    test: TestDelete
   1.432 +  },
   1.433 +
   1.434 +  // Certified application with permision granted
   1.435 +  {
   1.436 +    type: 'pictures',
   1.437 +    shouldPass: true,
   1.438 +    fileExtension: '.png',
   1.439 +
   1.440 +    app: "https://example.com/manifest_cert.webapp",
   1.441 +    permissions: ["device-storage:pictures"],
   1.442 +
   1.443 +    test: TestDelete
   1.444 +  },
   1.445 +  {
   1.446 +    type: 'videos',
   1.447 +    shouldPass: true,
   1.448 +    fileExtension: '.ogv',
   1.449 +
   1.450 +    app: "https://example.com/manifest_cert.webapp",
   1.451 +    permissions: ["device-storage:videos"],
   1.452 +
   1.453 +    test: TestDelete
   1.454 +  },
   1.455 +  {
   1.456 +    type: 'music',
   1.457 +    shouldPass: true,
   1.458 +    fileExtension: '.ogg',
   1.459 +
   1.460 +    app: "https://example.com/manifest_cert.webapp",
   1.461 +    permissions: ["device-storage:music"],
   1.462 +
   1.463 +    test: TestDelete
   1.464 +  },
   1.465 +  {
   1.466 +    type: 'sdcard',
   1.467 +    shouldPass: true,
   1.468 +    fileExtension: '.txt',
   1.469 +
   1.470 +    app: "https://example.com/manifest_cert.webapp",
   1.471 +    permissions: ["device-storage:sdcard"],
   1.472 +
   1.473 +    test: TestDelete
   1.474 +  },
   1.475 +
   1.476 +// Enumeration 
   1.477 +
   1.478 +  // Web applications with no permissions
   1.479 +  {
   1.480 +    type: 'pictures',
   1.481 +    shouldPass: false,
   1.482 +    fileExtension: '.png',
   1.483 +    test: TestEnumerate
   1.484 +  },
   1.485 +  {
   1.486 +    type: 'videos',
   1.487 +    shouldPass: false,
   1.488 +    fileExtension: '.ogv',
   1.489 +    test: TestEnumerate
   1.490 +  },
   1.491 +  {
   1.492 +    type: 'music',
   1.493 +    shouldPass: false,
   1.494 +    fileExtension: '.ogg',
   1.495 +    test: TestEnumerate
   1.496 +  },
   1.497 +  {
   1.498 +    type: 'sdcard',
   1.499 +    shouldPass: false,
   1.500 +    fileExtension: '.txt',
   1.501 +    test: TestEnumerate
   1.502 +  },
   1.503 +
   1.504 +  // Web applications with permission granted
   1.505 +  {
   1.506 +    type: 'pictures',
   1.507 +    shouldPass: true,
   1.508 +    fileExtension: '.png',
   1.509 +
   1.510 +    permissions: ["device-storage:pictures"],
   1.511 +
   1.512 +    test: TestEnumerate
   1.513 +  },
   1.514 +  {
   1.515 +    type: 'videos',
   1.516 +    shouldPass: true,
   1.517 +    fileExtension: '.ogv',
   1.518 +
   1.519 +    permissions: ["device-storage:videos"],
   1.520 +
   1.521 +    test: TestEnumerate
   1.522 +  },
   1.523 +  {
   1.524 +    type: 'music',
   1.525 +    shouldPass: true,
   1.526 +    fileExtension: '.ogg',
   1.527 +
   1.528 +    permissions: ["device-storage:music"],
   1.529 +
   1.530 +    test: TestEnumerate
   1.531 +  },
   1.532 +  {
   1.533 +    type: 'sdcard',
   1.534 +    shouldPass: true,
   1.535 +    fileExtension: '.txt',
   1.536 +
   1.537 +    permissions: ["device-storage:sdcard"],
   1.538 +
   1.539 +    test: TestEnumerate
   1.540 +  },
   1.541 +
   1.542 +  // Certified application with permision granted
   1.543 +  {
   1.544 +    type: 'pictures',
   1.545 +    shouldPass: true,
   1.546 +    fileExtension: '.png',
   1.547 +
   1.548 +    app: "https://example.com/manifest_cert.webapp",
   1.549 +    permissions: ["device-storage:pictures"],
   1.550 +
   1.551 +    test: TestEnumerate
   1.552 +  },
   1.553 +  {
   1.554 +    type: 'videos',
   1.555 +    shouldPass: true,
   1.556 +    fileExtension: '.ogv',
   1.557 +
   1.558 +    app: "https://example.com/manifest_cert.webapp",
   1.559 +    permissions: ["device-storage:videos"],
   1.560 +
   1.561 +    test: TestEnumerate
   1.562 +  },
   1.563 +  {
   1.564 +    type: 'music',
   1.565 +    shouldPass: true,
   1.566 +    fileExtension: '.ogg',
   1.567 +
   1.568 +    app: "https://example.com/manifest_cert.webapp",
   1.569 +    permissions: ["device-storage:music"],
   1.570 +
   1.571 +    test: TestEnumerate
   1.572 +  },
   1.573 +  {
   1.574 +    type: 'sdcard',
   1.575 +    shouldPass: true,
   1.576 +    fileExtension: '.txt',
   1.577 +
   1.578 +    app: "https://example.com/manifest_cert.webapp",
   1.579 +    permissions: ["device-storage:sdcard"],
   1.580 +
   1.581 +    test: TestEnumerate
   1.582 +  },
   1.583 +
   1.584 +];
   1.585 +
   1.586 +function setupTest(iframe,data) {
   1.587 +  if (data.permissions) {
   1.588 +    for (var j in data.permissions) {
   1.589 +      SpecialPowers.addPermission(data.permissions[j], true, iframe.contentDocument);
   1.590 +    }
   1.591 +  }
   1.592 +}
   1.593 +
   1.594 +function testComplete(iframe, data) {
   1.595 +  if (data.permissions) {
   1.596 +    for (var j in data.permissions) {
   1.597 +      SpecialPowers.removePermission(data.permissions[j], iframe.contentDocument);
   1.598 +    }
   1.599 +  }
   1.600 +  
   1.601 +  document.getElementById('content').removeChild(iframe);
   1.602 +
   1.603 +  if (gData.length == 0) {
   1.604 +    SimpleTest.finish();
   1.605 +  } else {
   1.606 +    gTestRunner.next();
   1.607 +  }
   1.608 +}
   1.609 +
   1.610 +function runTest() {
   1.611 +  while (gData.length > 0) {
   1.612 +    var iframe = document.createElement('iframe');
   1.613 +    var data = gData.pop();
   1.614 +
   1.615 +    iframe.setAttribute('mozbrowser', '');
   1.616 +    if (data.app) {
   1.617 +      iframe.setAttribute('mozapp', data.app);
   1.618 +    }
   1.619 +
   1.620 +    iframe.src = gTestUri;
   1.621 +
   1.622 +    iframe.addEventListener('load', function(e) {
   1.623 +      setupTest(iframe, data)
   1.624 +      data.test(iframe, data);
   1.625 +    });
   1.626 +
   1.627 +    document.getElementById('content').appendChild(iframe);
   1.628 +    yield undefined;
   1.629 +  }
   1.630 +}
   1.631 +
   1.632 +function createTestFile(extension) {
   1.633 +try {
   1.634 +  const Cc = SpecialPowers.Cc;
   1.635 +  const Ci = SpecialPowers.Ci;
   1.636 +  var directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
   1.637 +  var f = directoryService.get("TmpD", Ci.nsIFile);
   1.638 +  f.appendRelativePath("device-storage-testing");
   1.639 +  f.remove(true);
   1.640 +  f.appendRelativePath("testfile" + extension);
   1.641 +  f.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
   1.642 +  } catch(e) {}
   1.643 +}
   1.644 +
   1.645 +createTestFile('.txt');
   1.646 +var gTestRunner = runTest();
   1.647 +SpecialPowers.addPermission("browser", true, gTestUri);
   1.648 +
   1.649 +// We are more permissive with CSP in our testing environment....
   1.650 +const DEFAULT_CSP_PRIV = "default-src *; script-src 'self'; style-src 'self' 'unsafe-inline'; object-src 'none'";
   1.651 +const DEFAULT_CSP_CERT = "default-src *; script-src 'self'; style-src 'self'; object-src 'none'";
   1.652 +
   1.653 +SpecialPowers.pushPrefEnv({'set': [["dom.mozBrowserFramesEnabled", true],
   1.654 +                                   ["device.storage.enabled", true],
   1.655 +                                   ["device.storage.testing", true],
   1.656 +                                   ["device.storage.prompt.testing", false],
   1.657 +                                   ["security.apps.privileged.CSP.default", DEFAULT_CSP_PRIV],
   1.658 +                                   ["security.apps.certified.CSP.default", DEFAULT_CSP_CERT]]},
   1.659 +  function() {  gTestRunner.next(); });
   1.660 +
   1.661 +</script>
   1.662 +</pre>
   1.663 +</body>
   1.664 +</html>

mercurial