Changeset 253718 in webkit
- Timestamp:
- Dec 18, 2019, 2:05:27 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/inspector/resources/stable-id-map.js (added)
-
LayoutTests/http/tests/inspector/target/provisional-load-cancels-previous-load-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/inspector/target/provisional-load-cancels-previous-load.html (modified) (5 diffs)
-
LayoutTests/inspector/runtime/executionContextCreated-onEnable-expected.txt (added)
-
LayoutTests/inspector/runtime/executionContextCreated-onEnable.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp (modified) (2 diffs)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Models/ExecutionContextList.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r253705 r253718 1 2019-12-18 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: Runtime.enable reports duplicates (non existent) contexts 4 https://bugs.webkit.org/show_bug.cgi?id=204859 5 6 Reviewed by Devin Rousso. 7 8 Test that only existing contexts are reported. 9 10 * http/tests/inspector/resources/stable-id-map.js: Added. 11 (TestPage.registerInitializer.window.StableIdMap): 12 (TestPage.registerInitializer.window.StableIdMap.prototype.get size): 13 (TestPage.registerInitializer.window.StableIdMap.prototype.get let): 14 (TestPage.registerInitializer): 15 * http/tests/inspector/target/provisional-load-cancels-previous-load.html: 16 * inspector/runtime/executionContextCreated-onEnable-expected.txt: Added. 17 * inspector/runtime/executionContextCreated-onEnable.html: Added. 18 1 19 2019-12-18 youenn fablet <youenn@apple.com> 2 20 -
trunk/LayoutTests/http/tests/inspector/target/provisional-load-cancels-previous-load-expected.txt
r253097 r253718 4 4 == Running test suite: Target.PSON 5 5 -- Running test case: ProvisionalPagePaused 6 Current target is 1. 6 Current target is 0. 7 PASS: Should receive TargetAdded event for target 1. 8 PASS: Target 1 should be provisional. 9 PASS: Target 1 should be paused on start. 10 PASS: Should receive TargetRemoved event for target 1 7 11 PASS: Should receive TargetAdded event for target 2. 8 12 PASS: Target 2 should be provisional. 9 13 PASS: Target 2 should be paused on start. 10 PASS: Should receive TargetRemoved event for target 2 11 PASS: Should receive TargetAdded event for target 3. 12 PASS: Target 3 should be provisional. 13 PASS: Target 3 should be paused on start. 14 PASS: Should receive TargetRemoved event for target 1 15 PASS: Should receive DidCommitProvisionalTarget event 1 => 3. 14 PASS: Should receive TargetRemoved event for target 0 15 PASS: Should receive DidCommitProvisionalTarget event 0 => 2. 16 16 PASS: Should have seen 3 different targets. 17 17 -
trunk/LayoutTests/http/tests/inspector/target/provisional-load-cancels-previous-load.html
r253097 r253718 4 4 <meta charset="utf-8"> 5 5 <script src="../resources/inspector-test.js"></script> 6 <script src="../resources/stable-id-map.js"></script> 6 7 <script> 7 8 function test() 8 9 { 9 let lastAssignedId = 0;10 let targetToId = new Map;11 function stableTargetId(targetId)12 {13 let id = targetToId.get(targetId);14 if (!id) {15 id = ++lastAssignedId;16 targetToId.set(targetId, id);17 }18 return id;19 }20 21 10 let suite = InspectorTest.createAsyncSuite("Target.PSON"); 22 11 … … 25 14 description: "Check that new provisional page can be paused before navigation.", 26 15 test(resolve, reject) { 27 InspectorTest.log(`Current target is ${stableTargetId(WI.mainTarget.identifier)}.`); 16 let targetIdMap = new StableIdMap; 17 InspectorTest.log(`Current target is ${targetIdMap.get(WI.mainTarget.identifier)}.`); 28 18 const url = "http://localhost:8000/inspector/target/provisional-load-cancels-previous-load.html"; 29 19 let navigatedTwice = false; … … 31 21 WI.targetManager.addEventListener(WI.TargetManager.Event.TargetAdded, (event) => { 32 22 let target = event.data.target; 33 let targetId = stableTargetId(target.identifier);23 let targetId = targetIdMap.get(target.identifier); 34 24 InspectorTest.pass(`Should receive TargetAdded event for target ${targetId}.`); 35 25 InspectorTest.expectTrue(target.isProvisional, `Target ${targetId} should be provisional.`); … … 46 36 WI.targetManager.addEventListener(WI.TargetManager.Event.DidCommitProvisionalTarget, (event) => { 47 37 let {previousTargetId, target} = event.data; 48 InspectorTest.pass(`Should receive DidCommitProvisionalTarget event ${ stableTargetId(previousTargetId)} => ${stableTargetId(target.identifier)}.`);38 InspectorTest.pass(`Should receive DidCommitProvisionalTarget event ${targetIdMap.get(previousTargetId)} => ${targetIdMap.get(target.identifier)}.`); 49 39 }); 50 40 51 41 WI.targetManager.addEventListener(WI.TargetManager.Event.TargetRemoved, (event) =>{ 52 let targetId = stableTargetId(event.data.target.identifier);42 let targetId = targetIdMap.get(event.data.target.identifier); 53 43 InspectorTest.pass(`Should receive TargetRemoved event for target ${targetId}`); 54 44 }); … … 57 47 InspectorTest.awaitEvent(FrontendTestHarness.Event.TestPageDidLoad) 58 48 .then(() => { 59 InspectorTest.expectEqual( lastAssignedId, 3, `Should have seen 3 different targets.`);49 InspectorTest.expectEqual(targetIdMap.size, 3, `Should have seen 3 different targets.`); 60 50 }) 61 51 .then(resolve); -
trunk/Source/WebCore/ChangeLog
r253717 r253718 1 2019-12-18 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: Runtime.enable reports duplicates (non existent) contexts 4 https://bugs.webkit.org/show_bug.cgi?id=204859 5 6 Reviewed by Devin Rousso. 7 8 Do not report main world context as non-main world one when Runtime.enable is called. 9 10 Test: inspector/runtime/executionContextCreated-onEnable.html 11 12 * inspector/agents/page/PageRuntimeAgent.cpp: 13 (WebCore::PageRuntimeAgent::enable): 14 (WebCore::PageRuntimeAgent::reportExecutionContextCreation): 15 1 16 2019-12-18 Antti Koivisto <antti@apple.com> 2 17 -
trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp
r253166 r253718 71 71 void PageRuntimeAgent::enable(ErrorString& errorString) 72 72 { 73 bool enabled = m_instrumentingAgents.pageRuntimeAgent() == this; 73 if (m_instrumentingAgents.pageRuntimeAgent() == this) 74 return; 74 75 75 76 InspectorRuntimeAgent::enable(errorString); 77 if (!errorString.isEmpty()) 78 return; 79 80 // Report initial contexts before enabling instrumentation as the reporting 81 // can force creation of script state which could result in duplicate notifications. 82 reportExecutionContextCreation(); 76 83 77 84 m_instrumentingAgents.setPageRuntimeAgent(this); 78 79 if (!enabled)80 reportExecutionContextCreation();81 85 } 82 86 … … 149 153 if (isolatedContexts.isEmpty()) 150 154 continue; 151 for (auto& context : isolatedContexts) 152 notifyContextCreated(frameId, context.first, context.second, false); 155 for (auto& [globalObject, securityOrigin] : isolatedContexts) { 156 if (globalObject != scriptState) 157 notifyContextCreated(frameId, globalObject, securityOrigin, false); 158 } 153 159 isolatedContexts.clear(); 154 160 } -
trunk/Source/WebInspectorUI/ChangeLog
r253706 r253718 1 2019-12-18 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: Runtime.enable reports duplicates (non existent) contexts 4 https://bugs.webkit.org/show_bug.cgi?id=204859 5 6 Reviewed by Devin Rousso. 7 8 Assert that all contexts added to the list are unique. 9 10 * UserInterface/Models/ExecutionContextList.js: 11 (WI.ExecutionContextList.prototype.add): 12 1 13 2019-12-18 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Models/ExecutionContextList.js
r220119 r253718 46 46 add(context) 47 47 { 48 // FIXME: The backend sends duplicate page context execution contexts with the same id. Why? 48 // COMPATIBILITY (iOS 13.0): Older iOS releases will send duplicates. 49 // Newer releases will not and this check should be removed eventually. 49 50 if (context.isPageContext && this._pageExecutionContext) { 50 51 console.assert(context.id === this._pageExecutionContext.id);
Note:
See TracChangeset
for help on using the changeset viewer.