Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / resources / user-properties.js
blobe1b03c70f5fb56f5bd45375d40b3f9a1896b43d5
1 function test()
3     var containerNode;
4     var child1Node;
5     var child2Node;
6     var aNode;
8     InspectorTest.expandElementsTree(step0);
10     function step0()
11     {
12         containerNode = InspectorTest.expandedNodeWithId("container");
13         child1Node = InspectorTest.expandedNodeWithId("child1");
14         child2Node = InspectorTest.expandedNodeWithId("child2");
15         aNode = InspectorTest.expandedNodeWithId("aNode");
17         aNode.setMarker("attr1", true);
18         InspectorTest.addResult("attr1 set on aNode");
19         InspectorTest.dumpElementsTree(null);
21         child2Node.setMarker("attr2", "value");
22         InspectorTest.addResult("attr2 set on child2");
23         InspectorTest.dumpElementsTree(null);
25         child2Node.setMarker("attr1", true);
26         InspectorTest.addResult("attr1 set on child2");
27         InspectorTest.dumpElementsTree(null);
29         aNode.setMarker("attr1", "anotherValue");
30         InspectorTest.addResult("attr1 modified on aNode");
31         InspectorTest.dumpElementsTree(null);
33         child2Node.setMarker("attr2", "anotherValue");
34         InspectorTest.addResult("attr2 modified on child2");
35         InspectorTest.dumpElementsTree(null);
37         aNode.setMarker("attr1", null);
38         InspectorTest.addResult("attr1 removed from aNode");
39         InspectorTest.dumpElementsTree(null);
41         aNode.removeNode(step1);
42     }
44     function step1(error)
45     {
46         if (error) {
47             InspectorTest.addResult("Failed to remove aNode");
48             InspectorTest.completeTest();
49             return;
50         }
52         InspectorTest.addResult("aNode removed");
53         InspectorTest.dumpElementsTree(null);
55         child2Node.removeNode(step2);
56     }
58     function step2(error)
59     {
60         if (error) {
61             InspectorTest.addResult("Failed to remove child2");
62             InspectorTest.completeTest();
63             return;
64         }
66         InspectorTest.addResult("child2 removed");
67         InspectorTest.dumpElementsTree(null);
68         InspectorTest.completeTest();
69     }