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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/performance-timing/longtask/longtask-attributes.html

Issue 2636503003: minor name updates based on spec update at: https://wicg.github.io/longtasks (Closed)
Patch Set: update global-interface layout test expectation Created 3 years, 11 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 | third_party/WebKit/LayoutTests/http/tests/performance-timing/longtask/longtask-externalscript.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 5
6 async_test(function (t) { 6 async_test(function (t) {
7 var observer = new PerformanceObserver( 7 var observer = new PerformanceObserver(
8 t.step_func(function (entryList) { 8 t.step_func(function (entryList) {
9 var entries = entryList.getEntries(); 9 var entries = entryList.getEntries();
10 assert_equals(entries.length, 1, 10 assert_equals(entries.length, 1,
11 "Exactly one entry is expected."); 11 "Exactly one entry is expected.");
12 var longtask = entries[0]; 12 var longtask = entries[0];
13 assert_equals(longtask.entryType, "longtask", 13 assert_equals(longtask.entryType, "longtask");
14 "entryType expected to be: longtask"); 14 assert_equals(longtask.name, "self");
15 assert_equals(longtask.name, "same-origin-self", 15 assert_greater_than(longtask.duration, 50);
16 "name expected to be: same-origin-self");
17 assert_greater_than(longtask.duration, 50,
18 "duration expected to be greater than 50ms threshold");
19 assert_equals(longtask.startTime, Math.floor(longtask.startTime), 16 assert_equals(longtask.startTime, Math.floor(longtask.startTime),
20 "startTime expected to have 1 miillisecond granularity"); 17 "startTime expected to have 1 miillisecond granularity");
21 18
22 // Assert the TaskAttributionTiming entry in attribution. 19 // Assert the TaskAttributionTiming entry in attribution.
23 assert_equals(longtask.attribution.length, 1, 20 assert_equals(longtask.attribution.length, 1,
24 "Exactly one attribution entry is expected"); 21 "Exactly one attribution entry is expected");
25 var attribution = longtask.attribution[0]; 22 var attribution = longtask.attribution[0];
26 assert_equals(attribution.entryType, "taskattribution"); 23 assert_equals(attribution.entryType, "taskattribution");
27 assert_equals(attribution.name, "frame"); 24 assert_equals(attribution.name, "script");
28 assert_equals(attribution.duration, 0); 25 assert_equals(attribution.duration, 0);
29 assert_equals(attribution.startTime, 0); 26 assert_equals(attribution.startTime, 0);
30 27
31 observer.disconnect(); 28 observer.disconnect();
32 t.done(); 29 t.done();
33 }) 30 })
34 ); 31 );
35 observer.observe({entryTypes: ["longtask"]}); 32 observer.observe({entryTypes: ["longtask"]});
36 33
37 /* Generate a slow task */ 34 /* Generate a slow task */
38 var begin = window.performance.now(); 35 var begin = window.performance.now();
39 while (window.performance.now() < begin + 51); 36 while (window.performance.now() < begin + 51);
40 37
41 }, "Performance longtask entries are observable"); 38 }, "Performance longtask entries are observable");
42 39
43 </script> 40 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/performance-timing/longtask/longtask-externalscript.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698