Backout f938930b3ac5 (Bug 1161684) for M4 perma-failures on opt. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 22 May 2015 10:47:20 +0200
changeset 266225 57a6450f1c1caa6e587126391aeb451d1351af4a
parent 266224 ea0858f7f19ff01c7fe251cb548c1eb7ecab70fe
child 266226 6f16344cdb289f3f969330419c5fcaa7e39ae7f9
push id2231
push usermichael.l.comella@gmail.com
push dateFri, 22 May 2015 20:04:59 +0000
reviewersbackout
bugs1161684
milestone41.0a1
backs outf938930b3ac59d38ad27d3cdeb2018f912b500d6
Backout f938930b3ac5 (Bug 1161684) for M4 perma-failures on opt. r=backout
dom/workers/test/serviceworkers/app-protocol/README.txt
dom/workers/test/serviceworkers/app-protocol/application.zip
dom/workers/test/serviceworkers/app-protocol/foo.txt
dom/workers/test/serviceworkers/app-protocol/index.html
dom/workers/test/serviceworkers/app-protocol/manifest.webapp
dom/workers/test/serviceworkers/app-protocol/sw.js
dom/workers/test/serviceworkers/app-protocol/update.webapp
dom/workers/test/serviceworkers/app-protocol/update.webapp^headers^
dom/workers/test/serviceworkers/mochitest.ini
dom/workers/test/serviceworkers/test_app_protocol.html
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-application.zip contains foo.txt, index.html, sw.js and manifest.webapp.
-Any change to one of these three files should be added to application.zip as well.
deleted file mode 100644
index c135b1dad976df576f6a88536c3899c0d8ca7467..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/foo.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-networkresponse
\ No newline at end of file
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/index.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Test app for bug 1161684</title>
-    <script type='application/javascript;version=1.7'>
-function ok(aCondition, aMessage) {
-  if (aCondition) {
-    alert('OK: ' + aMessage);
-  } else {
-    alert('KO: ' + aMessage);
-  }
-}
-
-function done() {
-  alert('DONE');
-}
-
-function testFetchAppResource(aExpectedResponse) {
-  return fetch('foo.txt').then(res => {
-    ok(true, 'fetch should resolve');
-    if (res.type == 'error') {
-      ok(false, 'fetch failed');
-    }
-    ok(res.status == 200, 'status should be 200');
-    ok(res.statusText == 'OK', 'statusText should be OK');
-    return res.text().then(body => {
-      ok(body == aExpectedResponse, 'body should match');
-    });
-  });
-}
-
-function registerServiceWorkerAndClaim() {
-  return new Promise((resolve, reject) => {
-    navigator.serviceWorker.register('sw.js', {scope: '.'})
-    .then(registration => {
-      ok(true, 'service worker registered');
-      navigator.serviceWorker.oncontrollerchange = () => {
-        ok(true, 'client controlled');
-        resolve();
-      };
-      registration.active.postMessage('claim');
-    })
-    .catch(reject);
-  });
-}
-
-function runTests() {
-  return Promise.resolve()
-    .then(() => { return testFetchAppResource('networkresponse'); })
-    .then(registerServiceWorkerAndClaim)
-    .then(() => { return testFetchAppResource('swresponse'); })
-    .then(done)
-}
-  </script>
-  </head>
-  <body onload='runTests()'>
-  </body>
-</html>
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/manifest.webapp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "name": "App",
-  "launch_path": "/index.html",
-  "description": "Test app for bug 1161684"
-}
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/sw.js
+++ /dev/null
@@ -1,12 +0,0 @@
-self.addEventListener('fetch', (event) => {
-  if (event.request.url.indexOf('foo.txt') >= 0) {
-    var body = 'swresponse';
-    event.respondWith(new Response(body, {
-      headers: {'Content-Type': 'text/plain'}
-    }));
-  }
-});
-
-self.addEventListener('message', () => {
-  clients.claim();
-});
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/update.webapp
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "name": "App",
-  "launch_path": "/index.html",
-  "description": "Test app for bug 1161684",
-  "package_path": "application.zip"
-}
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/app-protocol/update.webapp^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Content-Type: application/manifest+json
--- a/dom/workers/test/serviceworkers/mochitest.ini
+++ b/dom/workers/test/serviceworkers/mochitest.ini
@@ -92,17 +92,16 @@ support-files =
   swa/worker_scope_too_deep.js^headers^
   swa/worker_scope_too_narrow.js
   swa/worker_scope_too_narrow.js^headers^
   claim_oninstall_worker.js
   claim_worker_1.js
   claim_worker_2.js
   claim_clients/client.html
   claim_fetch_worker.js
