Diff
Modified: trunk/LayoutTests/ChangeLog (100136 => 100137)
--- trunk/LayoutTests/ChangeLog 2011-11-14 14:06:59 UTC (rev 100136)
+++ trunk/LayoutTests/ChangeLog 2011-11-14 14:14:27 UTC (rev 100137)
@@ -1,3 +1,14 @@
+2011-11-14 Pavel Feldman <[email protected]>
+
+ Web Inspector: console's protocol payload does not have url and line properties.
+ https://bugs.webkit.org/show_bug.cgi?id=72256
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/console/console-url-and-line-expected.txt: Added.
+ * inspector/console/console-url-and-line.html: Added.
+ * inspector/protocol/console-agent-expected.txt:
+
2011-11-14 Tony Gentilcore <[email protected]>
[chromium] Two inspector tests timeout on mac
Added: trunk/LayoutTests/inspector/console/console-url-and-line-expected.txt (0 => 100137)
--- trunk/LayoutTests/inspector/console/console-url-and-line-expected.txt (rev 0)
+++ trunk/LayoutTests/inspector/console/console-url-and-line-expected.txt 2011-11-14 14:14:27 UTC (rev 100137)
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: line 9: one
+CONSOLE MESSAGE: line 10: two
+CONSOLE MESSAGE: line 11: three
+Tests that console's url and line properties are defiend for console.log entries. Bug 72256.
+
+Message at location: console-url-and-line.html:9
+Message at location: console-url-and-line.html:10
+Message at location: console-url-and-line.html:11
+
Property changes on: trunk/LayoutTests/inspector/console/console-url-and-line-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/inspector/console/console-url-and-line.html (0 => 100137)
--- trunk/LayoutTests/inspector/console/console-url-and-line.html (rev 0)
+++ trunk/LayoutTests/inspector/console/console-url-and-line.html 2011-11-14 14:14:27 UTC (rev 100137)
@@ -0,0 +1,40 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function log() {
+ // Fill console.
+ console.log("one");
+ console.log("two");
+ console.log("three");
+}
+
+function test()
+{
+ InspectorTest.addSniffer(WebInspector.ConsoleDispatcher.prototype, "messageAdded", messageAdded, true);
+
+ function messageAdded(payload)
+ {
+ var url = ""
+ var lastSlashIndex = url.lastIndexOf("/");
+ url = "" + 1);
+ InspectorTest.addResult("Message at location: " + url + ":" + payload.line);
+ if (payload.line === 10)
+ InspectorTest.completeTest();
+ }
+
+ InspectorTest.evaluateInPage("log()");
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Tests that console's url and line properties are defiend for console.log entries. Bug 72256.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/console/console-url-and-line.html
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/LayoutTests/inspector/protocol/console-agent-expected.txt (100136 => 100137)
--- trunk/LayoutTests/inspector/protocol/console-agent-expected.txt 2011-11-14 14:06:59 UTC (rev 100136)
+++ trunk/LayoutTests/inspector/protocol/console-agent-expected.txt 2011-11-14 14:14:27 UTC (rev 100137)
@@ -56,7 +56,7 @@
source : "console-api"
type : "log"
level : "log"
- line : 0
+ line : 1
url : ""
repeatCount : 1
text : "test"
Modified: trunk/Source/WebCore/ChangeLog (100136 => 100137)
--- trunk/Source/WebCore/ChangeLog 2011-11-14 14:06:59 UTC (rev 100136)
+++ trunk/Source/WebCore/ChangeLog 2011-11-14 14:14:27 UTC (rev 100137)
@@ -1,5 +1,19 @@
2011-11-14 Pavel Feldman <[email protected]>
+ Web Inspector: console's protocol payload does not have url and line properties.
+ https://bugs.webkit.org/show_bug.cgi?id=72256
+
+ Reviewed by Yury Semikhatsky.
+
+ Test: inspector/console/console-url-and-line.html
+
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ * inspector/front-end/ConsoleMessage.js:
+ (WebInspector.ConsoleMessageImpl):
+
+2011-11-14 Pavel Feldman <[email protected]>
+
Web Inspector: [regression r99960] null callback access.
https://bugs.webkit.org/show_bug.cgi?id=72263
Modified: trunk/Source/WebCore/inspector/ConsoleMessage.cpp (100136 => 100137)
--- trunk/Source/WebCore/inspector/ConsoleMessage.cpp 2011-11-14 14:06:59 UTC (rev 100136)
+++ trunk/Source/WebCore/inspector/ConsoleMessage.cpp 2011-11-14 14:14:27 UTC (rev 100137)
@@ -39,6 +39,7 @@
#include "InspectorFrontend.h"
#include "InspectorValues.h"
#include "ScriptArguments.h"
+#include "ScriptCallFrame.h"
#include "ScriptCallStack.h"
#include "ScriptValue.h"
@@ -62,11 +63,16 @@
, m_level(l)
, m_message(m)
, m_arguments(arguments)
- , m_callStack(callStack)
, m_line(0)
, m_url()
, m_repeatCount(1)
{
+ if (callStack && callStack->size()) {
+ const ScriptCallFrame& frame = callStack->at(0);
+ m_url = frame.sourceURL();
+ m_line = frame.lineNumber();
+ }
+ m_callStack = callStack;
}
ConsoleMessage::ConsoleMessage(MessageSource s, MessageType t, MessageLevel l, const String& m, const String& responseUrl, const String& requestId)
Modified: trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js (100136 => 100137)
--- trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js 2011-11-14 14:06:59 UTC (rev 100136)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js 2011-11-14 14:14:27 UTC (rev 100137)
@@ -63,14 +63,6 @@
this._stackTrace = stackTrace;
this._request = request;
- if (stackTrace && stackTrace.length) {
- var topCallFrame = stackTrace[0];
- if (!this.url)
- this.url = ""
- if (!this.line)
- this.line = topCallFrame.lineNumber;
- }
-
this._customFormatters = {
"object": this._formatParameterAsObject,
"array": this._formatParameterAsArray,