WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-164098-20161027211627.patch (text/plain), 48.24 KB, created by
Devin Rousso
on 2016-10-27 21:20:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2016-10-27 21:20:17 PDT
Size:
48.24 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 7e1de72e1095e8a2b75ae233fa3a0b2653575e5a..90323519afa636f024ed8cc2329e173f83f73c6c 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,5 +1,27 @@ > 2016-10-27 Devin Rousso <dcrousso+webkit@gmail.com> > >+ Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection >+ https://bugs.webkit.org/show_bug.cgi?id=164098 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Models/DOMTree.js: >+ * UserInterface/Models/Frame.js: >+ Add support for WebInspector.Collection. >+ >+ * UserInterface/Models/Script.js: >+ (WebInspector.Script): >+ * UserInterface/Views/DebuggerSidebarPanel.js: >+ (WebInspector.DebuggerSidebarPanel.prototype._addResourcesRecursivelyForFrame): >+ * UserInterface/Views/FrameTreeElement.js: >+ (WebInspector.FrameTreeElement): >+ (WebInspector.FrameTreeElement.prototype.onpopulate): >+ * UserInterface/Views/OpenResourceDialog.js: >+ (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame): >+ Use new functions defined by changing to WebInspector.Collection. >+ >+2016-10-27 Devin Rousso <dcrousso+webkit@gmail.com> >+ > Web Inspector: Create general model object Collection class > https://bugs.webkit.org/show_bug.cgi?id=163995 > >diff --git a/Source/WebInspectorUI/UserInterface/Models/Collection.js b/Source/WebInspectorUI/UserInterface/Models/Collection.js >index db14a60cd929dce1787fdfd2f5c2ca3fc6410cf5..8c7739f837ba28e192f5a969af7e0177e561fabf 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/Collection.js >+++ b/Source/WebInspectorUI/UserInterface/Models/Collection.js >@@ -112,6 +112,7 @@ WebInspector.Collection = class Collection extends WebInspector.Object > > WebInspector.Collection.TypeVerifier = { > Any: (object) => true, >+ ContentFlow: (object) => object instanceof WebInspector.ContentFlow, > Frame: (object) => object instanceof WebInspector.Frame, > Resource: (object) => object instanceof WebInspector.Resource, > Script: (object) => object instanceof WebInspector.Script, >diff --git a/Source/WebInspectorUI/UserInterface/Models/DOMTree.js b/Source/WebInspectorUI/UserInterface/Models/DOMTree.js >index 26c766c0e127e0b8426a513e95d426c8724971db..dfabd481f893ee5870250ab78ed01af68b8b91db 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/DOMTree.js >+++ b/Source/WebInspectorUI/UserInterface/Models/DOMTree.js >@@ -33,7 +33,7 @@ WebInspector.DOMTree = class DOMTree extends WebInspector.Object > > this._rootDOMNode = null; > this._requestIdentifier = 0; >- this._flowMap = {}; >+ this._contentFlowCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.ContentFlow); > > this._frame.addEventListener(WebInspector.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextChanged, this); > >@@ -52,20 +52,8 @@ WebInspector.DOMTree = class DOMTree extends WebInspector.Object > > // Public > >- get frame() >- { >- return this._frame; >- } >- >- get flowMap() >- { >- return this._flowMap; >- } >- >- get flowsCount() >- { >- return Object.keys(this._flowMap).length; >- } >+ get frame() { return this._frame; } >+ get contentFlowCollection() { return this._contentFlowCollection; } > > disconnect() > { >@@ -263,64 +251,52 @@ WebInspector.DOMTree = class DOMTree extends WebInspector.Object > return; > > // Assume that all the flows have been removed. >- var deletedFlows = {}; >- for (var flowId in this._flowMap) >- deletedFlows[flowId] = this._flowMap[flowId]; >- >- var newFlows = []; >- >- var flows = event.data.flows; >- for (var i = 0; i < flows.length; ++i) { >- var flow = flows[i]; >+ let deletedFlows = new Set(this._contentFlowCollection.items); >+ let newFlows = new Set; >+ for (let flow of event.data.flows) { > // All the flows received from WebKit are part of the same document. > console.assert(this._isContentFlowInCurrentDocument(flow)); > >- var flowId = flow.id; >- if (this._flowMap.hasOwnProperty(flowId)) { >+ if (this._contentFlowCollection.items.has(flow)) { > // Remove the flow name from the deleted list. >- console.assert(deletedFlows.hasOwnProperty(flowId)); >- delete deletedFlows[flowId]; >+ console.assert(deletedFlows.has(flow)); >+ deletedFlows.delete(flow); > } else { >- this._flowMap[flowId] = flow; >- newFlows.push(flow); >+ this._contentFlowCollection.add(flow); >+ newFlows.add(flow); > } > } > >- for (var flowId in deletedFlows) { >- delete this._flowMap[flowId]; >- } >+ for (let flow of deletedFlows) >+ this._contentFlowCollection.remove(flow); > > // Send update events to listeners. > >- for (var flowId in deletedFlows) >- this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow: deletedFlows[flowId]}); >+ for (let flow of deletedFlows) >+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow}); > >- for (var i = 0; i < newFlows.length; ++i) >- this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow: newFlows[i]}); >+ for (let flow of newFlows) >+ this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow}); > } > > _contentFlowWasAdded(event) > { >- var flow = event.data.flow; >+ let flow = event.data.flow; > if (!this._isContentFlowInCurrentDocument(flow)) > return; > >- var flowId = flow.id; >- console.assert(!this._flowMap.hasOwnProperty(flowId)); >- this._flowMap[flowId] = flow; >+ this._contentFlowCollection.add(flow); > > this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasAdded, {flow}); > } > > _contentFlowWasRemoved(event) > { >- var flow = event.data.flow; >+ let flow = event.data.flow; > if (!this._isContentFlowInCurrentDocument(flow)) > return; > >- var flowId = flow.id; >- console.assert(this._flowMap.hasOwnProperty(flowId)); >- delete this._flowMap[flowId]; >+ this._contentFlowCollection.remove(flow); > > this.dispatchEventToListeners(WebInspector.DOMTree.Event.ContentFlowWasRemoved, {flow}); > } >diff --git a/Source/WebInspectorUI/UserInterface/Models/Frame.js b/Source/WebInspectorUI/UserInterface/Models/Frame.js >index 605975b038086c4294279bf8254075063ef74a1c..d32333a54575e37c0d16d53b1762c40114229a56 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/Frame.js >+++ b/Source/WebInspectorUI/UserInterface/Models/Frame.js >@@ -38,9 +38,9 @@ WebInspector.Frame = class Frame extends WebInspector.Object > > this._resourceCollection = new WebInspector.ResourceCollection; > this._provisionalResourceCollection = new WebInspector.ResourceCollection; >- this._extraScripts = []; >+ this._extraScriptCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.Script); > >- this._childFrames = []; >+ this._childFrameCollection = new WebInspector.Collection(WebInspector.Collection.TypeVerifier.Frame); > this._childFrameIdentifierMap = new Map; > > this._parentFrame = null; >@@ -57,6 +57,8 @@ WebInspector.Frame = class Frame extends WebInspector.Object > // Public > > get resourceCollection() { return this._resourceCollection; } >+ get extraScriptCollection() { return this._extraScriptCollection; } >+ get childFrameCollection() { return this._childFrameCollection; } > > initialize(name, securityOrigin, loaderIdentifier, mainResource) > { >@@ -130,7 +132,7 @@ WebInspector.Frame = class Frame extends WebInspector.Object > > this._resourceCollection = this._provisionalResourceCollection; > this._provisionalResourceCollection = new WebInspector.ResourceCollection; >- this._extraScripts = []; >+ this._extraScriptCollection.clear(); > > this.clearExecutionContexts(true); > this.clearProvisionalLoad(true); >@@ -237,11 +239,6 @@ WebInspector.Frame = class Frame extends WebInspector.Object > return this._parentFrame; > } > >- get childFrames() >- { >- return this._childFrames; >- } >- > get domContentReadyEventTimestamp() > { > return this._domContentReadyEventTimestamp; >@@ -306,7 +303,7 @@ WebInspector.Frame = class Frame extends WebInspector.Object > if (frame._parentFrame) > frame._parentFrame.removeChildFrame(frame); > >- this._childFrames.push(frame); >+ this._childFrameCollection.add(frame); > this._childFrameIdentifierMap.set(frame._id, frame); > > frame._parentFrame = this; >@@ -318,22 +315,21 @@ WebInspector.Frame = class Frame extends WebInspector.Object > { > console.assert(frameOrFrameId); > >- if (frameOrFrameId instanceof WebInspector.Frame) >- var childFrameId = frameOrFrameId._id; >- else >- var childFrameId = frameOrFrameId; >+ let childFrameId = frameOrFrameId; >+ if (childFrameId instanceof WebInspector.Frame) >+ childFrameId = frameOrFrameId._id; > > // Fetch the frame by id even if we were passed a WebInspector.Frame. >- // We do this incase the WebInspector.Frame is a new object that isn't in _childFrames, >- // but the id is a valid child frame. >- var childFrame = this.childFrameForIdentifier(childFrameId); >+ // We do this incase the WebInspector.Frame is a new object that isn't >+ // in _childFrameCollection, but the id is a valid child frame. >+ let childFrame = this.childFrameForIdentifier(childFrameId); > console.assert(childFrame instanceof WebInspector.Frame); > if (!(childFrame instanceof WebInspector.Frame)) > return; > > console.assert(childFrame.parentFrame === this); > >- this._childFrames.remove(childFrame); >+ this._childFrameCollection.remove(childFrame); > this._childFrameIdentifierMap.delete(childFrame._id); > > childFrame._detachFromParentFrame(); >@@ -345,10 +341,10 @@ WebInspector.Frame = class Frame extends WebInspector.Object > { > this._detachFromParentFrame(); > >- for (let childFrame of this._childFrames) >+ for (let childFrame of this._childFrameCollection.items) > childFrame.removeAllChildFrames(); > >- this._childFrames = []; >+ this._childFrameCollection.clear(); > this._childFrameIdentifierMap.clear(); > > this.dispatchEventToListeners(WebInspector.Frame.Event.AllChildFramesRemoved); >@@ -361,8 +357,8 @@ WebInspector.Frame = class Frame extends WebInspector.Object > return resource; > > // Check the main resources of the child frames for the requested URL. >- for (var i = 0; i < this._childFrames.length; ++i) { >- resource = this._childFrames[i].mainResource; >+ for (let childFrame of this._childFrameCollection.items) { >+ resource = childFrame.mainResource; > if (resource.url === url) > return resource; > } >@@ -371,8 +367,8 @@ WebInspector.Frame = class Frame extends WebInspector.Object > return null; > > // Recursively search resources of child frames. >- for (var i = 0; i < this._childFrames.length; ++i) { >- resource = this._childFrames[i].resourceForURL(url, true); >+ for (let childFrame of this._childFrameCollection.items) { >+ resource = childFrame.resourceForURL(url, true); > if (resource) > return resource; > } >@@ -408,13 +404,11 @@ WebInspector.Frame = class Frame extends WebInspector.Object > } > } > >- removeResource(resourceOrURL) >+ removeResource(resource) > { > // This does not remove provisional resources. > >- var resource = this._resourceCollection.remove(resourceOrURL); >- if (!resource) >- return; >+ this._resourceCollection.remove(resource); > > this._disassociateWithResource(resource); > >@@ -437,14 +431,9 @@ WebInspector.Frame = class Frame extends WebInspector.Object > this.dispatchEventToListeners(WebInspector.Frame.Event.AllResourcesRemoved); > } > >- get extraScripts() >- { >- return this._extraScripts; >- } >- > addExtraScript(script) > { >- this._extraScripts.push(script); >+ this._extraScriptCollection.add(script); > > this.dispatchEventToListeners(WebInspector.Frame.Event.ExtraScriptAdded, {script}); > } >diff --git a/Source/WebInspectorUI/UserInterface/Models/Script.js b/Source/WebInspectorUI/UserInterface/Models/Script.js >index 320298d19144c7095e07e80cd76bc1cf8c26ac65..db4180aa36cfae0048189f0d729c349c2bf2ac84 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/Script.js >+++ b/Source/WebInspectorUI/UserInterface/Models/Script.js >@@ -52,7 +52,7 @@ WebInspector.Script = class Script extends WebInspector.SourceCode > this._resource = null; > this._dynamicallyAddedScriptElement = true; > documentResource.parentFrame.addExtraScript(this); >- this._dynamicallyAddedScriptElementNumber = documentResource.parentFrame.extraScripts.length; >+ this._dynamicallyAddedScriptElementNumber = documentResource.parentFrame.extraScriptCollection.items.size; > } else if (this._resource) > this._resource.associateWithScript(this); > >diff --git a/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js b/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js >index 6d91dd81f1f856c19c7c40067cd52ae1d58ba5e7..988094ff22ad12b0ec3f76413c173b476284f975 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js >+++ b/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js >@@ -422,7 +422,7 @@ WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspec > for (let resource of frame.resourceCollection.items) > this._addResource(resource); > >- for (var childFrame of frame.childFrames) >+ for (let childFrame of frame.childFrameCollection.items) > this._addResourcesRecursivelyForFrame(childFrame); > } > >diff --git a/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js b/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js >index 5b3cb619b3fad6e0b3877ab57f591a72e082a145..d1aa1a76e486c71e012417a4a35d998952282821 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js >+++ b/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js >@@ -51,19 +51,19 @@ WebInspector.FrameTreeElement = class FrameTreeElement extends WebInspector.Reso > > this.registerFolderizeSettings("frames", WebInspector.UIString("Frames"), > (representedObject) => representedObject instanceof WebInspector.Frame, >- () => this.frame.childFrames.length, >+ () => this.frame.childFrameCollection.items.size, > WebInspector.FrameTreeElement > ); > > this.registerFolderizeSettings("flows", WebInspector.UIString("Flows"), > (representedObject) => representedObject instanceof WebInspector.ContentFlow, >- () => this.frame.domTree.flowsCount, >+ () => this.frame.domTree.contentFlowCollection.items.size, > WebInspector.ContentFlowTreeElement > ); > > this.registerFolderizeSettings("extra-scripts", WebInspector.UIString("Extra Scripts"), > (representedObject) => representedObject instanceof WebInspector.Script && representedObject.dynamicallyAddedScriptElement, >- () => this.frame.extraScripts.length, >+ () => this.frame.extraScriptCollection.items.size, > WebInspector.ScriptTreeElement > ); > >@@ -178,8 +178,8 @@ WebInspector.FrameTreeElement = class FrameTreeElement extends WebInspector.Reso > this.updateParentStatus(); > this.prepareToPopulate(); > >- for (var i = 0; i < this._frame.childFrames.length; ++i) >- this.addChildForRepresentedObject(this._frame.childFrames[i]); >+ for (let frame of this._frame.childFrameCollection.items) >+ this.addChildForRepresentedObject(frame); > > for (let resource of this._frame.resourceCollection.items) > this.addChildForRepresentedObject(resource); >@@ -191,11 +191,10 @@ WebInspector.FrameTreeElement = class FrameTreeElement extends WebInspector.Reso > this.addChildForRepresentedObject(sourceMap.resources[j]); > } > >- var flowMap = this._frame.domTree.flowMap; >- for (var flowKey in flowMap) >- this.addChildForRepresentedObject(flowMap[flowKey]); >+ for (let contentFlow of this._frame.domTree.contentFlowCollection.items) >+ this.addChildForRepresentedObject(contentFlow); > >- for (let extraScript of this._frame.extraScripts) { >+ for (let extraScript of this._frame.extraScriptCollection.items) { > if (extraScript.sourceURL || extraScript.sourceMappingURL) > this.addChildForRepresentedObject(extraScript); > } >diff --git a/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js b/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js >index 3ac33e9c180b29de342cae255c6c7c4f55ceb59b..b3206372adb77e6fe3e2ae6df21efde13bfc1c73 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js >+++ b/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js >@@ -272,7 +272,7 @@ WebInspector.OpenResourceDialog = class OpenResourceDialog extends WebInspector. > for (let resource of resources) > this._addResource(resource, suppressFilterUpdate); > >- frames = frames.concat(currentFrame.childFrames); >+ frames = frames.concat(currentFrame.childFrameCollection.toArray()); > } > > this._updateFilter(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 37af16ab599228afe8263ac2a7dfde4e13f095e2..a49bc53238dff57b9dbe8a728578296cbeeab517 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,26 @@ >+2016-10-27 Devin Rousso <dcrousso+webkit@gmail.com> >+ >+ Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection >+ https://bugs.webkit.org/show_bug.cgi?id=164098 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt: >+ * http/tests/inspector/console/cross-domain-inspected-node-access.html: >+ * http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html: >+ * inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt: >+ * inspector/css/manager-preferredInspectorStyleSheetForFrame.html: >+ * inspector/dom/content-flow-list.html: >+ * inspector/dom/highlightFrame-expected.txt: >+ * inspector/dom/highlightFrame.html: >+ * inspector/dom/highlightNode-expected.txt: >+ * inspector/dom/highlightNode.html: >+ * inspector/dom/highlightSelector-expected.txt: >+ * inspector/dom/highlightSelector.html: >+ * inspector/model/frame-extra-scripts-expected.txt: >+ * inspector/model/frame-extra-scripts.html: >+ Change functionality to support WebInspector.Collection methods. >+ > 2016-10-27 Ryan Haddad <ryanhaddad@apple.com> > > Marking http/tests/security/svg-image-with-css-cross-domain.html as flaky on mac. >diff --git a/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt b/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt >index 6d0d07d16fbad16cb91ee3298dd65d947c682478..d638f6bd85a72f6abd708d778f09887a1af62410 100644 >--- a/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt >+++ b/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt >@@ -3,6 +3,7 @@ CONSOLE MESSAGE: line 42: Blocked a frame with origin "http://localhost:8000" fr > Test that code evaluated in the main frame cannot access $0 that resolves to a node in a frame from a different domain. Bug 105423. > > >+PASS: Page should have a subframe. > > == Running test suite: CommandLineAPI.$0.cross-frame > -- Running test case: AttemptCrossFrame$0AccessFromMainFrame >diff --git a/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html b/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html >index 7963d4bc8d2081e2061f16006ab46811bbd33a6f..0911f8e55ab56676007fd19845f0ba61c2348309 100644 >--- a/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html >+++ b/LayoutTests/http/tests/inspector/console/cross-domain-inspected-node-access.html >@@ -7,13 +7,17 @@ function test() > { > let suite = InspectorTest.createAsyncSuite("CommandLineAPI.$0.cross-frame"); > >+ let mainFrame = WebInspector.frameResourceManager.mainFrame; >+ let childFrames = mainFrame.childFrameCollection.toArray(); >+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe."); >+ > let nodeInMainFrameId; > let nodeInSubFrameId; > > suite.addTestCase({ > name: "AttemptCrossFrame$0AccessFromMainFrame", > description: "Should not be able to access $0 node in different domain subframe from the main frame.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > InspectorTest.log("Setting $0 to node within subframe."); > ConsoleAgent.addInspectedNode(nodeInSubFrameId); > RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true}, (error, remoteObjectPayload, wasThrown) => { >@@ -29,7 +33,7 @@ function test() > suite.addTestCase({ > name: "AttemptSameFrame$0AccessFromMainFrame", > description: "Should be able to access $0 node in the same frame.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > InspectorTest.log("Setting $0 to node within the main frame."); > ConsoleAgent.addInspectedNode(nodeInMainFrameId); > RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true}, (error, remoteObjectPayload, wasThrown) => { >@@ -45,11 +49,10 @@ function test() > suite.addTestCase({ > name: "AttemptCrossFrame$0AccessFromSubFrame", > description: "Should not be able to access $0 node in different domain main frame from the subframe.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > InspectorTest.log("Setting $0 to node within the main frame."); > ConsoleAgent.addInspectedNode(nodeInMainFrameId); >- const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0]; >- RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => { >+ RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => { > InspectorTest.assert(!error, "Should not be a protocol error."); > InspectorTest.assert(!wasThrown, "Should not be an exception."); > let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload); >@@ -62,11 +65,10 @@ function test() > suite.addTestCase({ > name: "AttemptSameFrame$0AccessFromSubFrame", > description: "Should be able to access $0 node in the same frame.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > InspectorTest.log("Setting $0 to node within the subframe."); > ConsoleAgent.addInspectedNode(nodeInSubFrameId); >- const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0]; >- RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => { >+ RuntimeAgent.evaluate.invoke({expression: "$0", includeCommandLineAPI: true, contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload, wasThrown) => { > InspectorTest.assert(!error, "Should not be a protocol error."); > InspectorTest.assert(!wasThrown, "Should not be an exception."); > let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload); >diff --git a/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html b/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html >index cdf931ab5325a6490935d025cf7b5c447ff3e7a3..90062a1f0adf1ee4505b37426b1e405a9e207a6d 100644 >--- a/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html >+++ b/LayoutTests/http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html >@@ -30,9 +30,14 @@ function test() > InspectorTest.log("DOMTree instance count: " + instances.size); > > // Force creation of child DOM trees. >- mainFrame.childFrames[0].domTree; >- mainFrame.childFrames[0].childFrames[0].domTree; >- mainFrame.childFrames[0].childFrames[0].childFrames[0].domTree; >+ let childrenLevel1 = mainFrame.childFrameCollection.toArray(); >+ childrenLevel1[0].domTree; >+ >+ let childrenLevel2 = childrenLevel1[0].childFrameCollection.toArray(); >+ childrenLevel2[0].domTree; >+ >+ let childrenLevel3 = childrenLevel2[0].childFrameCollection.toArray(); >+ childrenLevel3[0].domTree; > > instances = WebInspector.domTreeManager.retainedObjectsWithPrototype(WebInspector.DOMTree); > InspectorTest.expectThat(instances.size === 4, "There should be four DOMTrees listening to DOMTreeManager events after touching each Frame."); >diff --git a/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt b/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt >index 4438dcf02bc502000b5091f6cb12c982aea3936b..60a471ea00a62d0113ace3701456e598d9a5c473 100644 >--- a/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt >+++ b/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame-expected.txt >@@ -1,6 +1,7 @@ > Test CSSManager.preferredInspectorStyleSheetForFrame. > > >+PASS: Page should have a subframe. > > == Running test suite: CSSManager.preferredInspectorStyleSheetForFrame > -- Running test case: CheckNoStyleSheets >diff --git a/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html b/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html >index 48fc4810958f794fc30425675b23f69680d657e5..e80bf7a6bf3d9301fd2a455efb1cbe6f8d6c8ade 100644 >--- a/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html >+++ b/LayoutTests/inspector/css/manager-preferredInspectorStyleSheetForFrame.html >@@ -6,7 +6,8 @@ > function test() > { > let mainFrame = WebInspector.frameResourceManager.mainFrame; >- let childFrame = mainFrame.childFrames[0]; >+ let childFrames = mainFrame.childFrameCollection.toArray(); >+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe."); > > let suite = InspectorTest.createAsyncSuite("CSSManager.preferredInspectorStyleSheetForFrame"); > >@@ -64,10 +65,10 @@ function test() > .then((event) => { > InspectorTest.expectThat(event.data.styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, "Added StyleSheet origin should be 'inspector'."); > InspectorTest.expectThat(event.data.styleSheet.isInspectorStyleSheet(), "StyleSheet.isInspectorStyleSheet() should be true."); >- InspectorTest.expectThat(event.data.styleSheet.parentFrame === childFrame, "Added StyleSheet frame should be a child frame."); >+ InspectorTest.expectThat(event.data.styleSheet.parentFrame === childFrames[0], "Added StyleSheet frame should be a child frame."); > }); > >- WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrame, (styleSheet) => { >+ WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrames[0], (styleSheet) => { > InspectorTest.expectThat(WebInspector.cssStyleManager.styleSheets.length === 2, "Should be two stylesheets."); > InspectorTest.expectThat(styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, "StyleSheet origin should be 'inspector'."); > InspectorTest.expectThat(styleSheet.isInspectorStyleSheet(), "StyleSheet.isInspectorStyleSheet() should be true."); >@@ -83,7 +84,7 @@ function test() > let listener = WebInspector.cssStyleManager.singleFireEventListener(WebInspector.CSSStyleManager.Event.StyleSheetAdded, (event) => { > InspectorTest.assert(false, "Should not create a new StyleSheet, should reuse the existing one"); > }); >- WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrame, (styleSheet) => { >+ WebInspector.cssStyleManager.preferredInspectorStyleSheetForFrame(childFrames[0], (styleSheet) => { > InspectorTest.expectThat(WebInspector.cssStyleManager.styleSheets.length === 2, "Should be two stylesheets."); > InspectorTest.expectThat(styleSheet.origin === WebInspector.CSSStyleSheet.Type.Inspector, "StyleSheet origin should be 'inspector'."); > InspectorTest.expectThat(styleSheet.isInspectorStyleSheet(), "StyleSheet.isInspectorStyleSheet() should be true."); >diff --git a/LayoutTests/inspector/dom/content-flow-list.html b/LayoutTests/inspector/dom/content-flow-list.html >index 0b9221589b62aceec676da8078d1ea2025937a74..ff0628a32adc1c9cbba22dd707672557a8ab1ce6 100644 >--- a/LayoutTests/inspector/dom/content-flow-list.html >+++ b/LayoutTests/inspector/dom/content-flow-list.html >@@ -16,31 +16,32 @@ function removeFlow() > > function test() > { >+ let domTree = WebInspector.frameResourceManager.mainFrame.domTree; >+ > function onRootDOMNodeInvalidated() > { >- WebInspector.frameResourceManager.mainFrame.domTree.requestContentFlowList(); >+ domTree.requestContentFlowList(); > } > > function onContentFlowWasAdded(event) > { >- InspectorTest.expectThat(event.data.flow.name === "flow1", "ContentFlow was added"); >- InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 1, "Flow count is 1"); >+ InspectorTest.expectEqual(event.data.flow.name, "flow1", "ContentFlow was added"); >+ InspectorTest.expectEqual(domTree.contentFlowCollection.items.size, 1, "Flow count is 1"); > > InspectorTest.evaluateInPage("removeFlow()"); > } > > function onContentFlowWasRemoved(event) > { >- InspectorTest.expectThat(event.data.flow.name === "flow1", "ContentFlow was removed"); >- InspectorTest.expectThat(WebInspector.frameResourceManager.mainFrame.domTree.flowsCount === 0, "Flow count is 0"); >+ InspectorTest.expectEqual(event.data.flow.name, "flow1", "ContentFlow was removed"); >+ InspectorTest.expectEqual(domTree.contentFlowCollection.items.size, 0, "Flow count is 0"); > InspectorTest.completeTest(); > } > > WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, function() { >- var domTree = WebInspector.frameResourceManager.mainFrame.domTree; >- domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated, null); >- domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded, null); >- domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, onContentFlowWasRemoved, null); >+ domTree.addEventListener(WebInspector.DOMTree.Event.RootDOMNodeInvalidated, onRootDOMNodeInvalidated); >+ domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasAdded, onContentFlowWasAdded); >+ domTree.addEventListener(WebInspector.DOMTree.Event.ContentFlowWasRemoved, onContentFlowWasRemoved); > domTree.requestContentFlowList(); > }); > >diff --git a/LayoutTests/inspector/dom/highlightFrame-expected.txt b/LayoutTests/inspector/dom/highlightFrame-expected.txt >index 79995b58a14547dfae2ca891a4e3df56db35dcdc..ef2a00785cf222a0c2826f661acb2dc9a6075471 100644 >--- a/LayoutTests/inspector/dom/highlightFrame-expected.txt >+++ b/LayoutTests/inspector/dom/highlightFrame-expected.txt >@@ -1,6 +1,7 @@ > Tests for the DOM.highlightFrame command. > > >+PASS: Page should have subframes. > > == Running test suite: DOM.highlightFrame > -- Running test case: CheckEmptyHighlight >diff --git a/LayoutTests/inspector/dom/highlightFrame.html b/LayoutTests/inspector/dom/highlightFrame.html >index 2b30433c1ff655c97e6b812e13201d8f6e70c6c2..1c40a8ac9c2af52665950525eb1891a337805f00 100644 >--- a/LayoutTests/inspector/dom/highlightFrame.html >+++ b/LayoutTests/inspector/dom/highlightFrame.html >@@ -5,10 +5,11 @@ > <script> > function test() > { >- InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 2, "Page should have subframes."); >- const mainFrame = WebInspector.frameResourceManager.mainFrame; >- const childFrame1 = WebInspector.frameResourceManager.mainFrame.childFrames[0]; >- const childFrame2 = WebInspector.frameResourceManager.mainFrame.childFrames[1]; >+ let suite = InspectorTest.createAsyncSuite("DOM.highlightFrame"); >+ >+ let mainFrame = WebInspector.frameResourceManager.mainFrame; >+ let childFrames = mainFrame.childFrameCollection.toArray(); >+ InspectorTest.expectEqual(childFrames.length, 2, "Page should have subframes."); > > function getHighlight(callback) { > InspectorTest.evaluateInPage("window.internals.inspectorHighlightObject()", (error, payload, wasThrown) => { >@@ -25,12 +26,10 @@ function test() > }); > } > >- let suite = InspectorTest.createAsyncSuite("DOM.highlightFrame"); >- > suite.addTestCase({ > name: "CheckEmptyHighlight", > description: "Should not be a highlight yet.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > getHighlight((highlightObjectPayload) => { > InspectorTest.expectThat(highlightObjectPayload.length === 0, "Should not be a highlight yet."); > resolve(); >@@ -41,7 +40,7 @@ function test() > suite.addTestCase({ > name: "HighlightMainFrame", > description: "Main frame does not have an owner element, so there will be no highlight.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > DOMAgent.highlightFrame(mainFrame.id, undefined, undefined, (error) => { > getHighlight((highlightObjectPayload) => { > InspectorTest.expectThat(highlightObjectPayload.length === 0, "Should not be a highlight for the main frame."); >@@ -54,8 +53,8 @@ function test() > suite.addTestCase({ > name: "HighlightChildFrame1", > description: "Should highlight child frame 1.", >- test: (resolve, reject) => { >- DOMAgent.highlightFrame(childFrame1.id, undefined, undefined, (error) => { >+ test(resolve, reject) { >+ DOMAgent.highlightFrame(childFrames[0].id, undefined, undefined, (error) => { > InspectorTest.assert(!error, "Should not have an error."); > dumpHighlight(resolve); > }); >@@ -65,8 +64,8 @@ function test() > suite.addTestCase({ > name: "HighlightChildFrame2", > description: "Should highlight child frame 2.", >- test: (resolve, reject) => { >- DOMAgent.highlightFrame(childFrame2.id, undefined, undefined, (error) => { >+ test(resolve, reject) { >+ DOMAgent.highlightFrame(childFrames[1].id, undefined, undefined, (error) => { > InspectorTest.assert(!error, "Should not have an error."); > dumpHighlight(resolve); > }); >@@ -78,7 +77,7 @@ function test() > suite.addTestCase({ > name: "BadFrameId", > description: "Bad frame id should cause an error.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > DOMAgent.highlightFrame("bad-frame-id", undefined, undefined, (error) => { > InspectorTest.expectThat(error, "Should produce an error."); > InspectorTest.log("Error: " + error); >diff --git a/LayoutTests/inspector/dom/highlightNode-expected.txt b/LayoutTests/inspector/dom/highlightNode-expected.txt >index 4da65686036926d1b751db1031fe26bea84ba731..d6f7e05ba43bcaae7bcfa2b6a113e0f3411bc627 100644 >--- a/LayoutTests/inspector/dom/highlightNode-expected.txt >+++ b/LayoutTests/inspector/dom/highlightNode-expected.txt >@@ -1,6 +1,7 @@ > Tests for the DOM.highlightNode command. > > >+PASS: Page should have a subframe. > > == Running test suite: DOM.highlightNode > -- Running test case: CheckEmptyHighlight >diff --git a/LayoutTests/inspector/dom/highlightNode.html b/LayoutTests/inspector/dom/highlightNode.html >index d3e0eedf16030ed016a6bb11472b58ed1f481573..bce536dd68213c338b68a752d8db22f3b31cec39 100644 >--- a/LayoutTests/inspector/dom/highlightNode.html >+++ b/LayoutTests/inspector/dom/highlightNode.html >@@ -5,9 +5,12 @@ > <script> > function test() > { >- InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, "Page should have a subframe."); >- const mainFrame = WebInspector.frameResourceManager.mainFrame; >- const childFrame = WebInspector.frameResourceManager.mainFrame.childFrames[0]; >+ let suite = InspectorTest.createAsyncSuite("DOM.highlightNode"); >+ >+ let mainFrame = WebInspector.frameResourceManager.mainFrame; >+ let childFrames = mainFrame.childFrameCollection.toArray(); >+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe."); >+ > const highlightConfig = { > showInfo: true, > contentColor: {r: 255, g: 255, b: 255}, >@@ -26,7 +29,7 @@ function test() > > function dumpHighlight(callback) { > getHighlight((highlightObjectPayload) => { >- InspectorTest.expectThat(highlightObjectPayload.length === 1, "Should be one highlighted node."); >+ InspectorTest.expectEqual(highlightObjectPayload.length, 1, "Should be one highlighted node."); > InspectorTest.log("Highlighted Element Data: " + JSON.stringify(highlightObjectPayload[0].elementData)); > callback(); > }); >@@ -36,14 +39,12 @@ function test() > let mainFrameDocumentNodeId, mainFrameTargetNode; > let childFrameDocumentNodeId, childFrameTargetNode; > >- let suite = InspectorTest.createAsyncSuite("DOM.highlightNode"); >- > suite.addTestCase({ > name: "CheckEmptyHighlight", > description: "Should not be a highlight yet.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > getHighlight((highlightObjectPayload) => { >- InspectorTest.expectThat(highlightObjectPayload.length === 0, "Should not be a highlight yet."); >+ InspectorTest.expectEqual(highlightObjectPayload.length, 0, "Should not be a highlight yet."); > resolve(); > }); > } >@@ -52,7 +53,7 @@ function test() > suite.addTestCase({ > name: "MainFrameNodeViaNodeId", > description: "Should highlight a node in the main frame using node id.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > WebInspector.domTreeManager.querySelector(mainFrameDocumentNodeId, "#id-one", function(nodeId) { > mainFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId); > DOMAgent.highlightNode(highlightConfig, mainFrameTargetNode.id, undefined, (error) => { >@@ -66,7 +67,7 @@ function test() > suite.addTestCase({ > name: "ChildFrameNodeViaNodeId", > description: "Should highlight a node in the child frame using node id.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > WebInspector.domTreeManager.querySelector(childFrameDocumentNodeId, "#id-one", function(nodeId) { > childFrameTargetNode = WebInspector.domTreeManager.nodeForId(nodeId); > DOMAgent.highlightNode(highlightConfig, childFrameTargetNode.id, undefined, (error) => { >@@ -80,7 +81,7 @@ function test() > suite.addTestCase({ > name: "MainFrameNodeViaObjectId", > description: "Should highlight a node in the main frame using object id.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > WebInspector.RemoteObject.resolveNode(mainFrameTargetNode, "test", (remoteObject) => { > DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) => { > InspectorTest.assert(!error, "Should not have an error."); >@@ -93,7 +94,7 @@ function test() > suite.addTestCase({ > name: "ChildFrameNodeViaObjectId", > description: "Should highlight a node in the child frame using object id.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > WebInspector.RemoteObject.resolveNode(childFrameTargetNode, "test", (remoteObject) => { > DOMAgent.highlightNode(highlightConfig, undefined, remoteObject.objectId, (error) => { > InspectorTest.assert(!error, "Should not have an error."); >@@ -108,7 +109,7 @@ function test() > suite.addTestCase({ > name: "MissingNodeAndObjectIdShouldError", > description: "Missing identifiers should cause an error.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > DOMAgent.highlightNode(highlightConfig, undefined, undefined, (error) => { > InspectorTest.expectThat(error, "Should produce an error."); > InspectorTest.log("Error: " + error); >@@ -120,7 +121,7 @@ function test() > suite.addTestCase({ > name: "BadNodeId", > description: "Bad node id should cause an error.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > DOMAgent.highlightNode(highlightConfig, 9999999, undefined, (error) => { > InspectorTest.expectThat(error, "Should produce an error."); > InspectorTest.log("Error: " + error); >@@ -132,7 +133,7 @@ function test() > suite.addTestCase({ > name: "BadObjectId", > description: "Bad object id should cause an error.", >- test: (resolve, reject) => { >+ test(resolve, reject) { > DOMAgent.highlightNode(highlightConfig, undefined, "bad-object-id", (error) => { > InspectorTest.expectThat(error, "Should produce an error."); > InspectorTest.log("Error: " + error); >@@ -143,7 +144,7 @@ function test() > > WebInspector.domTreeManager.requestDocument((documentNode) => { > mainFrameDocumentNodeId = documentNode.id; >- RuntimeAgent.evaluate.invoke({expression: "document", objectGroup: "test", contextId: childFrame.pageExecutionContext.id}, (error, remoteObjectPayload) => { >+ RuntimeAgent.evaluate.invoke({expression: "document", objectGroup: "test", contextId: childFrames[0].pageExecutionContext.id}, (error, remoteObjectPayload) => { > let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload) > remoteObject.pushNodeToFrontend((documentNodeId) => { > childFrameDocumentNodeId = documentNodeId >diff --git a/LayoutTests/inspector/dom/highlightSelector-expected.txt b/LayoutTests/inspector/dom/highlightSelector-expected.txt >index b186d420e5c0f7139b9ef16c665de7afbc7c8d36..00f08923df5c026e972d9f1b92bdad0cc512846e 100644 >--- a/LayoutTests/inspector/dom/highlightSelector-expected.txt >+++ b/LayoutTests/inspector/dom/highlightSelector-expected.txt >@@ -1,6 +1,7 @@ > Tests for the DOM.highlightSelector command. > > >+PASS: Page should have a subframe. > > == Running test suite: DOM.highlightSelector > -- Running test case: MainFrameTagSelector >diff --git a/LayoutTests/inspector/dom/highlightSelector.html b/LayoutTests/inspector/dom/highlightSelector.html >index 7c7b122d5302edb03eb06e7e11a7059af2f181a7..9f2578333e6a579dfddb62af304d1b0fe7df8b0b 100644 >--- a/LayoutTests/inspector/dom/highlightSelector.html >+++ b/LayoutTests/inspector/dom/highlightSelector.html >@@ -5,9 +5,15 @@ > <script> > function test() > { >- InspectorTest.assert(WebInspector.frameResourceManager.mainFrame.childFrames.length === 1, "Page should have a subframe."); >- const mainFrameId = WebInspector.frameResourceManager.mainFrame.id; >- const childFrameId = WebInspector.frameResourceManager.mainFrame.childFrames[0].id; >+ let suite = InspectorTest.createAsyncSuite("DOM.highlightSelector"); >+ >+ let mainFrame = WebInspector.frameResourceManager.mainFrame; >+ let childFrames = mainFrame.childFrameCollection.toArray(); >+ InspectorTest.expectEqual(childFrames.length, 1, "Page should have a subframe."); >+ >+ let mainFrameId = mainFrame.id; >+ let childFrameId = childFrames[0].id; >+ > const highlightConfig = { > showInfo: true, > contentColor: {r: 255, g: 255, b: 255}, >@@ -102,13 +108,10 @@ function test() > }); > } > >- let suite = InspectorTest.createAsyncSuite("DOM.highlightSelector"); >- >- for (let testcase of tests) { >- let {name, frameId, selector, expectedElements, expectError} = testcase; >+ for (let {name, frameId, selector, expectedElements, expectError} of tests) { > suite.addTestCase({ > name, >- test: (resolve, reject) => { >+ test(resolve, reject) { > InspectorTest.log("- Frame: " + displayNameForFrameId(frameId)); > InspectorTest.log("- Selector: " + selector); > DOMAgent.highlightSelector(highlightConfig, selector, frameId, (error) => { >diff --git a/LayoutTests/inspector/model/frame-extra-scripts-expected.txt b/LayoutTests/inspector/model/frame-extra-scripts-expected.txt >index 3d4c30e4e6911ad6831ef0b300b2016202308c2e..3d5ce8960e933fc7420120f726a07a038d63b301 100644 >--- a/LayoutTests/inspector/model/frame-extra-scripts-expected.txt >+++ b/LayoutTests/inspector/model/frame-extra-scripts-expected.txt >@@ -1,8 +1,8 @@ > CONSOLE MESSAGE: line 1: dynamically added script element >-WebInspector.Frame.extraScripts. >+WebInspector.Frame.extraScriptCollection. > > >-== Running test suite: WebInspector.Frame.extraScripts >+== Running test suite: WebInspector.Frame.extraScriptCollection > -- Running test case: FrameHasNoExtraScriptsYet > PASS: Main frame should have no dynamic scripts. > >diff --git a/LayoutTests/inspector/model/frame-extra-scripts.html b/LayoutTests/inspector/model/frame-extra-scripts.html >index 6eb9b7a73d9528f68f1ebd15cfc1d619df6767d5..bf46982373ba513a8df4b0c6f1b90522cd665e75 100644 >--- a/LayoutTests/inspector/model/frame-extra-scripts.html >+++ b/LayoutTests/inspector/model/frame-extra-scripts.html >@@ -11,14 +11,15 @@ function triggerAddScriptElement() { > > function test() > { >- let suite = InspectorTest.createAsyncSuite("WebInspector.Frame.extraScripts"); >+ let suite = InspectorTest.createAsyncSuite("WebInspector.Frame.extraScriptCollection"); >+ >+ let mainFrame = WebInspector.frameResourceManager.mainFrame; > > suite.addTestCase({ > name: "FrameHasNoExtraScriptsYet", > description: "No extra scripts yet.", > test(resolve, reject) { >- let mainFrame = WebInspector.frameResourceManager.mainFrame; >- InspectorTest.expectThat(mainFrame.extraScripts.length === 0, "Main frame should have no dynamic scripts."); >+ InspectorTest.expectEqual(mainFrame.extraScriptCollection.items.size, 0, "Main frame should have no dynamic scripts."); > resolve(); > } > }); >@@ -31,9 +32,7 @@ function test() > .then((event) => { > InspectorTest.pass("ExtraScriptAdded event fired."); > InspectorTest.expectThat(event.data.script.dynamicallyAddedScriptElement, "Script should identify as dynamic."); >- >- let mainFrame = WebInspector.frameResourceManager.mainFrame; >- InspectorTest.expectThat(mainFrame.extraScripts.length === 1, "Main frame should have 1 dynamic script."); >+ InspectorTest.expectEqual(mainFrame.extraScriptCollection.items.size, 1, "Main frame should have 1 dynamic script."); > }) > .then(resolve, reject); > >@@ -46,6 +45,6 @@ function test() > </script> > </head> > <body onload="runTest()"> >-<p>WebInspector.Frame.extraScripts.</p> >+<p>WebInspector.Frame.extraScriptCollection.</p> > </body> > </html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 164098
:
293088
|
293095
|
293096
|
293098
|
293100
|
293104
|
293105
|
293107
| 293110