Closed Bug 1407026 Opened 3 years ago Closed 3 years ago

Undefined CPOW type

Categories

(DevTools :: Console, defect)

58 Branch
defect
Not set

Tracking

(firefox-esr52 unaffected, firefox56 unaffected, firefox57 unaffected, firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox-esr52 --- unaffected
firefox56 --- unaffected
firefox57 --- unaffected
firefox58 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

Details

(Keywords: regression)

Attachments

(1 file)

In bug 1394559 I made a typo and now the console says CPOWs are undefined, e.g.

1. Enable e10s.
2. Load http://example.com
3. Open browser console
4. Run this code:
    gBrowser.selectedBrowser._contentWindow

Result: [object CPOW: undefined]
Expected: [object CPOW: Window]
Comment on attachment 8916756 [details]
Bug 1407026 - Fix CPOW class mistake in the console.

https://reviewboard.mozilla.org/r/187828/#review192990

Looks good to me, thanks Oriol

::: devtools/server/actors/object.js:86
(Diff revision 1)
>      // 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 = unwrap(this.obj);
>      if (!unwrapped) {
>        if (DevToolsUtils.isCPOW(this.obj)) {
> -        g.class = "CPOW: " + g.class;
> +        g.class = "CPOW: " + this.obj.class;

good catch !
Attachment #8916756 - Flags: review?(nchevobbe) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/804b3282f778
Fix CPOW class mistake in the console. r=nchevobbe
Keywords: checkin-needed
Backed out for failing devtools/client/webconsole/test/browser_console.js on Windows 7 debug without e10s.

https://hg.mozilla.org/integration/autoland/rev/5a90656e4da6b9d2979f77fc12a911b0b894bef0

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=804b3282f778caecb7fab74b9f94bd3a71989290&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=135939685&repo=autoland

13:59:05     INFO -  185 INFO TEST-PASS | devtools/client/webconsole/test/browser_console.js | matched rule: frame script message -
13:59:05     INFO -  186 INFO TEST-PASS | devtools/client/webconsole/test/browser_console.js | matched rule: jsterm eval result 2 -
13:59:05     INFO -  187 INFO Creating an ObjectClient with: server1.conn10.obj29
13:59:05     INFO -  188 INFO Console message: [JavaScript Warning: "Ignoring get or set of property that has [LenientThis] because the “this” object is incorrect." {file: "resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/object.js" line: 386}]
13:59:05     INFO -  189 INFO TEST-PASS | devtools/client/webconsole/test/browser_console.js | Looks like a valid response -
13:59:05     INFO -  Buffered messages finished
13:59:05    ERROR -  190 INFO TEST-UNEXPECTED-FAIL | devtools/client/webconsole/test/browser_console.js | The CPOW grip has the right class. - Got Window, expected CPOW: Window
13:59:05     INFO -  Stack trace:
13:59:05     INFO -      chrome://mochikit/content/browser-test.js:test_is:1011
13:59:05     INFO -      chrome://mochitests/content/browser/devtools/client/webconsole/test/browser_console.js:testCPOWInspection:203
13:59:05     INFO -      process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:922:23
13:59:05     INFO -      walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:806:7
13:59:05     INFO -      Promise*scheduleWalkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:739:11
13:59:05     INFO -      schedulePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:770:7
13:59:05     INFO -      completePromise@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:707:7
13:59:05     INFO -      maybeDone@chrome://mochitests/content/browser/devtools/client/webconsole/test/head.js:1294:7
13:59:05     INFO -      onMessagesAdded@chrome://mochitests/content/browser/devtools/client/webconsole/test/head.js:1275:15
13:59:05     INFO -      emit@resource://devtools/shared/base-loader.js -> resource://devtools/shared/old-event-emitter.js:137:11
13:59:05     INFO -      _flushMessageQueue@resource://devtools/shared/base-loader.js -> resource://devtools/client/webconsole/webconsole.js:2043:7
Flags: needinfo?(oriol-bugzilla)
Argh, I thought this test would run only in e10s. In non-e10s, the object is not a CPOW, of course.
Flags: needinfo?(oriol-bugzilla)
Comment on attachment 8916756 [details]
Bug 1407026 - Fix CPOW class mistake in the console.

Fixed the test
Attachment #8916756 - Flags: review+ → review?(nchevobbe)
Comment on attachment 8916756 [details]
Bug 1407026 - Fix CPOW class mistake in the console.

https://reviewboard.mozilla.org/r/187828/#review193878

Thanks Oriol, this looks good to me.
Also, may I ask you to copy these change to http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/mochitest/browser_console.js too ?
We want to migrate all the tests from the old console to the new one and have a process for that, but tests between the old folder and the new one should be kept in-sync.
Attachment #8916756 - Flags: review?(nchevobbe) → review+
OK, done!
Keywords: checkin-needed
Thanks ! let me push that patch
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aad834084309
Fix CPOW class mistake in the console. r=nchevobbe
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/aad834084309
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.