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

Side by Side Diff: LayoutTests/inspector/elements/styles/cached-sync-computed-styles.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 <style id="style">
4 #inspected {
5 background-color: green;
6 }
7 </style>
8 <script src="../../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../../http/tests/inspector/elements-test.js"></script>
10 <script>
11
12 function updateStyle()
13 {
14 document.getElementById("style").textContent = "#inspected { color: red }";
15 }
16
17 function test()
18 {
19 InspectorTest.nodeWithId("inspected", step1);
20 var backendCallCount = 0;
21 var nodeId;
22
23 function onBackendCall(domain, method, params)
24 {
25 if (method === "CSS.getComputedStyleForNode" && params.nodeId === nodeId )
26 ++backendCallCount;
27 }
28
29 function step1(node)
30 {
31 var callsLeft = 2;
32 nodeId = node.id;
33 InspectorTest.addSniffer(InspectorBackend.connection(), "_wrapCallbackAn dSendMessageObject", onBackendCall, true);
34 InspectorTest.cssModel.getComputedStyleAsync(nodeId, styleCallback);
35 InspectorTest.cssModel.getComputedStyleAsync(nodeId, styleCallback);
36 function styleCallback()
37 {
38 if (--callsLeft)
39 return;
40 InspectorTest.addResult("# of backend calls sent [2 requests]: " + b ackendCallCount);
41 InspectorTest.evaluateInPage("updateStyle()", step2);
42 }
43 }
44
45 function step2()
46 {
47 InspectorTest.cssModel.getComputedStyleAsync(nodeId, callback);
48 function callback()
49 {
50 InspectorTest.addResult("# of backend calls sent [style update + ano ther request]: " + backendCallCount);
51 InspectorTest.completeTest();
52 }
53 }
54 }
55 </script>
56 </head>
57
58 <body onload="runTest()">
59 <p>
60 Tests that computed styles are cached across synchronous requests.
61 </p>
62
63 <div>
64 <div id="inspected">Test</div>
65 </div>
66
67 </body>
68 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698