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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/loading-iframe-document-node.html

Issue 2950713002: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: addressed comments, 4 tests Created 3 years, 6 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
Index: third_party/WebKit/LayoutTests/inspector-protocol/loading-iframe-document-node.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/loading-iframe-document-node.html b/third_party/WebKit/LayoutTests/inspector-protocol/loading-iframe-document-node.html
deleted file mode 100644
index 8757a3a958bd5be4c7eb4a5dff90658b67e5d29c..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/loading-iframe-document-node.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<script type="text/javascript" src="../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
-<script>
-function appendIframe()
-{
- var frame = document.createElement("iframe");
- frame.src = "resources/test-page-with-debugger-statement.html";
- document.body.appendChild(frame);
-}
-
-function test()
-{
- /*
- Testing that the Node ID can be retrieved before the onload event is triggered:
- 1. Create an iframe and point it to a page with a debugger statement.
- 2. Wait until the debugger statement is hit and pause using the inspector protocol.
- 3. Use the JS context to identify the "window.document" object inside the iframe.
- 4. Use the JS object to retrieve the DOM agent nodeId for the document node.
- */
-
- InspectorTest.eventHandler["Page.loadEventFired"] = onLoadEventFired;
- InspectorTest.eventHandler["Debugger.paused"] = onDebuggerPaused;
-
- function step1_bootstrap()
- {
- InspectorTest.log("step1_bootstrap");
-
- // Enable Page agent for the Page.loadEventFired event.
- InspectorTest.sendCommand("Page.enable", {});
-
- // Make sure the debugger ready to break on the "debugger" statement.
- InspectorTest.sendCommand("Debugger.enable", {});
-
- InspectorTest.sendCommand("DOM.getDocument", {}, callback);
-
- function callback() {
- InspectorTest.log("Adding iframe");
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "appendIframe()" });
- }
- }
-
- function onDebuggerPaused(response)
- {
- InspectorTest.log("Paused on the debugger statement");
- InspectorTest.sendCommand("Runtime.callFunctionOn", {
- objectId: response.params.callFrames[0].this.objectId,
- functionDeclaration: "function() { return this.document; }"
- }, callback);
-
- function callback(response)
- {
- step2_requestNode(response.result.result.objectId);
- }
- }
-
- function step2_requestNode(objectId)
- {
- InspectorTest.log("step2_requestNode: Requesting DOM node for iframe's document node");
- InspectorTest.sendCommand("DOM.requestNode", { objectId: objectId }, callback);
-
- function callback(response)
- {
- InspectorTest.log(response.result.nodeId ? "PASS: Received node for iframe's document node" : "FAIL: Iframe's document node is not available");
- InspectorTest.sendCommand("Debugger.resume", {}, completeTest);
- }
- }
-
- function completeTest()
- {
- InspectorTest.log("Test finished");
- InspectorTest.completeTest();
- }
-
- function onLoadEventFired()
- {
- // We should finish the test before this event is triggered.
- // If you see this in the output, then the slow-image is not loaded correctly in the iframe.
- InspectorTest.log("FAIL: Iframe load event fired before the test finished.");
- }
-
- step1_bootstrap()
-}
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698