Bug 811102 followup #2: add some clean up to tests from bug 804910 exposed by the fix for bug 811102, r=markh
authorGavin Sharp <gavin@gavinsharp.com>
Mon, 12 Nov 2012 22:24:59 -0800
changeset 113064 a06a34a849551211c9352c79d09678f31faa1e06
parent 113063 a2cdd1e642672e54533648fabb01c2f4a20c4122
child 113065 2b31de6440468683e51c55314fd81ac34d1d6cb9
push id17922
push usergsharp@mozilla.com
push dateTue, 13 Nov 2012 06:27:03 +0000
treeherdermozilla-inbound@a06a34a84955 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs811102, 804910
milestone19.0a1
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
Bug 811102 followup #2: add some clean up to tests from bug 804910 exposed by the fix for bug 811102, r=markh
toolkit/components/social/test/browser/browser_frameworker.js
--- a/toolkit/components/social/test/browser/browser_frameworker.js
+++ b/toolkit/components/social/test/browser/browser_frameworker.js
@@ -461,71 +461,75 @@ let tests = {
         }
         ioService.offline = false;
       }
       ioService.offline = true;
     }
   },
   
   testMissingWorker: function(cbnext) {
+    let worker = getFrameWorkerHandle(url, undefined, "testMissingWorker");
     Services.obs.addObserver(function handleError() {
       Services.obs.removeObserver(handleError, "social:frameworker-error");
         ok(true, "social:frameworker-error was handled");
+        worker.terminate();
         cbnext();
     }, 'social:frameworker-error', false);
     // don't ever create this file!  We want a 404.
     let url = "https://example.com/browser/toolkit/components/social/test/browser/worker_is_missing.js";
-    let worker = getFrameWorkerHandle(url, undefined, "testMissingWorker");
     worker.port.onmessage = function(e) {
       ok(false, "social:frameworker-error was handled");
       cbnext();
     }
   },
 
   testNoConnectWorker: function(cbnext) {
+    let worker = getFrameWorkerHandle(makeWorkerUrl(function () {}),
+                                      undefined, "testNoConnectWorker");
     Services.obs.addObserver(function handleError() {
       Services.obs.removeObserver(handleError, "social:frameworker-error");
         ok(true, "social:frameworker-error was handled");
+        worker.terminate();
         cbnext();
     }, 'social:frameworker-error', false);
-    let worker = getFrameWorkerHandle(makeWorkerUrl(function () {}),
-                                      undefined, "testNoConnectWorker");
     worker.port.onmessage = function(e) {
       ok(false, "social:frameworker-error was handled");
       cbnext();
     }
   },
 
   testEmptyWorker: function(cbnext) {
+    let worker = getFrameWorkerHandle("data:application/javascript;charset=utf-8,",
+                                      undefined, "testEmptyWorker");
     Services.obs.addObserver(function handleError() {
       Services.obs.removeObserver(handleError, "social:frameworker-error");
         ok(true, "social:frameworker-error was handled");
+        worker.terminate();
         cbnext();
     }, 'social:frameworker-error', false);
-    let worker = getFrameWorkerHandle("data:application/javascript;charset=utf-8,",
-                                      undefined, "testEmptyWorker");
     worker.port.onmessage = function(e) {
       ok(false, "social:frameworker-error was handled");
       cbnext();
     }
   },
 
   testWorkerConnectError: function(cbnext) {
+    let worker = getFrameWorkerHandle(makeWorkerUrl(run),
+                                      undefined, "testWorkerConnectError");
     Services.obs.addObserver(function handleError() {
       Services.obs.removeObserver(handleError, "social:frameworker-error");
         ok(true, "social:frameworker-error was handled");
+        worker.terminate();
         cbnext();
     }, 'social:frameworker-error', false);
     let run = function () {
       onconnect = function(e) {
         throw new Error("worker failure");
       }
     }
-    let worker = getFrameWorkerHandle(makeWorkerUrl(run),
-                                      undefined, "testWorkerConnectError");
     worker.port.onmessage = function(e) {
       ok(false, "social:frameworker-error was handled");
       cbnext();
     }
   },
 
   testReloadAndNewPort: function(cbnext) {
     let run = function () {