| Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html
|
| deleted file mode 100644
|
| index c1eb2f401824b8f607c7532e520f57b1905bcac9..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html
|
| +++ /dev/null
|
| @@ -1,154 +0,0 @@
|
| -<html>
|
| -<head>
|
| -<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
|
| -<script>
|
| -
|
| -function createFrame()
|
| -{
|
| - var frame = document.createElement("iframe");
|
| - frame.src = "../resources/blank.html";
|
| - frame.id = "iframe";
|
| - document.body.appendChild(frame);
|
| - return new Promise((resolve) => frame.onload = resolve);
|
| -}
|
| -
|
| -function createCraftedFrame()
|
| -{
|
| - var frame = document.createElement("iframe");
|
| - frame.src = "../resources/blank.html";
|
| - frame.id = "crafted-iframe";
|
| - document.body.appendChild(frame);
|
| - frame.contentDocument.write("<div>crafted</div>");
|
| - frame.contentDocument.close();
|
| -}
|
| -
|
| -function test()
|
| -{
|
| - InspectorTest.evaluate = function(expression)
|
| - {
|
| - InspectorTest.sendCommandOrDie("Runtime.evaluate", {expression: expression});
|
| - }
|
| -
|
| - InspectorTest.fail = function(message)
|
| - {
|
| - InspectorTest.log(message);
|
| - InspectorTest.completeTest();
|
| - }
|
| -
|
| - InspectorTest.sendCommand("Runtime.enable", {});
|
| -
|
| - function pageContextCreated()
|
| - {
|
| - InspectorTest.log("Page context was created");
|
| - InspectorTest.log("Create new frame");
|
| - InspectorTest.sendCommandPromise("Runtime.evaluate", {expression: "createFrame()", awaitPromise: true})
|
| - .then(() => navigateFrame());
|
| - }
|
| -
|
| - var frameExecutionContextId = 0;
|
| -
|
| - function frameContextCreated(executionContextId)
|
| - {
|
| - InspectorTest.log("Frame context was created");
|
| - frameExecutionContextId = executionContextId;
|
| - }
|
| -
|
| - function navigateFrame()
|
| - {
|
| - InspectorTest.log("Navigate frame");
|
| - InspectorTest.evaluate("window.frames[0].location = \"resources/runtime-events-iframe.html\"");
|
| - }
|
| -
|
| - function frameContextDestroyedBeforeNavigation(executionContextId)
|
| - {
|
| - if (frameExecutionContextId !== executionContextId) {
|
| - InspectorTest.fail("Execution context with id = " + executionContextId + " was destroyed, but iframe's executionContext had id = " + frameExecutionContextId + " before navigation");
|
| - return;
|
| - }
|
| - InspectorTest.log("Frame's context was destroyed");
|
| - frameExecutionContextId = 0;
|
| - }
|
| -
|
| - function frameContextCreatedAfterNavigation(executionContextId)
|
| - {
|
| - InspectorTest.log("Frame context was created");
|
| - frameExecutionContextId = executionContextId;
|
| - InspectorTest.log("Remove frame");
|
| - InspectorTest.evaluate("document.querySelector(\"#iframe\").remove()");
|
| - }
|
| -
|
| - function frameContextDestroyedAfterFrameRemoved(executionContextId)
|
| - {
|
| - if (frameExecutionContextId !== executionContextId) {
|
| - InspectorTest.fail("Deleted frame had execution context with id = " + frameExecutionContextId + " , but executionContext with id = " + executionContextId + " was removed");
|
| - return;
|
| - }
|
| - InspectorTest.log("Frame's context was destroyed");
|
| - InspectorTest.log("Create new crafted frame");
|
| - InspectorTest.evaluate("createCraftedFrame()");
|
| - }
|
| -
|
| - function craftedFrameContextCreated(executionContextId)
|
| - {
|
| - InspectorTest.log("Crafted frame context was created");
|
| - frameExecutionContextId = executionContextId;
|
| - InspectorTest.log("Remove crafted frame");
|
| - InspectorTest.evaluate("document.querySelector(\"#crafted-iframe\").remove()");
|
| - }
|
| -
|
| - function craftedFrameContextDestroyedAfterFrameRemoved(executionContextId)
|
| - {
|
| - if (frameExecutionContextId !== executionContextId) {
|
| - InspectorTest.fail("Deleted frame had execution context with id = " + frameExecutionContextId + " , but executionContext with id = " + executionContextId + " was removed");
|
| - return;
|
| - }
|
| - InspectorTest.log("Crafted frame's context was destroyed");
|
| - InspectorTest.completeTest();
|
| - }
|
| -
|
| - var contextCreationCounter = 0;
|
| -
|
| - InspectorTest.eventHandler["Runtime.executionContextCreated"] = function(messageObject)
|
| - {
|
| - contextCreationCounter++;
|
| - var executionContextId = messageObject.params.context.id;
|
| - switch (contextCreationCounter) {
|
| - case 1:
|
| - pageContextCreated();
|
| - break;
|
| - case 2:
|
| - frameContextCreated(executionContextId);
|
| - break;
|
| - case 3:
|
| - frameContextCreatedAfterNavigation(executionContextId);
|
| - break;
|
| - case 4:
|
| - craftedFrameContextCreated(executionContextId);
|
| - break;
|
| - }
|
| - }
|
| -
|
| - var contextDestructionCounter = 0;
|
| - InspectorTest.eventHandler["Runtime.executionContextDestroyed"] = function(messageObject)
|
| - {
|
| - contextDestructionCounter++;
|
| - var executionContextId = messageObject.params.executionContextId;
|
| - switch (contextDestructionCounter) {
|
| - case 1:
|
| - frameContextDestroyedBeforeNavigation(executionContextId);
|
| - break;
|
| - case 2:
|
| - frameContextDestroyedAfterFrameRemoved(executionContextId);
|
| - break;
|
| - case 3:
|
| - craftedFrameContextDestroyedAfterFrameRemoved(executionContextId);
|
| - break;
|
| - }
|
| - }
|
| -
|
| -}
|
| -</script>
|
| -</head>
|
| -<body onload="runTest()">
|
| -</body>
|
| -</html>
|
|
|