| 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 src="../../../http/tests/inspector/live-edit-test.js"></script> | 5 <script src="../../../http/tests/inspector/live-edit-test.js"></script> |
| 6 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 6 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 7 <link rel="stylesheet" href="../styles/resources/css-live-edit.css"> | 7 <link rel="stylesheet" href="../styles/resources/css-live-edit.css"> |
| 8 <div id=foo></div> | 8 <div id=foo></div> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| 11 function test() | 11 function test() |
| 12 { | 12 { |
| 13 InspectorTest.runTestSuite([ | 13 InspectorTest.runTestSuite([ |
| 14 function testLiveEdit(next) | 14 function testLiveEdit(next) |
| 15 { | 15 { |
| 16 InspectorTest.showScriptSource("css-live-edit.css", didShowResource)
; | 16 InspectorTest.showScriptSource("css-live-edit.css", didShowResource)
; |
| 17 | 17 |
| 18 function didShowResource(sourceFrame) | 18 function didShowResource(sourceFrame) |
| 19 { | 19 { |
| 20 InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_fire
StyleSheetChanged", didEditResource); | 20 InspectorTest.addSniffer(SDK.CSSModel.prototype, "_fireStyleShee
tChanged", didEditResource); |
| 21 InspectorTest.replaceInSource(sourceFrame, "font-size: 12px;", "
font-size: 20px;"); | 21 InspectorTest.replaceInSource(sourceFrame, "font-size: 12px;", "
font-size: 20px;"); |
| 22 } | 22 } |
| 23 | 23 |
| 24 function didEditResource() | 24 function didEditResource() |
| 25 { | 25 { |
| 26 InspectorTest.selectNodeAndWaitForStylesWithComputed("foo", didS
electElement); | 26 InspectorTest.selectNodeAndWaitForStylesWithComputed("foo", didS
electElement); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function didSelectElement() | 29 function didSelectElement() |
| 30 { | 30 { |
| 31 InspectorTest.dumpSelectedElementStyles(false, true); | 31 InspectorTest.dumpSelectedElementStyles(false, true); |
| 32 next(); | 32 next(); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 ]); | 35 ]); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 </script> | 38 </script> |
| 39 | 39 |
| 40 </head> | 40 </head> |
| 41 | 41 |
| 42 <body onload="runTest()"> | 42 <body onload="runTest()"> |
| 43 <p>Tests that styles are updated when live-editing css resource.</p> | 43 <p>Tests that styles are updated when live-editing css resource.</p> |
| 44 | 44 |
| 45 </body> | 45 </body> |
| 46 </html> | 46 </html> |
| OLD | NEW |