OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <style> | |
4 @media screen and (max-device-width: 100000px) { | |
5 #inspected { | |
6 color: green; | |
7 } | |
8 #inspected { | |
9 color: blue; | |
10 } | |
11 } | |
12 @media screen and (max-device-width: 200000px) { | |
13 #other { | |
14 color: green; | |
15 } | |
16 } | |
17 </style> | |
18 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
19 <script src="../../../http/tests/inspector/elements-test.js"></script> | |
20 <script> | |
21 | |
22 function test() | |
23 { | |
24 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); | |
25 | |
26 function step1() | |
27 { | |
28 InspectorTest.addResult("=== Before media text modification ==="); | |
29 InspectorTest.dumpSelectedElementStyles(true); | |
30 var section = InspectorTest.firstMatchedStyleSection(); | |
31 var mediaTextElement = InspectorTest.firstMediaTextElementInSection(sect
ion); | |
32 mediaTextElement.click(); | |
33 mediaTextElement.textContent = "screen and (max-device-width: 99999px)"; | |
34 InspectorTest.waitForMediaTextCommitted(step2); | |
35 mediaTextElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); | |
36 } | |
37 | |
38 function step2() | |
39 { | |
40 InspectorTest.addResult("=== After valid media text modification ==="); | |
41 InspectorTest.dumpSelectedElementStyles(true); | |
42 var section = InspectorTest.firstMatchedStyleSection(); | |
43 var mediaTextElement = InspectorTest.firstMediaTextElementInSection(sect
ion); | |
44 mediaTextElement.click(); | |
45 mediaTextElement.textContent = "something is wrong here"; | |
46 InspectorTest.waitForMediaTextCommitted(step3); | |
47 mediaTextElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); | |
48 } | |
49 | |
50 function step3() | |
51 { | |
52 InspectorTest.addResult("=== After invalid media text modification ===")
; | |
53 InspectorTest.dumpSelectedElementStyles(true); | |
54 InspectorTest.completeTest(); | |
55 } | |
56 } | |
57 | |
58 </script> | |
59 </head> | |
60 | |
61 <body onload="runTest()"> | |
62 <p> | |
63 Tests that editing media text updates element styles. | |
64 </p> | |
65 | |
66 <div id="inspected" style="color: red">Text</div> | |
67 <div id="other"></div> | |
68 | |
69 </body> | |
70 </html> | |
OLD | NEW |