Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource.html

Issue 2897713002: DevTools: ResourceTreeModel should not report resources twice (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource.html
new file mode 100644
index 0000000000000000000000000000000000000000..f4412666880194e8ee29a0485dccae410f6602d4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script src="../../inspector/inspector-test.js"></script>
+<script src="../../inspector/resources-test.js"></script>
+<script src="../../inspector/resource-tree/resource-tree-test.js"></script>
+<script>
+function createIframe() {
+ var iframe = document.createElement('iframe');
+ iframe.setAttribute('src', 'resources/dummy-iframe.html');
+ document.body.appendChild(iframe);
+ return new Promise(x => iframe.onload = x);
+}
+
+async function test()
+{
+ await InspectorTest.evaluateInPageAsync('createIframe()');
+
+ var resourceTreeModel = new SDK.ResourceTreeModel(InspectorTest.mainTarget);
+ var resources = [];
+ resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.ResourceAdded, event => resources.push(event.data));
+ resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.CachedResourcesLoaded, function() {
+ resources.sort((a, b) => {
+ if (a.url === b.url)
+ return 0;
+ return a.url < b.url ? -1 : 1;
+ });
+ InspectorTest.addResult('Reported resources:');
+ InspectorTest.addResult(resources.map(r => ' ' + r.url).join('\n'));
+ InspectorTest.completeTest();
+ });
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+Verify that iframe's main resource is reported only once.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/iframe-main-resource-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698