| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../isolated-filesystem-test.js"></script> | 4 <script src="../isolated-filesystem-test.js"></script> |
| 5 <script src="../debugger-test.js"></script> | 5 <script src="../debugger-test.js"></script> |
| 6 <script src="./persistence-test.js"></script> | 6 <script src="./persistence-test.js"></script> |
| 7 <script src="./automapping-test.js"></script> | 7 <script src="./automapping-test.js"></script> |
| 8 <style> | 8 <style> |
| 9 body { | 9 body { |
| 10 color: red; | 10 color: red; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // Nullify console.error since it dumps style sheet Ids and make tes
t flake. | 56 // Nullify console.error since it dumps style sheet Ids and make tes
t flake. |
| 57 console.error = function() { }; | 57 console.error = function() { }; |
| 58 | 58 |
| 59 var styleSheet = InspectorTest.cssModel.styleSheetHeaders().find(hea
der => header.contentURL().endsWith('simple.css')); | 59 var styleSheet = InspectorTest.cssModel.styleSheetHeaders().find(hea
der => header.contentURL().endsWith('simple.css')); |
| 60 // Make CSSModel constantly return errors on all getStyleSheetText r
equests. | 60 // Make CSSModel constantly return errors on all getStyleSheetText r
equests. |
| 61 InspectorTest.override(InspectorTest.cssModel._agent, 'getStyleSheet
Text', throwProtocolError, true); | 61 InspectorTest.override(InspectorTest.cssModel._agent, 'getStyleSheet
Text', throwProtocolError, true); |
| 62 // Set a new stylesheet text | 62 // Set a new stylesheet text |
| 63 InspectorTest.cssModel.setStyleSheetText(styleSheet.id, 'body {color
: blue}'); | 63 InspectorTest.cssModel.setStyleSheetText(styleSheet.id, 'body {color
: blue}'); |
| 64 // Expect StylesSourceMapping to sync styleSheet with network UISour
ceCode. | 64 // Expect StylesSourceMapping to sync styleSheet with network UISour
ceCode. |
| 65 // Persistence acts synchronously. | 65 // Persistence acts synchronously. |
| 66 InspectorTest.addSniffer(Bindings.StylesSourceMapping.prototype, '_s
tyleFileSyncedForTest', next); | 66 InspectorTest.addSniffer(Bindings.StyleFile.prototype, '_styleFileSy
ncedForTest', next); |
| 67 | 67 |
| 68 function throwProtocolError(styleSheetId, textCallback) { | 68 function throwProtocolError(styleSheetId, textCallback) { |
| 69 var error = 'FAKE PROTOCOL ERROR'; | 69 var error = 'FAKE PROTOCOL ERROR'; |
| 70 var result = textCallback(error); | 70 var result = textCallback(error); |
| 71 InspectorTest.addResult('Protocol Error: ' + error); | 71 InspectorTest.addResult('Protocol Error: ' + error); |
| 72 return Promise.resolve(result); | 72 return Promise.resolve(result); |
| 73 } | 73 } |
| 74 }, | 74 }, |
| 75 | 75 |
| 76 function onStylesSourcemappingSynced(next) { | 76 function onStylesSourcemappingSynced(next) { |
| 77 InspectorTest.addResult('Updated content of file:///var/www/simple.c
ss'); | 77 InspectorTest.addResult('Updated content of file:///var/www/simple.c
ss'); |
| 78 InspectorTest.addResult('----\n' + fsUISourceCode.content() + '\n---
-'); | 78 InspectorTest.addResult('----\n' + fsUISourceCode.content() + '\n---
-'); |
| 79 next() | 79 next() |
| 80 } | 80 } |
| 81 ]); | 81 ]); |
| 82 } | 82 } |
| 83 </script> | 83 </script> |
| 84 </head> | 84 </head> |
| 85 <body onload="runTest()"> | 85 <body onload="runTest()"> |
| 86 <p>Verify that persistence does not overwrite CSS files when CSS model reports e
rror on getStyleSheetText.</p> | 86 <p>Verify that persistence does not overwrite CSS files when CSS model reports e
rror on getStyleSheetText.</p> |
| 87 </body> | 87 </body> |
| 88 </html> | 88 </html> |
| OLD | NEW |