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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/formatter-css.html

Issue 2886053002: DevTools: do not use Bindings.NetworkProject.styleHeaderForUISourceCode in SourceFormatter (Closed)
Patch Set: nits Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debugger-test.js"></script> 4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <link rel="stylesheet" href="resources/style-formatter-obfuscated.css"> 5 <link rel="stylesheet" href="resources/style-formatter-obfuscated.css">
6 6
7 <script> 7 <script>
8 async function test() 8 async function test()
9 { 9 {
10 var uiSourceCode = await InspectorTest.waitForUISourceCode("style-formatter- obfuscated.css"); 10 var uiSourceCode = await InspectorTest.waitForUISourceCode("style-formatter- obfuscated.css");
11 var formatData = await Sources.sourceFormatter.format(uiSourceCode); 11 var formatData = await Sources.sourceFormatter.format(uiSourceCode);
12 var targetContent = await formatData.formattedSourceCode.requestContent(); 12 var targetContent = await formatData.formattedSourceCode.requestContent();
13 13
14 InspectorTest.addResult(`Formatted:\n${targetContent}`); 14 InspectorTest.addResult(`Formatted:\n${targetContent}`);
15 15
16 var originalContent = await uiSourceCode.requestContent(); 16 var originalContent = await uiSourceCode.requestContent();
17 var styleHeader = Bindings.NetworkProject.styleHeaderForUISourceCode(uiSourc eCode); 17 var styleHeader = Bindings.cssWorkspaceBinding.uiLocationToRawLocations(uiSo urceCode.uiLocation(0, 0))[0].header();
18 var text = new TextUtils.Text(originalContent); 18 var text = new TextUtils.Text(originalContent);
19 var liveLocationsPool = new Bindings.LiveLocationPool(); 19 var liveLocationsPool = new Bindings.LiveLocationPool();
20 var locationUpdateCount = 0; 20 var locationUpdateCount = 0;
21 var rawLocations = []; 21 var rawLocations = [];
22 var liveLocations = []; 22 var liveLocations = [];
23 for (var offset = originalContent.indexOf("{"); offset >= 0; offset = origin alContent.indexOf("{", offset + 1)) { 23 for (var offset = originalContent.indexOf("{"); offset >= 0; offset = origin alContent.indexOf("{", offset + 1)) {
24 var position = text.positionFromOffset(offset); 24 var position = text.positionFromOffset(offset);
25 var rawLocation = new SDK.CSSLocation(styleHeader, position.lineNumber, po sition.columnNumber); 25 var rawLocation = new SDK.CSSLocation(styleHeader, position.lineNumber, po sition.columnNumber);
26 rawLocations.push(rawLocation); 26 rawLocations.push(rawLocation);
27 liveLocations.push(Bindings.cssWorkspaceBinding.createLiveLocation(rawLoca tion, () => { locationUpdateCount++; }, liveLocationsPool)); 27 liveLocations.push(Bindings.cssWorkspaceBinding.createLiveLocation(rawLoca tion, () => { locationUpdateCount++; }, liveLocationsPool));
(...skipping 24 matching lines...) Expand all
52 } 52 }
53 } 53 }
54 } 54 }
55 </script> 55 </script>
56 56
57 </head> 57 </head>
58 <body onload="runTest()"> 58 <body onload="runTest()">
59 <p>Tests how SourceFormatter handles CSS sources</p> 59 <p>Tests how SourceFormatter handles CSS sources</p>
60 </body> 60 </body>
61 </html> 61 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698