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

Side by Side Diff: LayoutTests/inspector/elements/styles/paste-property.html

Issue 1158883003: DevTools: shard inspector/elements tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script>
6
7 function test()
8 {
9 InspectorTest.selectNodeAndWaitForStyles("inspected", pasteFirstProperty);
10
11 function pasteFirstProperty()
12 {
13 InspectorTest.addResult("Before pasting:");
14 InspectorTest.dumpSelectedElementStyles(true);
15 var section = InspectorTest.inlineStyleSection();
16
17 var treeElement = section.addNewBlankProperty(0);
18 pasteProperty(treeElement, "margin-left: 1px", pasteTwoProperties);
19 }
20
21 function pasteTwoProperties()
22 {
23 InspectorTest.addResult("After pasting 'margin-left: 1px':");
24 InspectorTest.dumpSelectedElementStyles(true);
25
26 var treeElement = InspectorTest.inlineStyleSection().addNewBlankProperty (2);
27 pasteProperty(treeElement, "margin-top: 1px; color: red;", pasteOverExis tingProperty);
28 }
29
30 function pasteOverExistingProperty()
31 {
32 InspectorTest.addResult("After pasting 'margin-top: 1px; color: red;':") ;
33 InspectorTest.dumpSelectedElementStyles(true);
34
35 var treeElement = InspectorTest.getElementStylePropertyTreeItem("margin- top");
36 pasteProperty(treeElement, "foo: bar; moo: zoo", dumpAndComplete);
37 }
38
39 function dumpAndComplete()
40 {
41 InspectorTest.addResult("After pasting 'foo: bar; moo: zoo' over 'margin -top':");
42 InspectorTest.dumpSelectedElementStyles(true);
43
44 InspectorTest.completeTest();
45 }
46
47 function pasteProperty(treeElement, propertyText, callback)
48 {
49 treeElement.nameElement.textContent = propertyText;
50 treeElement.startEditing();
51
52 document.execCommand("SelectAll");
53 document.execCommand("Copy");
54 InspectorTest.waitForStyleApplied(reloadStyles.bind(this, callback));
55 document.execCommand("Paste");
56 }
57
58 function reloadStyles(callback) {
59 InspectorTest.selectNodeAndWaitForStyles("other", otherCallback);
60
61 function otherCallback()
62 {
63 InspectorTest.selectNodeAndWaitForStyles("inspected", callback);
64 }
65 }
66 }
67
68 </script>
69 </head>
70
71 <body onload="runTest()">
72 <p>
73 Tests that splitting properties when pasting works.
74 </p>
75
76 <div id="inspected" style="font-size: 12px">Text</div>
77 <div id="other"></div>
78
79 </body>
80 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698