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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/observable.html

Issue 2932593002: Attempt 2: Update PaintTiming Web Perf APIs for FP & FCP to report swap time (Closed)
Patch Set: rebase to head Created 3 years, 6 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
(Empty)
1 <!DOCTYPE html>
2 <head>
3 <title>Performance Paint Timing Test</title>
4 </head>
5 <body>
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 <script>
9
10 async_test(function (t) {
11 var observer = new PerformanceObserver(
12 t.step_func(function (entryList) {
13 var entries = entryList.getEntries();
14 assert_equals(entries.length, 2,
15 "There should be two paint timing instances.");
16 assert_equals(entries[0].entryType, "paint",
17 "Expected entryType to be: paint.");
18 assert_equals(entries[0].name, "first-paint",
19 "Expected entryType to be: paint.");
20 assert_equals(entries[0].duration, 0,
21 "Expected duration to be: 0.");
22
23 assert_equals(entries[1].entryType, "paint",
24 "Expected entryType to be: paint.");
25 assert_equals(entries[1].name, "first-contentful-paint",
26 "Expected entryType to be: paint.");
27 assert_equals(entries[1].duration, 0,
28 "Expected duration to be: 0.");
29 observer.disconnect();
30
31 // Check buffer
32 bufferedEntries = performance.getEntriesByType('paint');
33 assert_equals(bufferedEntries.length, 2,
34 "There should be two paint timing instances.");
35 assert_equals(bufferedEntries[0].entryType, "paint",
36 "Expected entryType to be: paint.");
37 assert_equals(bufferedEntries[0].name, "first-paint",
38 "Expected entryType to be: paint.");
39 assert_equals(bufferedEntries[1].entryType, "paint",
40 "Expected entryType to be: paint.");
41 assert_equals(bufferedEntries[1].name, "first-contentful-paint",
42 "Expected entryType to be: paint.");
43
44 t.done();
45 })
46 );
47 observer.observe({entryTypes: ["paint"]});
48
49 }, "Both first-paint-timing and first-contentful-paint timing entry are obse rvable.");
50
51 </script>
52 <div style="background-color:black;color:white;padding:20px;">...test...</di v>
53 </body>
54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698