Title: [139602] branches/chromium/1364
Revision
139602
Author
pfeld...@chromium.org
Date
2013-01-14 03:53:47 -0800 (Mon, 14 Jan 2013)

Log Message

Merge 139416
> Web Inspector [chromium]: Debugger.globalObjectCleared is not dispatched on reload after renderer swap
> https://bugs.webkit.org/show_bug.cgi?id=106555
> 
> Reviewed by Vsevolod Vlasov.
> 
> Source/WebCore:
> 
> Wrong ::enable was made virtual in the InspectorDebuggerAgent.
> 
> Test: inspector/debugger/debugger-scripts-reload.html
> 
> * inspector/InspectorDebuggerAgent.h:
> (InspectorDebuggerAgent):
> * inspector/PageDebuggerAgent.cpp:
> (WebCore::PageDebuggerAgent::enable):
> (WebCore::PageDebuggerAgent::disable):
> * inspector/PageDebuggerAgent.h:
> (PageDebuggerAgent):
> 
> LayoutTests:
> 
> * http/tests/inspector/debugger-test.js:
> (initialize_DebuggerTest):
> * inspector/debugger/debugger-scripts-reload-expected.txt: Added.
> * inspector/debugger/debugger-scripts-reload.html: Added.

TBR=pfeld...@chromium.org
BUG=169437
Review URL: https://codereview.chromium.org/11876015

Modified Paths

Added Paths

Diff

Modified: branches/chromium/1364/LayoutTests/http/tests/inspector/debugger-test.js (139601 => 139602)


--- branches/chromium/1364/LayoutTests/http/tests/inspector/debugger-test.js	2013-01-14 11:10:36 UTC (rev 139601)
+++ branches/chromium/1364/LayoutTests/http/tests/inspector/debugger-test.js	2013-01-14 11:53:47 UTC (rev 139602)
@@ -284,7 +284,7 @@
     var scripts = [];
     for (var scriptId in WebInspector.debuggerModel._scripts) {
         var script = WebInspector.debuggerModel._scripts[scriptId];
-        if (filter(script))
+        if (!filter || filter(script))
             scripts.push(script);
     }
     return scripts;

Copied: branches/chromium/1364/LayoutTests/inspector/debugger/debugger-scripts-reload-expected.txt (from rev 139416, trunk/LayoutTests/inspector/debugger/debugger-scripts-reload-expected.txt) (0 => 139602)


--- branches/chromium/1364/LayoutTests/inspector/debugger/debugger-scripts-reload-expected.txt	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/inspector/debugger/debugger-scripts-reload-expected.txt	2013-01-14 11:53:47 UTC (rev 139602)
@@ -0,0 +1,7 @@
+Tests that scripts list is cleared upon page reload.
+
+Debugger was enabled.
+Dummy script found: dummyScript.js
+Page reloaded.
+Debugger was disabled.
+

Copied: branches/chromium/1364/LayoutTests/inspector/debugger/debugger-scripts-reload.html (from rev 139416, trunk/LayoutTests/inspector/debugger/debugger-scripts-reload.html) (0 => 139602)


--- branches/chromium/1364/LayoutTests/inspector/debugger/debugger-scripts-reload.html	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/inspector/debugger/debugger-scripts-reload.html	2013-01-14 11:53:47 UTC (rev 139602)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<script src=""
+<script src=""
+
+<script>
+
+function test()
+{
+    InspectorTest.evaluateInPage("function foo() {} //@ sourceURL=dummyScript.js", step1);
+
+    function step1()
+    {
+        InspectorTest.startDebuggerTest(step2);
+    }
+
+    function step2()
+    {
+        InspectorTest.queryScripts(function(script) { step3({ data: script }) });
+        WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step3);
+    }
+
+    function step3(event)
+    {
+        var script = event.data;
+        if (script.sourceURL.indexOf("dummyScript.js") !== -1) {
+            InspectorTest.addResult("Dummy script found: " + script.sourceURL);
+            // Let scripts dispatch and reload.
+            setTimeout(InspectorTest.reloadPage.bind(InspectorTest, afterReload), 0);
+        }
+    }
+
+    function afterReload()
+    {
+        var scripts = InspectorTest.queryScripts();
+        for (var i = 0; i < scripts.length; ++i) {
+            if (scripts[i].sourceURL.indexOf("dummyScript.js") !== -1)
+                InspectorTest.addResult("FAILED: dummy script found after navigation");
+        }
+        InspectorTest.completeDebuggerTest();
+    }
+
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>
+Tests that scripts list is cleared upon page reload.
+</p>
+</body>
+</html>

