diff --git a/cef3/tests/unittests/v8_unittest.cc b/cef3/tests/unittests/v8_unittest.cc index b30ea57fa..a06582e0b 100644 --- a/cef3/tests/unittests/v8_unittest.cc +++ b/cef3/tests/unittests/v8_unittest.cc @@ -1838,13 +1838,16 @@ class V8RendererTest : public ClientApp::RenderDelegate { // Call DevToolsLoaded() when DevTools window completed loading. std::string jsCode = "(function(){" - " var oldLoadCompleted = InspectorFrontendAPI.loadCompleted;" - " InspectorFrontendAPI.loadCompleted = function(){" - " oldLoadCompleted.call(InspectorFrontendAPI);" - " console.log('InspectorFrontendAPI.loadCompleted event fired');" - " window.DevToolsLoaded();" - " };" - "})();"; + " var oldLoadCompleted = InspectorFrontendAPI.loadCompleted;" + " if (InspectorFrontendAPI._isLoaded) {" + " window.DevToolsLoaded();" + " } else {" + " InspectorFrontendAPI.loadCompleted = function(){" + " oldLoadCompleted.call(InspectorFrontendAPI);" + " window.DevToolsLoaded();" + " };" + " }" + "})();"; CefRefPtr retval; CefRefPtr exception;