<!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>[189416] trunk</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/189416">189416</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-04 19:38:42 -0700 (Fri, 04 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Add tests for DOM highlight commands
https://bugs.webkit.org/show_bug.cgi?id=148786

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2015-09-04
Reviewed by Timothy Hatcher.

Source/WebCore:

Tests: inspector/dom/hideHighlight.html
       inspector/dom/highlightFrame.html
       inspector/dom/highlightNode.html
       inspector/dom/highlightQuad.html
       inspector/dom/highlightRect.html

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightNode):
(WebCore::InspectorDOMAgent::highlightFrame):
Include an error if a frame is not found.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::highlightQuad):
Should have been checking the usePageCoordinates state of the incoming
highlight configuration, not the one that will be replaced.

LayoutTests:

* inspector/dom/hideHighlight-expected.txt: Added.
* inspector/dom/hideHighlight.html: Added.
* inspector/dom/highlightFrame-expected.txt: Added.
* inspector/dom/highlightFrame.html: Added.
* inspector/dom/highlightNode-expected.txt: Added.
* inspector/dom/highlightNode.html: Added.
* inspector/dom/highlightQuad-expected.txt: Added.
* inspector/dom/highlightQuad.html: Added.
* inspector/dom/highlightRect-expected.txt: Added.
* inspector/dom/highlightRect.html: Added.
* inspector/dom/highlightSelector-expected.txt:
* inspector/dom/highlightSelector.html:
* inspector/dom/resources/highlight-iframe.html: Renamed from LayoutTests/inspector/dom/resources/highlightSelector-iframe.html.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightSelectorexpectedtxt">trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightSelectorhtml">trunk/LayoutTests/inspector/dom/highlightSelector.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordomhideHighlightexpectedtxt">trunk/LayoutTests/inspector/dom/hideHighlight-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhideHighlighthtml">trunk/LayoutTests/inspector/dom/hideHighlight.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightFrameexpectedtxt">trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightFramehtml">trunk/LayoutTests/inspector/dom/highlightFrame.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightNodeexpectedtxt">trunk/LayoutTests/inspector/dom/highlightNode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightNodehtml">trunk/LayoutTests/inspector/dom/highlightNode.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightQuadexpectedtxt">trunk/LayoutTests/inspector/dom/highlightQuad-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightQuadhtml">trunk/LayoutTests/inspector/dom/highlightQuad.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightRectexpectedtxt">trunk/LayoutTests/inspector/dom/highlightRect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomhighlightRecthtml">trunk/LayoutTests/inspector/dom/highlightRect.html</a></li>
<li><a href="#trunkLayoutTestsinspectordomresourceshighlightiframehtml">trunk/LayoutTests/inspector/dom/resources/highlight-iframe.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordomresourceshighlightSelectoriframehtml">trunk/LayoutTests/inspector/dom/resources/highlightSelector-iframe.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/LayoutTests/ChangeLog        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2015-09-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Add tests for DOM highlight commands
+        https://bugs.webkit.org/show_bug.cgi?id=148786
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/dom/hideHighlight-expected.txt: Added.
+        * inspector/dom/hideHighlight.html: Added.
+        * inspector/dom/highlightFrame-expected.txt: Added.
+        * inspector/dom/highlightFrame.html: Added.
+        * inspector/dom/highlightNode-expected.txt: Added.
+        * inspector/dom/highlightNode.html: Added.
+        * inspector/dom/highlightQuad-expected.txt: Added.
+        * inspector/dom/highlightQuad.html: Added.
+        * inspector/dom/highlightRect-expected.txt: Added.
+        * inspector/dom/highlightRect.html: Added.
+        * inspector/dom/highlightSelector-expected.txt:
+        * inspector/dom/highlightSelector.html:
+        * inspector/dom/resources/highlight-iframe.html: Renamed from LayoutTests/inspector/dom/resources/highlightSelector-iframe.html.
+
+2015-09-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Test Runtime.saveResult and $n values
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=148837
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomhideHighlightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/hideHighlight-expected.txt (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/hideHighlight-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/hideHighlight-expected.txt        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+Tests for the DOM.hideHighlight command.
+
+
+== Running test suite: DOM.hideHighlight
+-- Running test case: CheckEmptyHighlight
+PASS: Should not be a highlight yet.
+
+-- Running test case: HighlightRect
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:100,&quot;bottom&quot;:100,&quot;left&quot;:0,&quot;width&quot;:100,&quot;height&quot;:100}
+
+-- Running test case: HideHighlight
+PASS: Should be no highlight.
+
+-- Running test case: HighlightQuad
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:100,&quot;right&quot;:150,&quot;bottom&quot;:200,&quot;left&quot;:50,&quot;width&quot;:100,&quot;height&quot;:100}
+
+-- Running test case: HideHighlight
+PASS: Should be no highlight.
+
+-- Running test case: HighlightNode
+PASS: Should be one highlighted node.
+Highlighted Element Data: {&quot;tagName&quot;:&quot;p&quot;,&quot;idValue&quot;:&quot;target&quot;,&quot;size&quot;:{&quot;width&quot;:500,&quot;height&quot;:100},&quot;role&quot;:&quot;&quot;}
+
+-- Running test case: HideHighlight
+PASS: Should be no highlight.
+
+-- Running test case: HideHighlight
+PASS: Should be no highlight.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhideHighlighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/hideHighlight.html (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/hideHighlight.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/hideHighlight.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,130 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    const color = undefined;
+    const outlineColor = undefined;
+
+    function getHighlightRects(callback) {
+        InspectorTest.evaluateInPage(&quot;JSON.stringify(Array.from(window.internals.inspectorHighlightRects()))&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
+    }
+
+    function dumpHighlightRects(callback) {
+        getHighlightRects((highlightRects) =&gt; {
+            InspectorTest.expectThat(highlightRects.length === 1, &quot;Should be one highlight rect.&quot;);
+            InspectorTest.log(&quot;Highlight Rect: &quot; + JSON.stringify(highlightRects[0]));
+            callback();
+        });
+    }
+
+    function getHighlight(callback) {
+        InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
+    }
+
+    function dumpHighlight(callback) {
+        getHighlight((highlightObjectPayload) =&gt; {
+            InspectorTest.expectThat(highlightObjectPayload.length === 1, &quot;Should be one highlighted node.&quot;);
+            InspectorTest.log(&quot;Highlighted Element Data: &quot; + JSON.stringify(highlightObjectPayload[0].elementData));
+            callback();
+        });
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.hideHighlight&quot;);
+
+    function addHideHighlightTestCase() {
+        suite.addTestCase({
+            name: &quot;HideHighlight&quot;,
+            description: &quot;Calling hideHighlight should hide the highlight.&quot;,
+            test: (resolve, reject) =&gt; {
+                DOMAgent.hideHighlight(() =&gt; {
+                    getHighlightRects((highlightRects) =&gt; {
+                        InspectorTest.expectThat(highlightRects.length === 0, &quot;Should be no highlight.&quot;);
+                        resolve();
+                    });
+                });
+            }
+        });
+    }
+
+    suite.addTestCase({
+        name: &quot;CheckEmptyHighlight&quot;,
+        description: &quot;Should not be a highlight yet.&quot;,
+        test: (resolve, reject) =&gt; {
+            getHighlightRects((highlightRects) =&gt; {
+                InspectorTest.expectThat(highlightRects.length === 0, &quot;Should not be a highlight yet.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightRect&quot;,
+        description: &quot;Call highlightRect to create a highlight.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 100, 100);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    addHideHighlightTestCase();
+
+    suite.addTestCase({
+        name: &quot;HighlightQuad&quot;,
+        description: &quot;Call highlightQuad to create a highlight.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([100, 100, 150, 150, 100, 200, 50, 150]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    addHideHighlightTestCase();
+
+    suite.addTestCase({
+        name: &quot;HighlightNode&quot;,
+        description: &quot;Call highlightNode to create a highlight.&quot;,
+        test: (resolve, reject) =&gt; {
+            const highlightConfig = {
+                showInfo: true,
+                contentColor: {r: 255, g: 255, b: 255},
+                paddingColor: {r: 255, g: 255, b: 255},
+                borderColor: {r: 255, g: 255, b: 255},
+                marginColor: {r: 255, g: 255, b: 255},
+            };
+
+            WebInspector.domTreeManager.requestDocument((documentNode) =&gt; {
+                WebInspector.domTreeManager.querySelector(documentNode.id, &quot;#target&quot;, (nodeId) =&gt; {
+                    DOMAgent.highlightNode(highlightConfig, nodeId, (error) =&gt; {
+                        InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                        dumpHighlight(resolve);
+                    });
+                });
+            });
+        }
+    });
+
+    addHideHighlightTestCase();
+    addHideHighlightTestCase(); // Test that a duplicate hideHighlight is not problematic.
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p id=&quot;target&quot; style=&quot;width:500px; height:100px&quot;&gt;Tests for the DOM.hideHighlight command.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightFrameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightFrame-expected.txt        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Tests for the DOM.highlightFrame command.
+
+  
+
+== Running test suite: DOM.highlightFrame
+-- Running test case: CheckEmptyHighlight
+PASS: Should not be a highlight yet.
+
+-- Running test case: HighlightMainFrame
+PASS: Should not be a highlight for the main frame.
+
+-- Running test case: HighlightChildFrame1
+Highlight Object: [{&quot;scrollOffset&quot;:{&quot;x&quot;:0,&quot;y&quot;:0},&quot;fragments&quot;:[{&quot;quads&quot;:[[{&quot;x&quot;:8,&quot;y&quot;:50},{&quot;x&quot;:312,&quot;y&quot;:50},{&quot;x&quot;:312,&quot;y&quot;:204},{&quot;x&quot;:8,&quot;y&quot;:204}],[{&quot;x&quot;:8,&quot;y&quot;:50},{&quot;x&quot;:312,&quot;y&quot;:50},{&quot;x&quot;:312,&quot;y&quot;:204},{&quot;x&quot;:8,&quot;y&quot;:204}],[{&quot;x&quot;:10,&quot;y&quot;:52},{&quot;x&quot;:310,&quot;y&quot;:52},{&quot;x&quot;:310,&quot;y&quot;:202},{&quot;x&quot;:10,&quot;y&quot;:202}],[{&quot;x&quot;:10,&quot;y&quot;:52},{&quot;x&quot;:310,&quot;y&quot;:52},{&quot;x&quot;:310,&quot;y&quot;:202},{&quot;x&quot;:10,&quot;y&quot;:202}]],&quot;contentColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;contentOutlineColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;paddingColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;borderColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;marginColor&quot;:&quot;rgba(0, 0, 0, 0)&q
 uot;}],&quot;elementData&quot;:{&quot;tagName&quot;:&quot;iframe&quot;,&quot;idValue&quot;:&quot;frame-1&quot;,&quot;size&quot;:{&quot;width&quot;:304,&quot;height&quot;:154},&quot;role&quot;:&quot;group&quot;}}]
+
+-- Running test case: HighlightChildFrame2
+Highlight Object: [{&quot;scrollOffset&quot;:{&quot;x&quot;:0,&quot;y&quot;:0},&quot;fragments&quot;:[{&quot;quads&quot;:[[{&quot;x&quot;:316,&quot;y&quot;:50},{&quot;x&quot;:620,&quot;y&quot;:50},{&quot;x&quot;:620,&quot;y&quot;:204},{&quot;x&quot;:316,&quot;y&quot;:204}],[{&quot;x&quot;:316,&quot;y&quot;:50},{&quot;x&quot;:620,&quot;y&quot;:50},{&quot;x&quot;:620,&quot;y&quot;:204},{&quot;x&quot;:316,&quot;y&quot;:204}],[{&quot;x&quot;:318,&quot;y&quot;:52},{&quot;x&quot;:618,&quot;y&quot;:52},{&quot;x&quot;:618,&quot;y&quot;:202},{&quot;x&quot;:318,&quot;y&quot;:202}],[{&quot;x&quot;:318,&quot;y&quot;:52},{&quot;x&quot;:618,&quot;y&quot;:52},{&quot;x&quot;:618,&quot;y&quot;:202},{&quot;x&quot;:318,&quot;y&quot;:202}]],&quot;contentColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;contentOutlineColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;paddingColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;borderColor&quot;:&quot;rgba(0, 0, 0, 0)&quot;,&quot;marginColor&quot;:&quot;rgba(0
 , 0, 0, 0)&quot;}],&quot;elementData&quot;:{&quot;tagName&quot;:&quot;iframe&quot;,&quot;idValue&quot;:&quot;frame-2&quot;,&quot;size&quot;:{&quot;width&quot;:304,&quot;height&quot;:154},&quot;role&quot;:&quot;group&quot;}}]
+
+-- Running test case: BadFrameId
+PASS: Should produce an error.
+Error: No frame for given id found
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightFramehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightFrame.html (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightFrame.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightFrame.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 2, &quot;Page should have subframes.&quot;);
+    const mainFrame = WebInspector.frameResourceManager.mainFrame;
+    const childFrame1 = WebInspector.frameResourceManager.mainFrame.childFrames[0];
+    const childFrame2 = WebInspector.frameResourceManager.mainFrame.childFrames[1];
+
+    function getHighlight(callback) {
+        InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
+    }
+
+    function dumpHighlight(callback) {
+        getHighlight((highlightObjectPayload) =&gt; {
+            InspectorTest.log(&quot;Highlight Object: &quot; + JSON.stringify(highlightObjectPayload));
+            callback();
+        });
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightFrame&quot;);
+
+    suite.addTestCase({
+        name: &quot;CheckEmptyHighlight&quot;,
+        description: &quot;Should not be a highlight yet.&quot;,
+        test: (resolve, reject) =&gt; {
+            getHighlight((highlightObjectPayload) =&gt; {
+                InspectorTest.expectThat(highlightObjectPayload.length === 0, &quot;Should not be a highlight yet.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightMainFrame&quot;,
+        description: &quot;Main frame does not have an owner element, so there will be no highlight.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightFrame(mainFrame.id, undefined, undefined, (error) =&gt; {
+                getHighlight((highlightObjectPayload) =&gt; {
+                    InspectorTest.expectThat(highlightObjectPayload.length === 0, &quot;Should not be a highlight for the main frame.&quot;);
+                    resolve();
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightChildFrame1&quot;,
+        description: &quot;Should highlight child frame 1.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightFrame(childFrame1.id, undefined, undefined, (error) =&gt; {
+                InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                dumpHighlight(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightChildFrame2&quot;,
+        description: &quot;Should highlight child frame 2.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightFrame(childFrame2.id, undefined, undefined, (error) =&gt; {
+                InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                dumpHighlight(resolve);
+            });
+        }
+    });
+
+    // ------
+
+    suite.addTestCase({
+        name: &quot;BadFrameId&quot;,
+        description: &quot;Bad frame id should cause an error.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightFrame(&quot;bad-frame-id&quot;, undefined, undefined, (error) =&gt; {
+                InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
+                InspectorTest.log(&quot;Error: &quot; + error);
+                resolve();
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Tests for the DOM.highlightFrame command.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;iframe id=&quot;frame-1&quot; src=&quot;resources/highlight-iframe.html&quot;&gt;&lt;/iframe&gt;
+        &lt;iframe id=&quot;frame-2&quot; src=&quot;resources/highlight-iframe.html&quot;&gt;&lt;/iframe&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightNodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightNode-expected.txt (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightNode-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightNode-expected.txt        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+Tests for the DOM.highlightNode command.
+
+
+
+== Running test suite: DOM.highlightNode
+-- Running test case: CheckEmptyHighlight
+PASS: Should not be a highlight yet.
+
+-- Running test case: MainFrameNodeViaNodeId
+PASS: Should be one highlighted node.
+Highlighted Element Data: {&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;className&quot;:&quot;.class-two&quot;,&quot;size&quot;:{&quot;width&quot;:100,&quot;height&quot;:200},&quot;role&quot;:&quot;&quot;}
+
+-- Running test case: ChildFrameNodeViaNodeId
+PASS: Should be one highlighted node.
+Highlighted Element Data: {&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;size&quot;:{&quot;width&quot;:150,&quot;height&quot;:250},&quot;role&quot;:&quot;&quot;}
+
+-- Running test case: MainFrameNodeViaObjectId
+PASS: Should be one highlighted node.
+Highlighted Element Data: {&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;className&quot;:&quot;.class-two&quot;,&quot;size&quot;:{&quot;width&quot;:100,&quot;height&quot;:200},&quot;role&quot;:&quot;&quot;}
+
+-- Running test case: ChildFrameNodeViaObjectId
+PASS: Should be one highlighted node.
+Highlighted Element Data: {&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;size&quot;:{&quot;width&quot;:150,&quot;height&quot;:250},&quot;role&quot;:&quot;&quot;}
+
+-- Running test case: MissingNodeAndObjectIdShouldError
+PASS: Should produce an error.
+Error: Either nodeId or objectId must be specified
+
+-- Running test case: BadNodeId
+PASS: Should produce an error.
+Error: Could not find node with given id
+
+-- Running test case: BadObjectId
+PASS: Should produce an error.
+Error: Node for given objectId not found
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightNodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightNode.html (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightNode.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightNode.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,166 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, &quot;Page should have a subframe.&quot;);
+    const mainFrame = WebInspector.frameResourceManager.mainFrame;
+    const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0];
+    const highlightConfig = {
+        showInfo: true,
+        contentColor: {r: 255, g: 255, b: 255},
+        paddingColor: {r: 255, g: 255, b: 255},
+        borderColor: {r: 255, g: 255, b: 255},
+        marginColor: {r: 255, g: 255, b: 255},
+    };
+
+    function getHighlight(callback) {
+        InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
+    }
+
+    function dumpHighlight(callback) {
+        getHighlight((highlightObjectPayload) =&gt; {
+            InspectorTest.expectThat(highlightObjectPayload.length === 1, &quot;Should be one highlighted node.&quot;);
+            InspectorTest.log(&quot;Highlighted Element Data: &quot; + JSON.stringify(highlightObjectPayload[0].elementData));
+            callback();
+        });
+    }
+
+
+    let mainFrameDocumentNodeId, mainFrameTargetNode;
+    let childFrameDocumentNodeId, childFrameTargetNode;
+
+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightNode&quot;);
+
+    suite.addTestCase({
+        name: &quot;CheckEmptyHighlight&quot;,
+        description: &quot;Should not be a highlight yet.&quot;,
+        test: (resolve, reject) =&gt; {
+            getHighlight((highlightObjectPayload) =&gt; {
+                InspectorTest.expectThat(highlightObjectPayload.length === 0, &quot;Should not be a highlight yet.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;MainFrameNodeViaNodeId&quot;,
+        description: &quot;Should highlight a node in the main frame using node id.&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.domTreeManager.querySelector(mainFrameDocumentNodeId, &quot;#id-one&quot;, function(nodeId) {
+                mainFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId);
+                DOMAgent.highlightNode(highlightConfig, mainFrameTargetNode.id, undefined, (error) =&gt; {
+                    InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                    dumpHighlight(resolve);
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ChildFrameNodeViaNodeId&quot;,
+        description: &quot;Should highlight a node in the child frame using node id.&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.domTreeManager.querySelector(childFrameDocumentNodeId, &quot;#id-one&quot;, function(nodeId) {
+                childFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId);
+                DOMAgent.highlightNode(highlightConfig, childFrameTargetNode.id, undefined, (error) =&gt; {
+                    InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                    dumpHighlight(resolve);
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;MainFrameNodeViaObjectId&quot;,
+        description: &quot;Should highlight a node in the main frame using object id.&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.RemoteObject.resolveNode(mainFrameTargetNode, &quot;test&quot;, (remoteObject) =&gt; {
+                DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) =&gt; {
+                    InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                    dumpHighlight(resolve);
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ChildFrameNodeViaObjectId&quot;,
+        description: &quot;Should highlight a node in the child frame using object id.&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.RemoteObject.resolveNode(childFrameTargetNode, &quot;test&quot;, (remoteObject) =&gt; {
+                DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) =&gt; {
+                    InspectorTest.assert(!error, &quot;Should not have an error.&quot;);
+                    dumpHighlight(resolve);
+                });
+            });
+        }
+    });
+
+    // ------
+
+    suite.addTestCase({
+        name: &quot;MissingNodeAndObjectIdShouldError&quot;,
+        description: &quot;Missing identifiers should cause an error.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightNode(highlightConfig, undefined, undefined, (error) =&gt; {
+                InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
+                InspectorTest.log(&quot;Error: &quot; + error);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;BadNodeId&quot;,
+        description: &quot;Bad node id should cause an error.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightNode(highlightConfig, 9999999, undefined, (error) =&gt; {
+                InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
+                InspectorTest.log(&quot;Error: &quot; + error);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;BadObjectId&quot;,
+        description: &quot;Bad object id should cause an error.&quot;,
+        test: (resolve, reject) =&gt; {
+            DOMAgent.highlightNode(highlightConfig, undefined, &quot;bad-object-id&quot;, (error) =&gt; {
+                InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
+                InspectorTest.log(&quot;Error: &quot; + error);
+                resolve();
+            });
+        }
+    });
+
+    WebInspector.domTreeManager.requestDocument((documentNode) =&gt; {
+        mainFrameDocumentNodeId = documentNode.id;
+        RuntimeAgent.evaluate.invoke({expression: &quot;document&quot;, objectGroup: &quot;test&quot;, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload) =&gt; {
+            let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload)
+            remoteObject.pushNodeToFrontend((documentNodeId) =&gt; {
+                childFrameDocumentNodeId = documentNodeId
+
+                suite.runTestCasesAndFinish();
+            });
+        })
+    });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Tests for the DOM.highlightNode command.&lt;/p&gt;
+    &lt;div style=&quot;width: 500px; height: 500px&quot;&gt;
+        &lt;div class=&quot;class-one&quot; style=&quot;width: 10px; height: 20px&quot;&gt;&lt;/div&gt;
+        &lt;div id=&quot;id-one&quot; class=&quot;class-two&quot; style=&quot;width:100px; height: 200px&quot;&gt;&lt;/div&gt;
+        &lt;iframe class=&quot;class-one&quot; src=&quot;resources/highlight-iframe.html&quot;&gt;&lt;/iframe&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightQuadexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightQuad-expected.txt (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightQuad-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightQuad-expected.txt        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+Tests for the DOM.highlightQuad command.
+
+
+== Running test suite: DOM.highlightQuad
+-- Running test case: CheckEmptyHighlight
+PASS: Should not be a highlight yet.
+
+-- Running test case: HighlightSmallRectWithQuad
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:100,&quot;bottom&quot;:100,&quot;left&quot;:0,&quot;width&quot;:100,&quot;height&quot;:100}
+
+-- Running test case: HighlightSmallQuadViewportCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:100,&quot;right&quot;:150,&quot;bottom&quot;:200,&quot;left&quot;:50,&quot;width&quot;:100,&quot;height&quot;:100}
+
+-- Running test case: HighlightSmallQuadPageCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:90,&quot;right&quot;:140,&quot;bottom&quot;:190,&quot;left&quot;:40,&quot;width&quot;:100,&quot;height&quot;:100}
+
+-- Running test case: HighlightSmallUnspecifiedCoordinatesUsesViewportCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:100,&quot;right&quot;:150,&quot;bottom&quot;:200,&quot;left&quot;:50,&quot;width&quot;:100,&quot;height&quot;:100}
+
+-- Running test case: HighlightLargeQuadViewportCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:1000,&quot;bottom&quot;:2000,&quot;left&quot;:0,&quot;width&quot;:1000,&quot;height&quot;:2000}
+
+-- Running test case: HighlightLargeQuadPageCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:-10,&quot;right&quot;:990,&quot;bottom&quot;:1990,&quot;left&quot;:-10,&quot;width&quot;:1000,&quot;height&quot;:2000}
+
+-- Running test case: BadQuadShouldError
+PASS: Should produce an error.
+Error: Invalid Quad format
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightQuadhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightQuad.html (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightQuad.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightQuad.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    const color = undefined;
+    const outlineColor = undefined;
+    const useViewportCoordinates = false;
+    const usePageCoordinates = true;
+
+    function getHighlightRects(callback) {
+        InspectorTest.evaluateInPage(&quot;JSON.stringify(Array.from(window.internals.inspectorHighlightRects()))&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
+    }
+
+    function dumpHighlightRects(callback) {
+        getHighlightRects((highlightRects) =&gt; {
+            InspectorTest.expectThat(highlightRects.length === 1, &quot;Should be one highlight rect.&quot;);
+            InspectorTest.log(&quot;Highlight Rect: &quot; + JSON.stringify(highlightRects[0]));
+            callback();
+        });
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightQuad&quot;);
+
+    suite.addTestCase({
+        name: &quot;CheckEmptyHighlight&quot;,
+        description: &quot;Should not be a highlight yet.&quot;,
+        test: (resolve, reject) =&gt; {
+            getHighlightRects((highlightRects) =&gt; {
+                InspectorTest.expectThat(highlightRects.length === 0, &quot;Should not be a highlight yet.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallRectWithQuad&quot;,
+        description: &quot;Should create a highlight using viewport coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([0, 0, 100, 0, 100, 100, 100, 0]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallQuadViewportCoordinates&quot;,
+        description: &quot;Should create a highlight using viewport coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([100, 100, 150, 150, 100, 200, 50, 150]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, useViewportCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallQuadPageCoordinates&quot;,
+        description: &quot;Should create a highlight using page coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([100, 100, 150, 150, 100, 200, 50, 150]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, usePageCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallUnspecifiedCoordinatesUsesViewportCoordinates&quot;,
+        description: &quot;Should create a highlight using page coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([100, 100, 150, 150, 100, 200, 50, 150]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightLargeQuadViewportCoordinates&quot;,
+        description: &quot;Should create a highlight using viewport coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([0, 0, 500, 0, 1000, 1000, 0, 2000]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, useViewportCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightLargeQuadPageCoordinates&quot;,
+        description: &quot;Should create a highlight using viewport coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let quad = new WebInspector.Quad([0, 0, 500, 0, 1000, 1000, 0, 2000]);
+            DOMAgent.highlightQuad(quad.toProtocol(), color, outlineColor, usePageCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    // ------
+
+    suite.addTestCase({
+        name: &quot;BadQuadShouldError&quot;,
+        description: &quot;Should get an error when specifying a quad with too few points.&quot;,
+        test: (resolve, reject) =&gt; {
+            let badQuadArray = [1, 2, 3, 4];
+            DOMAgent.highlightQuad(badQuadArray, color, outlineColor, usePageCoordinates, (error) =&gt; {
+                InspectorTest.expectThat(error, &quot;Should produce an error.&quot;);
+                InspectorTest.log(&quot;Error: &quot; + error);
+                resolve();
+            });
+        }
+    });
+
+    InspectorTest.evaluateInPage(&quot;window.scrollTo(10, 10)&quot;, () =&gt; {
+        suite.runTestCasesAndFinish();
+    });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Tests for the DOM.highlightQuad command.&lt;/p&gt;
+    &lt;!-- Ensure the page is scrollable so we can test highlight rects relative to a scroll page --&gt;
+    &lt;div style=&quot;height:2000px; width: 2000px; background:blue&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightRectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightRect-expected.txt (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightRect-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightRect-expected.txt        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+Tests for the DOM.highlightRect command.
+
+
+== Running test suite: DOM.highlightRect
+-- Running test case: CheckEmptyHighlight
+PASS: Should not be a highlight yet.
+
+-- Running test case: HighlightSmallRectViewportCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:100,&quot;bottom&quot;:200,&quot;left&quot;:0,&quot;width&quot;:100,&quot;height&quot;:200}
+
+-- Running test case: HighlightSmallRectPageCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:-10,&quot;right&quot;:90,&quot;bottom&quot;:190,&quot;left&quot;:-10,&quot;width&quot;:100,&quot;height&quot;:200}
+
+-- Running test case: HighlightSmallRectUnspecifiedCoordinatesUsesViewportCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:100,&quot;bottom&quot;:200,&quot;left&quot;:0,&quot;width&quot;:100,&quot;height&quot;:200}
+
+-- Running test case: HighlightLargeRectViewportCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:100000,&quot;bottom&quot;:200000,&quot;left&quot;:0,&quot;width&quot;:100000,&quot;height&quot;:200000}
+
+-- Running test case: HighlightLargeRectPageCoordinates
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:-10,&quot;right&quot;:99990,&quot;bottom&quot;:199990,&quot;left&quot;:-10,&quot;width&quot;:100000,&quot;height&quot;:200000}
+
+-- Running test case: HighlightEmptyRect
+PASS: Should be one highlight rect.
+Highlight Rect: {&quot;top&quot;:0,&quot;right&quot;:0,&quot;bottom&quot;:0,&quot;left&quot;:0,&quot;width&quot;:0,&quot;height&quot;:0}
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightRecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/highlightRect.html (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightRect.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/highlightRect.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    const color = undefined;
+    const outlineColor = undefined;
+    const useViewportCoordinates = false;
+    const usePageCoordinates = true;
+
+    function getHighlightRects(callback) {
+        InspectorTest.evaluateInPage(&quot;JSON.stringify(Array.from(window.internals.inspectorHighlightRects()))&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
+    }
+
+    function dumpHighlightRects(callback) {
+        getHighlightRects((highlightRects) =&gt; {
+            InspectorTest.expectThat(highlightRects.length === 1, &quot;Should be one highlight rect.&quot;);
+            InspectorTest.log(&quot;Highlight Rect: &quot; + JSON.stringify(highlightRects[0]));
+            callback();
+        });
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightRect&quot;);
+
+    suite.addTestCase({
+        name: &quot;CheckEmptyHighlight&quot;,
+        description: &quot;Should not be a highlight yet.&quot;,
+        test: (resolve, reject) =&gt; {
+            getHighlightRects((highlightRects) =&gt; {
+                InspectorTest.expectThat(highlightRects.length === 0, &quot;Should not be a highlight yet.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallRectViewportCoordinates&quot;,
+        description: &quot;Should create a highlight using viewport coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 100, 200);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, useViewportCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallRectPageCoordinates&quot;,
+        description: &quot;Should create a highlight using page coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 100, 200);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, usePageCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightSmallRectUnspecifiedCoordinatesUsesViewportCoordinates&quot;,
+        description: &quot;Should create a highlight using viewport coordinates if unspecificed.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 100, 200);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightLargeRectViewportCoordinates&quot;,
+        description: &quot;Should create a large highlight using viewport coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 100000, 200000);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, useViewportCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightLargeRectPageCoordinates&quot;,
+        description: &quot;Should create a large highlight using page coordinates.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 100000, 200000);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, usePageCoordinates, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;HighlightEmptyRect&quot;,
+        description: &quot;Should create an empty highlight.&quot;,
+        test: (resolve, reject) =&gt; {
+            let rect = new WebInspector.Rect(0, 0, 0, 0);
+            DOMAgent.highlightRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, outlineColor, false, (error) =&gt; {
+                dumpHighlightRects(resolve);
+            });
+        }
+    });
+
+    InspectorTest.evaluateInPage(&quot;window.scrollTo(10, 10)&quot;, () =&gt; {
+        suite.runTestCasesAndFinish();
+    });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Tests for the DOM.highlightRect command.&lt;/p&gt;
+    &lt;!-- Ensure the page is scrollable so we can test highlight rects relative to a scroll page --&gt;
+    &lt;div style=&quot;height:2000px; width: 2000px; background:blue&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightSelectorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/LayoutTests/inspector/dom/highlightSelector-expected.txt        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -1,1350 +1,75 @@
</span><ins>+Tests for the DOM.highlightSelector command.
</ins><span class="cx"> 
</span><del>-SELECTOR: div
-FRAMEID: &lt;main-frame-id&gt;
-FOUND: 3
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 784,
-        &quot;height&quot;: 154
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  },
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;className&quot;: &quot;.class-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 784,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  },
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 792,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;id-one&quot;,
-      &quot;className&quot;: &quot;.class-two&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 784,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  }
-]
</del><span class="cx"> 
</span><span class="cx"> 
</span><del>-SELECTOR: .class-one
-FRAMEID: &lt;main-frame-id&gt;
-FOUND: 2
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;className&quot;: &quot;.class-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 769,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  },
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 160
-            },
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 160
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 160
-            },
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 160
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;iframe&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;className&quot;: &quot;.class-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 304,
-        &quot;height&quot;: 154
-      },
-      &quot;role&quot;: &quot;group&quot;
-    }
-  }
-]
</del><ins>+== Running test suite: DOM.highlightSelector
+-- Running test case: MainFrameTagSelector
+- Frame: &lt;main-frame&gt;
+- Selector: div
+PASS: Should highlight 3 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;size&quot;:{&quot;width&quot;:500,&quot;height&quot;:500},&quot;role&quot;:&quot;&quot;}
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;className&quot;:&quot;.class-one&quot;,&quot;size&quot;:{&quot;width&quot;:10,&quot;height&quot;:20},&quot;role&quot;:&quot;&quot;}
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;className&quot;:&quot;.class-two&quot;,&quot;size&quot;:{&quot;width&quot;:100,&quot;height&quot;:200},&quot;role&quot;:&quot;&quot;}
</ins><span class="cx"> 
</span><ins>+-- Running test case: MainFrameWithClassSelector
+- Frame: &lt;main-frame&gt;
+- Selector: .class-one
+PASS: Should highlight 2 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;className&quot;:&quot;.class-one&quot;,&quot;size&quot;:{&quot;width&quot;:10,&quot;height&quot;:20},&quot;role&quot;:&quot;&quot;}
+{&quot;tagName&quot;:&quot;iframe&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;className&quot;:&quot;.class-one&quot;,&quot;size&quot;:{&quot;width&quot;:304,&quot;height&quot;:154},&quot;role&quot;:&quot;group&quot;}
</ins><span class="cx"> 
</span><del>-SELECTOR: #id-one
-FRAMEID: &lt;main-frame-id&gt;
-FOUND: 1
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;id-one&quot;,
-      &quot;className&quot;: &quot;.class-two&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 769,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  }
-]
</del><ins>+-- Running test case: MainFrameIdSelector
+- Frame: &lt;main-frame&gt;
+- Selector: #id-one
+PASS: Should highlight 1 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;className&quot;:&quot;.class-two&quot;,&quot;size&quot;:{&quot;width&quot;:100,&quot;height&quot;:200},&quot;role&quot;:&quot;&quot;}
</ins><span class="cx"> 
</span><ins>+-- Running test case: MainFrameMultipleSelectors
+- Frame: &lt;main-frame&gt;
+- Selector: .class-one, .class-two
+PASS: Should highlight 3 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;className&quot;:&quot;.class-one&quot;,&quot;size&quot;:{&quot;width&quot;:10,&quot;height&quot;:20},&quot;role&quot;:&quot;&quot;}
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;className&quot;:&quot;.class-two&quot;,&quot;size&quot;:{&quot;width&quot;:100,&quot;height&quot;:200},&quot;role&quot;:&quot;&quot;}
+{&quot;tagName&quot;:&quot;iframe&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;className&quot;:&quot;.class-one&quot;,&quot;size&quot;:{&quot;width&quot;:304,&quot;height&quot;:154},&quot;role&quot;:&quot;group&quot;}
</ins><span class="cx"> 
</span><del>-SELECTOR: .class-one, .class-two
-FRAMEID: &lt;main-frame-id&gt;
-FOUND: 3
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;className&quot;: &quot;.class-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 769,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  },
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 777,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;id-one&quot;,
-      &quot;className&quot;: &quot;.class-two&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 769,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  },
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 160
-            },
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 160
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 160
-            },
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 160
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;iframe&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;className&quot;: &quot;.class-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 304,
-        &quot;height&quot;: 154
-      },
-      &quot;role&quot;: &quot;group&quot;
-    }
-  }
-]
</del><ins>+-- Running test case: MissingOptionalFrameIdShouldUseMainFrame
+- Frame: Not Provided
+- Selector: iframe.class-one
+PASS: Should highlight 1 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;iframe&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;className&quot;:&quot;.class-one&quot;,&quot;size&quot;:{&quot;width&quot;:304,&quot;height&quot;:154},&quot;role&quot;:&quot;group&quot;}
</ins><span class="cx"> 
</span><ins>+-- Running test case: MainFrameNonMatchingSelector
+- Frame: &lt;main-frame&gt;
+- Selector: .no-elements
+PASS: Should highlight 0 element(s).
</ins><span class="cx"> 
</span><del>-SELECTOR: iframe.class-one
-FRAMEID: undefined
-FOUND: 1
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 8
-            },
-            {
-              &quot;x&quot;: 312,
-              &quot;y&quot;: 162
-            },
-            {
-              &quot;x&quot;: 8,
-              &quot;y&quot;: 162
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 160
-            },
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 160
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 10
-            },
-            {
-              &quot;x&quot;: 310,
-              &quot;y&quot;: 160
-            },
-            {
-              &quot;x&quot;: 10,
-              &quot;y&quot;: 160
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;iframe&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;className&quot;: &quot;.class-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 304,
-        &quot;height&quot;: 154
-      },
-      &quot;role&quot;: &quot;group&quot;
-    }
-  }
-]
</del><ins>+-- Running test case: BadFrameShouldError
+- Frame: Bad Value
+- Selector: div
+PASS: Should throw error: No frame for given id found
</ins><span class="cx"> 
</span><ins>+-- Running test case: BadSelectorShouldError
+- Frame: &lt;main-frame&gt;
+- Selector: $%foobar
+PASS: Should throw error: DOM Error while querying
</ins><span class="cx"> 
</span><del>-PASS: Expected error: No frame for given id found
-SELECTOR: div
-FRAMEID: x.x
</del><ins>+-- Running test case: ChildFrameTagSelector
+- Frame: &lt;child-frame&gt;
+- Selector: div
+PASS: Should highlight 2 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;size&quot;:{&quot;width&quot;:150,&quot;height&quot;:250},&quot;role&quot;:&quot;&quot;}
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;&quot;,&quot;size&quot;:{&quot;width&quot;:269,&quot;height&quot;:0},&quot;role&quot;:&quot;&quot;}
</ins><span class="cx"> 
</span><ins>+-- Running test case: ChildFrameIdSelector
+- Frame: &lt;child-frame&gt;
+- Selector: #id-one
+PASS: Should highlight 1 element(s).
+Highlighted Elements:
+{&quot;tagName&quot;:&quot;div&quot;,&quot;idValue&quot;:&quot;id-one&quot;,&quot;size&quot;:{&quot;width&quot;:150,&quot;height&quot;:250},&quot;role&quot;:&quot;&quot;}
</ins><span class="cx"> 
</span><del>-SELECTOR: .no-elements
-FRAMEID: &lt;main-frame-id&gt;
-FOUND: 0
-[]
-
-
-PASS: Expected error: DOM Error while querying
-SELECTOR: $%foobar
-FRAMEID: &lt;main-frame-id&gt;
-
-
-SELECTOR: div
-FRAMEID: &lt;child-frame-id&gt;
-FOUND: 2
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;id-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 284,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  },
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 284,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  }
-]
-
-
-SELECTOR: #id-one
-FRAMEID: &lt;child-frame-id&gt;
-FOUND: 1
-[
-  {
-    &quot;scrollOffset&quot;: {
-      &quot;x&quot;: 0,
-      &quot;y&quot;: 0
-    },
-    &quot;fragments&quot;: [
-      {
-        &quot;quads&quot;: [
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ],
-          [
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 302,
-              &quot;y&quot;: 18
-            },
-            {
-              &quot;x&quot;: 18,
-              &quot;y&quot;: 18
-            }
-          ]
-        ],
-        &quot;contentColor&quot;: &quot;#ffffff&quot;,
-        &quot;contentOutlineColor&quot;: &quot;rgba(0, 0, 0, 0)&quot;,
-        &quot;paddingColor&quot;: &quot;#ffffff&quot;,
-        &quot;borderColor&quot;: &quot;#ffffff&quot;,
-        &quot;marginColor&quot;: &quot;#ffffff&quot;
-      }
-    ],
-    &quot;elementData&quot;: {
-      &quot;tagName&quot;: &quot;div&quot;,
-      &quot;idValue&quot;: &quot;id-one&quot;,
-      &quot;size&quot;: {
-        &quot;width&quot;: 284,
-        &quot;height&quot;: 0
-      },
-      &quot;role&quot;: &quot;&quot;
-    }
-  }
-]
-
-
-
</del></span></pre></div>
<a id="trunkLayoutTestsinspectordomhighlightSelectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/highlightSelector.html (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/highlightSelector.html        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/LayoutTests/inspector/dom/highlightSelector.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -1,104 +1,141 @@
</span><ins>+&lt;!doctype html&gt;
</ins><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><del>-function test() {
-    var testcases = [
-        {'frameId': 'MAINFRAME', 'selector': 'div'},
-        {'frameId': 'MAINFRAME', 'selector': '.class-one'},
-        {'frameId': 'MAINFRAME', 'selector': '#id-one'},
-        {'frameId': 'MAINFRAME', 'selector': '.class-one, .class-two'},
-        {'selector': 'iframe.class-one'}, // No frame ID.
-        {'frameId': 'x.x', 'selector': 'div', &quot;error&quot;: true}, // Non-existing frame ID.
-        {'frameId': 'MAINFRAME', 'selector': '.no-elements'}, // Non-matching selector.
-        {'frameId': 'MAINFRAME', 'selector': '$%foobar', &quot;error&quot;: true}, // Invalid selector.
-        {'frameId': 'CHILDFRAME', 'selector': 'div'},
-        {'frameId': 'CHILDFRAME', 'selector': '#id-one'},
</del><ins>+function test()
+{
+    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, &quot;Page should have a subframe.&quot;);
+    const mainFrameId = WebInspector.frameResourceManager.mainFrame.id;
+    const childFrameId = WebInspector.frameResourceManager.mainFrame.childFrames[0].id;
+    const highlightConfig = {
+        showInfo: true,
+        contentColor: {r: 255, g: 255, b: 255},
+        paddingColor: {r: 255, g: 255, b: 255},
+        borderColor: {r: 255, g: 255, b: 255},
+        marginColor: {r: 255, g: 255, b: 255},
+    };
+
+    let tests = [
+        {
+            name: &quot;MainFrameTagSelector&quot;,
+            frameId: mainFrameId,
+            selector: &quot;div&quot;,
+            expectedElements: 3,
+        },
+        {
+            name: &quot;MainFrameWithClassSelector&quot;,
+            frameId: mainFrameId,
+            selector: &quot;.class-one&quot;,
+            expectedElements: 2,
+        },
+        {
+            name: &quot;MainFrameIdSelector&quot;,
+            frameId: mainFrameId,
+            selector: &quot;#id-one&quot;,
+            expectedElements: 1,
+        },
+        {
+            name: &quot;MainFrameMultipleSelectors&quot;,
+            frameId: mainFrameId,
+            selector: &quot;.class-one, .class-two&quot;,
+            expectedElements: 3,
+        },
+        {
+            name: &quot;MissingOptionalFrameIdShouldUseMainFrame&quot;,
+            selector: &quot;iframe.class-one&quot;,
+            expectedElements: 1,
+        },
+        {
+            name: &quot;MainFrameNonMatchingSelector&quot;,
+            frameId: mainFrameId,
+            selector: &quot;.no-elements&quot;,
+            expectedElements: 0,
+        },
+        {
+            name: &quot;BadFrameShouldError&quot;,
+            frameId: &quot;x.x&quot;,
+            selector: &quot;div&quot;,
+            expectError: true,
+        },
+        {
+            name: &quot;BadSelectorShouldError&quot;,
+            frameId: mainFrameId,
+            selector: &quot;$%foobar&quot;,
+            expectError: true,
+        },
+        {
+            name: &quot;ChildFrameTagSelector&quot;,
+            frameId: childFrameId,
+            selector: &quot;div&quot;,
+            expectedElements: 2,
+        },
+        {
+            name: &quot;ChildFrameIdSelector&quot;,
+            frameId: childFrameId,
+            selector: &quot;#id-one&quot;,
+            expectedElements: 1,
+        },
</ins><span class="cx">     ];
</span><span class="cx"> 
</span><del>-    InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1);
-    var mainFrameId = WebInspector.frameResourceManager.mainFrame.id;
-    var childFrameId = WebInspector.frameResourceManager.mainFrame.childFrames[0].id;
-    for (var test of testcases) {
-        if (test.frameId === &quot;MAINFRAME&quot;)
-            test.frameId = mainFrameId;
-        else if (test.frameId === &quot;CHILDFRAME&quot;)
-            test.frameId = childFrameId;
-    }
-
</del><span class="cx">     function displayNameForFrameId(frameId) {
</span><ins>+        if (frameId === undefined)
+            return &quot;Not Provided&quot;;
</ins><span class="cx">         if (frameId === mainFrameId)
</span><del>-            return &quot;&lt;main-frame-id&gt;&quot;;
</del><ins>+            return &quot;&lt;main-frame&gt;&quot;;
</ins><span class="cx">         if (frameId === childFrameId)
</span><del>-            return &quot;&lt;child-frame-id&gt;&quot;;
-        return frameId;
</del><ins>+            return &quot;&lt;child-frame&gt;&quot;;
+        return &quot;Bad Value&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    function getHighlightObjectForSelector(selector, frameId, errorExpected, callback) {
-        var highlightConfig = {
-            showInfo: true,
-            contentColor: {r: 255, g: 255, b: 255},
-            paddingColor: {r: 255, g: 255, b: 255},
-            borderColor: {r: 255, g: 255, b: 255},
-            marginColor: {r: 255, g: 255, b: 255},
-        };
-
-        DOMAgent.highlightSelector(highlightConfig, selector, frameId, highlightSelectorCallback);
-
-        function highlightSelectorCallback(error) {
-            if (errorExpected) {
-                InspectorTest.assert(error, &quot;Missing expected error. Error: &quot; + error);
-
-                if (error)
-                    InspectorTest.log(&quot;PASS: Expected error: &quot; + error);
-
-                callback();
-                return;
-            } else
-                InspectorTest.assert(!error, &quot;Error in callback for DOMAgent.highlightSelector: &quot; + error);
-
-            InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, receivedHighlightObject);
-        }
-
-        function receivedHighlightObject(error, payload, wasThrown) {
-            InspectorTest.assert(!error, &quot;When evaluating code, received unexpected error:&quot; + error);
-            InspectorTest.assert(!wasThrown, &quot;When evaluating code, an exception was thrown:&quot; + wasThrown);
-
-            var data = JSON.parse(payload.value);
-            callback(data);
-        }
</del><ins>+    function getHighlight(callback) {
+        InspectorTest.evaluateInPage(&quot;window.internals.inspectorHighlightObject()&quot;, (error, payload, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Unexpected error dumping highlight: &quot; + error);
+            InspectorTest.assert(!wasThrown, &quot;Unexpected exception when dumping highlight.&quot;);
+            callback(JSON.parse(payload.value));
+        });
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    function runNextTest(tests) {
-        var testcase = tests[0];
</del><ins>+    let suite = InspectorTest.createAsyncSuite(&quot;DOM.highlightSelector&quot;);
</ins><span class="cx"> 
</span><del>-        getHighlightObjectForSelector(testcase.selector, testcase.frameId, testcase.error, function(payload) {
-            InspectorTest.log(&quot;SELECTOR: &quot; + testcase.selector);
-            InspectorTest.log(&quot;FRAMEID: &quot; + displayNameForFrameId(testcase.frameId));
-
-            if (payload) {
-                InspectorTest.log(&quot;FOUND: &quot; + payload.length);
-                InspectorTest.log(JSON.stringify(payload, null, 2));
</del><ins>+    for (let testcase of tests) {
+        let {name, frameId, selector, expectedElements, expectError} = testcase;
+        suite.addTestCase({
+            name,
+            test: (resolve, reject) =&gt; {
+                InspectorTest.log(&quot;- Frame: &quot; + displayNameForFrameId(frameId));
+                InspectorTest.log(&quot;- Selector: &quot; + selector);
+                DOMAgent.highlightSelector(highlightConfig, selector, frameId, (error) =&gt; {
+                    if (expectError) {
+                        InspectorTest.expectThat(error, &quot;Should throw error: &quot; + error);
+                        resolve();
+                    } else {
+                        InspectorTest.assert(!error, &quot;Should not throw error.&quot;);
+                        getHighlight((highlightPayloadList) =&gt; {
+                            InspectorTest.expectThat(highlightPayloadList.length === expectedElements, `Should highlight ${expectedElements} element(s).`);
+                            if (highlightPayloadList.length) {
+                                InspectorTest.log(&quot;Highlighted Elements:&quot;);
+                                for (let highlightPayload of highlightPayloadList)
+                                    InspectorTest.log(JSON.stringify(highlightPayload.elementData));
+                            }
+                            resolve();
+                        });
+                    }
+                });
</ins><span class="cx">             }
</span><del>-
-            InspectorTest.log(&quot;\n&quot;);
-        
-            if (tests.length &gt; 1)
-                runNextTest(tests.splice(1));
-            else
-                InspectorTest.completeTest();
</del><span class="cx">         });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    runNextTest(testcases);
</del><ins>+    suite.runTestCasesAndFinish();
</ins><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body onload=&quot;runTest()&quot;&gt;
</span><del>-    &lt;div&gt;
-        &lt;div class=&quot;class-one&quot;&gt;&lt;/div&gt;
-        &lt;div id=&quot;id-one&quot; class=&quot;class-two&quot;&gt;&lt;/div&gt;
-        &lt;iframe class=&quot;class-one&quot; src=&quot;resources/highlightSelector-iframe.html&quot;&gt;&lt;/iframe&gt;
</del><ins>+    &lt;p&gt;Tests for the DOM.highlightSelector command.&lt;/p&gt;
+    &lt;div style=&quot;width: 500px; height: 500px&quot;&gt;
+        &lt;div class=&quot;class-one&quot; style=&quot;width: 10px; height: 20px&quot;&gt;&lt;/div&gt;
+        &lt;div id=&quot;id-one&quot; class=&quot;class-two&quot; style=&quot;width:100px; height: 200px&quot;&gt;&lt;/div&gt;
+        &lt;iframe class=&quot;class-one&quot; src=&quot;resources/highlight-iframe.html&quot;&gt;&lt;/iframe&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomresourceshighlightiframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/resources/highlight-iframe.html (0 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/resources/highlight-iframe.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/resources/highlight-iframe.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;html&gt;
+    &lt;head&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;div id=&quot;id-one&quot; style=&quot;width:150px; height: 250px&quot;&gt;&lt;/div&gt;
+        &lt;div&gt;&lt;/div&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomresourceshighlightSelectoriframehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/dom/resources/highlightSelector-iframe.html (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/resources/highlightSelector-iframe.html        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/LayoutTests/inspector/dom/resources/highlightSelector-iframe.html        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-&lt;html&gt;
-    &lt;head&gt;
-    &lt;/head&gt;
-    &lt;body&gt;
-        &lt;div id=&quot;id-one&quot;&gt;&lt;/div&gt;
-        &lt;div&gt;&lt;/div&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/Source/WebCore/ChangeLog        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-09-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Add tests for DOM highlight commands
+        https://bugs.webkit.org/show_bug.cgi?id=148786
+
+        Reviewed by Timothy Hatcher.
+
+        Tests: inspector/dom/hideHighlight.html
+               inspector/dom/highlightFrame.html
+               inspector/dom/highlightNode.html
+               inspector/dom/highlightQuad.html
+               inspector/dom/highlightRect.html
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::highlightNode):
+        (WebCore::InspectorDOMAgent::highlightFrame):
+        Include an error if a frame is not found.
+
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::highlightQuad):
+        Should have been checking the usePageCoordinates state of the incoming
+        highlight configuration, not the one that will be replaced.
+
</ins><span class="cx"> 2015-09-04  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unnecessary compiler guards from mm files
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -1120,10 +1120,10 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorDOMAgent::highlightNode(ErrorString&amp; errorString, const InspectorObject&amp; highlightInspectorObject, const int* nodeId, const String* objectId)
</span><span class="cx"> {
</span><del>-    Node* node = 0;
-    if (nodeId) {
</del><ins>+    Node* node = nullptr;
+    if (nodeId)
</ins><span class="cx">         node = assertNode(errorString, *nodeId);
</span><del>-    } else if (objectId) {
</del><ins>+    else if (objectId) {
</ins><span class="cx">         node = nodeForObjectId(*objectId);
</span><span class="cx">         if (!node)
</span><span class="cx">             errorString = ASCIILiteral(&quot;Node for given objectId not found&quot;);
</span><span class="lines">@@ -1140,10 +1140,13 @@
</span><span class="cx">     m_overlay-&gt;highlightNode(node, *highlightConfig);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorDOMAgent::highlightFrame(ErrorString&amp;, const String&amp; frameId, const InspectorObject* color, const InspectorObject* outlineColor)
</del><ins>+void InspectorDOMAgent::highlightFrame(ErrorString&amp; errorString, const String&amp; frameId, const InspectorObject* color, const InspectorObject* outlineColor)
</ins><span class="cx"> {
</span><del>-    Frame* frame = m_pageAgent-&gt;frameForId(frameId);
-    if (frame &amp;&amp; frame-&gt;ownerElement()) {
</del><ins>+    Frame* frame = m_pageAgent-&gt;assertFrame(errorString, frameId);
+    if (!frame)
+        return;
+
+    if (frame-&gt;ownerElement()) {
</ins><span class="cx">         auto highlightConfig = std::make_unique&lt;HighlightConfig&gt;();
</span><span class="cx">         highlightConfig-&gt;showInfo = true; // Always show tooltips for frames.
</span><span class="cx">         highlightConfig-&gt;content = parseColor(color);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (189415 => 189416)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2015-09-05 02:34:22 UTC (rev 189415)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2015-09-05 02:38:42 UTC (rev 189416)
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorOverlay::highlightQuad(std::unique_ptr&lt;FloatQuad&gt; quad, const HighlightConfig&amp; highlightConfig)
</span><span class="cx"> {
</span><del>-    if (m_quadHighlightConfig.usePageCoordinates)
</del><ins>+    if (highlightConfig.usePageCoordinates)
</ins><span class="cx">         *quad -= m_page.mainFrame().view()-&gt;scrollOffset();
</span><span class="cx"> 
</span><span class="cx">     m_quadHighlightConfig = highlightConfig;
</span></span></pre>
</div>
</div>

</body>
</html>