Backed out changeset f485eaccbb98 (bug 1319904) because it needs a reworked patch.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 30 Nov 2016 17:54:11 -0500
changeset 359022 468db8dc0d4f22fe45e1238950bea781c280685f
parent 359021 9c9278793a1526d65c5cc3437d030d880f14cfe2
child 359023 bd764aa8bb0e01ff15aa44f0834985e321ed7b73
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1319904
milestone51.0
backs outf485eaccbb98034a1111eaf4f4871de1868bcb70
Backed out changeset f485eaccbb98 (bug 1319904) because it needs a reworked patch.
browser/base/content/test/general/browser_web_channel.js
toolkit/modules/WebChannel.jsm
--- a/browser/base/content/test/general/browser_web_channel.js
+++ b/browser/base/content/test/general/browser_web_channel.js
@@ -32,36 +32,16 @@ var gTests = [
           resolve();
         });
 
         tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?generic");
       });
     }
   },
   {
-    desc: "WebChannel generic message in a private window.",
-    run: function* () {
-      let promiseTestDone = new Promise(function(resolve, reject) {
-        let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
-        channel.listen(function(id, message, target) {
-          is(id, "generic");
-          is(message.something.nested, "hello");
-          channel.stopListening();
-          resolve();
-        });
-      });
-
-      const url = HTTP_PATH + HTTP_ENDPOINT + "?generic";
-      let privateWindow = yield BrowserTestUtils.openNewBrowserWindow({private: true});
-      yield BrowserTestUtils.openNewForegroundTab(privateWindow.gBrowser, url);
-      yield promiseTestDone;
-      yield BrowserTestUtils.closeWindow(privateWindow);
-    }
-  },
-  {
     desc: "WebChannel two way communication",
     run: function* () {
       return new Promise(function(resolve, reject) {
         let tab;
         let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH, null, null));
 
         channel.listen(function (id, message, sender) {
           is(id, "twoway", "bad id");
--- a/toolkit/modules/WebChannel.jsm
+++ b/toolkit/modules/WebChannel.jsm
@@ -166,29 +166,29 @@ this.WebChannel = function(id, originOrP
   this.id = id;
   // originOrPermission can be either an nsIURI or a string representing a
   // permission name.
   if (typeof originOrPermission == "string") {
     this._originCheckCallback = requestPrincipal => {
       // The permission manager operates on domain names rather than true
       // origins (bug 1066517).  To mitigate that, we explicitly check that
       // the scheme is https://.
-      let uri = Services.io.newURI(requestPrincipal.originNoSuffix, null, null);
+      let uri = Services.io.newURI(requestPrincipal.origin, null, null);
       if (uri.scheme != "https") {
         return false;
       }
       // OK - we have https - now we can check the permission.
       let perm = Services.perms.testExactPermissionFromPrincipal(requestPrincipal,
                                                                  originOrPermission);
       return perm == Ci.nsIPermissionManager.ALLOW_ACTION;
     }
   } else {
     // a simple URI, so just check for an exact match.
     this._originCheckCallback = requestPrincipal => {
-      return originOrPermission.prePath === requestPrincipal.originNoSuffix;
+      return originOrPermission.prePath === requestPrincipal.origin;
     }
   }
   this._originOrPermission = originOrPermission;
 };
 
 this.WebChannel.prototype = {
 
   /**