Bug 1278630 - Native Console API should work also after a refresh, r=bgrins
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 08 Jun 2016 08:01:08 -0700
changeset 301103 051765f8237daf5da7ba0d3e97da16668ce9988c
parent 301102 346d46f452a51e6d9654932211acf358b31d166d
child 301104 8b94fc162494c7d2c874cc9ada5814e2adf3eee4
child 301187 249d57fa78a0522f63a5b1ed1fdda55f383156e0
push id78205
push useramarchesini@mozilla.com
push dateWed, 08 Jun 2016 15:57:00 +0000
treeherdermozilla-inbound@051765f8237d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1278630
milestone50.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 1278630 - Native Console API should work also after a refresh, r=bgrins
devtools/server/actors/webbrowser.js
devtools/server/tests/browser/browser_navigateEvents.js
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -2011,17 +2011,17 @@ TabActor.prototype = {
    *         True if the window.console object is native, or false otherwise.
    */
   hasNativeConsoleAPI(window) {
     let isNative = false;
     try {
       // We are very explicitly examining the "console" property of
       // the non-Xrayed object here.
       let console = window.wrappedJSObject.console;
-      isNative = console instanceof window.Console;
+      isNative = new XPCNativeWrapper(console).IS_NATIVE_CONSOLE
     } catch (ex) {
       // ignore
     }
     return isNative;
   },
 
   /**
    * Create or return the StyleSheetActor for a style sheet. This method
--- a/devtools/server/tests/browser/browser_navigateEvents.js
+++ b/devtools/server/tests/browser/browser_navigateEvents.js
@@ -30,16 +30,17 @@ function assertEvent(event, data) {
     case x++:
       is(event, "will-navigate", "The very first event is will-navigate on server side");
       is(data.newURI, URL2, "newURI property is correct");
       break;
     case x++:
       is(event, "tabNavigated", "Right after will-navigate, the client receive tabNavigated");
       is(data.state, "start", "state is start");
       is(data.url, URL2, "url property is correct");
+      is(data.nativeConsoleAPI, true, "nativeConsoleAPI is correct");
       break;
     case x++:
       is(event, "request", "Given that locally, the Debugger protocol is sync, the request happens after tabNavigated");
       is(data, URL2);
       break;
     case x++:
       is(event, "DOMContentLoaded");
       is(content.document.readyState, "interactive");
@@ -51,16 +52,17 @@ function assertEvent(event, data) {
     case x++:
       is(event, "navigate", "Then once the second doc is loaded, we get the navigate event");
       is(content.document.readyState, "complete", "navigate is emitted only once the document is fully loaded");
       break;
     case x++:
       is(event, "tabNavigated", "Finally, the receive the client event");
       is(data.state, "stop", "state is stop");
       is(data.url, URL2, "url property is correct");
+      is(data.nativeConsoleAPI, true, "nativeConsoleAPI is correct");
 
       // End of test!
       cleanup();
       break;
   }
 }
 
 function waitForOnBeforeUnloadDialog(browser, callback) {