Backed out 4 changesets (bug 982726) for mochitest-4 bustage
authorWes Kocher <wkocher@mozilla.com>
Tue, 02 Sep 2014 19:09:38 -0700
changeset 226539 d323ede35f89cab603de05167e0ce86aaf1378ff
parent 226538 e9e1db6d0b8851246dc2d3f5259acb7b1fecf95f
child 226540 accfce64d9df470b20953d44675a6bd694103df4
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs982726
milestone35.0a1
backs out547076d4a357727f9d882580a49d29927a0b95fa
095ca68e5d3834a8ef0588f35c6beae1a59df5d3
05acfcc7a34119085fc8ad4582e5420c96658c80
9244a16c3258f57039b0b1cfbd0cd24239b822b7
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 4 changesets (bug 982726) for mochitest-4 bustage Backed out changeset 547076d4a357 (bug 982726) Backed out changeset 095ca68e5d38 (bug 982726) Backed out changeset 05acfcc7a341 (bug 982726) Backed out changeset 9244a16c3258 (bug 982726)
dom/bindings/Bindings.conf
dom/webidl/ServiceWorker.webidl
dom/webidl/ServiceWorkerClient.webidl
dom/webidl/ServiceWorkerClients.webidl
dom/webidl/ServiceWorkerGlobalScope.webidl
dom/webidl/moz.build
dom/workers/ServiceWorker.cpp
dom/workers/ServiceWorker.h
dom/workers/ServiceWorkerClient.cpp
dom/workers/ServiceWorkerClient.h
dom/workers/ServiceWorkerClients.cpp
dom/workers/ServiceWorkerClients.h
dom/workers/ServiceWorkerManager.cpp
dom/workers/ServiceWorkerManager.h
dom/workers/WorkerScope.cpp
dom/workers/WorkerScope.h
dom/workers/moz.build
dom/workers/test/serviceworkers/get_serviced_worker.js
dom/workers/test/serviceworkers/get_serviced_worker_advanced.js
dom/workers/test/serviceworkers/get_serviced_worker_enumerate.js
dom/workers/test/serviceworkers/message_posting_worker.js
dom/workers/test/serviceworkers/mochitest.ini
dom/workers/test/serviceworkers/sw_clients/service_worker_controlled.html
dom/workers/test/serviceworkers/sw_clients/simple.html
dom/workers/test/serviceworkers/test_get_serviced.html
dom/workers/test/serviceworkers/test_get_serviced_advanced.html
dom/workers/test/serviceworkers/test_get_serviced_enumerate.html
dom/workers/test/serviceworkers/test_post_message.html
dom/workers/test/serviceworkers/test_post_message_advanced.html
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1053,26 +1053,16 @@ DOMInterfaces = {
     ]
 },
 
 'ServiceWorker': {
     'nativeType': 'mozilla::dom::workers::ServiceWorker',
     'headerFile': 'mozilla/dom/workers/bindings/ServiceWorker.h',
 },
 
