Bug 1407026 - Fix CPOW class mistake in the console. r=nchevobbe
☠☠ backed out by 5a90656e4da6 ☠ ☠
authorOriol Brufau <oriol-bugzilla@hotmail.com>
Mon, 09 Oct 2017 22:03:18 +0200
changeset 385338 804b3282f778caecb7fab74b9f94bd3a71989290
parent 385337 ff181baf62e0e0fb0c0b1a0178e71a3fb9349726
child 385339 2ece41a76b0c270b66b35d23434f799fb13b0c1f
push id52971
push userryanvm@gmail.com
push dateTue, 10 Oct 2017 12:52:06 +0000
treeherderautoland@804b3282f778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1407026
milestone58.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 1407026 - Fix CPOW class mistake in the console. r=nchevobbe MozReview-Commit-ID: LDmbQEuU3JE
devtools/client/webconsole/new-console-output/test/mochitest/browser_console.js
devtools/client/webconsole/test/browser_console.js
devtools/server/actors/object.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_console.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_console.js
@@ -192,9 +192,13 @@ function* testCPOWInspection(hud) {
 
   // Before the fix for Bug 1382833, this wouldn't resolve due to a CPOW error
   // in the ObjectActor.
   let prototypeAndProperties = yield objectClient.getPrototypeAndProperties();
 
   // Just a sanity check to make sure a valid packet came back
   is(prototypeAndProperties.prototype.class, "XBL prototype JSClass",
     "Looks like a valid response");
+
+  // The CPOW is in the _contentWindow property.
+  let cpow = prototypeAndProperties.ownProperties._contentWindow.value;
+  is(cpow.class, "CPOW: Window", "The CPOW grip has the right class.");
 }
--- a/devtools/client/webconsole/test/browser_console.js
+++ b/devtools/client/webconsole/test/browser_console.js
@@ -192,9 +192,13 @@ function* testCPOWInspection(hud) {
 
   // Before the fix for Bug 1382833, this wouldn't resolve due to a CPOW error
   // in the ObjectActor.
   let prototypeAndProperties = yield objectClient.getPrototypeAndProperties();
 
   // Just a sanity check to make sure a valid packet came back
   is(prototypeAndProperties.prototype.class, "XBL prototype JSClass",
     "Looks like a valid response");
+
+  // The CPOW is in the _contentWindow property.
+  let cpow = prototypeAndProperties.ownProperties._contentWindow.value;
+  is(cpow.class, "CPOW: Window", "The CPOW grip has the right class.");
 }
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -78,17 +78,17 @@ ObjectActor.prototype = {
       "actor": this.actorID
     };
 
     // Check if the object has a wrapper which denies access. It may be a CPOW or a
     // security wrapper. Change the class so that this will be visible in the UI.
     let unwrapped = DevToolsUtils.unwrap(this.obj);
     if (!unwrapped) {
       if (DevToolsUtils.isCPOW(this.obj)) {
-        g.class = "CPOW: " + g.class;
+        g.class = "CPOW: " + this.obj.class;
       } else {
         g.class = "Inaccessible";
       }
       return g;
     }
 
     // Dead objects also deny access.
     if (this.obj.class == "DeadObject") {