| Index: third_party/WebKit/LayoutTests/inspector-protocol/timeline/page-frames.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/timeline/page-frames.html b/third_party/WebKit/LayoutTests/inspector-protocol/timeline/page-frames.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f7746709b28420b62238ad2339d6d22d7aabef81
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/timeline/page-frames.html
|
| @@ -0,0 +1,48 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/tracing-test.js"></script>
|
| +<script>
|
| +function performActions()
|
| +{
|
| + var frame1 = document.createElement("iframe");
|
| + frame1.name = "Frame No. 1";
|
| + document.body.appendChild(frame1);
|
| + frame1.contentWindow.document.write("console.log('frame2')");
|
| +
|
| + var frame2 = document.createElement("iframe");
|
| + frame2.src = "../resources/blank.html";
|
| + document.body.appendChild(frame2);
|
| +
|
| + return new Promise(fulfill => { frame2.addEventListener("load", fulfill, false) });
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.invokeAsyncWithTracing("performActions", finish);
|
| +
|
| + function finish(devtoolsEvents, data)
|
| + {
|
| + InspectorTest.log("Frames in TracingStartedInPage");
|
| + var tracingStarted = InspectorTest.findEvent("TracingStartedInPage", "I");
|
| + for (var frame of tracingStarted.args["data"]["frames"] || [])
|
| + dumpFrame(frame);
|
| +
|
| + InspectorTest.log("Frames in CommitLoad events");
|
| + var commitLoads = InspectorTest.findEvents("CommitLoad", "X");
|
| + for (var event of commitLoads)
|
| + dumpFrame(event.args["data"]);
|
| + InspectorTest.completeTest();
|
| + }
|
| +
|
| + function dumpFrame(frame)
|
| + {
|
| + var url = frame.url.replace(/.*\/(([^/]*\/){2}[^/]*$)/, "$1");
|
| + InspectorTest.log(`url: ${url} name: ${frame.name}`);
|
| + }
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onLoad="runTest();">
|
| +</body>
|
| +</html>
|
|
|