-'ServiceWorkerClient': {
-    'nativeType': 'mozilla::dom::workers::ServiceWorkerClient',
-    'headerFile': 'mozilla/dom/workers/bindings/ServiceWorkerClient.h',
-},
-
-'ServiceWorkerClients': {
-    'nativeType': 'mozilla::dom::workers::ServiceWorkerClients',
-    'headerFile': 'mozilla/dom/workers/bindings/ServiceWorkerClients.h',
-},
-
 'ServiceWorkerGlobalScope': {
     'headerFile': 'mozilla/dom/WorkerScope.h',
     'workers': True,
 },
 
 'SharedWorker': {
     'nativeType': 'mozilla::dom::workers::SharedWorker',
     'headerFile': 'mozilla/dom/workers/bindings/SharedWorker.h',
--- a/dom/webidl/ServiceWorker.webidl
+++ b/dom/webidl/ServiceWorker.webidl
@@ -3,30 +3,28 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
  *
  */
 
+// Still unclear what should be subclassed.
+// https://github.com/slightlyoff/ServiceWorker/issues/189
 [Pref="dom.serviceWorkers.enabled",
  // XXXbz I have no idea where this should be exposed.  The spec makes
  // no sense.  But since it's got a pref, let's say window.
  Exposed=Window]
 interface ServiceWorker : EventTarget {
   readonly attribute DOMString scope;
   readonly attribute DOMString url;
 
   readonly attribute ServiceWorkerState state;
   attribute EventHandler onstatechange;
-
-  // FIXME(catalinb): Bug 1053483 - This should be inherited from MessageUtils
-  [Throws]
-  void postMessage(any message, optional sequence<Transferable> transferable);
 };
 
 ServiceWorker implements AbstractWorker;
 
 enum ServiceWorkerState {
   "installing",
   "installed",
   "activating",
deleted file mode 100644
--- a/dom/webidl/ServiceWorkerClient.webidl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
- *
- */
-
-[Exposed=ServiceWorker]
-interface ServiceWorkerClient {
-  readonly attribute unsigned long id;
-  [Throws]
-  void postMessage(any message, optional sequence<Transferable> transfer);
-};
deleted file mode 100644
--- a/dom/webidl/ServiceWorkerClients.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
- *
- */
-
-[Exposed=ServiceWorker]
-interface ServiceWorkerClients {
-  // A list of client objects, identifiable by ID, that correspond to windows
-  // (or workers) that are "controlled" by this SW
-  [Throws]
-  Promise<sequence<ServiceWorkerClient>?> getServiced();
-  [Throws]
-  Promise<any> reloadAll();
-};
--- a/dom/webidl/ServiceWorkerGlobalScope.webidl
+++ b/dom/webidl/ServiceWorkerGlobalScope.webidl
@@ -11,17 +11,20 @@
  */
 
 [Global=(Worker,ServiceWorker),
  Exposed=ServiceWorker]
 interface ServiceWorkerGlobalScope : WorkerGlobalScope {
   // FIXME(nsm): Bug 982725
   // readonly attribute CacheList caches;
 
-  readonly attribute ServiceWorkerClients clients;
+  // FIXME(nsm): Bug 982726
+  // A container for a list of window objects, identifiable by ID, that
+  // correspond to windows (or workers) that are "controlled" by this SW
+  // readonly attribute ServiceWorkerClients clients;
 
   [Unforgeable] readonly attribute DOMString scope;
 
   // FIXME(nsm): Bug 995484
   // ResponsePromise<any> fetch((Request or [EnsureUTF16] DOMString) request);
 
   void update();
   void unregister();
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -320,18 +320,16 @@ WEBIDL_FILES = [
     'RTCRtpSender.webidl',
     'RTCSessionDescription.webidl',
     'RTCStatsReport.webidl',
     'Screen.webidl',
     'ScriptProcessorNode.webidl',
     'ScrollAreaEvent.webidl',
     'Selection.webidl',
     'ServiceWorker.webidl',
-    'ServiceWorkerClient.webidl',
-    'ServiceWorkerClients.webidl',
     'ServiceWorkerContainer.webidl',
     'ServiceWorkerGlobalScope.webidl',
     'ServiceWorkerRegistration.webidl',
     'SettingsManager.webidl',
     'ShadowRoot.webidl',
     'SharedWorker.webidl',
     'SharedWorkerGlobalScope.webidl',
     'SimpleGestureEvent.webidl',
--- a/dom/workers/ServiceWorker.cpp
+++ b/dom/workers/ServiceWorker.cpp
@@ -6,17 +6,16 @@
 #include "ServiceWorker.h"
 
 #include "nsPIDOMWindow.h"
 #include "SharedWorker.h"
 #include "WorkerPrivate.h"
 
 #include "mozilla/dom/Promise.h"
 
-using mozilla::ErrorResult;
 using namespace mozilla::dom;
 USING_WORKERS_NAMESPACE
 
 ServiceWorker::ServiceWorker(nsPIDOMWindow* aWindow,
                              SharedWorker* aSharedWorker)
   : DOMEventTargetHelper(aWindow),
     mState(ServiceWorkerState::Installing),
     mSharedWorker(aSharedWorker)
@@ -42,27 +41,16 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(Servi
 JSObject*
 ServiceWorker::WrapObject(JSContext* aCx)
 {
   AssertIsOnMainThread();
 
   return ServiceWorkerBinding::Wrap(aCx, this);
 }
 
-void
-ServiceWorker::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
-                           const Optional<Sequence<JS::Value>>& aTransferable,
-                           ErrorResult& aRv)
-{
-  WorkerPrivate* workerPrivate = GetWorkerPrivate();
-  MOZ_ASSERT(workerPrivate);
-
-  workerPrivate->PostMessage(aCx, aMessage, aTransferable, aRv);
-}
-
 WorkerPrivate*
 ServiceWorker::GetWorkerPrivate() const
 {
   // At some point in the future, this may be optimized to terminate a worker
   // that hasn't been used in a certain amount of time or when there is memory
   // pressure or similar.
   MOZ_ASSERT(mSharedWorker);
   return mSharedWorker->GetWorkerPrivate();
--- a/dom/workers/ServiceWorker.h
+++ b/dom/workers/ServiceWorker.h
@@ -47,21 +47,16 @@ public:
   }
 
   void
   GetUrl(nsString& aURL) const
   {
     aURL = mURL;
   }
 
-  void
-  PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
-              const Optional<Sequence<JS::Value>>& aTransferable,
-              ErrorResult& aRv);
-
   WorkerPrivate*
   GetWorkerPrivate() const;
 
 private:
   // This class can only be created from the RuntimeService.
   ServiceWorker(nsPIDOMWindow* aWindow, SharedWorker* aSharedWorker);
 
   // This class is reference-counted and will be destroyed from Release().
deleted file mode 100644
--- a/dom/workers/ServiceWorkerClient.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "ServiceWorkerClient.h"
-
-#include "mozilla/dom/MessageEvent.h"
-#include "nsGlobalWindow.h"
-#include "WorkerPrivate.h"
-
-#include "mozilla/dom/ServiceWorkerClientBinding.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::dom::workers;
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ServiceWorkerClient, mOwner)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(ServiceWorkerClient)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(ServiceWorkerClient)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ServiceWorkerClient)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-JSObject*
-ServiceWorkerClient::WrapObject(JSContext* aCx)
-{
-  return ServiceWorkerClientBinding::Wrap(aCx, this);
-}
-
-namespace {
-
-class ServiceWorkerClientPostMessageRunnable MOZ_FINAL : public nsRunnable
-{
-  uint64_t mId;
-  JSAutoStructuredCloneBuffer mBuffer;
-  nsTArray<nsCOMPtr<nsISupports>> mClonedObjects;
-
-public:
-  ServiceWorkerClientPostMessageRunnable(uint64_t aId,
-                                         JSAutoStructuredCloneBuffer&& aData,
-                                         nsTArray<nsCOMPtr<nsISupports>>& aClonedObjects)
-    : mId(aId),
-      mBuffer(Move(aData))
-  {
-    mClonedObjects.SwapElements(aClonedObjects);
-  }
-
-  NS_IMETHOD
-  Run()
-  {
-    AssertIsOnMainThread();
-    nsGlobalWindow* window = nsGlobalWindow::GetInnerWindowWithId(mId);
-    if (!window) {
-      return NS_ERROR_FAILURE;
-    }
-
-    AutoJSAPI jsapi;
-    jsapi.Init(window);
-    JSContext* cx = jsapi.cx();
-
-    return DispatchDOMEvent(cx, window);
-  }
-
-private:
-  NS_IMETHOD
-  DispatchDOMEvent(JSContext* aCx, nsGlobalWindow* aTargetWindow)
-  {
-    AssertIsOnMainThread();
-
-    // Release reference to objects that were AddRef'd for
-    // cloning into worker when array goes out of scope.
-    nsTArray<nsCOMPtr<nsISupports>> clonedObjects;
-    clonedObjects.SwapElements(mClonedObjects);
-
-    JS::Rooted<JS::Value> messageData(aCx);
-    if (!mBuffer.read(aCx, &messageData,
-                      WorkerStructuredCloneCallbacks(true))) {
-      xpc::Throw(aCx, NS_ERROR_DOM_DATA_CLONE_ERR);
-      return NS_ERROR_FAILURE;
-    }
-
-    nsCOMPtr<nsIDOMMessageEvent> event = new MessageEvent(aTargetWindow,
-                                                          nullptr, nullptr);
-    nsresult rv =
-      event->InitMessageEvent(NS_LITERAL_STRING("message"),
-                              false /* non-bubbling */,
-                              false /* not cancelable */,
-                              messageData,
-                              EmptyString(),
-                              EmptyString(),
-                              nullptr);
-    if (NS_FAILED(rv)) {
-      xpc::Throw(aCx, rv);
-      return NS_ERROR_FAILURE;
-    }
-
-    event->SetTrusted(true);
-    bool status = false;
-    aTargetWindow->DispatchEvent(event, &status);
-
-    if (!status) {
-      return NS_ERROR_FAILURE;
-    }
-
-    return NS_OK;
-  }
-};
-
-} // anonymous namespace
-
-void
-ServiceWorkerClient::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
-                                 const Optional<Sequence<JS::Value>>& aTransferable,
-                                 ErrorResult& aRv)
-{
-  WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
-  MOZ_ASSERT(workerPrivate);
-  workerPrivate->AssertIsOnWorkerThread();
-
-  JS::Rooted<JS::Value> transferable(aCx, JS::UndefinedValue());
-  if (aTransferable.WasPassed()) {
-    const Sequence<JS::Value>& realTransferable = aTransferable.Value();
-
-    JS::HandleValueArray elements =
-      JS::HandleValueArray::fromMarkedLocation(realTransferable.Length(),
-                                               realTransferable.Elements());
-
-    JSObject* array = JS_NewArrayObject(aCx, elements);
-    if (!array) {
-      aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
-      return;
-    }
-
-    transferable.setObject(*array);
-  }
-
-  JSStructuredCloneCallbacks* callbacks = WorkerStructuredCloneCallbacks(false);
-
-  nsTArray<nsCOMPtr<nsISupports>> clonedObjects;
-
-  JSAutoStructuredCloneBuffer buffer;
-  if (!buffer.write(aCx, aMessage, transferable, callbacks, &clonedObjects)) {
-    aRv.Throw(NS_ERROR_DOM_DATA_CLONE_ERR);
-    return;
-  }
-
-  nsRefPtr<ServiceWorkerClientPostMessageRunnable> runnable =
-    new ServiceWorkerClientPostMessageRunnable(mId, Move(buffer), clonedObjects);
-  nsresult rv = NS_DispatchToMainThread(runnable);
-  if (NS_FAILED(rv)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-  }
-}
-
deleted file mode 100644
--- a/dom/workers/ServiceWorkerClient.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef mozilla_dom_workers_serviceworkerclient_h
-#define mozilla_dom_workers_serviceworkerclient_h
-
-#include "nsCOMPtr.h"
-#include "nsWrapperCache.h"
-
-namespace mozilla {
-
-class ErrorResult;
-
-namespace dom {
-
-class Promise;
-template<typename T> class Optional;
-template<typename T> class Sequence;
-
-namespace workers {
-
-class ServiceWorkerClient MOZ_FINAL : public nsISupports,
-                                      public nsWrapperCache
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ServiceWorkerClient)
-
-  ServiceWorkerClient(nsISupports* aOwner, uint64_t aId)
-    : mOwner(aOwner),
-      mId(aId)
-  {
-    SetIsDOMBinding();
-  }
-
-  uint32_t Id() const
-  {
-    return mId;
-  }
-
-  void PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
-                   const Optional<Sequence<JS::Value>>& aTransferable,
-                   ErrorResult& aRv);
-
-  nsISupports* GetParentObject() const
-  {
-    return mOwner;
-  }
-
-  JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
-
-private:
-  ~ServiceWorkerClient()
-  {
-  }
-
-  nsCOMPtr<nsISupports> mOwner;
-  uint64_t mId;
-};
-
-} // namespace workers
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_workers_serviceworkerclient_h
deleted file mode 100644
--- a/dom/workers/ServiceWorkerClients.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "ServiceWorkerClient.h"
-#include "ServiceWorkerClients.h"
-#include "ServiceWorkerManager.h"
-
-#include "WorkerPrivate.h"
-#include "WorkerRunnable.h"
-#include "WorkerScope.h"
-
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/ServiceWorkerClientsBinding.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::dom::workers;
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(ServiceWorkerClients)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(ServiceWorkerClients)
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ServiceWorkerClients, mWorkerScope)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ServiceWorkerClients)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-ServiceWorkerClients::ServiceWorkerClients(ServiceWorkerGlobalScope* aWorkerScope)
-  : mWorkerScope(aWorkerScope)
-{
-  MOZ_ASSERT(mWorkerScope);
-  SetIsDOMBinding();
-}
-
-JSObject*
-ServiceWorkerClients::WrapObject(JSContext* aCx)
-{
-  return ServiceWorkerClientsBinding::Wrap(aCx, this);
-}
-
-namespace {
-
-// Helper class used for passing the promise between threads while
-// keeping the worker alive.
-class PromiseHolder MOZ_FINAL : public WorkerFeature
-{
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PromiseHolder)
-
-public:
-  PromiseHolder(WorkerPrivate* aWorkerPrivate,
-                Promise* aPromise)
-    : mWorkerPrivate(aWorkerPrivate),
-      mPromise(aPromise),
-      mClean(false)
-  {
-    MOZ_ASSERT(mWorkerPrivate);
-    mWorkerPrivate->AssertIsOnWorkerThread();
-    MOZ_ASSERT(mPromise);
-
-    if (NS_WARN_IF(!mWorkerPrivate->AddFeature(mWorkerPrivate->GetJSContext(), this))) {
-      // Worker has been canceled and will go away.
-      // The ResolvePromiseWorkerRunnable won't run, so we can set mPromise to
-      // nullptr.
-      mPromise = nullptr;
-      mClean = true;
-    }
-  }
-
-  Promise*
-  Get() const
-  {
-    return mPromise;
-  }
-
-  void
-  Clean()
-  {
-    mWorkerPrivate->AssertIsOnWorkerThread();
-
-    if (mClean) {
-      return;
-    }
-
-    mPromise = nullptr;
-    mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
-    mClean = true;
-  }
-
-  bool
-  Notify(JSContext* aCx, Status aStatus)
-  {
-    mWorkerPrivate->AssertIsOnWorkerThread();
-
-    if (aStatus > Running) {
-      Clean();
-    }
-
-    return true;
-  }
-
-private:
-  ~PromiseHolder()
-  {
-    MOZ_ASSERT(mClean);
-  }
-
-  WorkerPrivate* mWorkerPrivate;
-  nsRefPtr<Promise> mPromise;
-
-  bool mClean;
-};
-
-class ResolvePromiseWorkerRunnable MOZ_FINAL : public WorkerRunnable
-{
-  nsRefPtr<PromiseHolder> mPromiseHolder;
-  nsAutoPtr<nsTArray<uint64_t>> mValue;
-
-public:
-  ResolvePromiseWorkerRunnable(WorkerPrivate* aWorkerPrivate,
-                               PromiseHolder* aPromiseHolder,
-                               nsAutoPtr<nsTArray<uint64_t>>& aValue)
-    : WorkerRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount),
-      mPromiseHolder(aPromiseHolder),
-      mValue(aValue)
-  {
-    AssertIsOnMainThread();
-  }
-
-  bool
-  WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
-  {
-    MOZ_ASSERT(aWorkerPrivate);
-    aWorkerPrivate->AssertIsOnWorkerThread();
-
-    Promise* promise = mPromiseHolder->Get();
-    MOZ_ASSERT(promise);
-
-    nsTArray<nsRefPtr<ServiceWorkerClient>> ret;
-    for (size_t i = 0; i < mValue->Length(); i++) {
-      ret.AppendElement(nsRefPtr<ServiceWorkerClient>(
-            new ServiceWorkerClient(promise->GetParentObject(),
-                                    mValue->ElementAt(i))));
-    }
-    promise->MaybeResolve(ret);
-
-    // release the reference on the worker thread.
-    mPromiseHolder->Clean();
-
-    return true;
-  }
-};
-
-class GetServicedRunnable MOZ_FINAL : public nsRunnable
-{
-  WorkerPrivate* mWorkerPrivate;
-  nsCString mScope;
-  nsRefPtr<PromiseHolder> mPromiseHolder;
-public:
-  GetServicedRunnable(WorkerPrivate* aWorkerPrivate,
-                      Promise* aPromise,
-                      const nsCString& aScope)
-    : mWorkerPrivate(aWorkerPrivate),
-      mScope(aScope)
-  {
-    MOZ_ASSERT(aWorkerPrivate);
-    aWorkerPrivate->AssertIsOnWorkerThread();
-    mPromiseHolder = new PromiseHolder(aWorkerPrivate, aPromise);
-  }
-
-  NS_IMETHOD
-  Run() MOZ_OVERRIDE
-  {
-    AssertIsOnMainThread();
-
-    nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
-    nsAutoPtr<nsTArray<uint64_t>> result(new nsTArray<uint64_t>());
-
-    swm->GetServicedClients(mScope, result);
-    nsRefPtr<ResolvePromiseWorkerRunnable> r =
-      new ResolvePromiseWorkerRunnable(mWorkerPrivate, mPromiseHolder, result);
-
-    AutoSafeJSContext cx;
-    r->Dispatch(cx);
-    return NS_OK;
-  }
-};
-
-} // anonymous namespace
-
-already_AddRefed<Promise>
-ServiceWorkerClients::GetServiced(ErrorResult& aRv)
-{
-  WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
-  MOZ_ASSERT(workerPrivate);
-  workerPrivate->AssertIsOnWorkerThread();
-
-  DOMString scope;
-  mWorkerScope->GetScope(scope);
-
-  nsRefPtr<Promise> promise = Promise::Create(mWorkerScope, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  nsRefPtr<GetServicedRunnable> r =
-    new GetServicedRunnable(workerPrivate, promise, NS_ConvertUTF16toUTF8(scope));
-  nsresult rv = NS_DispatchToMainThread(r);
-
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_NOT_AVAILABLE);
-  }
-
-  return promise.forget();
-}
-
-// FIXME(catalinb): Bug 1045257 - Implement ReloadAll
-already_AddRefed<Promise>
-ServiceWorkerClients::ReloadAll(ErrorResult& aRv)
-{
-  nsRefPtr<Promise> promise = Promise::Create(mWorkerScope, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  promise->MaybeReject(NS_ERROR_NOT_AVAILABLE);
-  return promise.forget();
-}
-
deleted file mode 100644
--- a/dom/workers/ServiceWorkerClients.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef mozilla_dom_workers_serviceworkerclients_h
-#define mozilla_dom_workers_serviceworkerclients_h
-
-#include "nsAutoPtr.h"
-#include "nsWrapperCache.h"
-
-namespace mozilla {
-
-class ErrorResult;
-
-namespace dom {
-
-class Promise;
-
-namespace workers {
-
-class ServiceWorkerGlobalScope;
-
-class ServiceWorkerClients MOZ_FINAL : public nsISupports,
-                                       public nsWrapperCache
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ServiceWorkerClients)
-
-  ServiceWorkerClients(ServiceWorkerGlobalScope* aWorkerScope);
-
-  already_AddRefed<Promise> GetServiced(ErrorResult& aRv);
-  already_AddRefed<Promise> ReloadAll(ErrorResult& aRv);
-
-  JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
-
-  ServiceWorkerGlobalScope* GetParentObject() const
-  {
-    return mWorkerScope;
-  }
-
-private:
-  ~ServiceWorkerClients()
-  {
-  }
-
-  nsRefPtr<ServiceWorkerGlobalScope> mWorkerScope;
-};
-
-} // namespace workers
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_workers_serviceworkerclients_h
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -19,17 +19,16 @@
 
 #include "nsContentUtils.h"
 #include "nsNetUtil.h"
 #include "nsProxyRelease.h"
 #include "nsTArray.h"
 
 #include "RuntimeService.h"
 #include "ServiceWorker.h"
-#include "ServiceWorkerClient.h"
 #include "ServiceWorkerRegistration.h"
 #include "ServiceWorkerEvents.h"
 #include "WorkerInlines.h"
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 #include "WorkerScope.h"
 
 using namespace mozilla;
@@ -2169,59 +2168,9 @@ ServiceWorkerManager::InvalidateServiceW
         continue;
       }
 
       target->InvalidateWorkerReference(aWhichOnes);
     }
   }
 }
 
