<!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>[202522] 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/202522">202522</a></dd>
<dt>Author</dt> <dd>bburg@apple.com</dd>
<dt>Date</dt> <dd>2016-06-27 17:23:09 -0700 (Mon, 27 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: RuntimeManager should not use view object WebInspector.quickConsole
https://bugs.webkit.org/show_bug.cgi?id=128092
&lt;rdar://problem/15966526&gt;

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

This is a layering violation which makes it harder to use RuntimeManager.evaluateInInspectedWindow
from a testing context where the QuickConsole view does not exist.

Store the selected execution context identifier on RuntimeManager and use it
when doing subsequent evaluations that act on the currently selected frame.

* UserInterface/Controllers/RuntimeManager.js:
(WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
(WebInspector.RuntimeManager.prototype.saveResult):
Use local state.

(WebInspector.RuntimeManager.prototype.get defaultExecutionContextIdentifier):
(WebInspector.RuntimeManager.prototype.set defaultExecutionContextIdentifier):
Added.

(WebInspector.RuntimeManager):
* UserInterface/Models/ExecutionContext.js:
(WebInspector.ExecutionContext):
Move the symbolic name for the top level execution context to RuntimeManager.

* UserInterface/Test/Test.js:
(WebInspector.loaded): No need to stub out WebInspector.QuickConsole any more.

* UserInterface/Views/QuickConsole.js:
(WebInspector.QuickConsole.prototype._framePageExecutionContextsChanged):
(WebInspector.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
(WebInspector.QuickConsole.prototype._updateExecutionContextPathComponentForFrame):
(WebInspector.QuickConsole.prototype._pathComponentSelected):
For now, set RuntimeManager's selected execution context whenever we set the
selected path component. In a future patch, we should invert the dependency and have
the selected component change whenever RuntimeManager.defaultExecutionContext changes.

LayoutTests:

Add some really basic coverage for RuntimeManager.defaultExecutionContextIdentifier
and using it in RuntimeManager.evaluateInInspectedWindow.

* inspector/runtime/change-execution-context-identifier-expected.txt: Added.
* inspector/runtime/change-execution-context-identifier.html: Added.
* inspector/runtime/resources/change-execution-context-identifier-subframe.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersRuntimeManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsExecutionContextjs">trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTestTestjs">trunk/Source/WebInspectorUI/UserInterface/Test/Test.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolejs">trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorruntimechangeexecutioncontextidentifierexpectedtxt">trunk/LayoutTests/inspector/runtime/change-execution-context-identifier-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorruntimechangeexecutioncontextidentifierhtml">trunk/LayoutTests/inspector/runtime/change-execution-context-identifier.html</a></li>
<li>trunk/LayoutTests/inspector/runtime/resources/</li>
<li><a href="#trunkLayoutTestsinspectorruntimeresourceschangeexecutioncontextidentifiersubframehtml">trunk/LayoutTests/inspector/runtime/resources/change-execution-context-identifier-subframe.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202521 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-27 23:59:50 UTC (rev 202521)
+++ trunk/LayoutTests/ChangeLog        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-06-27  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: RuntimeManager should not use view object WebInspector.quickConsole
+        https://bugs.webkit.org/show_bug.cgi?id=128092
+        &lt;rdar://problem/15966526&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        Add some really basic coverage for RuntimeManager.defaultExecutionContextIdentifier
+        and using it in RuntimeManager.evaluateInInspectedWindow.
+
+        * inspector/runtime/change-execution-context-identifier-expected.txt: Added.
+        * inspector/runtime/change-execution-context-identifier.html: Added.
+        * inspector/runtime/resources/change-execution-context-identifier-subframe.html: Added.
+
</ins><span class="cx"> 2016-06-27  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix style invalidation for :active when the activated node has no renderer
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorruntimechangeexecutioncontextidentifierexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/runtime/change-execution-context-identifier-expected.txt (0 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/runtime/change-execution-context-identifier-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/runtime/change-execution-context-identifier-expected.txt        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+
+Test that RuntimeManager.evaluateInInspectedWindow respects the selected execution context.
+
+
+== Running test suite: RuntimeManager.defaultExecutionContextIdentifier
+-- Running test case: InitialScriptExecutionContext
+PASS: The default execution context should be the top level execution context initially.
+
+-- Running test case: ScriptExecutionContextMainFrame
+Passphrase in selected frame: coldwater
+PASS: The passphrase should match the phrase defined in the main frame.
+
+-- Running test case: ScriptExecutionContextSubFrame
+PASS: The test page should only have one sub-frame.
+Passphrase in selected frame: rosewater
+PASS: The passphrase should match the phrase defined in the subframe.
+
+-- Running test case: ScriptExecutionContextMainFrameAgain
+Passphrase in selected frame: coldwater
+PASS: The passphrase should match the phrase defined in the main frame.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorruntimechangeexecutioncontextidentifierhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/runtime/change-execution-context-identifier.html (0 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/runtime/change-execution-context-identifier.html                                (rev 0)
+++ trunk/LayoutTests/inspector/runtime/change-execution-context-identifier.html        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -0,0 +1,74 @@
</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;
+
+var passphrase = &quot;coldwater&quot;;
+
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite(&quot;RuntimeManager.defaultExecutionContextIdentifier&quot;);
+
+    suite.addTestCase({
+        name: &quot;InitialScriptExecutionContext&quot;,
+        description: &quot;Test that the initial value of defaultExecutionContextIdentifier is the top-level context.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.expectThat(WebInspector.runtimeManager.defaultExecutionContextIdentifier === WebInspector.RuntimeManager.TopLevelExecutionContextIdentifier, &quot;The default execution context should be the top level execution context initially.&quot;);
+            resolve();
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ScriptExecutionContextMainFrame&quot;,
+        description: &quot;Test that evaluateInInspectedWindow works when defaultExecutionContextIdentifier is the top level context.&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.runtimeManager.evaluateInInspectedWindow(&quot;passphrase&quot;, {objectGroup: &quot;test&quot;}, (remoteObject, wasThrown, savedResultIndex) =&gt; {
+                InspectorTest.log(&quot;Passphrase in selected frame: &quot; + remoteObject.value);
+                InspectorTest.expectThat(remoteObject.value === &quot;coldwater&quot;, &quot;The passphrase should match the phrase defined in the main frame.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ScriptExecutionContextSubFrame&quot;,
+        description: &quot;Test that evaluateInInspectedWindow works when defaultExecutionContextIdentifier is a subframe context.&quot;,
+        test: (resolve, reject) =&gt; {
+            let mainFrame = WebInspector.frameResourceManager.mainFrame;
+            let subframes = WebInspector.frameResourceManager.frames.filter((frame) =&gt; frame != mainFrame);
+            InspectorTest.expectThat(subframes.length === 1, &quot;The test page should only have one sub-frame.&quot;);
+
+            WebInspector.runtimeManager.defaultExecutionContextIdentifier = subframes[0].pageExecutionContext.id;
+            WebInspector.runtimeManager.evaluateInInspectedWindow(&quot;passphrase&quot;, {objectGroup: &quot;test&quot;}, (remoteObject, wasThrown, savedResultIndex) =&gt; {
+                InspectorTest.log(&quot;Passphrase in selected frame: &quot; + remoteObject.value);
+                InspectorTest.expectThat(remoteObject.value === &quot;rosewater&quot;, &quot;The passphrase should match the phrase defined in the subframe.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ScriptExecutionContextMainFrameAgain&quot;,
+        description: &quot;Test that evaluateInInspectedWindow works when defaultExecutionContextIdentifier switches back to the main frame execution context.&quot;,
+        test: (resolve, reject) =&gt; {
+            let mainFrame = WebInspector.frameResourceManager.mainFrame;
+
+            WebInspector.runtimeManager.defaultExecutionContextIdentifier = mainFrame.pageExecutionContext.id;
+            WebInspector.runtimeManager.evaluateInInspectedWindow(&quot;passphrase&quot;, {objectGroup: &quot;test&quot;}, (remoteObject, wasThrown, savedResultIndex) =&gt; {
+                InspectorTest.log(&quot;Passphrase in selected frame: &quot; + remoteObject.value);
+                InspectorTest.expectThat(remoteObject.value === &quot;coldwater&quot;, &quot;The passphrase should match the phrase defined in the main frame.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;iframe src=&quot;resources/change-execution-context-identifier-subframe.html&quot; onload=&quot;runTest()&quot;&gt;&lt;/iframe&gt;
+&lt;p&gt;Test that RuntimeManager.evaluateInInspectedWindow respects the selected execution context.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorruntimeresourceschangeexecutioncontextidentifiersubframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/runtime/resources/change-execution-context-identifier-subframe.html (0 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/runtime/resources/change-execution-context-identifier-subframe.html                                (rev 0)
+++ trunk/LayoutTests/inspector/runtime/resources/change-execution-context-identifier-subframe.html        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+var passphrase = &quot;rosewater&quot;;
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (202521 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-06-27 23:59:50 UTC (rev 202521)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-06-27  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Inspector: RuntimeManager should not use view object WebInspector.quickConsole
+        https://bugs.webkit.org/show_bug.cgi?id=128092
+        &lt;rdar://problem/15966526&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        This is a layering violation which makes it harder to use RuntimeManager.evaluateInInspectedWindow
+        from a testing context where the QuickConsole view does not exist.
+
+        Store the selected execution context identifier on RuntimeManager and use it
+        when doing subsequent evaluations that act on the currently selected frame.
+
+        * UserInterface/Controllers/RuntimeManager.js:
+        (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
+        (WebInspector.RuntimeManager.prototype.saveResult):
+        Use local state.
+
+        (WebInspector.RuntimeManager.prototype.get defaultExecutionContextIdentifier):
+        (WebInspector.RuntimeManager.prototype.set defaultExecutionContextIdentifier):
+        Added.
+
+        (WebInspector.RuntimeManager):
+        * UserInterface/Models/ExecutionContext.js:
+        (WebInspector.ExecutionContext):
+        Move the symbolic name for the top level execution context to RuntimeManager.
+
+        * UserInterface/Test/Test.js:
+        (WebInspector.loaded): No need to stub out WebInspector.QuickConsole any more.
+
+        * UserInterface/Views/QuickConsole.js:
+        (WebInspector.QuickConsole.prototype._framePageExecutionContextsChanged):
+        (WebInspector.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
+        (WebInspector.QuickConsole.prototype._updateExecutionContextPathComponentForFrame):
+        (WebInspector.QuickConsole.prototype._pathComponentSelected):
+        For now, set RuntimeManager's selected execution context whenever we set the
+        selected path component. In a future patch, we should invert the dependency and have
+        the selected component change whenever RuntimeManager.defaultExecutionContext changes.
+
</ins><span class="cx"> 2016-06-23  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: first heap snapshot taken when a page is reloaded happens before the reload navigation
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersRuntimeManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js (202521 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js        2016-06-27 23:59:50 UTC (rev 202521)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // COMPATIBILITY (iOS 8): &quot;saveResult&quot; did not exist.
</span><del>-        var contextId = WebInspector.quickConsole.executionContextIdentifier;
</del><ins>+        let contextId = this.defaultExecutionContextIdentifier;
</ins><span class="cx">         RuntimeAgent.evaluate.invoke({expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, contextId, returnByValue, generatePreview, saveResult}, evalCallback.bind(this));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">         if (remoteObject.objectId)
</span><span class="cx">             RuntimeAgent.saveResult(remoteObject.asCallArgument(), mycallback);
</span><span class="cx">         else
</span><del>-            RuntimeAgent.saveResult(remoteObject.asCallArgument(), WebInspector.quickConsole.executionContextIdentifier, mycallback);
</del><ins>+            RuntimeAgent.saveResult(remoteObject.asCallArgument(), this.defaultExecutionContextIdentifier, mycallback);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     getPropertiesForRemoteObject(objectId, callback)
</span><span class="lines">@@ -122,8 +122,13 @@
</span><span class="cx">             callback(null, properties);
</span><span class="cx">         });
</span><span class="cx">     }
</span><ins>+
+    get defaultExecutionContextIdentifier() { return this._defaultExecutionContextIdentifier; }
+    set defaultExecutionContextIdentifier(value) { this._defaultExecutionContextIdentifier = value; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+WebInspector.RuntimeManager.TopLevelExecutionContextIdentifier = undefined;
+
</ins><span class="cx"> WebInspector.RuntimeManager.Event = {
</span><span class="cx">     DidEvaluate: &quot;runtime-manager-did-evaluate&quot;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsExecutionContextjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js (202521 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js        2016-06-27 23:59:50 UTC (rev 202521)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">     {
</span><span class="cx">         super();
</span><span class="cx"> 
</span><del>-        console.assert(typeof id === &quot;number&quot; || id === WebInspector.QuickConsole.MainFrameContextExecutionIdentifier);
</del><ins>+        console.assert(typeof id === &quot;number&quot; || id === WebInspector.RuntimeManager.TopLevelExecutionContextIdentifier);
</ins><span class="cx">         console.assert(typeof name === &quot;string&quot;);
</span><span class="cx"> 
</span><span class="cx">         this._id = id;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTestTestjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test/Test.js (202521 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test/Test.js        2016-06-27 23:59:50 UTC (rev 202521)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/Test.js        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -62,9 +62,6 @@
</span><span class="cx">     this.probeManager = new WebInspector.ProbeManager;
</span><span class="cx">     this.replayManager = new WebInspector.ReplayManager;
</span><span class="cx"> 
</span><del>-    // Global controllers.
-    this.quickConsole = {executionContextIdentifier: undefined};
-
</del><span class="cx">     document.addEventListener(&quot;DOMContentLoaded&quot;, this.contentLoaded);
</span><span class="cx"> 
</span><span class="cx">     // Enable agents.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (202521 => 202522)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js        2016-06-27 23:59:50 UTC (rev 202521)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js        2016-06-28 00:23:09 UTC (rev 202522)
</span><span class="lines">@@ -149,6 +149,7 @@
</span><span class="cx">         if (shouldAutomaticallySelect) {
</span><span class="cx">             delete this._restoreSelectedExecutionContextForFrame;
</span><span class="cx">             this._selectedExecutionContextPathComponent = newExecutionContextPathComponent;
</span><ins>+            WebInspector.runtimeManager.defaultExecutionContextIdentifier = this.executionContextIdentifier;
</ins><span class="cx">             this._rebuildExecutionContextPathComponents();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -260,8 +261,10 @@
</span><span class="cx">         if (next)
</span><span class="cx">             next.previousSibling = prev;
</span><span class="cx"> 
</span><del>-        if (this._selectedExecutionContextPathComponent === executionContextPathComponent)
</del><ins>+        if (this._selectedExecutionContextPathComponent === executionContextPathComponent) {
</ins><span class="cx">             this._selectedExecutionContextPathComponent = this._mainFrameExecutionContextPathComponent;
</span><ins>+            WebInspector.runtimeManager.defaultExecutionContextIdentifier = this.executionContextIdentifier;
+        }
</ins><span class="cx"> 
</span><span class="cx">         this._otherExecutionContextPathComponents.remove(executionContextPathComponent, true);
</span><span class="cx">         delete this._frameIdentifierToExecutionContextPathComponentMap[frame.id];
</span><span class="lines">@@ -284,8 +287,10 @@
</span><span class="cx">         this._removeExecutionContextPathComponentForFrame(frame, true);
</span><span class="cx">         var newExecutionContextPathComponent = this._insertExecutionContextPathComponentForFrame(frame, true);
</span><span class="cx"> 
</span><del>-        if (wasSelected)
</del><ins>+        if (wasSelected) {
</ins><span class="cx">             this._selectedExecutionContextPathComponent = newExecutionContextPathComponent;
</span><ins>+            WebInspector.runtimeManager.defaultExecutionContextIdentifier = this.executionContextIdentifier;
+        }
</ins><span class="cx"> 
</span><span class="cx">         this._rebuildExecutionContextPathComponents();
</span><span class="cx">     }
</span><span class="lines">@@ -296,6 +301,7 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this._selectedExecutionContextPathComponent = event.data.pathComponent;
</span><ins>+        WebInspector.runtimeManager.defaultExecutionContextIdentifier = this.executionContextIdentifier;
</ins><span class="cx"> 
</span><span class="cx">         this._rebuildExecutionContextPathComponents();
</span><span class="cx">     }
</span><span class="lines">@@ -325,8 +331,6 @@
</span><span class="cx"> WebInspector.QuickConsole.ToolbarPromptPadding = 4;
</span><span class="cx"> WebInspector.QuickConsole.ToolbarTopBorder = 1;
</span><span class="cx"> 
</span><del>-WebInspector.QuickConsole.MainFrameContextExecutionIdentifier = undefined;
-
</del><span class="cx"> WebInspector.QuickConsole.Event = {
</span><span class="cx">     DidResize: &quot;quick-console-did-resize&quot;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>