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

Side by Side Diff: LayoutTests/inspector/timeline/timeline-network-received-data.html

Issue 351873003: Unflaky test inspector/timeline/timeline-network-received-data.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: another test was adjusted Created 6 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
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 src="../../http/tests/inspector/timeline-test.js"></script> 4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script> 5 <script>
6 6
7 var scriptUrl = "timeline-network-resource.js";
8
9 function performActions() 7 function performActions()
10 { 8 {
11 var image = new Image(); 9 var image = new Image();
12 image.src = "resources/anImage.png"; 10 image.src = "resources/anImage.png";
13 var script = document.createElement("script"); 11 var script = document.createElement("script");
14 script.src = scriptUrl; 12 script.src = "timeline-network-resource.js";
15 document.body.appendChild(script); 13 document.body.appendChild(script);
16 } 14 }
17 15
18 function test() 16 function test()
19 { 17 {
20 var scriptUrl = "timeline-network-resource.js"; 18 var callbackBarrier = new CallbackBarrier();
19 var resourceReceivedCallback = callbackBarrier.createCallback();
20 // It will be called from timeline-network-resource.js script by evaluateInW ebInspector call.
21 InspectorTest.scriptEvaluated = callbackBarrier.createCallback();
22 callbackBarrier.callWhenDone(done);
23
24 function done()
25 {
26 InspectorTest.addResult("Script evaluated.");
27 InspectorTest.addResult("Resource received data has length, test passed. ");
28 InspectorTest.completeTest();
29 }
21 30
22 var calledOnce; 31 var calledOnce;
23 32
24 InspectorTest.startTimeline(function() { 33 InspectorTest.startTimeline(function() {
25 InspectorTest.evaluateInPage("performActions()"); 34 InspectorTest.evaluateInPage("performActions()");
26 }); 35 });
27 36
28 InspectorTest.waitForRecordType("ResourceReceivedData", finish); 37 InspectorTest.waitForRecordType("ResourceReceivedData", finish);
29 38
30 function finish(object) 39 function finish(object)
31 { 40 {
32 for (var prop in object) { 41 for (var prop in object) {
33 if (!InspectorTest.timelinePropertyFormatters[prop]) { 42 if (!InspectorTest.timelinePropertyFormatters[prop]) {
34 for (var property in object[prop]) { 43 for (var property in object[prop]) {
35 if (property === "encodedDataLength") { 44 if (property === "encodedDataLength") {
36 if (!calledOnce) { 45 if (!calledOnce) {
37 calledOnce = true; 46 calledOnce = true;
38 InspectorTest.addResult("Resource received data has length, test passed."); 47 resourceReceivedCallback();
39 InspectorTest.completeTest();
40 } 48 }
41 return; 49 return;
42 } 50 }
43 } 51 }
44 } 52 }
45 } 53 }
46 } 54 }
47 } 55 }
48 56
49 </script> 57 </script>
50 </head> 58 </head>
51 59
52 <body onload="runTest()"> 60 <body onload="runTest()">
53 <p> 61 <p>
54 Tests the Timeline API instrumentation of a network resource received data 62 Tests the Timeline API instrumentation of a network resource received data
55 </p> 63 </p>
56 </body> 64 </body>
57 </html> 65 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/inspector/timeline/timeline-network-received-data-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698