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