- Revision
- 88815
- Author
- [email protected]
- Date
- 2011-06-14 10:03:38 -0700 (Tue, 14 Jun 2011)
Log Message
2011-06-14 Sreeram Ramachandran <[email protected]>
Reviewed by Pavel Feldman.
Web Inspector: Allow the console to persist on page refresh or navigation
https://bugs.webkit.org/show_bug.cgi?id=53359
Tests that console messages are preserved upon navigation.
* inspector/console/console-preserve-log-expected.txt: Added.
* inspector/console/console-preserve-log.html: Added.
2011-06-14 Sreeram Ramachandran <[email protected]>
Reviewed by Pavel Feldman.
Web Inspector: Allow the console to persist on page refresh or navigation
https://bugs.webkit.org/show_bug.cgi?id=53359
Adds a context menu checkbox to preserve the console log across
navigations. However, the underlying messages and objects are actually
deleted from the backend, so they are not expandable; their continued
display in the console frontend is merely cosmetic.
Test: inspector/console/console-preserve-log.html
* English.lproj/localizedStrings.js:
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher.dispatcher.messagesCleared):
(WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher):
(WebInspector.ConsoleView.prototype.requestClearMessages):
(WebInspector.ConsoleView.prototype._handleContextMenuEvent.monitoringXHRItemAction):
(WebInspector.ConsoleView.prototype._handleContextMenuEvent.preserveLogItemAction):
(WebInspector.ConsoleView.prototype._handleContextMenuEvent):
* inspector/front-end/Settings.js:
(WebInspector.Settings):
* inspector/front-end/inspector.js:
(WebInspector.reset):
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (88814 => 88815)
--- trunk/LayoutTests/ChangeLog 2011-06-14 16:59:24 UTC (rev 88814)
+++ trunk/LayoutTests/ChangeLog 2011-06-14 17:03:38 UTC (rev 88815)
@@ -1,3 +1,15 @@
+2011-06-14 Sreeram Ramachandran <[email protected]>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Allow the console to persist on page refresh or navigation
+ https://bugs.webkit.org/show_bug.cgi?id=53359
+
+ Tests that console messages are preserved upon navigation.
+
+ * inspector/console/console-preserve-log-expected.txt: Added.
+ * inspector/console/console-preserve-log.html: Added.
+
2011-06-14 Pavel Podivilov <[email protected]>
Reviewed by Pavel Feldman.
Added: trunk/LayoutTests/inspector/console/console-preserve-log-expected.txt (0 => 88815)
--- trunk/LayoutTests/inspector/console/console-preserve-log-expected.txt (rev 0)
+++ trunk/LayoutTests/inspector/console/console-preserve-log-expected.txt 2011-06-14 17:03:38 UTC (rev 88815)
@@ -0,0 +1,5 @@
+Tests that the console can preserve log messages across navigations. Bug 53359
+
+Page reloaded.
+PASS
+
Added: trunk/LayoutTests/inspector/console/console-preserve-log.html (0 => 88815)
--- trunk/LayoutTests/inspector/console/console-preserve-log.html (rev 0)
+++ trunk/LayoutTests/inspector/console/console-preserve-log.html 2011-06-14 17:03:38 UTC (rev 88815)
@@ -0,0 +1,25 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+function test()
+{
+ WebInspector.console.addMessage(
+ WebInspector.ConsoleMessage.createTextMessage("PASS"));
+ WebInspector.settings.preserveConsoleLog = true;
+ InspectorTest.reloadPage(function() {
+ InspectorTest.dumpConsoleMessages();
+ WebInspector.settings.preserveConsoleLog = false;
+ InspectorTest.completeTest();
+ });
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>
+Tests that the console can preserve log messages across navigations.
+<a href="" 53359</a>
+</p>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (88814 => 88815)
--- trunk/Source/WebCore/ChangeLog 2011-06-14 16:59:24 UTC (rev 88814)
+++ trunk/Source/WebCore/ChangeLog 2011-06-14 17:03:38 UTC (rev 88815)
@@ -1,3 +1,30 @@
+2011-06-14 Sreeram Ramachandran <[email protected]>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Allow the console to persist on page refresh or navigation
+ https://bugs.webkit.org/show_bug.cgi?id=53359
+
+ Adds a context menu checkbox to preserve the console log across
+ navigations. However, the underlying messages and objects are actually
+ deleted from the backend, so they are not expandable; their continued
+ display in the console frontend is merely cosmetic.
+
+ Test: inspector/console/console-preserve-log.html
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher.dispatcher.messagesCleared):
+ (WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher):
+ (WebInspector.ConsoleView.prototype.requestClearMessages):
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent.monitoringXHRItemAction):
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent.preserveLogItemAction):
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ * inspector/front-end/inspector.js:
+ (WebInspector.reset):
+
2011-06-14 Pavel Podivilov <[email protected]>
Reviewed by Pavel Feldman.
Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js
(Binary files differ)
Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (88814 => 88815)
--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js 2011-06-14 16:59:24 UTC (rev 88814)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js 2011-06-14 17:03:38 UTC (rev 88815)
@@ -148,7 +148,8 @@
messagesCleared: function()
{
- console.clearMessages();
+ if (!WebInspector.settings.preserveConsoleLog)
+ console.clearMessages();
},
}
InspectorBackend.registerDomainDispatcher("Console", dispatcher);
@@ -327,6 +328,7 @@
requestClearMessages: function()
{
ConsoleAgent.clearConsoleMessages();
+ this.clearMessages();
},
clearMessages: function()
@@ -449,12 +451,19 @@
return;
}
- var itemAction = function () {
+ var contextMenu = new WebInspector.ContextMenu();
+
+ var monitoringXHRItemAction = function () {
WebInspector.settings.monitoringXHREnabled = !WebInspector.settings.monitoringXHREnabled;
ConsoleAgent.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled);
}.bind(this);
- var contextMenu = new WebInspector.ContextMenu();
- contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "XMLHttpRequest logging" : "XMLHttpRequest Logging"), itemAction, WebInspector.settings.monitoringXHREnabled)
+ contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "XMLHttpRequest logging" : "XMLHttpRequest Logging"), monitoringXHRItemAction, WebInspector.settings.monitoringXHREnabled);
+
+ var preserveLogItemAction = function () {
+ WebInspector.settings.preserveConsoleLog = !WebInspector.settings.preserveConsoleLog;
+ }.bind(this);
+ contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Preserve log" : "Preserve Log"), preserveLogItemAction, WebInspector.settings.preserveConsoleLog);
+
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear console" : "Clear Console"), this.requestClearMessages.bind(this));
contextMenu.show(event);
},
Modified: trunk/Source/WebCore/inspector/front-end/Settings.js (88814 => 88815)
--- trunk/Source/WebCore/inspector/front-end/Settings.js 2011-06-14 16:59:24 UTC (rev 88814)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js 2011-06-14 17:03:38 UTC (rev 88815)
@@ -66,6 +66,7 @@
this.installApplicationSetting("lastActivePanel", "elements");
this.installApplicationSetting("lastViewedScriptFile", "application");
this.installApplicationSetting("monitoringXHREnabled", false);
+ this.installApplicationSetting("preserveConsoleLog", false);
this.installApplicationSetting("pauseOnExceptionStateString", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
this.installApplicationSetting("resourcesLargeRows", true);
this.installApplicationSetting("resourcesSortOptions", {timeOption: "responseTime", sizeOption: "transferSize"});
Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (88814 => 88815)
--- trunk/Source/WebCore/inspector/front-end/inspector.js 2011-06-14 16:59:24 UTC (rev 88814)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js 2011-06-14 17:03:38 UTC (rev 88815)
@@ -982,7 +982,8 @@
this.resources = {};
this.highlightDOMNode(0);
- this.console.clearMessages();
+ if (!WebInspector.settings.preserveConsoleLog)
+ this.console.clearMessages();
this.extensionServer.notifyInspectorReset();
if (this.workerManager)
this.workerManager.reset();