OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function test() | 7 function test() |
8 { | 8 { |
9 WebInspector.inspectorView.showPanel("elements"); | 9 WebInspector.inspectorView.showPanel("elements"); |
10 var nodeId; | 10 var nodeId; |
11 var stylesPane; | 11 var stylesPane; |
12 | 12 |
13 InspectorTest.runTestSuite([ | 13 InspectorTest.runTestSuite([ |
14 function setUp(next) { | 14 function setUp(next) { |
15 InspectorTest.selectNodeAndWaitForStyles("inspected", next); | 15 InspectorTest.selectNodeAndWaitForStyles("inspected", next); |
16 }, | 16 }, |
17 | 17 |
18 function addRule(next) | 18 function addRule(next) |
19 { | 19 { |
20 InspectorTest.nodeWithId("inspected", nodeCallback); | 20 InspectorTest.nodeWithId("inspected", nodeCallback); |
21 | 21 |
22 function nodeCallback(node) | 22 function nodeCallback(node) |
23 { | 23 { |
24 nodeId = node.id; | 24 nodeId = node.id; |
25 stylesPane = WebInspector.panels.elements.sidebarPanes.styles; | 25 stylesPane = WebInspector.panels.elements.sidebarPanes.styles; |
26 stylesPane.addBlankSection(); | 26 InspectorTest.addNewRule("foo, #inspected, .bar, #inspected", ca
llback); |
27 var section = stylesPane.sections[0][2]; | |
28 section.startEditingSelector(); | |
29 section._selectorElement.textContent = "foo, #inspected, .bar, #
inspected"; | |
30 section._selectorElement.dispatchEvent(InspectorTest.createKeyEv
ent("Enter")); | |
31 InspectorTest.runAfterPendingDispatches(callback); | |
32 } | 27 } |
33 | 28 |
34 function callback() | 29 function callback() |
35 { | 30 { |
36 InspectorTest.dumpSelectedElementStyles(true, false, false, true
); | 31 InspectorTest.dumpSelectedElementStyles(true, false, false, true
); |
37 next(); | 32 next(); |
38 } | 33 } |
39 }, | 34 }, |
40 | 35 |
41 function changeSelector(next) | 36 function changeSelector(next) |
(...skipping 19 matching lines...) Expand all Loading... |
61 | 56 |
62 <body onload="runTest()"> | 57 <body onload="runTest()"> |
63 <p> | 58 <p> |
64 Tests that matching selectors are marked properly after new rule creation and se
lector change. | 59 Tests that matching selectors are marked properly after new rule creation and se
lector change. |
65 </p> | 60 </p> |
66 | 61 |
67 <div id="inspected"></div> | 62 <div id="inspected"></div> |
68 | 63 |
69 </body> | 64 </body> |
70 </html> | 65 </html> |
OLD | NEW |