Index: LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html |
diff --git a/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html b/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html |
index 9607b91692b5b27bed7214486816a04bd02ddf73..329f35f84ba2df5ce0f89e032acfa35714463af0 100644 |
--- a/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html |
+++ b/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html |
@@ -11,6 +11,15 @@ function createFrame() |
document.body.appendChild(frame); |
} |
+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>"); |
+} |
+ |
function test() |
{ |
InspectorTest.evaluate = function(expression) |
@@ -68,6 +77,25 @@ function test() |
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(); |
} |
@@ -87,6 +115,9 @@ function test() |
case 3: |
frameContextCreatedAfterNavigation(executionContextId); |
break; |
+ case 4: |
+ craftedFrameContextCreated(executionContextId); |
+ break; |
} |
} |
@@ -102,6 +133,9 @@ function test() |
case 2: |
frameContextDestroyedAfterFrameRemoved(executionContextId); |
break; |
+ case 3: |
+ craftedFrameContextDestroyedAfterFrameRemoved(executionContextId); |
+ break; |
} |
} |