-namespace {
-
-class MOZ_STACK_CLASS FilterRegistrationData
-{
-public:
-  FilterRegistrationData(nsTArray<uint64_t>* aDocuments,
-                     ServiceWorkerRegistrationInfo* aRegistration)
-  : mDocuments(aDocuments),
-    mRegistration(aRegistration)
-  {
-  }
-
-  nsTArray<uint64_t>* mDocuments;
-  nsRefPtr<ServiceWorkerRegistrationInfo> mRegistration;
-};
-
-static PLDHashOperator
-EnumControlledDocuments(nsISupports* aKey,
-                        ServiceWorkerRegistrationInfo* aRegistration,
-                        void* aData)
-{
-  FilterRegistrationData* data = static_cast<FilterRegistrationData*>(aData);
-  if (data->mRegistration != aRegistration) {
-    return PL_DHASH_NEXT;
-  }
-  nsCOMPtr<nsIDocument> document = do_QueryInterface(aKey);
-  if (!document || !document->GetInnerWindow()) {
-      return PL_DHASH_NEXT;
-  }
-
-  data->mDocuments->AppendElement(document->GetInnerWindow()->WindowID());
-  return PL_DHASH_NEXT;
-}
-
-} // anonymous namespace
-
-void
-ServiceWorkerManager::GetServicedClients(const nsCString& aScope,
-                                     nsTArray<uint64_t>* aControlledDocuments)
-{
-  nsRefPtr<ServiceWorkerDomainInfo> domainInfo = GetDomainInfo(aScope);
-  nsRefPtr<ServiceWorkerRegistrationInfo> registration =
-    domainInfo->GetRegistration(aScope);
-  MOZ_ASSERT(registration);
-  FilterRegistrationData data(aControlledDocuments, registration);
-
-  domainInfo->mControlledDocuments.EnumerateRead(EnumControlledDocuments,
-                                                 &data);
-}
-
 END_WORKERS_NAMESPACE
