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

Side by Side Diff: LayoutTests/inspector-protocol/console/console-timestamp.html

Issue 1021543002: DevTools: remove InspectorTest.assert from inspector-protocol tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 function test() 6 function test()
7 { 7 {
8 8
9 var messages = []; 9 var messages = [];
10 10
11 function messageAdded(data) 11 function messageAdded(data)
12 { 12 {
13 var payload = data.params.message; 13 var payload = data.params.message;
14 14
15 if (messages.length > 0) 15 if (messages.length > 0)
16 InspectorTest.assert(payload.timestamp >= messages[messages.length - 1].timestamp, "Timestamp shouldn't decrease over time."); 16 InspectorTest.log("Message " + messages.length + " has non-decreasin g timestamp: " + (payload.timestamp >= messages[messages.length - 1].timestamp)) ;
alph 2015/03/18 15:45:55 How does it work? Previously it only spammed the l
yurys 2015/03/18 16:13:43 Correct, and if there is a mismatch it is clear wh
17 17
18 messages.push(payload); 18 messages.push(payload);
19 InspectorTest.assert(payload.timestamp, "No timestamp found in message." ); 19 InspectorTest.log("Message has timestamp: " + !!payload.timestamp);
20 20
21 InspectorTest.assert(Math.abs(new Date().getTime() / 1000 - payload.time stamp) < 60, "Timestamp shouldn't differ very much from current time (one minute interval)."); 21 InspectorTest.log("Message timestamp doesn't differ too much from curren t time (one minute interval): " + (Math.abs(new Date().getTime() / 1000 - payloa d.timestamp) < 60));
22 if (messages.length === 3) 22 if (messages.length === 3)
23 InspectorTest.completeTest(); 23 InspectorTest.completeTest();
24 } 24 }
25 25
26 InspectorTest.eventHandler["Console.messageAdded"] = messageAdded; 26 InspectorTest.eventHandler["Console.messageAdded"] = messageAdded;
27 InspectorTest.sendCommand("Console.enable", {}); 27 InspectorTest.sendCommand("Console.enable", {});
28 28
29 InspectorTest.sendCommand("Runtime.evaluate", { expression: "console.log('te stUnique'); for (var i = 0; i < 2; ++i) console.log('testDouble');" }); 29 InspectorTest.sendCommand("Runtime.evaluate", { expression: "console.log('te stUnique'); for (var i = 0; i < 2; ++i) console.log('testDouble');" });
30 } 30 }
31 31
32 </script> 32 </script>
33 </head> 33 </head>
34 <body onload="runTest()"> 34 <body onload="runTest()">
35 </body> 35 </body>
36 </html> 36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698