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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-do-not-detach-sourcemap-on-edits.html

Issue 2116903002: DevTools: do not detach sourcemap in case of style sheet editing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
(Empty)
1 <html>
2 <head>
3
4 <link rel="stylesheet" href="./resources/styles-do-not-detach-sourcemap-on-edits .css">
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script src="../../../http/tests/inspector/elements-test.js"></script>
7 <script src="../../../http/tests/inspector/inspector-test.js"></script>
8 <script>
9
10 function test()
11 {
12 InspectorTest.waitForScriptSource("styles-do-not-detach-sourcemap-on-edits.s css", onSourceMapLoaded);
13
14 function onSourceMapLoaded()
15 {
16 InspectorTest.selectNodeAndWaitForStyles("container", onNodeSelected);
17 }
18
19 function onNodeSelected()
20 {
21 InspectorTest.runTestSuite(testSuite);
22 }
23
24 var testSuite = [
25 function editProperty(next)
26 {
27 InspectorTest.dumpSelectedElementStyles(true, false, true);
28
29 var treeItem = InspectorTest.getMatchedStylePropertyTreeItem("color" );
30 treeItem.applyStyleText("NAME: VALUE", true);
31 InspectorTest.waitForStyles("container", next);
32 },
33
34 function editSelector(next)
35 {
36 InspectorTest.dumpSelectedElementStyles(true, false, true);
37
38 var section = InspectorTest.firstMatchedStyleSection();
39 section.startEditingSelector();
40 section._selectorElement.textContent = "#container, SELECTOR";
41 InspectorTest.waitForSelectorCommitted(next);
42 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent( "Enter"));
43 },
44
45 function editMedia(next)
46 {
47 InspectorTest.dumpSelectedElementStyles(true, false, true);
48
49 var section = InspectorTest.firstMatchedStyleSection();
50 var mediaTextElement = InspectorTest.firstMediaTextElementInSection( section);
51 mediaTextElement.click();
52 mediaTextElement.textContent = "(max-width: 9999999px)";
53 InspectorTest.waitForMediaTextCommitted(next);
54 mediaTextElement.dispatchEvent(InspectorTest.createKeyEvent("Enter") );
55 },
56
57 function addRule(next)
58 {
59 InspectorTest.dumpSelectedElementStyles(true, false, true);
60
61 var styleSheetHeader = InspectorTest.cssModel.styleSheetHeaders().fi nd(header => header.resourceURL().indexOf("styles-do-not-detach-sourcemap-on-edi ts.css") !== -1);
62 if (!styleSheetHeader) {
63 InspectorTest.addResult("ERROR: failed to find style sheet!");
64 InspectorTest.completeTest();
65 return;
66 }
67 InspectorTest.addNewRuleInStyleSheet(styleSheetHeader, "NEW-RULE", n ext);
68 },
69
70 function finish(next)
71 {
72 InspectorTest.dumpSelectedElementStyles(true, false, true);
73 next();
74 },
75 ];
76 }
77
78 </script>
79 </head>
80
81 <body onload="runTest()">
82 <p>
83 Tests that source map is not detached on edits. crbug.com/257778
84 </p>
85
86 <div id="container">container.</div>
87
88 </body>
89 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698