--- a/dom/workers/ServiceWorkerManager.h
+++ b/dom/workers/ServiceWorkerManager.h
@@ -313,20 +313,16 @@ public:
               const nsAString& aWorkerURL,
               nsString aMessage,
               nsString aFilename,
               nsString aLine,
               uint32_t aLineNumber,
               uint32_t aColumnNumber,
               uint32_t aFlags);
 
-  void
-  GetServicedClients(const nsCString& aScope,
-                     nsTArray<uint64_t>* aControlledDocuments);
-
   static already_AddRefed<ServiceWorkerManager>
   GetInstance();
 
 private:
   ServiceWorkerManager();
   ~ServiceWorkerManager();
 
   void
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -341,24 +341,16 @@ SharedWorkerGlobalScope::WrapGlobalObjec
   JS::CompartmentOptions options;
   mWorkerPrivate->CopyJSCompartmentOptions(options);
 
   return SharedWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this, options,
                                                       GetWorkerPrincipal(),
                                                       true);
 }
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorkerGlobalScope, WorkerGlobalScope,
-                                   mClients)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorkerGlobalScope)
-NS_INTERFACE_MAP_END_INHERITING(WorkerGlobalScope)
-
-NS_IMPL_ADDREF_INHERITED(ServiceWorkerGlobalScope, WorkerGlobalScope)
-NS_IMPL_RELEASE_INHERITED(ServiceWorkerGlobalScope, WorkerGlobalScope)
-
 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(WorkerPrivate* aWorkerPrivate,
                                                    const nsACString& aScope)
   : WorkerGlobalScope(aWorkerPrivate),
     mScope(NS_ConvertUTF8toUTF16(aScope))
 {
 }
 
 JSObject*
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_workerscope_h__
 #define mozilla_dom_workerscope_h__
 
 #include "Workers.h"
 #include "mozilla/DOMEventTargetHelper.h"
