Bug 1431913 - Port bug 1431204 to mailnews: Make nsIURI.spec readonly (JS part, follow-up). r=aceman
authorJorg K <jorgk@jorgk.com>
Mon, 22 Jan 2018 10:23:21 +0100
changeset 30036 866b5c60d753a85c42dbf7445a8c36c501184771
parent 30035 4b11d994f0234cd69ad3b4598c4bcee01c5f3a67
child 30037 1dd846f3e167ed1f8ddf4463239daaed86a00e38
push id2108
push userclokep@gmail.com
push dateMon, 22 Jan 2018 17:53:55 +0000
treeherdercomm-beta@c44930d8ad9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1431913, 1431204
Bug 1431913 - Port bug 1431204 to mailnews: Make nsIURI.spec readonly (JS part, follow-up). r=aceman
ldap/xpcom/tests/unit/test_nsLDAPURL.js
--- a/ldap/xpcom/tests/unit/test_nsLDAPURL.js
+++ b/ldap/xpcom/tests/unit/test_nsLDAPURL.js
@@ -256,32 +256,31 @@ function run_test() {
   url.attributes = "";
 
   Assert.equal(url.attributes.length, 0);
   Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
 
   // Set attributes via the url spec
 
   newAttrs = "abc,def,ghi,jkl";
-  url = url.mutate().setSpec("ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)").finalize();
-  url instanceof Components.interfaces.nsILDAPURL;
+  url = url.mutate().setSpec("ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)")
+                    .finalize().QueryInterface(Ci.nsILDAPURL);
 
   Assert.equal(url.attributes, newAttrs);
   Assert.equal(url.spec,
                "ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)");
 
-  url = url.mutate().setSpec("ldap://localhost/dc=short??one?(objectclass=*)").finalize();
-  url instanceof Components.interfaces.nsILDAPURL;
+  url = url.mutate().setSpec("ldap://localhost/dc=short??one?(objectclass=*)")
+                    .finalize().QueryInterface(Ci.nsILDAPURL);
 
   var attrs = url.attributes;
   Assert.equal(attrs.length, 0);
   Assert.equal(url.spec, "ldap://localhost/dc=short??one?(objectclass=*)");
 
   // Test - clone
 
   url = url.mutate().setSpec("ldap://localhost/dc=short?abc,def,ghi,jkl?one?(objectclass=*)").finalize();
 
-
   var newUrl = url.clone();
 
   Assert.equal(newUrl.spec,
                "ldap://localhost/dc=short?abc,def,ghi,jkl?one?(objectclass=*)");
 }