Modified: branches/chromium/1364/Source/WebCore/inspector/InspectorDebuggerAgent.h (139601 => 139602)


--- branches/chromium/1364/Source/WebCore/inspector/InspectorDebuggerAgent.h	2013-01-14 11:10:36 UTC (rev 139601)
+++ branches/chromium/1364/Source/WebCore/inspector/InspectorDebuggerAgent.h	2013-01-14 11:53:47 UTC (rev 139602)
@@ -71,9 +71,6 @@
     virtual void canSetScriptSource(ErrorString*, bool*);
     virtual void supportsSeparateScriptCompilationAndExecution(ErrorString*, bool*);
 
-    virtual void enable(ErrorString*);
-    virtual void disable(ErrorString*);
-
     virtual void setFrontend(InspectorFrontend*);
     virtual void clearFrontend();
     virtual void restore();
@@ -82,6 +79,8 @@
     void addMessageToConsole(MessageSource, MessageType);
 
     // Part of the protocol.
+    virtual void enable(ErrorString*);
+    virtual void disable(ErrorString*);
     virtual void setBreakpointsActive(ErrorString*, bool active);
 
     virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& locations);
@@ -141,13 +140,13 @@
     InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
     virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
 
+    virtual void enable();
     virtual void disable();
     virtual void didPause(ScriptState*, const ScriptValue& callFrames, const ScriptValue& exception);
     virtual void didContinue();
     void reset();
 
 private:
-    void enable();
     bool enabled();
 
     PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCallFrames();

Modified: branches/chromium/1364/Source/WebCore/inspector/PageDebuggerAgent.cpp (139601 => 139602)


--- branches/chromium/1364/Source/WebCore/inspector/PageDebuggerAgent.cpp	2013-01-14 11:10:36 UTC (rev 139601)
+++ branches/chromium/1364/Source/WebCore/inspector/PageDebuggerAgent.cpp	2013-01-14 11:53:47 UTC (rev 139602)
@@ -59,15 +59,15 @@
 {
 }
 
-void PageDebuggerAgent::enable(ErrorString* errorString)
+void PageDebuggerAgent::enable()
 {
-    InspectorDebuggerAgent::enable(errorString);
+    InspectorDebuggerAgent::enable();
     m_instrumentingAgents->setPageDebuggerAgent(this);
 }
 
-void PageDebuggerAgent::disable(ErrorString* errorString)
+void PageDebuggerAgent::disable()
 {
-    InspectorDebuggerAgent::disable(errorString);
+    InspectorDebuggerAgent::disable();
     m_instrumentingAgents->setPageDebuggerAgent(0);
 }
 

Modified: branches/chromium/1364/Source/WebCore/inspector/PageDebuggerAgent.h (139601 => 139602)


--- branches/chromium/1364/Source/WebCore/inspector/PageDebuggerAgent.h	2013-01-14 11:10:36 UTC (rev 139601)
+++ branches/chromium/1364/Source/WebCore/inspector/PageDebuggerAgent.h	2013-01-14 11:53:47 UTC (rev 139602)
@@ -49,11 +49,12 @@
     static PassOwnPtr<PageDebuggerAgent> create(InstrumentingAgents*, InspectorState*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
     virtual ~PageDebuggerAgent();
 
-    virtual void enable(ErrorString*);
-    virtual void disable(ErrorString*);
-
     void didClearMainFrameWindowObject();
 
+protected:
+    virtual void enable();
+    virtual void disable();
+
 private:
     virtual void startListeningScriptDebugServer();
     virtual void stopListeningScriptDebugServer();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to