| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| function dispatchDOMInspectEvent(nodeId) { |
| WI.dispatchMessageFromBackend({ |
| "params": {"nodeId": nodeId}, |
| let suite = InspectorTest.createAsyncSuite("DOM.inspect"); |
| name: "DOM.inspect.valid", |
| description: "Event given a valid nodeId should select it.", |
| WI.domManager.querySelector(documentNode.id, "#element-to-select", (nodeId) => { |
| dispatchDOMInspectEvent(nodeId); |
| WI.domManager.awaitEvent(WI.DOMManager.Event.DOMNodeWasInspected).then((event) => { |
| InspectorTest.pass("DOMNodeWasInspected event"); |
| name: "DOM.inspect.invalid", |
| description: "Event given an ivalid nodeId should not cause an exception.", |
| dispatchDOMInspectEvent("DOES_NOT_EXIST"); |
| InspectorTest.pass("No error"); |
| WI.domManager.requestDocument((node) => { |
| suite.runTestCasesAndFinish(); |
| <body onload="runTest()"> |
| <p id="element-to-select">Test for DOM.inspect.</p> |