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

Side by Side Diff: LayoutTests/fast/performance/performance-observer.html

Issue 1198863006: First version of PerformanceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments Created 5 years, 3 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 | LayoutTests/fast/performance/performance-observer-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script>
4
5 description("This tests that PerformanceObserver gets called the right number of times.");
6
7 window.jsTestIsAsync = true;
8
9 var entries = [];
10
11 var expectedEntries = [
12 {entryType:'mark', name:'mark_1'},
13 {entryType:'mark', name:'mark_2'},
14 {entryType:'measure', name:'measure_1'}
15 ];
16
17 var observer = new PerformanceObserver(performanceCallback);
18
19 function performanceCallback(performanceEntryList)
20 {
21 entries = entries.concat(performanceEntryList.getEntries());
22 if (entries.length != expectedEntries.length)
23 return;
24 shouldBe('entries[0].entryType', 'expectedEntries[0].entryType');
25 shouldBe('entries[0].name', 'expectedEntries[0].name');
26 shouldBe('entries[1].entryType', 'expectedEntries[1].entryType');
27 shouldBe('entries[1].name', 'expectedEntries[1].name');
28 shouldBe('entries[2].entryType', 'expectedEntries[2].entryType');
29 shouldBe('entries[2].name', 'expectedEntries[2].name');
30 finishJSTest();
31 }
32
33 function performMeasure()
34 {
35 window.performance.measure('measure_1', 'mark_1', 'mark_2');
36 }
37
38 var config = { entryTypes: ['mark', 'measure'] };
39 observer.observe(config);
40
41 window.performance.mark('mark_1');
42 window.performance.mark('mark_2');
43
44 window.setTimeout(performMeasure, 0);
45 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/performance/performance-observer-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698