Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-do-not-overwrite-css.html

Issue 2893523002: DevTools: make StyleSourceMapping in charge of managing UISourceCodes (Closed)
Patch Set: address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) { 68 function throwProtocolError(styleSheetId) {
69 InspectorTest.addResult('Protocol Error: FAKE PROTOCOL ERROR'); 69 InspectorTest.addResult('Protocol Error: FAKE PROTOCOL ERROR');
70 return Promise.resolve(null); 70 return Promise.resolve(null);
71 } 71 }
72 }, 72 },
73 73
74 function onStylesSourcemappingSynced(next) { 74 function onStylesSourcemappingSynced(next) {
75 InspectorTest.addResult('Updated content of file:///var/www/simple.c ss'); 75 InspectorTest.addResult('Updated content of file:///var/www/simple.c ss');
76 InspectorTest.addResult('----\n' + fsUISourceCode.content() + '\n--- -'); 76 InspectorTest.addResult('----\n' + fsUISourceCode.content() + '\n--- -');
77 next() 77 next()
78 } 78 }
79 ]); 79 ]);
80 } 80 }
81 </script> 81 </script>
82 </head> 82 </head>
83 <body onload="runTest()"> 83 <body onload="runTest()">
84 <p>Verify that persistence does not overwrite CSS files when CSS model reports e rror on getStyleSheetText.</p> 84 <p>Verify that persistence does not overwrite CSS files when CSS model reports e rror on getStyleSheetText.</p>
85 </body> 85 </body>
86 </html> 86 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698