https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 89a7b39d4c0b8c2b2339fd26fa39ab802b6980f1 authored by Rune Lillesveen on 23 March 2018, 14:59:20 UTC
Don't skip display:none options finding selectable options.
Tip revision: 89a7b39
po-takeRecords.html
<!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>
back to top