OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <meta charset="utf8"> | |
4 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
5 <script> | |
6 | |
7 function test() | |
8 { | |
9 InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument); | |
10 | |
11 var bodyId; | |
12 function onGotDocument(msg) | |
13 { | |
14 if (InspectorTest.completeTestIfError(msg)) | |
15 return; | |
16 InspectorTest.sendCommand("DOM.querySelector", { nodeId: msg.result.root
.nodeId, selector: "body" }, onQuerySelector1); | |
17 InspectorTest.sendCommand("DOM.querySelector", { nodeId: msg.result.root
.nodeId, selector: "#id" }, onQuerySelector2); | |
18 } | |
19 | |
20 function onQuerySelector1(msg) | |
21 { | |
22 if (InspectorTest.completeTestIfError(msg)) | |
23 return; | |
24 bodyId = msg.result.nodeId; | |
25 } | |
26 | |
27 function onQuerySelector2(msg) | |
28 { | |
29 if (InspectorTest.completeTestIfError(msg)) | |
30 return; | |
31 InspectorTest.sendCommand("DOM.setOuterHTML", { nodeId: msg.result.nodeI
d, outerHTML: "<div>Привет мир 1</div>" }, onSetOuterHTML); | |
32 } | |
33 | |
34 function onSetOuterHTML(msg) | |
35 { | |
36 if (InspectorTest.completeTestIfError(msg)) | |
37 return; | |
38 InspectorTest.sendCommand("DOM.getOuterHTML", { nodeId: bodyId }, onGetO
uterHTML); | |
39 } | |
40 | |
41 function onGetOuterHTML(msg) | |
42 { | |
43 InspectorTest.completeTest(); | |
44 } | |
45 } | |
46 | |
47 </script> | |
48 </head> | |
49 <body onload="runTest()"> | |
50 <div id="id">Привет мир</div> | |
51 <div>Привет мир 2</div> | |
52 </body> | |
53 </html> | |
OLD | NEW |