Backed out 2 changesets (bug 1328293) for eslint failures
authorPhil Ringnalda <philringnalda@gmail.com>
Sat, 21 Jan 2017 12:19:37 -0800
changeset 375551 14b3fa51bb1261b74b50f440d7410f46c7960d2c
parent 375550 a76a454541fc9a40f46129e960e4eb3f74af6389
child 375552 2baeb0ea29839295cd3e712264d5d65c564c7a8a
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1328293
milestone53.0a1
backs outa76a454541fc9a40f46129e960e4eb3f74af6389
42823a93cd1600cbb59e7eafa97a7ad82f0cbb85
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
Backed out 2 changesets (bug 1328293) for eslint failures CLOSED TREE Backed out changeset a76a454541fc (bug 1328293) Backed out changeset 42823a93cd16 (bug 1328293)
devtools/client/aboutdebugging/components/workers/panel.js
devtools/client/aboutdebugging/components/workers/service-worker-target.js
devtools/client/aboutdebugging/test/browser.ini
devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
devtools/client/aboutdebugging/test/service-workers/fetch-sw.html
devtools/client/aboutdebugging/test/service-workers/fetch-sw.js
devtools/client/locales/en-US/aboutdebugging.properties
devtools/server/actors/worker.js
dom/interfaces/base/nsIServiceWorkerManager.idl
dom/workers/ServiceWorkerInfo.cpp
--- a/devtools/client/aboutdebugging/components/workers/panel.js
+++ b/devtools/client/aboutdebugging/components/workers/panel.js
@@ -71,17 +71,16 @@ module.exports = createClass({
 
     getWorkerForms(this.props.client).then(forms => {
       forms.registrations.forEach(form => {
         workers.service.push({
           icon: WorkerIcon,
           name: form.url,
           url: form.url,
           scope: form.scope,
-          fetch: form.fetch,
           registrationActor: form.actor,
           active: form.active
         });
       });
 
       forms.workers.forEach(form => {
         let worker = {
           icon: WorkerIcon,
@@ -95,18 +94,16 @@ module.exports = createClass({
             if (registration) {
               // XXX: Race, sometimes a ServiceWorkerRegistrationInfo doesn't
               // have a scriptSpec, but its associated WorkerDebugger does.
               if (!registration.url) {
                 registration.name = registration.url = form.url;
               }
               registration.workerActor = form.actor;
             } else {
-              worker.fetch = form.fetch;
-
               // If a service worker registration could not be found, this means we are in
               // e10s, and registrations are not forwarded to other processes until they
               // reach the activated state. Augment the worker as a registration worker to
               // display it in aboutdebugging.
               worker.scope = form.scope;
               worker.active = false;
               workers.service.push(worker);
             }
--- a/devtools/client/aboutdebugging/components/workers/service-worker-target.js
+++ b/devtools/client/aboutdebugging/components/workers/service-worker-target.js
@@ -20,17 +20,16 @@ const Strings = Services.strings.createB
 module.exports = createClass({
   displayName: "ServiceWorkerTarget",
 
   propTypes: {
     client: PropTypes.instanceOf(DebuggerClient).isRequired,
     debugDisabled: PropTypes.bool,
     target: PropTypes.shape({
       active: PropTypes.bool,
-      fetch: PropTypes.bool.isRequired,
       icon: PropTypes.string,
       name: PropTypes.string.isRequired,
       url: PropTypes.string,
       scope: PropTypes.string.isRequired,
       // registrationActor can be missing in e10s.
       registrationActor: PropTypes.string,
       workerActor: PropTypes.string
     }).isRequired
@@ -191,19 +190,16 @@ module.exports = createClass({
     }, Strings.GetStringFromName("unregister"));
   },
 
   render() {
     let { target } = this.props;
     let { pushSubscription } = this.state;
     let status = this.getServiceWorkerStatus();
 
-    let fetch = target.fetch ? Strings.GetStringFromName("listeningForFetchEvents") :
-      Strings.GetStringFromName("notListeningForFetchEvents");
-
     return dom.div({ className: "target-container" },
       dom.img({
         className: "target-icon",
         role: "presentation",
         src: target.icon
       }),
       dom.span({ className: `target-status target-status-${status}` },
         Strings.GetStringFromName(status)),
@@ -215,22 +211,16 @@ module.exports = createClass({
               dom.strong(null, Strings.GetStringFromName("pushService")),
               dom.span({
                 className: "service-worker-push-url",
                 title: pushSubscription.endpoint
               }, pushSubscription.endpoint)) :
             null
           ),
           dom.li({ className: "target-detail" },
-            dom.strong(null, Strings.GetStringFromName("fetch")),
-            dom.span({
-              className: "service-worker-fetch-flag",
-              title: fetch
-            }, fetch)),
-          dom.li({ className: "target-detail" },
             dom.strong(null, Strings.GetStringFromName("scope")),
             dom.span({
               className: "service-worker-scope",
               title: target.scope
             }, target.scope),
             this.renderUnregisterLink()
           )
         )
--- a/devtools/client/aboutdebugging/test/browser.ini
+++ b/devtools/client/aboutdebugging/test/browser.ini
@@ -8,18 +8,16 @@ support-files =
   addons/bad/manifest.json
   addons/bug1273184.xpi
   addons/test-devtools-webextension/*
   addons/test-devtools-webextension-nobg/*
   service-workers/delay-sw.html
   service-workers/delay-sw.js
   service-workers/empty-sw.html
   service-workers/empty-sw.js
-  service-workers/fetch-sw.html
-  service-workers/fetch-sw.js
   service-workers/push-sw.html
   service-workers/push-sw.js
   !/devtools/client/framework/test/shared-head.js
 
 [browser_addons_debug_bootstrapped.js]
 [browser_addons_debug_webextension.js]
 tags = webextensions
 [browser_addons_debug_webextension_inspector.js]
@@ -29,17 +27,16 @@ tags = webextensions
 [browser_addons_debug_webextension_popup.js]
 tags = webextensions
 [browser_addons_debugging_initial_state.js]
 [browser_addons_install.js]
 [browser_addons_reload.js]
 [browser_addons_toggle_debug.js]
 [browser_page_not_found.js]
 [browser_service_workers.js]
-[browser_service_workers_fetch_flag.js]
 [browser_service_workers_not_compatible.js]
 [browser_service_workers_push.js]
 [browser_service_workers_push_service.js]
 [browser_service_workers_start.js]
 [browser_service_workers_status.js]
 [browser_service_workers_timeout.js]
 skip-if = true # Bug 1232931
 [browser_service_workers_unregister.js]
deleted file mode 100644
--- a/devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Service workers can't be loaded from chrome://,
-// but http:// is ok with dom.serviceWorkers.testing.enabled turned on.
-const EMPTY_SW_TAB_URL = URL_ROOT + "service-workers/empty-sw.html";
-const FETCH_SW_TAB_URL = URL_ROOT + "service-workers/fetch-sw.html";
-
-function* testBody(url, expecting) {
-  yield new Promise(done => {
-    let options = {"set": [
-      ["dom.serviceWorkers.enabled", true],
-      ["dom.serviceWorkers.testing.enabled", true],
-    ]};
-    SpecialPowers.pushPrefEnv(options, done);
-  });
-
-  let { tab, document } = yield openAboutDebugging("workers");
-
-  let swTab = yield addTab(url);
-
-  let serviceWorkersElement = getServiceWorkerList(document);
-  yield waitForMutation(serviceWorkersElement, { childList: true });
-
-  let fetchFlags = [...document.querySelectorAll("#service-workers .service-worker-fetch-flag")];
-  fetchFlags = fetchFlags.map(element => element.textContent);
-  ok(fetchFlags.includes(expecting), "Found correct fetch flag.");
-
-  try {
-    yield unregisterServiceWorker(swTab, serviceWorkersElement);
-    ok(true, "Service worker registration unregistered");
-  } catch (e) {
-    ok(false, "SW not unregistered; " + e);
-  }
-
-  // Check that the service worker disappeared from the UI
-  let names = [...document.querySelectorAll("#service-workers .target-name")];
-  names = names.map(element => element.textContent);
-  ok(names.length == 0, "All service workers were removed from the list.");
-
-  yield removeTab(swTab);
-  yield closeAboutDebugging(tab);
-}
-
-add_task(function* () {
-  yield testBody(FETCH_SW_TAB_URL, "Listening for fetch events.");
-  yield testBody(EMPTY_SW_TAB_URL, "Not listening for fetch events.");
-});
deleted file mode 100644
--- a/devtools/client/aboutdebugging/test/service-workers/fetch-sw.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="UTF-8">
-  <title>Service worker test</title>
-</head>
-<body>
-<script type="text/javascript">
-"use strict";
-
-var sw = navigator.serviceWorker.register("fetch-sw.js", {scope: "fetch-sw/"});
-sw.then(
-  function () {
-    dump("SW registered\n");
-  },
-  function (e) {
-    dump("SW not registered: " + e + "\n");
-  }
-);
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/devtools/client/aboutdebugging/test/service-workers/fetch-sw.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Bug 1328293
-onfetch = function(event) {
-  // do nothing.
-}
--- a/devtools/client/locales/en-US/aboutdebugging.properties
+++ b/devtools/client/locales/en-US/aboutdebugging.properties
@@ -16,28 +16,16 @@ push = Push
 # This string is displayed as a label of the button that starts a service worker.
 start = Start
 
 scope = Scope
 unregister = unregister
 
 pushService = Push Service
 
-# LOCALIZATION NOTE (fetch):
-# Fetch is an event type and should not be translated.
-fetch = Fetch
-
-# LOCALIZATION NOTE (listeningForFetchEvents):
-# This is used to display the state of the SW in regard to fetch events.
-listeningForFetchEvents = Listening for fetch events.
-
-# LOCALIZATION NOTE (notListeningForFetchEvents):
-# This is used to display the state of the SW in regard to fetch events.
-notListeningForFetchEvents = Not listening for fetch events.
-
 # LOCALIZATION NOTE (addons):
 # This string is displayed as a header of the about:debugging#addons page.
 addons = Add-ons
 
 # LOCALIZATION NOTE (addonDebugging.label):
 # This string is displayed next to a check box that enables the user to switch
 # addon debugging on/off.
 addonDebugging.label = Enable add-on debugging
--- a/devtools/server/actors/worker.js
+++ b/devtools/server/actors/worker.js
@@ -48,20 +48,16 @@ let WorkerActor = protocol.ActorClassWit
       actor: this.actorID,
       consoleActor: this._consoleActor,
       url: this._dbg.url,
       type: this._dbg.type
     };
     if (this._dbg.type === Ci.nsIWorkerDebugger.TYPE_SERVICE) {
       let registration = this._getServiceWorkerRegistrationInfo();
       form.scope = registration.scope;
-      let newestWorker = (registration.activeWorker ||
-                          registration.waitingWorker ||
-                          registration.installingWorker);
-      form.fetch = newestWorker && newestWorker.handlesFetchEvents;
     }
     return form;
   },
 
   attach() {
     if (this._dbg.isClosed) {
       return { error: "closed" };
     }
@@ -228,17 +224,16 @@ let ServiceWorkerActor = protocol.ActorC
   form() {
     if (!this._worker) {
       return null;
     }
 
     return {
       url: this._worker.scriptSpec,
       state: this._worker.state,
-      fetch: this._worker.handlesFetchEvents
     };
   },
 
   destroy() {
     protocol.Actor.prototype.destroy.call(this);
     this._worker = null;
   },
 });
@@ -287,27 +282,24 @@ protocol.ActorClassWithSpec(serviceWorke
     if (detail === "actorid") {
       return this.actorID;
     }
     let registration = this._registration;
     let installingWorker = this._installingWorker.form();
     let waitingWorker = this._waitingWorker.form();
     let activeWorker = this._activeWorker.form();
 
-    let newestWorker = (activeWorker || waitingWorker || installingWorker);
-
     let isE10s = Services.appinfo.browserTabsRemoteAutostart;
     return {
       actor: this.actorID,
       scope: registration.scope,
       url: registration.scriptSpec,
       installingWorker,
       waitingWorker,
       activeWorker,
-      fetch: newestWorker && newestWorker.fetch,
       // - In e10s: only active registrations are available.
       // - In non-e10s: registrations always have at least one worker, if the worker is
       // active, the registration is active.
       active: isE10s ? true : !!activeWorker
     };
   },
 
   destroy() {
--- a/dom/interfaces/base/nsIServiceWorkerManager.idl
+++ b/dom/interfaces/base/nsIServiceWorkerManager.idl
@@ -40,18 +40,16 @@ interface nsIServiceWorkerInfo : nsISupp
 
   readonly attribute DOMString scriptSpec;
   readonly attribute DOMString cacheName;
 
   readonly attribute unsigned short state;
 
   readonly attribute nsIWorkerDebugger debugger;
 
-  readonly attribute bool handlesFetchEvents;
-
   void attachDebugger();
 
   void detachDebugger();
 };
 
 [scriptable, uuid(87e63548-d440-4b8a-b158-65ad1de0211E)]
 interface nsIServiceWorkerRegistrationInfoListener : nsISupports
 {
--- a/dom/workers/ServiceWorkerInfo.cpp
+++ b/dom/workers/ServiceWorkerInfo.cpp
@@ -56,25 +56,16 @@ ServiceWorkerInfo::GetDebugger(nsIWorker
   if (NS_WARN_IF(!aResult)) {
     return NS_ERROR_FAILURE;
   }
 
   return mServiceWorkerPrivate->GetDebugger(aResult);
 }
 
 NS_IMETHODIMP
-ServiceWorkerInfo::GetHandlesFetchEvents(bool* aValue)
-{
-  MOZ_ASSERT(aValue);
-  AssertIsOnMainThread();
-  *aValue = HandlesFetch();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 ServiceWorkerInfo::AttachDebugger()
 {
   return mServiceWorkerPrivate->AttachDebugger();
 }
 
 NS_IMETHODIMP
 ServiceWorkerInfo::DetachDebugger()
 {