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

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

Issue 1167693010: Add a DevTools Security domain to protocol.json. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Exclude Security from the agents-enable-disable test (like ServiceWorker). 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
« no previous file with comments | « no previous file | Source/devtools/protocol.json » ('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();
11 11
12 function finishWhenDone(agentName, action, errorString) 12 function finishWhenDone(agentName, action, errorString)
13 { 13 {
14 if (action === "enable") 14 if (action === "enable")
15 InspectorTest.addResult(""); 15 InspectorTest.addResult("");
16 if (errorString) 16 if (errorString)
17 InspectorTest.addResult(agentName + "." + action + " finished with e rror " + errorString); 17 InspectorTest.addResult(agentName + "." + action + " finished with e rror " + errorString);
18 else 18 else
19 InspectorTest.addResult(agentName + "." + action + " finished succes sfully"); 19 InspectorTest.addResult(agentName + "." + action + " finished succes sfully");
20 20
21 ++responsesReceived; 21 ++responsesReceived;
22 if (responsesReceived === requestsSent) 22 if (responsesReceived === requestsSent)
23 InspectorTest.completeTest(); 23 InspectorTest.completeTest();
24 } 24 }
25 25
26 var targets = WebInspector.targetManager.targets(); 26 var targets = WebInspector.targetManager.targets();
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"; // 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().then(finishWhenDone.bind(null, agentName, "disab le", null), finishWhenDone.bind(null, agentName, "disable"));
39 else 39 else
40 agent.disable(finishWhenDone.bind(null, agentName, "disable")); 40 agent.disable(finishWhenDone.bind(null, agentName, "disable"));
(...skipping 17 matching lines...) Expand all
58 }); 58 });
59 }); 59 });
60 } 60 }
61 61
62 </script> 62 </script>
63 </head> 63 </head>
64 <body onload="runTest()"> 64 <body onload="runTest()">
65 <p>Test that each agent could be enabled/disabled separately.</p> 65 <p>Test that each agent could be enabled/disabled separately.</p>
66 </body> 66 </body>
67 </html> 67 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698