Diff
Modified: trunk/LayoutTests/ChangeLog (87279 => 87280)
--- trunk/LayoutTests/ChangeLog 2011-05-25 07:48:53 UTC (rev 87279)
+++ trunk/LayoutTests/ChangeLog 2011-05-25 09:03:11 UTC (rev 87280)
@@ -1,3 +1,14 @@
+2011-05-24 Pavel Podivilov <[email protected]>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: inspected page crashes when call stack is empty after live edit.
+ https://bugs.webkit.org/show_bug.cgi?id=61364
+
+ * inspector/debugger/live-edit-expected.txt:
+ * inspector/debugger/live-edit.html:
+ * platform/chromium/test_expectations.txt:
+
2011-05-25 Mads Ager <[email protected]>
Reviewed by Adam Barth.
Modified: trunk/LayoutTests/inspector/debugger/live-edit-expected.txt (87279 => 87280)
--- trunk/LayoutTests/inspector/debugger/live-edit-expected.txt 2011-05-25 07:48:53 UTC (rev 87279)
+++ trunk/LayoutTests/inspector/debugger/live-edit-expected.txt 2011-05-25 09:03:11 UTC (rev 87280)
@@ -13,14 +13,15 @@
Running: testLiveEditWhenPaused
Script execution paused.
+Script execution resumed.
+
+Running: testNoCrashWhenOnlyOneFunctionOnStack
+Script execution paused.
Call stack:
0) f1 (edit-me-when-paused.js:13)
- 1) (:1)
- 2) eval ((internal script):146)
- 3) InjectedScript._evaluateOn (:283)
- 4) InjectedScript._evaluateAndWrap (:265)
- 5) InjectedScript.evaluate (:245)
Script execution resumed.
+Script execution paused.
+Script execution resumed.
Running: testBreakpointsUpdated
Debugger was disabled.
Modified: trunk/LayoutTests/inspector/debugger/live-edit.html (87279 => 87280)
--- trunk/LayoutTests/inspector/debugger/live-edit.html 2011-05-25 07:48:53 UTC (rev 87279)
+++ trunk/LayoutTests/inspector/debugger/live-edit.html 2011-05-25 09:03:11 UTC (rev 87280)
@@ -51,7 +51,6 @@
function didEditScriptSource()
{
- InspectorTest.captureStackTrace(WebInspector.debuggerModel.callFrames);
InspectorTest.resumeExecution();
}
@@ -62,6 +61,28 @@
}
},
+ function testNoCrashWhenOnlyOneFunctionOnStack(next)
+ {
+ InspectorTest.showScriptSource("edit-me-when-paused.js", didShowScriptSource);
+
+ function didShowScriptSource(sourceFrame)
+ {
+ InspectorTest.waitUntilPaused(paused);
+ InspectorTest.evaluateInPage("setTimeout(f1, 0)");
+ }
+
+ function paused(callFrames)
+ {
+ InspectorTest.captureStackTrace(callFrames);
+ replaceInSource(panel.visibleView, "debugger;", "debugger;\n", didEditScriptSource);
+ }
+
+ function didEditScriptSource()
+ {
+ InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, InspectorTest.resumeExecution.bind(InspectorTest, next)));
+ }
+ },
+
function testBreakpointsUpdated(next)
{
InspectorTest.showScriptSource("edit-me.js", didShowScriptSource);
@@ -91,7 +112,7 @@
{
InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSource", callback);
sourceFrame._textViewer._mainPanel.readOnly = false;
- sourceFrame.startEditing();
+ sourceFrame.beforeTextChanged();
var oldRange, newRange;
var lines = sourceFrame._textModel._lines;
for (var i = 0; i < lines.length; ++i) {
@@ -105,7 +126,7 @@
newRange = new WebInspector.TextRange(i, column, i + lineEndings.length - 1, lastLineLength);
break;
}
- sourceFrame.endEditing(oldRange, newRange);
+ sourceFrame.afterTextChanged(oldRange, newRange);
sourceFrame._textViewer._commitEditing();
}
};
Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (87279 => 87280)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-05-25 07:48:53 UTC (rev 87279)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-05-25 09:03:11 UTC (rev 87280)
@@ -685,9 +685,6 @@
BUGCR77630 WIN LINUX DEBUG SLOW : inspector/debugger/debugger-activation-crash.html = PASS TEXT
-BUGWK60106 DEBUG WIN LINUX : inspector/debugger/live-edit.html = TEXT TIMEOUT PASS
-BUGWK60106 RELEASE LINUX : inspector/debugger/live-edit.html = TEXT PASS
-
BUGWK60107 WIN LINUX : inspector/console/console-object-constructor-name.html = TEXT PASS TIMEOUT
BUGWK60107 WIN LINUX : inspector/console/console-log-before-inspector-open.html = TEXT PASS TIMEOUT
BUGWK60107 WIN LINUX : inspector/console/console-tests.html = TEXT PASS TIMEOUT
Modified: trunk/Source/WebCore/ChangeLog (87279 => 87280)
--- trunk/Source/WebCore/ChangeLog 2011-05-25 07:48:53 UTC (rev 87279)
+++ trunk/Source/WebCore/ChangeLog 2011-05-25 09:03:11 UTC (rev 87280)
@@ -1,3 +1,13 @@
+2011-05-24 Pavel Podivilov <[email protected]>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: inspected page crashes when call stack is empty after live edit.
+ https://bugs.webkit.org/show_bug.cgi?id=61364
+
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::currentCallFrame):
+
2011-05-23 Yury Semikhatsky <[email protected]>
Reviewed by Adam Barth.
Modified: trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp (87279 => 87280)
--- trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp 2011-05-25 07:48:53 UTC (rev 87279)
+++ trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp 2011-05-25 09:03:11 UTC (rev 87280)
@@ -248,6 +248,8 @@
v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("currentCallFrame")));
v8::Handle<v8::Value> argv[] = { m_executionState.get() };
v8::Handle<v8::Value> currentCallFrameV8 = currentCallFrameFunction->Call(m_debuggerScript.get(), 1, argv);
+ if (!currentCallFrameV8->IsObject())
+ return ScriptValue(v8::Null());
RefPtr<_javascript_CallFrame> currentCallFrame = _javascript_CallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));
v8::Context::Scope contextScope(m_pausedContext);
return ScriptValue(toV8(currentCallFrame.release()));