Bug 841661 - Remove the observer in this test when it finishes so we don't get failures from it in unrelated tests. r=mcmanus
authorJoe Drew <joe@drew.ca>
Fri, 15 Feb 2013 15:43:27 -0500
changeset 122062 53390204f2138dd7efa7af082d9977e5c52c9bcf
parent 122061 67dc087e319ae179546b831fe116a3eff2a41e4c
child 122063 727072808d9fca65cf4e29b271be44b3aec7b364
push id24317
push userryanvm@gmail.com
push dateSat, 16 Feb 2013 14:49:39 +0000
treeherdermozilla-central@484dbca61133 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs841661
milestone21.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 841661 - Remove the observer in this test when it finishes so we don't get failures from it in unrelated tests. r=mcmanus
image/test/mochitest/test_net_failedtoprocess.html
--- a/image/test/mochitest/test_net_failedtoprocess.html
+++ b/image/test/mochitest/test_net_failedtoprocess.html
@@ -14,35 +14,38 @@ observer event with the nsIURI of the fa
 <p id="display"></p>
 <pre id="test">
 <script type="application/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
+var obs = Cc["@mozilla.org/observer-service;1"].getService();
+obs = obs.QueryInterface(Ci.nsIObserverService);
 
 var observer = {
   QueryInterface: function (aIID) {
     if (aIID.equals(Ci.nsISupports) ||
         aIID.equals(Ci.nsIObserver))
       return this;
     throw Cr.NS_ERROR_NO_INTERFACE;
   },
 
   observe: function(subject, topic, data) {
     ok(topic == "net:failed-to-process-uri-content", "wrong topic");
     subject = subject.QueryInterface(Ci.nsIURI);
     ok(subject.asciiSpec == "chrome://mochitests/content/chrome/image/test/mochitest/invalid.jpg", "wrong subject");
+
+    obs.removeObserver(this, "net:failed-to-process-uri-content", false);
+
     SimpleTest.finish();
   }
 };
 
-var obs = Cc["@mozilla.org/observer-service;1"].getService();
-obs = obs.QueryInterface(Ci.nsIObserverService);
 obs.addObserver(observer, "net:failed-to-process-uri-content", false);
 
 </script>
 </pre>
 <img src="damon.jpg">
 <img src="invalid.jpg">
 </body>
 </html>