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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-timer.html

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp Created 3 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script type="text/javascript" src="../../http/tests/inspector-protocol/tracing- test.js"></script>
5 <script>
6
7 function performActions()
8 {
9 var callback;
10 var promise = new Promise((fulfill) => callback = fulfill);
11 var timerId = setTimeout(function()
12 {
13 evaluateInFrontend("InspectorTest.testFunctionTimerFired(" + timerId + " , " + timerId2 + ")");
14 callback();
15 }, 0);
16
17 var timerId2 = setTimeout(function() { }, 0);
18 clearTimeout(timerId2);
19 return promise;
20 }
21
22 function test()
23 {
24 InspectorTest.invokeAsyncWithTracing("performActions", finish);
25
26 var firedTimerId;
27 var removedTimerId;
28 InspectorTest.testFunctionTimerFired = function(timerId1, timerId2)
29 {
30 firedTimerId = timerId1;
31 removedTimerId = timerId2;
32 InspectorTest.log("SUCCESS: testFunctionTimerFired");
33 }
34
35 function finish(devtoolsEvents)
36 {
37 function hasTimerId(id, e) { return e.args.data.timerId === id}
38
39 var installTimer1 = InspectorTest.findEvent("TimerInstall", "I", hasTime rId.bind(this, firedTimerId));
40 var installTimer2 = InspectorTest.findEvent("TimerInstall", "I", hasTime rId.bind(this, removedTimerId));
41
42 InspectorTest.log("TimerInstall has frame: " + !!installTimer1.args.data .frame);
43 InspectorTest.log("TimerInstall frames match: " + (installTimer1.args.da ta.frame === installTimer2.args.data.frame));
44
45 InspectorTest.findEvent("TimerRemove", "I", hasTimerId.bind(this, remove dTimerId));
46 InspectorTest.findEvent("TimerFire", "X", hasTimerId.bind(this, firedTim erId));
47
48 InspectorTest.log("SUCCESS: found all expected events.");
49 InspectorTest.completeTest();
50 }
51 }
52 </script>
53 </head>
54 <body onLoad="runTest();">
55 <div id="myDiv">DIV</div>
56 </body>
57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698