Bug 790732 - Fix two more toolkit tests. r=me
authorBobby Holley <bobbyholley@gmail.com>
Wed, 27 Mar 2013 18:27:25 -0700
changeset 126500 e5b54db9ddb63b0d9535ec6324d20bc43ac1febf
parent 126499 adb4ae9d355a946c2a8ab58ed0c2ca6e77733761
child 126501 d5dfcbbcd176acf30a779eaac2344657fa642b6b
push id24485
push userryanvm@gmail.com
push dateThu, 28 Mar 2013 12:31:20 +0000
treeherdermozilla-central@293498096b28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs790732
milestone22.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 790732 - Fix two more toolkit tests. r=me Not sure why these didn't appear on earlier try runs, but they're trivial.
toolkit/components/passwordmgr/test/test_prompt.html
toolkit/components/satchel/test/test_form_autocomplete.html
--- a/toolkit/components/passwordmgr/test/test_prompt.html
+++ b/toolkit/components/passwordmgr/test/test_prompt.html
@@ -133,17 +133,17 @@ proxyChannelListener.prototype = {
   onStopRequest: function(request, context, status) { }
 };
 
 var resolveCallback = {
   QueryInterface : function (iid) {
     const interfaces = [Ci.nsIProtocolProxyCallback, Ci.nsISupports];
 
     if (!interfaces.some( function(v) { return iid.equals(v) } ))
-      throw Components.results.NS_ERROR_NO_INTERFACE;
+      throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
     return this;
   },
 
   onProxyAvailable : function (req, uri, pi, status) {
     initLogins(pi);
 
     // I'm cheating a bit here... We should probably do some magic foo to get
     // something implementing nsIProxiedProtocolHandler and then call
@@ -155,22 +155,20 @@ var resolveCallback = {
     // for simplicity.
     proxyChannel = ioService.newChannel(proxiedHost, null, null);
     proxyChannel.asyncOpen(new proxyChannelListener(), null);
   }
 };
 
 function startup() {
   //need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy.
-  var ios = SpecialPowers.wrap(Components).
-    classes["@mozilla.org/network/io-service;1"].
-    getService(Components.interfaces.nsIIOService);
+  var ios = SpecialPowers.Cc["@mozilla.org/network/io-service;1"].
+    getService(SpecialPowers.Ci.nsIIOService);
 
-  var pps = SpecialPowers.wrap(Components).
-    classes["@mozilla.org/network/protocol-proxy-service;1"].getService();
+  var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"].getService();
 
   var uri = ios.newURI("http://example.com", null, null);
   pps.asyncResolve(uri, 0, resolveCallback);
 }
 
 function addNotificationCallback(cb) {
   storageObserver.notificationCallbacks.push(cb);
 }
@@ -178,17 +176,17 @@ function addNotificationCallback(cb) {
 var storageObserver = {
   notificationCallbacks: [],
 
   QueryInterface : function (iid) {
     const interfaces = [Ci.nsIObserver,
                         Ci.nsISupports, Ci.nsISupportsWeakReference];
 
     if (!interfaces.some( function(v) { return iid.equals(v) } ))
-      throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
+      throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
     return this;
   },
 
   observe : function (subject, topic, data) {
     ok(true, ".");
     ok(true, "observer for " + topic + " / " + data);
     ok(true, "Time is " + (new Date()).toUTCString());
     var wrapped = SpecialPowers.wrap(subject);
--- a/toolkit/components/satchel/test/test_form_autocomplete.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete.html
@@ -117,17 +117,17 @@ Form History test: form field autocomple
 
 /** Test for Form History autocomplete **/
 
 var input = $_(1, "field1");
 const shiftModifier = Event.SHIFT_MASK;
 
 // Get the form history service
 var fh = SpecialPowers.Cc["@mozilla.org/satchel/form-history;1"].
-         getService(Components.interfaces.nsIFormHistory2);
+         getService(SpecialPowers.Ci.nsIFormHistory2);
 ok(fh != null, "got form history service");
 
 fh.removeAllEntries();
 fh.addEntry("field1", "value1");
 fh.addEntry("field1", "value2");
 fh.addEntry("field1", "value3");
 fh.addEntry("field1", "value4");
 fh.addEntry("field2", "value1");