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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/performance-timing/longtask/longtask-raf.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
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 src="resources/slowraf.js"></script> 4 <script src="resources/slowraf.js"></script>
5 <script> 5 <script>
6 6
7 async_test(function (t) { 7 async_test(function (t) {
8 var observer = new PerformanceObserver( 8 var observer = new PerformanceObserver(
9 t.step_func(function (entryList) { 9 t.step_func(function (entryList) {
10 var entries = entryList.getEntries(); 10 var entries = entryList.getEntries();
11 assert_equals(entries.length, 1, 11 assert_equals(entries.length, 1,
12 "Exactly one entry is expected."); 12 "Exactly one entry is expected.");
13 var longtask = entries[0]; 13 var longtask = entries[0];
14 assert_equals(longtask.entryType, "longtask", 14 assert_equals(longtask.entryType, "longtask");
15 "entryType expected to be: longtask"); 15 assert_equals(longtask.name, "self");
16 assert_equals(longtask.name, "same-origin-self", 16 assert_greater_than(longtask.duration, 50);
17 "name expected to be: same-origin-self");
18 assert_greater_than(longtask.duration, 50,
19 "duration expected to be greater than 50ms threshold");
20 assert_equals(longtask.startTime, Math.floor(longtask.startTime), 17 assert_equals(longtask.startTime, Math.floor(longtask.startTime),
21 "startTime expected to have 1 miillisecond granularity"); 18 "startTime expected to have 1 miillisecond granularity");
22 19
23 // Assert the TaskAttributionTiming entry in attribution. 20 // Assert the TaskAttributionTiming entry in attribution.
24 assert_equals(longtask.attribution.length, 1, 21 assert_equals(longtask.attribution.length, 1,
25 "Exactly one attribution entry is expected"); 22 "Exactly one attribution entry is expected");
26 var attribution = longtask.attribution[0]; 23 var attribution = longtask.attribution[0];
27 assert_equals(attribution.entryType, "taskattribution"); 24 assert_equals(attribution.entryType, "taskattribution");
28 assert_equals(attribution.name, "frame"); 25 assert_equals(attribution.name, "script");
29 assert_equals(attribution.duration, 0); 26 assert_equals(attribution.duration, 0);
30 assert_equals(attribution.startTime, 0); 27 assert_equals(attribution.startTime, 0);
31 28
32 observer.disconnect(); 29 observer.disconnect();
33 t.done(); 30 t.done();
34 }) 31 })
35 ); 32 );
36 observer.observe({entryTypes: ["longtask"]}); 33 observer.observe({entryTypes: ["longtask"]});
37 34
38 }, "Performance longtask entries are observable"); 35 }, "Performance longtask entries are observable");
39 36
40 </script> 37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698