-#include "ServiceWorkerClients.h"
 
 namespace mozilla {
 namespace dom {
 
 class Console;
 class Function;
 
 } // namespace dom
@@ -159,25 +158,19 @@ public:
   }
 
   IMPL_EVENT_HANDLER(connect)
 };
 
 class ServiceWorkerGlobalScope MOZ_FINAL : public WorkerGlobalScope
 {
   const nsString mScope;
-  nsRefPtr<ServiceWorkerClients> mClients;
-
   ~ServiceWorkerGlobalScope() { }
 
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerGlobalScope,
-                                           WorkerGlobalScope)
-
   ServiceWorkerGlobalScope(WorkerPrivate* aWorkerPrivate, const nsACString& aScope);
 
   virtual JSObject*
   WrapGlobalObject(JSContext* aCx) MOZ_OVERRIDE;
 
   void
   GetScope(DOMString& aScope) const
   {
@@ -197,25 +190,16 @@ public:
   }
 
   void
   Unregister()
   {
     // FIXME(nsm): Bug 982728
   }
 
-  ServiceWorkerClients*
-  Clients() {
-    if (!mClients) {
-      mClients = new ServiceWorkerClients(this);
-    }
-
-    return mClients;
-  }
-
   IMPL_EVENT_HANDLER(activate)
   IMPL_EVENT_HANDLER(beforeevicted)
   IMPL_EVENT_HANDLER(evicted)
   IMPL_EVENT_HANDLER(fetch)
   IMPL_EVENT_HANDLER(install)
   IMPL_EVENT_HANDLER(message)
 };
 
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -24,18 +24,16 @@ EXPORTS.mozilla.dom.workers.bindings += 
     'DataStore.h',
     'DataStoreCursor.h',
     'FileReaderSync.h',
     'Location.h',
     'MessagePort.h',
     'Navigator.h',
     'Performance.h',
     'ServiceWorker.h',
