<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193201] branches/safari-601-branch</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193201">193201</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 10:57:10 -0800 (Thu, 03 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/189373">r189373</a>. rdar://problem/23221163</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsChangeLog">branches/safari-601-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreChangeLog">branches/safari-601-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceJavaScriptCoreinspectorprotocolConsolejson">branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Console.json</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIChangeLog">branches/safari-601-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsoleaddInspectedNodeexpectedtxt">branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsoleaddInspectedNodehtml">branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode.html</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsoleclearMessagesexpectedtxt">branches/safari-601-branch/LayoutTests/inspector/console/clearMessages-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsoleclearMessageshtml">branches/safari-601-branch/LayoutTests/inspector/console/clearMessages.html</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsolemessageRepeatCountUpdatedexpectedtxt">branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsolemessageRepeatCountUpdatedhtml">branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated.html</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsolemessagesClearedexpectedtxt">branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsinspectorconsolemessagesClearedhtml">branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193200 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-03 18:57:00 UTC (rev 193200)
+++ branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2015-12-02 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r189373. rdar://problem/23221163
+
+ 2015-09-04 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Expand Console domain test coverage
+ https://bugs.webkit.org/show_bug.cgi?id=148740
+
+ Reviewed by Brian Burg.
+
+ Test more Console domain commands and events.
+
+ * inspector/console/addInspectedNode-expected.txt: Added.
+ * inspector/console/addInspectedNode.html: Added.
+ * inspector/console/clearMessages-expected.txt: Added.
+ * inspector/console/clearMessages.html: Added.
+ * inspector/console/messageRepeatCountUpdated-expected.txt: Added.
+ * inspector/console/messageRepeatCountUpdated.html: Added.
+ * inspector/console/messagesCleared-expected.txt: Added.
+ * inspector/console/messagesCleared.html: Added.
+
+2015-12-02 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r189104. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-08-28 Joseph Pecoraro <pecoraro@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsoleaddInspectedNodeexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode-expected.txt (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode-expected.txt         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode-expected.txt        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Test for the Console.addInspectedNode command.
+
+
+== Running test suite: Console.addInspectedNode
+-- Running test case: Check$0IsUndefined
+PASS: $0 should be undefined.
+
+-- Running test case: SetAndCheckNodeA
+PASS: $0 should be a node.
+PASS: $0 should be Node A.
+
+-- Running test case: SetBadNodeId
+PASS: Should be an error
+PASS: $0 should be a node.
+PASS: $0 should be Node A.
+
+-- Running test case: SetAndCheckNodeB
+PASS: $0 should be a node.
+PASS: $0 should not be Node A.
+PASS: $0 should be Node B.
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsoleaddInspectedNodehtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode.html (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode.html         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/addInspectedNode.html        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ function evaluate$0(callback) {
+ const objectGroup = "test";
+ const includeCommandLineAPI = true;
+ const ignorePauseOnExceptionsAndMute = false;
+ const shouldReturnByValue = false;
+ const shouldGeneratePreview = false;
+ const shouldSaveResult = false;
+ WebInspector.runtimeManager.evaluateInInspectedWindow("$0", objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, callback);
+ }
+
+ let nodeA, nodeB;
+
+ let suite = InspectorTest.createAsyncSuite("Console.addInspectedNode");
+
+ suite.addTestCase({
+ name: "Check$0IsUndefined",
+ description: "No inspected node yet, $0 should be undefined.",
+ test: (resolve, reject) => {
+ evaluate$0((remoteObject) => {
+ InspectorTest.expectThat(remoteObject.isUndefined(), "$0 should be undefined.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "SetAndCheckNodeA",
+ description: "Set the inspected node to be Node A and check that $0 is Node A.",
+ test: (resolve, reject) => {
+ ConsoleAgent.addInspectedNode(nodeA.id);
+ evaluate$0((remoteObject) => {
+ remoteObject.pushNodeToFrontend((nodeId) => {
+ InspectorTest.expectThat(remoteObject.isNode(), "$0 should be a node.");
+ InspectorTest.expectThat(nodeId === nodeA.id, "$0 should be Node A.");
+ resolve();
+ });
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "SetBadNodeId",
+ description: "If an invalid inspected node is set, it should not be bound to $0.",
+ test: (resolve, reject) => {
+ ConsoleAgent.addInspectedNode(999999, (error) => {
+ InspectorTest.expectThat(error, "Should be an error");
+ });
+ evaluate$0((remoteObject) => {
+ remoteObject.pushNodeToFrontend((nodeId) => {
+ InspectorTest.expectThat(remoteObject.isNode(), "$0 should be a node.");
+ InspectorTest.expectThat(nodeId === nodeA.id, "$0 should be Node A.");
+ resolve();
+ });
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "SetAndCheckNodeB",
+ description: "Set the inspected node to be Node B and check that $0 is Node B.",
+ test: (resolve, reject) => {
+ ConsoleAgent.addInspectedNode(nodeB.id);
+ evaluate$0((remoteObject) => {
+ remoteObject.pushNodeToFrontend((nodeId) => {
+ InspectorTest.expectThat(remoteObject.isNode(), "$0 should be a node.");
+ InspectorTest.expectThat(nodeId !== nodeA.id, "$0 should not be Node A.");
+ InspectorTest.expectThat(nodeId === nodeB.id, "$0 should be Node B.");
+ resolve();
+ });
+ });
+ }
+ });
+
+ // FIXME: What should $0 be after reloading / navigating the page. Should it be cleared?
+
+ WebInspector.domTreeManager.requestDocument((documentNode) => {
+ WebInspector.domTreeManager.querySelector(documentNode.id, "#a", (contentNodeId) => {
+ InspectorTest.assert(contentNodeId, "#a node should exist.");
+ nodeA = WebInspector.domTreeManager.nodeForId(contentNodeId);
+ });
+ WebInspector.domTreeManager.querySelector(documentNode.id, "#b", (contentNodeId) => {
+ InspectorTest.assert(contentNodeId, "#b node should exist.");
+ nodeB = WebInspector.domTreeManager.nodeForId(contentNodeId);
+ suite.runTestCasesAndFinish();
+ });
+ });
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Test for the Console.addInspectedNode command.</p>
+<div style="display:none">
+ <p id="a">Node A</p>
+ <p id="b">Node B</p>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsoleclearMessagesexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/clearMessages-expected.txt (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/clearMessages-expected.txt         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/clearMessages-expected.txt        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+Test for the Console.clearMessages command.
+
+
+== Running test suite: Console.clearMessages
+-- Running test case: CallClearMessages
+PASS: Cleared event should fire.
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsoleclearMessageshtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/clearMessages.html (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/clearMessages.html         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/clearMessages.html        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ let suite = InspectorTest.createAsyncSuite("Console.clearMessages");
+
+ suite.addTestCase({
+ name: "CallClearMessages",
+ description: "Calling the Console.clearMessages command should trigger Console.messagesCleared.",
+ test: (resolve, reject) => {
+ ConsoleAgent.clearMessages();
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.assert(false, "MessageAdded event should not fire.");
+ reject();
+ });
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => {
+ InspectorTest.expectThat(event, "Cleared event should fire.");
+ resolve();
+ });
+ }
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Test for the Console.clearMessages command.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsolemessageRepeatCountUpdatedexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated-expected.txt (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated-expected.txt         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated-expected.txt        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: different message
+CONSOLE MESSAGE: line 1: different message
+CONSOLE MESSAGE: line 1: test message
+CONSOLE MESSAGE: line 1: equal parameter values
+CONSOLE MESSAGE: line 1: equal parameter values
+CONSOLE MESSAGE: line 1: object
+CONSOLE MESSAGE: line 1: object
+CONSOLE MESSAGE: line 1: level
+CONSOLE MESSAGE: line 1: level
+Test for the Console.messageRepeatCountUpdated event.
+
+
+== Running test suite: Console.messageRepeatCountUpdated
+-- Running test case: AddTestMessage
+PASS: MessageAdded event should fire.
+PASS: ConsoleMessage repeatCount is 1.
+
+-- Running test case: RepeatTestMessage1
+PASS: PreviousMessageRepeatCountUpdated should fire.
+PASS: Count should be 2.
+
+-- Running test case: RepeatTestMessage2
+PASS: PreviousMessageRepeatCountUpdated should fire.
+PASS: Count should be 3.
+
+-- Running test case: RepeatTestMessage3
+PASS: PreviousMessageRepeatCountUpdated should fire.
+PASS: Count should be 4.
+
+-- Running test case: RepeatTestMessage4
+PASS: PreviousMessageRepeatCountUpdated should fire.
+PASS: Count should be 5.
+
+-- Running test case: RepeatTestMessage5
+PASS: PreviousMessageRepeatCountUpdated should fire.
+PASS: Count should be 6.
+
+-- Running test case: AddDifferentMessage
+PASS: MessageAdded event should fire.
+PASS: ConsoleMessage repeatCount is 1.
+
+-- Running test case: RepeatDifferentMessage
+PASS: PreviousMessageRepeatCountUpdated should fire.
+PASS: Count should be 2.
+
+-- Running test case: AddTestMessageAgain
+PASS: MessageAdded event should fire.
+PASS: ConsoleMessage repeatCount is 1.
+
+-- Running test case: MessagesWithEqualValuesRepeats
+PASS: PreviousMessageRepeatCountUpdated should fire for repeat messages with equal values.
+
+-- Running test case: MessagesWithObjectsDoNotRepeat
+PASS: MessageAdded event should fire.
+PASS: MessageAdded event should fire.
+
+-- Running test case: MessagesWithDifferentLevelsDoNotRepeat
+PASS: MessageAdded event should fire.
+PASS: MessageAdded event should fire.
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsolemessageRepeatCountUpdatedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated.html (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated.html         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/messageRepeatCountUpdated.html        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ const testMessage = "console.log('test message')";
+ const differentMessage = "console.log('different message')";
+
+ let suite = InspectorTest.createAsyncSuite("Console.messageRepeatCountUpdated");
+
+ suite.addTestCase({
+ name: "AddTestMessage",
+ description: "Add a new message, it should have a single repeat count.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage(testMessage);
+
+ let listener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.assert(false, "Should not fire PreviousMessageRepeatCountUpdated yet.");
+ reject();
+ });
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.expectThat(event.data.message instanceof WebInspector.ConsoleMessage, "MessageAdded event should fire.");
+ InspectorTest.expectThat(event.data.message.repeatCount === 1, "ConsoleMessage repeatCount is 1.");
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, listener, null);
+ resolve();
+ });
+ }
+ });
+
+ for (let i = 1; i <= 5; ++i) {
+ suite.addTestCase({
+ name: `RepeatTestMessage${i}`,
+ description: "Repeat the last message, it should trigger messageRepeatCountUpdated.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage(testMessage);
+
+ let listener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.assert(false, "Should not fire MessageAdded, this should be a repeat.");
+ reject();
+ });
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.expectThat(event, "PreviousMessageRepeatCountUpdated should fire.");
+ InspectorTest.expectThat(event.data.count === (i + 1), `Count should be ${i + 1}.`);
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.MessageAdded, listener, null);
+ resolve();
+ });
+ }
+ });
+ }
+
+ suite.addTestCase({
+ name: "AddDifferentMessage",
+ description: "Add a different message, it should reset the repeat count.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage(differentMessage);
+
+ let listener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.assert(false, "Should not fire PreviousMessageRepeatCountUpdated, this message is different.");
+ reject();
+ });
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.expectThat(event.data.message instanceof WebInspector.ConsoleMessage, "MessageAdded event should fire.");
+ InspectorTest.expectThat(event.data.message.repeatCount === 1, "ConsoleMessage repeatCount is 1.");
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, listener, null);
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "RepeatDifferentMessage",
+ description: "Repeat this different message, it should increment the repeat count.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage(differentMessage);
+
+ let listener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.assert(false, "Should not fire MessageAdded, this should be a repeat.");
+ reject();
+ });
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.expectThat(event, "PreviousMessageRepeatCountUpdated should fire.");
+ InspectorTest.expectThat(event.data.count === 2, "Count should be 2.");
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.MessageAdded, listener, null);
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "AddTestMessageAgain",
+ description: "Add the original message again, it should have a single repeat count.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage(testMessage);
+
+ let listener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.assert(false, "Should not fire PreviousMessageRepeatCountUpdated yet.");
+ reject();
+ });
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, (event) => {
+ InspectorTest.expectThat(event.data.message instanceof WebInspector.ConsoleMessage, "MessageAdded event should fire.");
+ InspectorTest.expectThat(event.data.message.repeatCount === 1, "ConsoleMessage repeatCount is 1.");
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, listener, null);
+ resolve();
+ });
+ }
+ });
+
+ // --------
+
+ suite.addTestCase({
+ name: "MessagesWithEqualValuesRepeats",
+ description: "Repeat messages with equal values should trigger messageRepeatCountUpdated.",
+ test: (resolve, reject) => {
+ const messageWithValues = "console.log('equal parameter values', 1, 2)";
+ InspectorTest.evaluateInPage(messageWithValues);
+ InspectorTest.evaluateInPage(messageWithValues);
+
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.expectThat(event, "PreviousMessageRepeatCountUpdated should fire for repeat messages with equal values.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "MessagesWithObjectsDoNotRepeat",
+ description: "Repeat messages with objects should not trigger messageRepeatCountUpdated.",
+ test: (resolve, reject) => {
+ const messageWithObject = "console.log('object', window)";
+ InspectorTest.evaluateInPage(messageWithObject);
+ InspectorTest.evaluateInPage(messageWithObject);
+
+ let repeatListener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.assert(false, "PreviousMessageRepeatCountUpdated should not fire for repeat messages with object arguments.");
+ reject();
+ });
+
+ let remaining = 2;
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function addListener(event) {
+ InspectorTest.expectThat(event.data.message instanceof WebInspector.ConsoleMessage, "MessageAdded event should fire.");
+ remaining--;
+ if (!remaining) {
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, repeatListener, null);
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.MessageAdded, addListener, null);
+ resolve();
+ }
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "MessagesWithDifferentLevelsDoNotRepeat",
+ description: "Repeat messages with different levels should not trigger messageRepeatCountUpdated.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage("console.warn('level')");
+ InspectorTest.evaluateInPage("console.error('level')");
+
+ let repeatListener = WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, (event) => {
+ InspectorTest.assert(false, "PreviousMessageRepeatCountUpdated should not fire for repeat messages with different levels.");
+ reject();
+ });
+
+ let remaining = 2;
+ WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function addListener(event) {
+ InspectorTest.expectThat(event.data.message instanceof WebInspector.ConsoleMessage, "MessageAdded event should fire.");
+ remaining--;
+ if (!remaining) {
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.PreviousMessageRepeatCountUpdated, repeatListener, null);
+ WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.MessageAdded, addListener, null);
+ resolve();
+ }
+ });
+ }
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Test for the Console.messageRepeatCountUpdated event.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsolemessagesClearedexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared-expected.txt (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared-expected.txt         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared-expected.txt        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test for the Console.messagesCleared event.
+
+
+== Running test suite: Console.messagesCleared
+-- Running test case: ClearViaConsoleClearMessagesAPI
+PASS: Cleared event should fire.
+
+-- Running test case: ClearViaConsoleAPI
+PASS: Cleared event should fire.
+
+-- Running test case: ClearViaCommandLineAPI
+PASS: Cleared event should fire.
+
+-- Running test case: ClearViaPageReload
+PASS: Cleared event should fire.
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsinspectorconsolemessagesClearedhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared.html (0 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared.html         (rev 0)
+++ branches/safari-601-branch/LayoutTests/inspector/console/messagesCleared.html        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ let suite = InspectorTest.createAsyncSuite("Console.messagesCleared");
+
+ suite.addTestCase({
+ name: "ClearViaConsoleClearMessagesAPI",
+ description: "Calling Console.clearMessages should trigger Console.messagesCleared.",
+ test: (resolve, reject) => {
+ ConsoleAgent.clearMessages();
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => {
+ InspectorTest.expectThat(event, "Cleared event should fire.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "ClearViaConsoleAPI",
+ description: "Calling console.clear() should trigger Console.messagesCleared.",
+ test: (resolve, reject) => {
+ InspectorTest.evaluateInPage("console.clear()");
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => {
+ InspectorTest.expectThat(event, "Cleared event should fire.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "ClearViaCommandLineAPI",
+ description: "Calling `clear()` in the command line API should trigger Console.messagesCleared.",
+ test: (resolve, reject) => {
+ const objectGroup = "test";
+ const includeCommandLineAPI = true;
+ const ignorePauseOnExceptionsAndMute = false;
+ const shouldReturnByValue = false;
+ const shouldGeneratePreview = false;
+ const shouldSaveResult = false;
+ WebInspector.runtimeManager.evaluateInInspectedWindow("clear()", objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, function(){});
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => {
+ InspectorTest.expectThat(event, "Cleared event should fire.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "ClearViaPageReload",
+ description: "Reloading the page should trigger Console.messagesCleared.",
+ test: (resolve, reject) => {
+ InspectorTest.reloadPage();
+ WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => {
+ InspectorTest.expectThat(event, "Cleared event should fire.");
+ resolve();
+ });
+ }
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Test for the Console.messagesCleared event.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/ChangeLog (193200 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2015-12-03 18:57:00 UTC (rev 193200)
+++ branches/safari-601-branch/Source/JavaScriptCore/ChangeLog        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2015-12-02 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r189373. rdar://problem/23221163
+
+ 2015-09-04 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Expand Console domain test coverage
+ https://bugs.webkit.org/show_bug.cgi?id=148740
+
+ Reviewed by Brian Burg.
+
+ * inspector/protocol/Console.json:
+ Update the description of this command now that it only
+ manipulates $0, and not $1, $2, .. $n.
+
+2015-12-02 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r189104. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-08-28 Joseph Pecoraro <pecoraro@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceJavaScriptCoreinspectorprotocolConsolejson"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Console.json (193200 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Console.json        2015-12-03 18:57:00 UTC (rev 193200)
+++ branches/safari-601-branch/Source/JavaScriptCore/inspector/protocol/Console.json        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -61,9 +61,9 @@
</span><span class="cx"> {
</span><span class="cx"> "name": "addInspectedNode",
</span><span class="cx"> "parameters": [
</span><del>- { "name": "nodeId", "$ref": "DOM.NodeId", "description": "DOM node id to be accessible by means of $x command line API." }
</del><ins>+ { "name": "nodeId", "$ref": "DOM.NodeId", "description": "DOM node id to be accessible by means of $0 command line API." }
</ins><span class="cx"> ],
</span><del>- "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
</del><ins>+ "description": "Enables console to refer to the node with given id via $0 (see Command Line API for more details)."
</ins><span class="cx"> }
</span><span class="cx"> ],
</span><span class="cx"> "events": [
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/ChangeLog (193200 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:57:00 UTC (rev 193200)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2015-12-02 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r189373. rdar://problem/23221163
+
+ 2015-09-04 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Expand Console domain test coverage
+ https://bugs.webkit.org/show_bug.cgi?id=148740
+
+ Reviewed by Brian Burg.
+
+ * UserInterface/Protocol/RemoteObject.js:
+ Add a few helpers for checking the RemoteObject type.
+
+2015-12-02 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r189238. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-09-01 Matt Baker <mattbaker@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (193200 => 193201)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-12-03 18:57:00 UTC (rev 193200)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-12-03 18:57:10 UTC (rev 193201)
</span><span class="lines">@@ -345,6 +345,16 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ isUndefined()
+ {
+ return this._type === "undefined";
+ }
+
+ isNode()
+ {
+ return this._subtype === "node";
+ }
+
</ins><span class="cx"> isArray()
</span><span class="cx"> {
</span><span class="cx"> return this._subtype === "array";
</span></span></pre>
</div>
</div>
</body>
</html>