Commit 65a32617 authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

Add test for PerformanceObserver#takeRecords()

Bug: 799929
Change-Id: Ibbd51642556f25aa8d0c1772923dc32d9de62d2c
Reviewed-on: https://chromium-review.googlesource.com/865097
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529166}
parent 0abb457a
......@@ -3553,3 +3553,5 @@ crbug.com/799814 [ Android ] fast/beacon/beacon-basic.html [ Pass Failure ]
# This test is flaky and times out on Windows 7 bots. It also times out on MSAN
# bots due to taling too long to complete.
crbug.com/800359 [ Win7 ] external/wpt/mimesniff/mime-types/parsing.any.worker.html [ Pass Timeout ]
crbug.com/799929 external/wpt/performance-timeline/po-takeRecords.html [ Failure ]
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>PerformanceObserver: takeRecords</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="performanceobservers.js"></script>
<script>
async_test(function (t) {
const observer = new PerformanceObserver(function (entryList, observer) {
assert_unreached('This callback should not have been called.')
});
let entries = observer.takeRecords();
checkEntries(entries, [], 'No records before observe');
observer.observe({entryTypes: ['mark']});
assert_equals(typeof(observer.takeRecords), 'function');
entries = observer.takeRecords();
checkEntries(entries, [], 'No records just from observe');
performance.mark('a');
performance.mark('b');
entries = observer.takeRecords();
checkEntries(entries, [
{entryType: 'mark', name: 'a'},
{entryType: 'mark', name: 'b'}
]);
performance.mark('c');
performance.mark('d');
performance.mark('e');
entries = observer.takeRecords();
checkEntries(entries, [
{entryType: 'mark', name: 'c'},
{entryType: 'mark', name: 'd'},
{entryType: 'mark', name: 'e'}
]);
entries = observer.takeRecords();
checkEntries(entries, [], 'No entries right after takeRecords');
observer.disconnect();
t.done();
}, "Test PerformanceObserver's takeRecords()");
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment