<!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>[206152] trunk/LayoutTests</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206152">206152</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-20 10:28:51 -0700 (Tue, 20 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/model
https://bugs.webkit.org/show_bug.cgi?id=162074
Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-09-20
Reviewed by Brian Burg.
Replace instances of singleFireEventListener with awaitEvent and use promise logic to make
tests more readable.
* inspector/model/frame-extra-scripts.html:
* inspector/model/scope-chain-node.html:
* inspector/model/script-resource-relationship-expected.txt:
* inspector/model/script-resource-relationship.html:
* inspector/model/stack-trace.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectormodelframeextrascriptshtml">trunk/LayoutTests/inspector/model/frame-extra-scripts.html</a></li>
<li><a href="#trunkLayoutTestsinspectormodelscopechainnodehtml">trunk/LayoutTests/inspector/model/scope-chain-node.html</a></li>
<li><a href="#trunkLayoutTestsinspectormodelscriptresourcerelationshipexpectedtxt">trunk/LayoutTests/inspector/model/script-resource-relationship-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelscriptresourcerelationshiphtml">trunk/LayoutTests/inspector/model/script-resource-relationship.html</a></li>
<li><a href="#trunkLayoutTestsinspectormodelstacktracehtml">trunk/LayoutTests/inspector/model/stack-trace.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206151 => 206152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-20 17:14:00 UTC (rev 206151)
+++ trunk/LayoutTests/ChangeLog        2016-09-20 17:28:51 UTC (rev 206152)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-09-20 Devin Rousso <dcrousso+webkit@gmail.com>
+
+ Web Inspector: adopt Object.awaitEvent in LayoutTests/inspector/model
+ https://bugs.webkit.org/show_bug.cgi?id=162074
+
+ Reviewed by Brian Burg.
+
+ Replace instances of singleFireEventListener with awaitEvent and use promise logic to make
+ tests more readable.
+
+ * inspector/model/frame-extra-scripts.html:
+ * inspector/model/scope-chain-node.html:
+ * inspector/model/script-resource-relationship-expected.txt:
+ * inspector/model/script-resource-relationship.html:
+ * inspector/model/stack-trace.html:
+
</ins><span class="cx"> 2016-09-20 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> [media-source] Support MediaSource.setLiveSeekableRanges()
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelframeextrascriptshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/frame-extra-scripts.html (206151 => 206152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/frame-extra-scripts.html        2016-09-20 17:14:00 UTC (rev 206151)
+++ trunk/LayoutTests/inspector/model/frame-extra-scripts.html        2016-09-20 17:28:51 UTC (rev 206152)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "FrameHasNoExtraScriptsYet",
</span><span class="cx"> description: "No extra scripts yet.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> let mainFrame = WebInspector.frameResourceManager.mainFrame;
</span><span class="cx"> InspectorTest.expectThat(mainFrame.extraScripts.length === 0, "Main frame should have no dynamic scripts.");
</span><span class="cx"> resolve();
</span><span class="lines">@@ -26,17 +26,18 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "AddExtraScript",
</span><span class="cx"> description: "Add extra script.",
</span><del>- test: (resolve, reject) => {
- WebInspector.frameResourceManager.mainFrame.singleFireEventListener(WebInspector.Frame.Event.ExtraScriptAdded, (event) => {
</del><ins>+ test(resolve, reject) {
+ WebInspector.frameResourceManager.mainFrame.awaitEvent(WebInspector.Frame.Event.ExtraScriptAdded)
+ .then((event) => {
</ins><span class="cx"> InspectorTest.pass("ExtraScriptAdded event fired.");
</span><span class="cx"> InspectorTest.expectThat(event.data.script.dynamicallyAddedScriptElement, "Script should identify as dynamic.");
</span><del>- });
</del><span class="cx">
</span><del>- InspectorTest.evaluateInPage("triggerAddScriptElement()", () => {
</del><span class="cx"> let mainFrame = WebInspector.frameResourceManager.mainFrame;
</span><span class="cx"> InspectorTest.expectThat(mainFrame.extraScripts.length === 1, "Main frame should have 1 dynamic script.");
</span><del>- resolve();
- });
</del><ins>+ })
+ .then(resolve, reject);
+
+ InspectorTest.evaluateInPage("triggerAddScriptElement()");
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelscopechainnodehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/scope-chain-node.html (206151 => 206152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/scope-chain-node.html        2016-09-20 17:14:00 UTC (rev 206151)
+++ trunk/LayoutTests/inspector/model/scope-chain-node.html        2016-09-20 17:28:51 UTC (rev 206152)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> return "Unexpected Scope Type";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function harvestScopeChain(scopeChain) {
</del><ins>+ function harvestScopeChain(scopeChain) {
</ins><span class="cx"> let promises = [];
</span><span class="cx"> for (let scope of scopeChain) {
</span><span class="cx"> promises.push(new Promise((resolve, reject) => {
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function logScopeChain(scopeChain) {
</span><del>- return harvestScopeChain(scopeChain).then((results) => {
</del><ins>+ return harvestScopeChain(scopeChain)
+ .then((results) => {
</ins><span class="cx"> InspectorTest.log("SCOPE CHAIN:");
</span><span class="cx"> for (let {scope, propertyDescriptors} of results) {
</span><span class="cx"> InspectorTest.log(` ${scopeTypeToString(scope.type)}`);
</span><span class="lines">@@ -59,18 +60,21 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "WebInspector.ScopeChainNode.AllTypes",
</span><span class="cx"> description: "Tests for each of the different scope chain node types.",
</span><del>- test: (resolve, reject) => {
- InspectorTest.evaluateInPage("setTimeout(testAllScopes)");
- WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => {
</del><ins>+ test(resolve, reject) {
+ WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.CallFramesDidChange)
+ .then((event) => {
</ins><span class="cx"> let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
</span><span class="cx"> InspectorTest.expectThat(scopeChain.length === 13, "ScopeChain should have 13 scopes.");
</span><del>- logScopeChain(scopeChain).then((result) => {
- WebInspector.debuggerManager.resume();
- WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Resumed, (event) => {
- resolve();
- });
- });
- });
</del><ins>+ return logScopeChain(scopeChain);
+ })
+ .then((result) => {
+ let promise = WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Resumed);
+ WebInspector.debuggerManager.resume();
+ return promise;
+ })
+ .then(resolve, reject);
+
+ InspectorTest.evaluateInPage("setTimeout(testAllScopes)");
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -77,17 +81,20 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "WebInspector.ScopeChainNode.FunctionNameInFunctionExpression",
</span><span class="cx"> description: "Tests that there should be a FunctionName scope inside a function expression.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
+ WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.CallFramesDidChange)
+ .then((event) => {
+ let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
+ return logScopeChain(scopeChain);
+ })
+ .then((result) => {
+ let promise = WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Resumed);
+ WebInspector.debuggerManager.resume();
+ return promise;
+ })
+ .then(resolve, reject);
+
</ins><span class="cx"> InspectorTest.evaluateInPage("setTimeout(testFunctionNameScope1)");
</span><del>- WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => {
- let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
- logScopeChain(scopeChain).then((result) => {
- WebInspector.debuggerManager.resume();
- WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Resumed, (event) => {
- resolve();
- });
- });
- });
</del><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -94,17 +101,20 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "WebInspector.ScopeChainNode.FunctionNameInClassMethod",
</span><span class="cx"> description: "Tests that there should be a FunctionName scope inside a class method.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
+ WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.CallFramesDidChange)
+ .then((event) => {
+ let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
+ return logScopeChain(scopeChain);
+ })
+ .then((result) => {
+ let promise = WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Resumed);
+ WebInspector.debuggerManager.resume();
+ return promise;
+ })
+ .then(resolve, reject);
+
</ins><span class="cx"> InspectorTest.evaluateInPage("setTimeout(testFunctionNameScope2)");
</span><del>- WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => {
- let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
- logScopeChain(scopeChain).then((result) => {
- WebInspector.debuggerManager.resume();
- WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Resumed, (event) => {
- resolve();
- });
- });
- });
</del><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -111,10 +121,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "WebInspector.ScopeChainNode.BlockScopes",
</span><span class="cx"> description: "Tests for a Block scope inside all the different types of blocks.",
</span><del>- test: (resolve, reject) => {
- InspectorTest.evaluateInPage("setTimeout(testBlockScopes)");
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, callFramesDidChangeListener);
-
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> let pauseCount = 0;
</span><span class="cx"> let pauseEventsExpected = 19;
</span><span class="cx"> function callFramesDidChangeListener(event) {
</span><span class="lines">@@ -121,7 +128,7 @@
</span><span class="cx"> if (!WebInspector.debuggerManager.activeCallFrame)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- pauseCount++;
</del><ins>+ pauseCount++;
</ins><span class="cx"> let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
</span><span class="cx">
</span><span class="cx"> // First, normal function scope.
</span><span class="lines">@@ -149,10 +156,15 @@
</span><span class="cx">
</span><span class="cx"> // Print out the full scope of the last few where there are nested or buried block scopes.
</span><span class="cx"> InspectorTest.expectThat(scopeChain.some((scopeChain) => scopeChain.type === WebInspector.ScopeChainNode.Type.Block), `Pause #${pauseCount} - Contains a Block scope.`);
</span><del>- logScopeChain(scopeChain).then((result) => {
</del><ins>+
+ logScopeChain(scopeChain)
+ .then((result) => {
</ins><span class="cx"> WebInspector.debuggerManager.resume();
</span><span class="cx"> });
</span><span class="cx"> }
</span><ins>+
+ WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, callFramesDidChangeListener);
+ InspectorTest.evaluateInPage("setTimeout(testBlockScopes)");
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelscriptresourcerelationshipexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/script-resource-relationship-expected.txt (206151 => 206152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/script-resource-relationship-expected.txt        2016-09-20 17:14:00 UTC (rev 206151)
+++ trunk/LayoutTests/inspector/model/script-resource-relationship-expected.txt        2016-09-20 17:28:51 UTC (rev 206152)
</span><span class="lines">@@ -3,8 +3,7 @@
</span><span class="cx">
</span><span class="cx"> == Running test suite: WebInspector.Script and WebInspector.Resource relationship
</span><span class="cx"> -- Running test case: ScriptWithResource
</span><del>-PASS: Resource was added.
-PASS: Script was added.
</del><ins>+PASS: Only one Script should be added.
</ins><span class="cx"> PASS: Resource and Script have the same URL.
</span><span class="cx"> PASS: Resource should be related to one script.
</span><span class="cx"> PASS: Resource should be related to the newly added script.
</span><span class="lines">@@ -12,8 +11,7 @@
</span><span class="cx"> PASS: Script should not have a sourceURL.
</span><span class="cx">
</span><span class="cx"> -- Running test case: NamedScriptWithResource
</span><del>-PASS: Resource was added.
-PASS: Script was added.
</del><ins>+PASS: Only one Script should be added.
</ins><span class="cx"> PASS: Resource and Script have the same URL.
</span><span class="cx"> PASS: Resource should be related to one script.
</span><span class="cx"> PASS: Resource should be related to the newly added script.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelscriptresourcerelationshiphtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/script-resource-relationship.html (206151 => 206152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/script-resource-relationship.html        2016-09-20 17:14:00 UTC (rev 206151)
+++ trunk/LayoutTests/inspector/model/script-resource-relationship.html        2016-09-20 17:28:51 UTC (rev 206152)
</span><span class="lines">@@ -46,24 +46,31 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "ScriptWithResource",
</span><span class="cx"> description: "Normal relationship between a script and a resource.",
</span><del>- test: (resolve, reject) => {
- let script = null, resource = null;
</del><ins>+ test(resolve, reject) {
+ let script = null;
+ let resource = null;
</ins><span class="cx">
</span><span class="cx"> WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, scriptListener);
</span><del>- WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
- InspectorTest.pass("Resource was added.");
</del><ins>+ WebInspector.Frame.awaitEvent(WebInspector.Frame.Event.ResourceWasAdded)
+ .then((event) => {
</ins><span class="cx"> resource = event.data.resource;
</span><ins>+ validateRelationship();
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> function scriptListener(event) {
</span><span class="cx"> if (!event.data.script.url)
</span><span class="cx"> return;
</span><del>- InspectorTest.pass("Script was added.");
</del><ins>+
+ InspectorTest.expectThat(!script, "Only one Script should be added.");
+
</ins><span class="cx"> script = event.data.script;
</span><span class="cx"> validateRelationship();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function validateRelationship() {
</span><ins>+ if (!resource || !script)
+ return;
+
</ins><span class="cx"> validateNormalRelationship(resource, script);
</span><span class="cx"> InspectorTest.expectThat(!script.sourceURL, "Script should not have a sourceURL.");
</span><span class="cx">
</span><span class="lines">@@ -78,24 +85,31 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "NamedScriptWithResource",
</span><span class="cx"> description: "Normal relationship between a named script and a resource.",
</span><del>- test: (resolve, reject) => {
- let script = null, resource = null;
</del><ins>+ test(resolve, reject) {
+ let script = null;
+ let resource = null;
</ins><span class="cx">
</span><span class="cx"> WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, scriptListener);
</span><del>- WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
- InspectorTest.pass("Resource was added.");
</del><ins>+ WebInspector.Frame.awaitEvent(WebInspector.Frame.Event.ResourceWasAdded)
+ .then((event) => {
</ins><span class="cx"> resource = event.data.resource;
</span><ins>+ validateRelationship();
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> function scriptListener(event) {
</span><span class="cx"> if (!event.data.script.url)
</span><span class="cx"> return;
</span><del>- InspectorTest.pass("Script was added.");
</del><ins>+
+ InspectorTest.expectThat(!script, "Only one Script should be added.");
+
</ins><span class="cx"> script = event.data.script;
</span><span class="cx"> validateRelationship();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function validateRelationship() {
</span><ins>+ if (!resource || !script)
+ return;
+
</ins><span class="cx"> validateNormalRelationship(resource, script);
</span><span class="cx"> InspectorTest.expectThat(script.sourceURL === "foo.js", "Script should have a sourceURL.");
</span><span class="cx"> WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, scriptListener, null);
</span><span class="lines">@@ -109,7 +123,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "ScriptWithoutResource",
</span><span class="cx"> description: "A named eval does not have a resource.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, scriptListener);
</span><span class="cx"> let resourceListener = WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
</span><span class="cx"> InspectorTest.fail("Resource should not be added.");
</span><span class="lines">@@ -138,7 +152,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "DynamicallyAddedScriptElementNoResource",
</span><span class="cx"> description: "A dynamically added script element has no resource.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, scriptListener);
</span><span class="cx">
</span><span class="cx"> function scriptListener(event) {
</span><span class="lines">@@ -161,7 +175,7 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "DocumentWithInlineScripts",
</span><span class="cx"> description: "A document resource may be associated with multiple inline scripts.",
</span><del>- test: (resolve, reject) => {
</del><ins>+ test(resolve, reject) {
</ins><span class="cx"> let mainResource = WebInspector.frameResourceManager.mainFrame.mainResource;
</span><span class="cx"> let scripts = mainResource.scripts.slice().sort((a, b) => a.range.startLine - b.range.startLine);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelstacktracehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/stack-trace.html (206151 => 206152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/stack-trace.html        2016-09-20 17:14:00 UTC (rev 206151)
+++ trunk/LayoutTests/inspector/model/stack-trace.html        2016-09-20 17:28:51 UTC (rev 206152)
</span><span class="lines">@@ -30,9 +30,9 @@
</span><span class="cx"> suite.addTestCase({
</span><span class="cx"> name: "WebInspector.ConsoleMessage.StackTrace",
</span><span class="cx"> description: "Test we can create a StackTrace from console messages (Console.StackTrace).",
</span><del>- test: (resolve, reject) => {
- InspectorTest.evaluateInPage("triggerConsoleMessage()");
- WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.MessageAdded, function addListener(event) {
</del><ins>+ test(resolve, reject) {
+ WebInspector.logManager.awaitEvent(WebInspector.LogManager.Event.MessageAdded)
+ .then((event) => {
</ins><span class="cx"> // Trace message should always have a stack trace.
</span><span class="cx"> let consoleMessage = event.data.message;
</span><span class="cx"> let stackTrace = consoleMessage.stackTrace;
</span><span class="lines">@@ -45,8 +45,10 @@
</span><span class="cx"> InspectorTest.expectThat(!stackTrace.callFrames[0].scopeChain.length, "CallFrame in StackTrace has no scopeChain.");
</span><span class="cx">
</span><span class="cx"> logStackTrace(consoleMessage.stackTrace);
</span><del>- resolve();
- });
</del><ins>+ })
+ .then(resolve, reject);
+
+ InspectorTest.evaluateInPage("triggerConsoleMessage()");
</ins><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>