Bug 793585 - Only default the shared state if it's not there. r=joe
authorAdam Dane [:hobophobe] <unusualtears@gmail.com>
Mon, 08 Oct 2012 16:09:11 -0500
changeset 109711 4a6c1725dd4becbd22e74b378766506fe97d45f9
parent 109710 6ee4101a85f34f239230546ab546d54078c4b0eb
child 109712 c33b5e11209ad4d6f9eaf637d8a6496bd66f5b7f
push id23648
push useremorley@mozilla.com
push dateTue, 09 Oct 2012 14:23:49 +0000
treeherdermozilla-central@dd61540f237c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs793585
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 793585 - Only default the shared state if it's not there. r=joe
image/test/mochitest/bug733553.sjs
image/test/mochitest/test_bug733553.html
--- a/image/test/mochitest/bug733553.sjs
+++ b/image/test/mochitest/bug733553.sjs
@@ -38,17 +38,19 @@ function getFileAsInputStream(aFilename)
   var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1']
                    .createInstance(Components.interfaces.nsIFileInputStream);
   fileStream.init(file, 1, 0, false);
   return fileStream;
 }
 
 function handleRequest(request, response)
 {
-  setSharedState("next-part", "-1");
+  if (!getSharedState("next-part")) {
+    setSharedState("next-part", "-1");
+  }
   response.setHeader("Content-Type",
                      "multipart/x-mixed-replace;boundary=BOUNDARYOMG", false);
   response.setHeader("Cache-Control", "no-cache", false);
   response.setStatusLine(request.httpVersion, 200, "OK");
   // We're sending parts off in a delayed fashion, to let the tests occur.
   response.processAsync();
   response.write("--BOUNDARYOMG\r\n");
   sendParts(response);
--- a/image/test/mochitest/test_bug733553.html
+++ b/image/test/mochitest/test_bug733553.html
@@ -62,20 +62,20 @@ function readyForNext() {
   loader.src = BASE_URL + ++testIndex;
 }
 
 function imageLoad(aEvent) {
   var [width, fileName] = testParts[testIndex];
   is(aEvent.target.width, width,
      "Test " + testIndex + " " + fileName + " width correct");
 
+  // Always call readyForNext here, as it's the closest we have to a cleanup
+  readyForNext();
   if ((testParts.length - 1) == testIndex) {
     SimpleTest.finish();
-  } else {
-    readyForNext();
   }
 }
 
 </script>
 </pre>
 <div id="content"> <!-- style="display: none" -->
 <iframe id="loader"></iframe>
 </div>