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

Side by Side Diff: LayoutTests/inspector/agents-enable-disable.html

Issue 1196193016: DevTools: [CSS] promisify CSS domain (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/styles-3/selector-source-data.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 function test() 5 function test()
6 { 6 {
7 var requestsSent = 0; 7 var requestsSent = 0;
8 var responsesReceived = 0; 8 var responsesReceived = 0;
9 9
10 InspectorTest.startDumpingProtocolMessages(); 10 InspectorTest.startDumpingProtocolMessages();
(...skipping 16 matching lines...) Expand all
27 targets.forEach(function(target) { 27 targets.forEach(function(target) {
28 var agentNames = Object.keys(target._agentsMap).filter(function(agentNam e) { 28 var agentNames = Object.keys(target._agentsMap).filter(function(agentNam e) {
29 var agent = target._agentsMap[agentName]; 29 var agent = target._agentsMap[agentName];
30 return agent["enable"] && agent["disable"] && agentName !== "Service Worker" && agentName !== "Security"; // async wrt others. 30 return agent["enable"] && agent["disable"] && agentName !== "Service Worker" && agentName !== "Security"; // async wrt others.
31 }).sort(); 31 }).sort();
32 32
33 function disableAgent(agentName) 33 function disableAgent(agentName)
34 { 34 {
35 ++requestsSent; 35 ++requestsSent;
36 var agent = target._agentsMap[agentName]; 36 var agent = target._agentsMap[agentName];
37 if (agent._promisified) 37 if (agent._promisified) {
38 agent.disable().then(finishWhenDone.bind(null, agentName, "disab le", null), finishWhenDone.bind(null, agentName, "disable")); 38 agent.disable(finishWhenDone.bind(null, agentName, "disable"))
39 else 39 .catch(finishWhenDone.bind(null, agentName, "disable"));
40 } else {
40 agent.disable(finishWhenDone.bind(null, agentName, "disable")); 41 agent.disable(finishWhenDone.bind(null, agentName, "disable"));
42 }
41 } 43 }
42 44
43 function enableAgent(agentName) 45 function enableAgent(agentName)
44 { 46 {
45 ++requestsSent; 47 ++requestsSent;
46 var agent = target._agentsMap[agentName]; 48 var agent = target._agentsMap[agentName];
47 if (agent._promisified) 49 if (agent._promisified) {
48 agent.enable().then(finishWhenDone.bind(null, agentName, "enable ", null), finishWhenDone.bind(null, agentName, "enable")); 50 agent.enable(finishWhenDone.bind(null, agentName, "enable"))
49 else 51 .catch(finishWhenDone.bind(null, agentName, "enable"));
52 } else {
50 agent.enable(finishWhenDone.bind(null, agentName, "enable")); 53 agent.enable(finishWhenDone.bind(null, agentName, "enable"));
54 }
51 } 55 }
52 56
53 agentNames.forEach(disableAgent); 57 agentNames.forEach(disableAgent);
54 58
55 agentNames.forEach(function(agentName) { 59 agentNames.forEach(function(agentName) {
56 enableAgent(agentName); 60 enableAgent(agentName);
57 disableAgent(agentName); 61 disableAgent(agentName);
58 }); 62 });
59 }); 63 });
60 } 64 }
61 65
62 </script> 66 </script>
63 </head> 67 </head>
64 <body onload="runTest()"> 68 <body onload="runTest()">
65 <p>Test that each agent could be enabled/disabled separately.</p> 69 <p>Test that each agent could be enabled/disabled separately.</p>
66 </body> 70 </body>
67 </html> 71 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/styles-3/selector-source-data.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698