-  app-protocol/*
 
 [test_unregister.html]
 [test_installation_simple.html]
 [test_fetch_event.html]
 [test_https_fetch.html]
 [test_https_fetch_cloned_response.html]
 [test_https_synth_fetch_from_cached_sw.html]
 [test_match_all.html]
@@ -130,10 +129,9 @@ support-files =
 [test_empty_serviceworker.html]
 [test_periodic_update.html]
 [test_claim_oninstall.html]
 [test_claim.html]
 [test_periodic_https_update.html]
 [test_sanitize.html]
 [test_sanitize_domain.html]
 [test_service_worker_allowed.html]
-[test_app_protocol.html]
 [test_claim_fetch.html]
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/test_app_protocol.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 1161684 - Allow JAR channels to be intercepted by service workers</title>
-  <script type='text/javascript' src='/tests/SimpleTest/SimpleTest.js'></script>
-  <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css' />
-</head>
-<body onload='runTests()'>
-<p id='display'></p>
-<div id='content' style='display: none'></div>
-<pre id='test'></pre>
-<script class='testbody' type='application/javascript;version=1.7'>
-
-SimpleTest.waitForExplicitFinish();
-
-const appManifestURL =
-  'http://mochi.test:8888/tests/dom/workers/test/serviceworkers/app-protocol/update.webapp';
-let gApp;
-
-function setup() {
-  info('Setting up');
-  return new Promise((resolve, reject) => {
-    SpecialPowers.setAllAppsLaunchable(true);
-    SpecialPowers.pushPrefEnv({'set': [
-      ['dom.mozBrowserFramesEnabled', true],
-      ['dom.serviceWorkers.exemptFromPerDomainMax', true],
-      ['dom.serviceWorkers.enabled', true],
-      ['dom.serviceWorkers.testing.enabled', true]
-    ]}, () => {
-      SpecialPowers.pushPermissions([
-        { 'type': 'webapps-manage', 'allow': 1, 'context': document },
-        { 'type': 'browser', 'allow': 1, 'context': document },
-        { 'type': 'embed-apps', 'allow': 1, 'context': document }
-      ], () => {
-        SpecialPowers.autoConfirmAppInstall(() => {
-          SpecialPowers.autoConfirmAppUninstall(resolve);
-        });
-      });
-    });
-  });
-}
-
-function installApp() {
-  return new Promise((resolve, reject) => {
-    let req = navigator.mozApps.installPackage(appManifestURL);
-    req.onsuccess = function() {
-      gApp = req.result;
-      is(req.result.manifestURL, appManifestURL, 'app installed');
-      if (req.result.installState == 'installed') {
-        is(req.result.installState, 'installed', 'app downloaded');
-        resolve()
-      } else {
-        req.result.ondownloadapplied = function() {
-          is(req.result.installState, 'installed', 'app downloaded');
-          resolve();
-        }
-      }
-    }
-    req.onerror = reject;
-  });
-}
-
-function launchApp() {
-  return new Promise((resolve, reject) => {
-    if (!gApp) {
-      ok(false, 'No test application to launch');
-      reject();
-    }
-
-    let iframe = document.createElement('iframe');
-    iframe.setAttribute('mozbrowser', 'true');
-    iframe.setAttribute('mozapp', gApp.manifestURL);
-    let domParent = document.getElementById('container');
-    iframe.addEventListener('mozbrowsershowmodalprompt', function listener(e) {
-      let message = e.detail.message;
-      info(message);
-      if (/OK/.exec(message)) {
-        ok(true, "Message from app: " + message);
-      } else if (/KO/.exec(message)) {
-        ok(false, "Message from app: " + message);
-      } else if (/DONE/.exec(message)) {
-        ok(true, "Messaging from app complete");
-        iframe.removeEventListener('mozbrowsershowmodalprompt', listener);
-        domParent.removeChild(iframe);
-        resolve();
-      }
-    }, false);
-    domParent.appendChild(iframe);
-    SpecialPowers.wrap(iframe.contentWindow).location =
-      gApp.origin + gApp.manifest.launch_path;
-  });
-}
-
-function uninstallApp() {
-  return new Promise((resolve, reject) => {
-    if (!gApp) {
-      return reject();
-    }
-    let req = navigator.mozApps.mgmt.uninstall(gApp);
-    req.onsuccess = resolve;
-    req.onerror = reject;
-  });
-}
-
-function runTests() {
-  setup()
-    .then(installApp)
-    .then(launchApp)
-    .then(uninstallApp)
-    .then(SimpleTest.finish)
-    .catch((e) => {
-      ok(false, 'Unexpected error ' + e.target.error.name);
-      SimpleTest.finish();
-    });
-}
-
-</script>
-<div id='container'></div>
-</body>
-</html>