Backout of c129811b87ef due to mochi bustage
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 23 Aug 2012 12:00:51 -0700
changeset 105242 15584c68bf8171c82055e9670ac4075f9bd5302a
parent 105241 da0aa4b65f8429596939f3ef441af682d1ca60e9
child 105243 946c68705ac909f50b93408a3259e5d96225eef6
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
milestone17.0a1
backs outc129811b87ef38c26d4fa80b1df7fbcee033a72e
Backout of c129811b87ef due to mochi bustage
dom/base/DOMRequest.cpp
dom/base/test/test_domrequest.html
testing/mochitest/tests/SimpleTest/specialpowersAPI.js
--- a/dom/base/DOMRequest.cpp
+++ b/dom/base/DOMRequest.cpp
@@ -231,17 +231,17 @@ public:
                        const jsval& aResult) :
     mReq(aRequest),
     mResult(aResult)
   {
     JSContext* cx = mReq->GetJSContextForEventHandlers();
     JS_AddValueRoot(cx, &mResult);
   }
 
-  NS_IMETHODIMP
+  nsresult
   Run()
   {
     static_cast<DOMRequest*>(mReq)->FireSuccess(mResult);
     return NS_OK;
   }
 
   ~FireSuccessAsyncTask()
   {
@@ -258,17 +258,17 @@ class FireErrorAsyncTask : public nsRunn
 public:
   FireErrorAsyncTask(nsIDOMDOMRequest* aRequest,
                      const nsAString& aError) :
     mReq(aRequest),
     mError(aError)
   {
   }
 
-  NS_IMETHODIMP  
+  nsresult
   Run()
   {
     static_cast<DOMRequest*>(mReq)->FireError(mError);
     return NS_OK;
   }
 private:
   nsIDOMDOMRequest* mReq;
   nsString mError;
--- a/dom/base/test/test_domrequest.html
+++ b/dom/base/test/test_domrequest.html
@@ -45,50 +45,19 @@ is(req.result, "my result", "correct res
 
 // fire error
 req = reqserv.createRequest(window);
 ev = null;
 req.onerror = function(e) {
   ev = e;
 }
 reqserv.fireError(req, "OhMyError");
-ok(ev, "got error event");
+ok(ev, "got success event");
 is(ev.type, "error", "correct type during error");
 is(ev.target, req, "correct target during error");
 is(req.readyState, "done", "correct readyState after error");
 is(req.error.name, "OhMyError", "correct error after error");
 is(req.result, undefined, "correct result after error");
 
-// fire success
-req = reqserv.createRequest(window);
-ev = null;
-req.onsuccess = function(e) {
-  ev = e;
-  ok(ev, "got async success event");
-  is(ev.type, "success", "correct type during async success");
-  is(ev.target, this, "correct target during async success");
-  is(this.readyState, "done", "correct readyState after async success");
-  is(this.error, null, "correct error after async success");
-  is(this.result, "my async result", "correct result after async success");
-}
-reqserv.fireSuccessAsync(req, "my async result");
-
-// fire error
-req = reqserv.createRequest(window);
-ev = null;
-req.onerror = function(e) {
-  ev = e;
-  ok(ev, "got async error event");
-  is(ev.type, "error", "correct type during async error");
-  is(ev.target, this, "correct target during async error");
-  is(this.readyState, "done", "correct readyState after async error");
-  is(this.error.name, "OhMyAsyncError", "correct error after async error");
-  is(this.result, undefined, "correct result after async error");
-  SimpleTest.finish();
-}
-reqserv.fireErrorAsync(req, "OhMyAsyncError");
-
-SimpleTest.waitForExplicitFinish();
-
 </script>
 </pre>
 </body>
 </html>
--- a/testing/mochitest/tests/SimpleTest/specialpowersAPI.js
+++ b/testing/mochitest/tests/SimpleTest/specialpowersAPI.js
@@ -919,18 +919,17 @@ SpecialPowersAPI.prototype = {
       getService(Ci.nsIEventListenerService).
       removeSystemEventListener(target, type, listener, useCapture);
   },
 
   getDOMRequestService: function() {
     var serv = Cc["@mozilla.org/dom/dom-request-service;1"].
       getService(Ci.nsIDOMRequestService);
     var res = { __exposedProps__: {} };
-    var props = ["createRequest", "fireError", "fireSuccess", 
-								 "fireErrorAsync", "fireSuccessAsync"];
+    var props = ["createRequest", "fireError", "fireSuccess"];
     for (i in props) {
       let prop = props[i];
       res[prop] = function() { return serv[prop].apply(serv, arguments) };
       res.__exposedProps__[prop] = "r";
     }
     return res;
   },