-    'ServiceWorkerClient.h',
-    'ServiceWorkerClients.h',
     'SharedWorker.h',
     'URL.h',
     'WorkerFeature.h',
     'XMLHttpRequest.h',
     'XMLHttpRequestUpload.h',
 ]
 
 SOURCES += [
@@ -48,18 +46,16 @@ SOURCES += [
     'MessagePort.cpp',
     'Navigator.cpp',
     'Performance.cpp',
     'Principal.cpp',
     'RegisterBindings.cpp',
     'RuntimeService.cpp',
     'ScriptLoader.cpp',
     'ServiceWorker.cpp',
-    'ServiceWorkerClient.cpp',
-    'ServiceWorkerClients.cpp',
     'ServiceWorkerContainer.cpp',
     'ServiceWorkerEvents.cpp',
     'ServiceWorkerManager.cpp',
     'ServiceWorkerRegistration.cpp',
     'SharedWorker.cpp',
     'URL.cpp',
     'WorkerPrivate.cpp',
     'WorkerRunnable.cpp',
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/get_serviced_worker.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function loop() {
-  self.clients.getServiced().then(function(result) {
-    setTimeout(loop, 0);
-  });
-}
-
-onactivate = function(e) {
-  // spam getServiced until the worker is closed.
-  loop();
-}
-
-onclose = function(e) {
-  for (var i = 0; i < 100; ++i) {
-    self.clients.getServiced();
-  }
-}
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/get_serviced_worker_advanced.js
+++ /dev/null
@@ -1,12 +0,0 @@
-onmessage = function(e) {
-  if (!e.data) {
-    dump("ERROR: message has no data.\n");
-  }
-
-  self.clients.getServiced().then(function(res) {
-    if (res.length === 0) {
-      dump("ERROR: no client is currently being controlled.\n");
-    }
-    res[res.length - 1].postMessage(res.length);
-  });
-};
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/get_serviced_worker_enumerate.js
+++ /dev/null
@@ -1,7 +0,0 @@
-onmessage = function() {
-  self.clients.getServiced().then(function(result) {
-    for (i = 0; i < result.length; i++) {
-      result[i].postMessage(i);
-    }
-  });
-};
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/message_posting_worker.js
+++ /dev/null
@@ -1,9 +0,0 @@
-onmessage = function(e) {
-  self.clients.getServiced().then(function(res) {
-    if (!res.length) {
-      dump("ERROR: no clients are currently controlled.\n");
-    }
-    res[0].postMessage(e.data);
-  });
-};
-
--- a/dom/workers/test/serviceworkers/mochitest.ini
+++ b/dom/workers/test/serviceworkers/mochitest.ini
@@ -5,26 +5,15 @@ support-files =
   worker2.js
   worker3.js
   parse_error_worker.js
   install_event_worker.js
   simpleregister/index.html
   simpleregister/ready.html
   controller/index.html
   unregister/index.html
-  sw_clients/simple.html
-  get_serviced_worker.js
-  get_serviced_worker_advanced.js
-  message_posting_worker.js
-  sw_clients/service_worker_controlled.html
-  get_serviced_worker_enumerate.js
 
-[test_get_serviced.html]
-[test_get_serviced_advanced.html]
-[test_get_serviced_enumerate.html]
 [test_installation_simple.html]
 [test_install_event.html]
 [test_navigator.html]
-[test_post_message.html]
-[test_post_message_advanced.html]
 [test_scopes.html]
 [test_controller.html]
 [test_unregister.html]
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/sw_clients/service_worker_controlled.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>controlled page</title>
-  <!--
-    Paged controlled by a service worker for testing getServiced().
-    See bug 982726.
-  -->
-<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-<script class="testbody" type="text/javascript">
-  function fail(msg) {
-    info("service_worker_controlled.html: " + msg);
-    opener.postMessage("FAIL", "*");
-  }
-
-  if (!opener) {
-      info("service_worker_controlled.html should not be launched directly!");
-  }
-
-  window.onload = function() {
-    navigator.serviceWorker.ready.then(function(swr) {
-      opener.postMessage("READY", "*");
-    });
-  }
-
-  window.onmessage = function(msg) {
-    // forward message to the test page.
-    opener.postMessage(msg.data, "*");
-  };
-</script>
-
-</head>
-<body>
-</body>
-</html>
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/sw_clients/simple.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 982726 - test get_serviced not crashing</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script class="testbody" type="text/javascript">
-
-  window.onload = function() {
-    opener.postMessage("READY", "*");
-  }
-</script>
-</pre>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/test_get_serviced.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 982726 - test get_serviced not crashing</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script class="testbody" type="text/javascript">
-  // get_serviced_worker will call getServiced until the worker shuts down.
-  // Test passes if the browser doesn't crash on leaked promise objects.
-  var controlled_window;
-  function simpleRegister() {
-    return navigator.serviceWorker.register("get_serviced_worker.js", { scope: "./sw_clients/" });
-  }
-
-  function openWindow() {
-    var p = new Promise(function(resolve, reject) {
-      window.onmessage = function(e) {
-        if (e.data === "READY") {
-          resolve();
-        }
-      }
-    });
-
-    controlled_window = window.open("sw_clients/simple.html");
-    return p;
-  }
-
-  function runTest() {
-    simpleRegister()
-      .then(openWindow).catch(function(e) {
-        ok(false, "Some test failed with error " + e);
-      }).then(function() {
-        ok(true, "Didn't crash on resolving getServiced promises while worker shuts down.");
-        SimpleTest.finish();
-        controlled_window.close();
-      });
-  }
-
-  SimpleTest.waitForExplicitFinish();
-  SpecialPowers.pushPrefEnv({"set": [
-    ["dom.serviceWorkers.enabled", true],
-    ["dom.serviceWorkers.testing.enabled", true]
-  ]}, runTest);
-</script>
-</pre>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/test_get_serviced_advanced.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 982726 - test get_serviced </title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script class="testbody" type="text/javascript">
-  var opened = [];
-  var registration;
-
-  function start() {
-    return navigator.serviceWorker.register("get_serviced_worker_advanced.js",
-                                            { scope: "./sw_clients/" }).then((swr) => registration = swr);
-  }
-
-  function testGetServiced() {
-    var p = new Promise(function(res, rej) {
-      window.onmessage = function(e) {
-        if (e.data === "READY") {
-          opened.push(w);
-          registration.active.postMessage("getServiced");
-        } else if (e.data === opened.length) {
-          ok(true, "getServiced returned the correct value.");
-          res();
-        } else {
-          ok(false, "Wrong value. Expected: " + opened.length +
-                    ", got: " + e.data);
-          res();
-        }
-      }
-    });
-    var w;
-    setTimeout(function() {
-      w = window.open("sw_clients/service_worker_controlled.html");
-    }, 100);
-    return p;
-  }
-
-  function removeAndTest() {
-    opened.pop().close();
-    opened.pop().close();
-    return testGetServiced();
-  }
-
-  function runTest() {
-    start()
-      .then(testGetServiced)
-      .then(testGetServiced)
-      .then(testGetServiced)
-      .then(removeAndTest)
-      .then(function(e) {
-        while (opened.length) {
-          opened.pop().close();
-        }
-        SimpleTest.finish();
-      }).catch(function(e) {
-        ok(false, "Some test failed with error " + e);
-        SimpleTest.finish();
-      });
-  }
-
-  SimpleTest.waitForExplicitFinish();
-  SpecialPowers.pushPrefEnv({"set": [
-    ["dom.serviceWorkers.enabled", true],
-    ["dom.serviceWorkers.testing.enabled", true]
-  ]}, runTest);
-</script>
-</pre>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/test_get_serviced_enumerate.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 982726 - test get_serviced </title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script class="testbody" type="text/javascript">
-  var registration;
-  var opened = [];
-  var results = [];
-
-  function start() {
-    return navigator.serviceWorker.register("get_serviced_worker_enumerate.js",
-                                            { scope: "./sw_clients/" }).then((swr) => registration = swr);
-  }
-
-  function openWindow() {
-    var p = new Promise(function(res, rej) {
-      var w = window.open("sw_clients/service_worker_controlled.html");
-      window.onmessage = function(e) {
-        if (e.data === "READY") {
-          opened.push(w);
-          res();
-        }
-      }
-    });
-    return p;
-  }
-
-  function testGetServiced() {
-    var count = 0;
-    return new Promise(function (res, rej) {
-      registration.active.postMessage("getServiced");
-      // wait for response
-      window.onmessage = function(msg) {
-        results[msg.data] = "ok";
-        count = count + 1;
-        if (count == opened.length) {
-          for (i = 0; i < count; i++) {
-            ok(results[i] == "ok", "Client received the message.");
-          }
-          res();
-        }
-      }
-    });
-  }
-
-  function runTest() {
-    start()
-      .then(openWindow).then(openWindow)
-      .then(openWindow).then(openWindow)
-      .then(testGetServiced)
-      .then(function(e) {
-        while (opened.length) {
-          opened.pop().close();
-        }
-        SimpleTest.finish();
-      }).catch(function(e) {
-        ok(false, "Some test failed with error " + e);
-        SimpleTest.finish();
-      });
-  }
-
-  SimpleTest.waitForExplicitFinish();
-  SpecialPowers.pushPrefEnv({"set": [
-    ["dom.serviceWorkers.enabled", true],
-    ["dom.serviceWorkers.testing.enabled", true]
-  ]}, runTest);
-</script>
-</pre>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/test_post_message.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 982726 - Test service worker post message </title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script class="testbody" type="text/javascript">
-  var magic_value = "MAGIC_VALUE_123";
-  function start() {
-    return navigator.serviceWorker.register("message_posting_worker.js",
-                                            { scope: "./sw_clients/" });
-  }
-
-  function testPostMessage(swr) {
-    var p = new Promise(function(res, rej) {
-      window.onmessage = function(e) {
-        if (e.data === "READY") {
-          swr.active.postMessage(magic_value);
-        } else if (e.data === magic_value) {
-          ok(true, "Worker posted the correct value.");
-          res();
-        } else {
-          ok(false, "Wrong value. Expected: " + magic_value +
-                    ", got: " + e.data);
-          res();
-        }
-      }
-    });
-
-    var w;
-    setTimeout(function() {
-      w = window.open("sw_clients/service_worker_controlled.html");
-    }, 100);
-    return p.then(() => w.close());
-  }
-
-  function runTest() {
-    start()
-      .then(testPostMessage).catch(function(e) {
-        ok(false, "Some test failed with error " + e);
-      }).then(SimpleTest.finish);
-  }
-
-  SimpleTest.waitForExplicitFinish();
-  SpecialPowers.pushPrefEnv({"set": [
-    ["dom.serviceWorkers.enabled", true],
-    ["dom.serviceWorkers.testing.enabled", true]
-  ]}, runTest);
-</script>
-</pre>
-</body>
-</html>
-
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/test_post_message_advanced.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Bug 982726 - Test service worker post message advanced </title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script class="testbody" type="text/javascript">
-  var registration;
-  var base = ["string", true, 42];
-  var blob = new Blob(["blob_content"]);
-  var file = new File(["file_content"], "file");
-  var obj = { body : "object_content" };
-
-  function readBlob(blob) {
-    return new Promise(function(resolve, reject) {
-      var reader = new FileReader();
-      reader.onloadend = () => resolve(reader.result);
-      reader.readAsText(blob);
-    });
-  }
-
-  function equals(v1, v2) {
-    return Promise.all([v1, v2]).then(function(val) {
-      ok(val[0] === val[1], "Values should match.");
-    });
-  }
-
-  function blob_equals(b1, b2) {
-    return equals(readBlob(b1), readBlob(b2));
-  }
-
-  function file_equals(f1, f2) {
-    return equals(f1.name, f2.name).then(blob_equals(f1, f2));
-  }
-
-  function obj_equals(o1, o2) {
-    return equals(o1.body, o2.body);
-  }
-
-  function start() {
-    return navigator.serviceWorker.register("message_posting_worker.js",
-                                            { scope: "./sw_clients/" }).then((swr) => registration = swr);
-  }
-
-  function testPostMessageObject(obj, test) {
-    var p = new Promise(function(res, rej) {
-      window.onmessage = function(e) {
-        if (e.data === "READY") {
-          registration.active.postMessage(obj)
-        } else {
-          test(obj, e.data).then(res);
-        }
-      }
-    });
-
-    var w = window.open("sw_clients/service_worker_controlled.html");
-    return p.then(() => w.close());
-  }
-
-  function runTest() {
-    start()
-      .then(testPostMessageObject.bind(this, base[0], equals))
-      .then(testPostMessageObject.bind(this, base[1], equals))
-      .then(testPostMessageObject.bind(this, base[2], equals))
-      .then(testPostMessageObject.bind(this, blob, blob_equals))
-      .then(testPostMessageObject.bind(this, file, file_equals))
-      .then(testPostMessageObject.bind(this, obj, obj_equals))
-      .catch(function(e) {
-        ok(false, "Some test failed with error " + e);
-      }).then(SimpleTest.finish);
-  }
-
-  SimpleTest.waitForExplicitFinish();
-  SpecialPowers.pushPrefEnv({"set": [
-    ["dom.serviceWorkers.enabled", true],
-    ["dom.serviceWorkers.testing.enabled", true]
-  ]}, runTest);
-</script>
-</pre>
-</body>
-</html>
-