<!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>[188019] trunk/LayoutTests</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/188019">188019</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-05 21:36:04 -0700 (Wed, 05 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: rewrite protocol test for console messages from X-Frame-Options
https://bugs.webkit.org/show_bug.cgi?id=147714

Patch by Brian Burg &lt;bburg@apple.com&gt; on 2015-08-05
Reviewed by Joseph Pecoraro.

Rewrite deny-X-FrameOption.html to use AsyncTestSuite, and hopefully address
the flakiness of the test. It is now in the inspector-protocol/console/ directory.

Extract the addConsoleTestCase helper to a shared file. Clean up console test
helpers and use a less awkward namespace for these helpers.

* TestExpectations: Unskip the deleted test, the new test should be less flaky.
* inspector-protocol/console/console-message.html:
* inspector-protocol/console/css-source-locations.html:
* inspector-protocol/console/js-source-locations.html:
* inspector-protocol/console/x-frame-options-message-expected.txt: Added.
* inspector-protocol/console/x-frame-options-message.html: Added.
* inspector-protocol/debugger/setBreakpoint-actions.html:
* inspector-protocol/debugger/setBreakpoint-options-exception.html:
* inspector-protocol/page/deny-X-FrameOption-expected.txt: Removed.
* inspector-protocol/page/deny-X-FrameOption.html: Removed.
* inspector-protocol/resources/console-helper.js: Removed.
* inspector-protocol/resources/console-test.js: Added.
(InspectorTest.Console.sanitizeConsoleMessage):
(InspectorTest.Console.addTestCase):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolconsoleconsolemessagehtml">trunk/LayoutTests/inspector-protocol/console/console-message.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolconsolecsssourcelocationshtml">trunk/LayoutTests/inspector-protocol/console/css-source-locations.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolconsolejssourcelocationshtml">trunk/LayoutTests/inspector-protocol/console/js-source-locations.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggersetBreakpointactionshtml">trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-actions.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggersetBreakpointoptionsexceptionhtml">trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-options-exception.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorprotocolconsolexframeoptionsmessageexpectedtxt">trunk/LayoutTests/inspector-protocol/console/x-frame-options-message-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolconsolexframeoptionsmessagehtml">trunk/LayoutTests/inspector-protocol/console/x-frame-options-message.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolresourcesconsoletestjs">trunk/LayoutTests/inspector-protocol/resources/console-test.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorprotocolpagedenyXFrameOptionexpectedtxt">trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolpagedenyXFrameOptionhtml">trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocolresourcesconsolehelperjs">trunk/LayoutTests/inspector-protocol/resources/console-helper.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/ChangeLog        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-08-05  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: rewrite protocol test for console messages from X-Frame-Options
+        https://bugs.webkit.org/show_bug.cgi?id=147714
+
+        Reviewed by Joseph Pecoraro.
+
+        Rewrite deny-X-FrameOption.html to use AsyncTestSuite, and hopefully address
+        the flakiness of the test. It is now in the inspector-protocol/console/ directory.
+
+        Extract the addConsoleTestCase helper to a shared file. Clean up console test
+        helpers and use a less awkward namespace for these helpers.
+
+        * TestExpectations: Unskip the deleted test, the new test should be less flaky.
+        * inspector-protocol/console/console-message.html:
+        * inspector-protocol/console/css-source-locations.html:
+        * inspector-protocol/console/js-source-locations.html:
+        * inspector-protocol/console/x-frame-options-message-expected.txt: Added.
+        * inspector-protocol/console/x-frame-options-message.html: Added.
+        * inspector-protocol/debugger/setBreakpoint-actions.html:
+        * inspector-protocol/debugger/setBreakpoint-options-exception.html:
+        * inspector-protocol/page/deny-X-FrameOption-expected.txt: Removed.
+        * inspector-protocol/page/deny-X-FrameOption.html: Removed.
+        * inspector-protocol/resources/console-helper.js: Removed.
+        * inspector-protocol/resources/console-test.js: Added.
+        (InspectorTest.Console.sanitizeConsoleMessage):
+        (InspectorTest.Console.addTestCase):
+
</ins><span class="cx"> 2015-08-05  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [ES6] Class parser does not allow methods named set and get.
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/TestExpectations        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -93,7 +93,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/133761 inspector-protocol/debugger/breakpoint-action-detach.html [ Skip ]
</span><span class="cx"> webkit.org/b/129639 inspector-protocol/dom/dom-search-crash.html [ Skip ]
</span><del>-webkit.org/b/127414 inspector-protocol/page/deny-X-FrameOption.html [ Pass Failure ]
</del><span class="cx"> 
</span><span class="cx"> webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html [ Skip ]
</span><span class="cx"> webkit.org/b/147502 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolconsoleconsolemessagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/console/console-message.html (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/console/console-message.html        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/console/console-message.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -13,9 +13,11 @@
</span><span class="cx"> 
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><ins>+    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-test.js&quot;);
+
</ins><span class="cx">     var suite = new InspectorTest.AsyncTestSuite(&quot;Console.MessagesFromCommandLineAPI&quot;);
</span><span class="cx"> 
</span><del>-    addConsoleTestCase({
</del><ins>+    InspectorTest.Console.addTestCase(suite, {
</ins><span class="cx">         name: &quot;ConsoleLogString&quot;,
</span><span class="cx">         description: &quot;Test `console.log(\&quot;log\&quot;)`&quot;,
</span><span class="cx">         expression: 'console.log(&quot;log&quot;);',
</span><span class="lines">@@ -27,7 +29,7 @@
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    addConsoleTestCase({
</del><ins>+    InspectorTest.Console.addTestCase(suite, {
</ins><span class="cx">         name: &quot;ConsoleInfoString&quot;,
</span><span class="cx">         description: &quot;Test `console.info(\&quot;info\&quot;)`&quot;,
</span><span class="cx">         expression: 'console.info(&quot;info&quot;);',
</span><span class="lines">@@ -39,7 +41,7 @@
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    addConsoleTestCase({
</del><ins>+    InspectorTest.Console.addTestCase(suite, {
</ins><span class="cx">         name: &quot;ConsoleWarnString&quot;,
</span><span class="cx">         description: &quot;Test `console.warn(\&quot;warn\&quot;)`&quot;,
</span><span class="cx">         expression: 'console.warn(&quot;warn&quot;);',
</span><span class="lines">@@ -51,7 +53,7 @@
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    addConsoleTestCase({
</del><ins>+    InspectorTest.Console.addTestCase(suite, {
</ins><span class="cx">         name: &quot;ConsoleErrorString&quot;,
</span><span class="cx">         description: &quot;Test `console.error(\&quot;error\&quot;)`&quot;,
</span><span class="cx">         expression: 'console.error(&quot;error&quot;);',
</span><span class="lines">@@ -63,7 +65,7 @@
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    addConsoleTestCase({
</del><ins>+    InspectorTest.Console.addTestCase(suite, {
</ins><span class="cx">         name: &quot;ConsoleDebugString&quot;,
</span><span class="cx">         description: &quot;Test `console.debug(\&quot;debug\&quot;)`&quot;,
</span><span class="cx">         expression: 'console.debug(&quot;debug&quot;);',
</span><span class="lines">@@ -75,9 +77,6 @@
</span><span class="cx">         }
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    // Set up the console prior to running the test suite.
-    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-helper.js&quot;);
-
</del><span class="cx">     InspectorTest.awaitCommand({
</span><span class="cx">         method: &quot;Console.enable&quot;,
</span><span class="cx">         params: {}
</span><span class="lines">@@ -91,41 +90,6 @@
</span><span class="cx">         InspectorTest.log(&quot;Test failed with fatal error: &quot; + JSON.stringify(e));
</span><span class="cx">         InspectorTest.completeTest();
</span><span class="cx">     }
</span><del>-
-    function addConsoleTestCase(args) {
-        var {name, description, expression, expected} = args;
-        suite.addTestCase({
-            name,
-            description,
-            test: function(resolve, reject) {
-                InspectorTest.awaitEvent({
-                    event: &quot;Console.messageAdded&quot;,
-                })
-                .then(function(messageObject) {
-                    var consoleMessage = messageObject.params.message;
-                    var {source, level, text, parameters} = consoleMessage;
-                    InspectorTest.assert(source === expected.source, &quot;ConsoleMessage type should be '&quot; + expected.source + &quot;'.&quot;);
-                    InspectorTest.assert(level === expected.level, &quot;ConsoleMessage level should be '&quot; + expected.level + &quot;'.&quot;);
-                    InspectorTest.assert(text === expected.text, &quot;ConsoleMessage text should be '&quot; + expected.text + &quot;'.&quot;);
-
-                    InspectorTest.assert(parameters.length === expected.parameters.length, &quot;ConsoleMessage parameters.length === &quot; + expected.parameters.length);
-                    for (var i = 0; i &lt; parameters.length; ++i) {
-                        var expectedType = expected.parameters[i];
-                        InspectorTest.assert(parameters[i].type === expectedType, &quot;ConsoleMessage parameter &quot; + i + &quot; should have type '&quot; + expectedType + &quot;'.&quot;);
-                    }
-                    resolve();
-                })
-                .catch(reject);
-
-                // Cause a messageAdded event to be generated.
-                InspectorTest.log(&quot;Evaluating expression: &quot; + expression);
-                InspectorTest.sendCommand({
-                    method: &quot;Runtime.evaluate&quot;,
-                    params: {expression}
-                });
-            }
-        });
-    }
</del><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolconsolecsssourcelocationshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/console/css-source-locations.html (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/console/css-source-locations.html        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/console/css-source-locations.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-helper.js&quot;);
</del><ins>+    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-test.js&quot;);
</ins><span class="cx"> 
</span><span class="cx">     var consoleMessageCount = 0;
</span><span class="cx">     const expectedConsoleMessageCount = 7;
</span><span class="lines">@@ -24,8 +24,8 @@
</span><span class="cx">     InspectorTest.addEventListener({
</span><span class="cx">         event: &quot;Console.messageAdded&quot;,
</span><span class="cx">         listener: function(messageObject) {
</span><del>-            var simplifiedMessage = ConsoleHelper.simplifiedConsoleMessage(messageObject);
-            InspectorTest.log(JSON.stringify(simplifiedMessage));
</del><ins>+            var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
+            InspectorTest.log(JSON.stringify(message));
</ins><span class="cx"> 
</span><span class="cx">             if (++consoleMessageCount === expectedConsoleMessageCount)
</span><span class="cx">                 InspectorTest.completeTest();
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolconsolejssourcelocationshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/console/js-source-locations.html (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/console/js-source-locations.html        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/console/js-source-locations.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-helper.js&quot;);
</del><ins>+    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-test.js&quot;);
</ins><span class="cx"> 
</span><span class="cx">     var consoleMessageCount = 0;
</span><span class="cx">     const expectedConsoleMessageCount = 8;
</span><span class="lines">@@ -20,8 +20,8 @@
</span><span class="cx">     InspectorTest.addEventListener({
</span><span class="cx">         event: &quot;Console.messageAdded&quot;,
</span><span class="cx">         listener: function(messageObject) {
</span><del>-            var simplifiedMessage = ConsoleHelper.simplifiedConsoleMessage(messageObject);
-            InspectorTest.log(JSON.stringify(simplifiedMessage));
</del><ins>+            var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
+            InspectorTest.log(JSON.stringify(message));
</ins><span class="cx"> 
</span><span class="cx">             if (++consoleMessageCount === expectedConsoleMessageCount)
</span><span class="cx">                 InspectorTest.completeTest();
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolconsolexframeoptionsmessageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/console/x-frame-options-message-expected.txt (0 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/console/x-frame-options-message-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/console/x-frame-options-message-expected.txt        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 41: Refused to display 'x-frame-options-message.html' in a frame because it set 'X-Frame-Options' to 'deny'.
+
+
+== Running test suite: Console.XFrameOptionsMessages
+-- Running test case: XFrameOptionsDeny
+Evaluating expression: triggerXFrameOptionDeny();
+PASS: ConsoleMessage type should be 'security'.
+PASS: ConsoleMessage level should be 'error'.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolconsolexframeoptionsmessagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/console/x-frame-options-message.html (0 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/console/x-frame-options-message.html                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/console/x-frame-options-message.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector-protocol/resources/protocol-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-test.js&quot;);
+
+    let suite = new InspectorTest.AsyncTestSuite(&quot;Console.XFrameOptionsMessages&quot;);
+
+    InspectorTest.Console.addTestCase(suite, {
+        name: &quot;XFrameOptionsDeny&quot;,
+        description: &quot;Ensure that a console message is logged when enforcing an X-Frame-Options policy. In this case, setting X-Frame-Options: 'deny' means the iframe does not want to be embedded in the test page.&quot;,
+        expression: &quot;triggerXFrameOptionDeny();&quot;,
+        expected: {source: 'security', level: 'error'}
+    });
+
+    InspectorTest.awaitCommand({
+        method: &quot;Console.enable&quot;,
+        params: {}
+    })
+    .then(function() {
+        suite.runTestCasesAndFinish();
+    })
+    .catch(fatalError);
+
+    function fatalError(e) {
+        InspectorTest.log(&quot;Test failed with fatal error: &quot; + JSON.stringify(e));
+        InspectorTest.completeTest();
+    }
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+  &lt;iframe id=&quot;denied&quot;&gt;&lt;/iframe&gt;
+  &lt;script&gt;
+  function triggerXFrameOptionDeny()
+  {
+    let deniedFrame = document.getElementById('denied');
+    let deniedDocument = deniedFrame.contentWindow.document;
+    deniedDocument.write('&lt;meta http-equiv=&quot;X-Frame-Options&quot; content=&quot;deny&quot;/&gt;');
+  }
+  &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggersetBreakpointactionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-actions.html (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-actions.html        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-actions.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-helper.js&quot;);
</del><ins>+    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-test.js&quot;);
</ins><span class="cx">     InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/probe-helper.js&quot;);
</span><span class="cx"> 
</span><span class="cx">     InspectorTest.sendCommand(&quot;Console.enable&quot;, {});
</span><span class="lines">@@ -111,8 +111,8 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var simplifiedMessage = ConsoleHelper.simplifiedConsoleMessage(messageObject);
-        InspectorTest.log(&quot;PASS: Console Message: &quot; + JSON.stringify(simplifiedMessage));
</del><ins>+        var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
+        InspectorTest.log(&quot;PASS: Console Message: &quot; + JSON.stringify(message));
</ins><span class="cx"> 
</span><span class="cx">         ++logCount;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggersetBreakpointoptionsexceptionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-options-exception.html (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-options-exception.html        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/debugger/setBreakpoint-options-exception.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> function test()
</span><span class="cx"> {
</span><del>-    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-helper.js&quot;);
</del><ins>+    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-test.js&quot;);
</ins><span class="cx"> 
</span><span class="cx">     InspectorTest.sendCommand(&quot;Console.enable&quot;, {});
</span><span class="cx">     InspectorTest.sendCommand(&quot;Debugger.enable&quot;, {});
</span><span class="lines">@@ -45,8 +45,8 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorTest.eventHandler[&quot;Console.messageAdded&quot;] = function(messageObject)
</span><span class="cx">     {
</span><del>-        var simplifiedMessage = ConsoleHelper.simplifiedConsoleMessage(messageObject);
-        InspectorTest.log(&quot;PASS: Console Message: &quot; + JSON.stringify(simplifiedMessage));
</del><ins>+        var message = InspectorTest.Console.sanitizeConsoleMessage(messageObject);
+        InspectorTest.log(&quot;PASS: Console Message: &quot; + JSON.stringify(message));
</ins><span class="cx"> 
</span><span class="cx">         if (++logsSeen === expectedLogs)
</span><span class="cx">             InspectorTest.completeTest();
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolpagedenyXFrameOptionexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption-expected.txt (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption-expected.txt        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption-expected.txt        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -1,4 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 30: Refused to display 'deny-X-FrameOption.html' in a frame because it set 'X-Frame-Options' to 'deny'.
-
-deny-X-FrameOption.html:30:17
-
</del></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolpagedenyXFrameOptionhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption.html (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption.html        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/page/deny-X-FrameOption.html        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector-protocol/resources/protocol-test.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function test()
-{
-    InspectorTest.importScript(&quot;../../../../inspector-protocol/resources/console-helper.js&quot;);
-    InspectorTest.sendCommand(&quot;Console.enable&quot;, {});
-
-    InspectorTest.eventHandler[&quot;Console.messageAdded&quot;] = function(messageObject)
-    {
-        var simplifiedMessage = ConsoleHelper.simplifiedConsoleMessage(messageObject);
-        // FIXME The line and column values will be zeros until this fix:
-        // https://bugs.webkit.org/show_bug.cgi?id=125340
-        // After this probably we should update the expected.txt.
-        InspectorTest.log(simplifiedMessage.location);
-
-        InspectorTest.completeTest();
-    }
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;startTest()&quot;&gt;
-  &lt;iframe id=foo&gt;&lt;/iframe&gt;
-  &lt;script&gt;
-  function startTest()
-  {
-    var fooFrame = document.getElementById('foo');
-    var fooDoc = fooFrame.contentWindow.document;
-    fooDoc.write('&lt;meta http-equiv=&quot;X-Frame-Options&quot; content=&quot;deny&quot;/&gt;');
-    runTest();
-  }
-  &lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolresourcesconsolehelperjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector-protocol/resources/console-helper.js (188018 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/resources/console-helper.js        2015-08-06 04:01:00 UTC (rev 188018)
+++ trunk/LayoutTests/inspector-protocol/resources/console-helper.js        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-window.ConsoleHelper = {};
-
-ConsoleHelper.simplifiedConsoleMessage = function(messageObject)
-{
-    function basename(url)
-    {
-        return url.substring(url.lastIndexOf(&quot;/&quot;) + 1) || &quot;???&quot;;
-    }
-
-    var message = messageObject.params.message;
-    var obj = {
-        source: message.source,
-        level: message.level,
-        text: message.text,
-        location: basename(message.url) + &quot;:&quot; + message.line + &quot;:&quot; + message.column
-    };
-
-    if (message.parameters) {
-        var params = [];
-        for (var i = 0; i &lt; message.parameters.length; ++i) {
-            var param = message.parameters[i];
-            var o = {type: param.type};
-            if (param.subtype)
-                o.subtype = param.subtype;
-            params.push(o);
-        }
-        obj.parameters = params;
-    }
-
-    return obj;
-}
</del></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocolresourcesconsoletestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/resources/console-test.js (0 => 188019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/resources/console-test.js                                (rev 0)
+++ trunk/LayoutTests/inspector-protocol/resources/console-test.js        2015-08-06 04:36:04 UTC (rev 188019)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+InspectorTest.Console = {};
+
+InspectorTest.Console.sanitizeConsoleMessage = function(messageObject)
+{
+    function basename(url)
+    {
+        return url.substring(url.lastIndexOf(&quot;/&quot;) + 1) || &quot;???&quot;;
+    }
+
+    var message = messageObject.params.message;
+    var obj = {
+        source: message.source,
+        level: message.level,
+        text: message.text,
+        location: basename(message.url) + &quot;:&quot; + message.line + &quot;:&quot; + message.column
+    };
+
+    if (message.parameters) {
+        var params = [];
+        for (var i = 0; i &lt; message.parameters.length; ++i) {
+            var param = message.parameters[i];
+            var o = {type: param.type};
+            if (param.subtype)
+                o.subtype = param.subtype;
+            params.push(o);
+        }
+        obj.parameters = params;
+    }
+
+    return obj;
+}
+
+InspectorTest.Console.addTestCase = function(suite, args)
+{
+    if (!(suite instanceof InspectorTest.AsyncTestSuite))
+        throw new Error(&quot;Console test cases must be added to an async test suite.&quot;);
+
+    var {name, description, expression, expected} = args;
+    suite.addTestCase({
+        name,
+        description,
+        test: function(resolve, reject) {
+            InspectorTest.awaitEvent({
+                event: &quot;Console.messageAdded&quot;,
+            })
+            .then(function(messageObject) {
+                var consoleMessage = messageObject.params.message;
+                var {source, level, text, parameters} = consoleMessage;
+                InspectorTest.assert(source === expected.source, &quot;ConsoleMessage type should be '&quot; + expected.source + &quot;'.&quot;);
+                InspectorTest.assert(level === expected.level, &quot;ConsoleMessage level should be '&quot; + expected.level + &quot;'.&quot;);
+
+                if (expected.text)
+                    InspectorTest.assert(text === expected.text, &quot;ConsoleMessage text should be '&quot; + expected.text + &quot;'.&quot;);
+
+                if (expected.parameters) {
+                    InspectorTest.assert(parameters.length === expected.parameters.length, &quot;ConsoleMessage parameters.length === &quot; + expected.parameters.length);
+                    for (var i = 0; i &lt; parameters.length; ++i) {
+                        var expectedType = expected.parameters[i];
+                        InspectorTest.assert(parameters[i].type === expectedType, &quot;ConsoleMessage parameter &quot; + i + &quot; should have type '&quot; + expectedType + &quot;'.&quot;);
+                    }
+                }
+
+                resolve();
+            })
+            .catch(reject);
+
+            // Cause a messageAdded event to be generated.
+            InspectorTest.log(&quot;Evaluating expression: &quot; + expression);
+            InspectorTest.sendCommand({
+                method: &quot;Runtime.evaluate&quot;,
+                params: {expression}
+            });
+        }
+    });
+}
</ins></span></pre>
</div>
</div>

</body>
</html>