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

Side by Side Diff: LayoutTests/http/tests/workers/resources/performance-timeline-worker.js

Issue 1192913007: Change BodyStreamBuffer to be FetchDataConsumerHandle-based and enable backpressure in Fetch API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up done. ready. 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
OLDNEW
1 importScripts('../../resources/testharness.js'); 1 importScripts('../../resources/testharness.js');
2 2
3 promise_test(function(test) { 3 promise_test(function(test) {
4 var durationMsec = 100; 4 var durationMsec = 100;
5 5
6 return new Promise(function(resolve) { 6 return new Promise(function(resolve) {
7 performance.mark('startMark'); 7 performance.mark('startMark');
8 setTimeout(resolve, durationMsec); 8 setTimeout(resolve, durationMsec);
9 }).then(function() { 9 }).then(function() {
10 performance.mark('endMark'); 10 performance.mark('endMark');
(...skipping 16 matching lines...) Expand all
27 assert_equals(performance.getEntriesByType('measure').length, 0); 27 assert_equals(performance.getEntriesByType('measure').length, 0);
28 }); 28 });
29 }, 'User Timing'); 29 }, 'User Timing');
30 30
31 promise_test(function(test) { 31 promise_test(function(test) {
32 return fetch('../../resources/dummy.txt') 32 return fetch('../../resources/dummy.txt')
33 .then(function(resp) { 33 .then(function(resp) {
34 return resp.text(); 34 return resp.text();
35 }) 35 })
36 .then(function(t) { 36 .then(function(t) {
37 return new Promise(function(resolve, reject) {
hiroshige 2015/07/02 08:22:10 This is temporary fix: |performance| entries are u
38 setTimeout(function() { resolve(t); }, 1000);
39 });
40 })
41 .then(function(t) {
37 var expectedResources = ['/resources/testharness.js', '/resources/dumm y.txt']; 42 var expectedResources = ['/resources/testharness.js', '/resources/dumm y.txt'];
38 assert_equals(performance.getEntriesByType('resource').length, expecte dResources.length); 43 assert_equals(performance.getEntriesByType('resource').length, expecte dResources.length);
39 for (var i = 0; i < expectedResources.length; i++) { 44 for (var i = 0; i < expectedResources.length; i++) {
40 var entry = performance.getEntriesByType('resource')[i]; 45 var entry = performance.getEntriesByType('resource')[i];
41 assert_true(entry.name.endsWith(expectedResources[i])); 46 assert_true(entry.name.endsWith(expectedResources[i]));
42 assert_equals(entry.workerStart, 0); 47 assert_equals(entry.workerStart, 0);
43 assert_greater_than(entry.startTime, 0); 48 assert_greater_than(entry.startTime, 0);
44 assert_greater_than(entry.responseEnd, entry.startTime); 49 assert_greater_than(entry.responseEnd, entry.startTime);
45 } 50 }
46 return new Promise(function(resolve) { 51 return new Promise(function(resolve) {
47 performance.onwebkitresourcetimingbufferfull = resolve; 52 performance.onwebkitresourcetimingbufferfull = resolve;
48 performance.webkitSetResourceTimingBufferSize(expectedResources.le ngth); 53 performance.webkitSetResourceTimingBufferSize(expectedResources.le ngth);
49 }); 54 });
50 }) 55 })
51 .then(function() { 56 .then(function() {
52 performance.webkitClearResourceTimings(); 57 performance.webkitClearResourceTimings();
53 assert_equals(performance.getEntriesByType('resource').length, 0); 58 assert_equals(performance.getEntriesByType('resource').length, 0);
54 }) 59 })
55 }, 'Resource Timing'); 60 }, 'Resource Timing');
56 61
57 done(); 62 done();
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/progressive.php ('k') | Source/core/fetch/FetchInitiatorTypeNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698