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

Side by Side Diff: LayoutTests/inspector-protocol/css/css-replace-range.html

Issue 172593003: DevTools: [CSS] Add CSS.editRangeInStyleSheetText() to the protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/protocol-test.js"></script>
4 <script type="text/javascript">
5 function test()
6 {
7 InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded;
8 InspectorTest.sendCommandOrDie("CSS.enable", {});
9
10 var styleSheetId;
11
12 function styleSheetAdded(result)
13 {
14 styleSheetId = result.params.header.styleSheetId;
15 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styleSheetId }, onInitialStyleSheetText);
16 }
17
18 function onInitialStyleSheetText(result)
19 {
20 InspectorTest.log("==== Initial style sheet text ====");
21 InspectorTest.log(result.text);
22 InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", {
apavlov 2014/02/20 09:58:14 It is hard to follow. Let's dump all intermediate
lushnikov 2014/02/20 14:17:04 Done.
23 styleSheetId: styleSheetId,
24 range: { startLine: 0, startColumn: 0, endLine: 0, endColumn: 0 },
25 text: "* { border: 1px }"
26 });
27 InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", {
28 styleSheetId: styleSheetId,
29 range: { startLine: 1, startColumn: 5, endLine: 3, endColumn: 0 },
30 text: "\n background-color: blue;\n font-size: 12px;\n"
31 });
32 InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", {
33 styleSheetId: styleSheetId,
34 range: { startLine: 1, startColumn: 0, endLine: 1, endColumn: 3 },
35 text: "p, span:hover"
36 });
37 InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", {
38 styleSheetId: styleSheetId,
39 range: { startLine: 4, startColumn: 1, endLine: 4, endColumn: 1 },
40 text: "\n* { box-sizing: border-box; }"
41 });
42 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styleSheetId }, onChangedStyleSheetText);
43 }
44
45 function onChangedStyleSheetText(result)
46 {
47 InspectorTest.log("==== Changed style sheet text ====");
48 InspectorTest.log(result.text);
49 InspectorTest.completeTest();
50 }
51 }
52
53 </script>
54 <link rel="stylesheet" href="resources/replace-range.css"/>
55 </head>
56 <body onload="runTest();">
57 </body>
58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698