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

Side by Side Diff: LayoutTests/inspector/elements/styles/cached-sync-computed-styles.html

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <style id="style"> 3 <style id="style">
4 #inspected { 4 #inspected {
5 background-color: green; 5 background-color: green;
6 } 6 }
7 </style> 7 </style>
8 <script src="../../../http/tests/inspector/inspector-test.js"></script> 8 <script src="../../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../../http/tests/inspector/elements-test.js"></script> 9 <script src="../../../http/tests/inspector/elements-test.js"></script>
10 <script> 10 <script>
(...skipping 13 matching lines...) Expand all
24 { 24 {
25 if (method === "CSS.getComputedStyleForNode" && params.nodeId === nodeId ) 25 if (method === "CSS.getComputedStyleForNode" && params.nodeId === nodeId )
26 ++backendCallCount; 26 ++backendCallCount;
27 } 27 }
28 28
29 function step1(node) 29 function step1(node)
30 { 30 {
31 var callsLeft = 2; 31 var callsLeft = 2;
32 nodeId = node.id; 32 nodeId = node.id;
33 InspectorTest.addSniffer(InspectorBackend.connection(), "_wrapCallbackAn dSendMessageObject", onBackendCall, true); 33 InspectorTest.addSniffer(InspectorBackend.connection(), "_wrapCallbackAn dSendMessageObject", onBackendCall, true);
34 WebInspector.cssModel.getComputedStyleAsync(nodeId, styleCallback); 34 InspectorTest.cssModel.getComputedStyleAsync(nodeId, styleCallback);
35 WebInspector.cssModel.getComputedStyleAsync(nodeId, styleCallback); 35 InspectorTest.cssModel.getComputedStyleAsync(nodeId, styleCallback);
36 function styleCallback() 36 function styleCallback()
37 { 37 {
38 if (--callsLeft) 38 if (--callsLeft)
39 return; 39 return;
40 InspectorTest.addResult("# of backend calls sent [2 requests]: " + b ackendCallCount); 40 InspectorTest.addResult("# of backend calls sent [2 requests]: " + b ackendCallCount);
41 InspectorTest.evaluateInPage("updateStyle()", step2); 41 InspectorTest.evaluateInPage("updateStyle()", step2);
42 } 42 }
43 } 43 }
44 44
45 function step2() 45 function step2()
46 { 46 {
47 WebInspector.cssModel.getComputedStyleAsync(nodeId, callback); 47 InspectorTest.cssModel.getComputedStyleAsync(nodeId, callback);
48 function callback() 48 function callback()
49 { 49 {
50 InspectorTest.addResult("# of backend calls sent [style update + ano ther request]: " + backendCallCount); 50 InspectorTest.addResult("# of backend calls sent [style update + ano ther request]: " + backendCallCount);
51 InspectorTest.completeTest(); 51 InspectorTest.completeTest();
52 } 52 }
53 } 53 }
54 } 54 }
55 </script> 55 </script>
56 </head> 56 </head>
57 57
58 <body onload="runTest()"> 58 <body onload="runTest()">
59 <p> 59 <p>
60 Tests that computed styles are cached across synchronous requests. 60 Tests that computed styles are cached across synchronous requests.
61 </p> 61 </p>
62 62
63 <div> 63 <div>
64 <div id="inspected">Test</div> 64 <div id="inspected">Test</div>
65 </div> 65 </div>
66 66
67 </body> 67 </body>
68 </html> 68 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698