LayoutTests/imported/w3c/ChangeLog

 12020-07-10 Chris Dumez <cdumez@apple.com>
 2
 3 Resync web-platform-tests/user-timing from upstream
 4 https://bugs.webkit.org/show_bug.cgi?id=214208
 5
 6 Reviewed by Sam Weinig.
 7
 8 Resync web-platform-tests/user-timing from upstream 859527a3513029d2.
 9
 10 * web-platform-tests/user-timing/*: Updated.
 11
1122020-07-10 Chris Dumez <cdumez@apple.com>
213
314 Resync web-platform-tests/eventsource from upstream

LayoutTests/imported/w3c/web-platform-tests/user-timing/META.yml

 1spec: https://w3c.github.io/user-timing/
 2suggested_reviewers:
 3 - plehegar
 4 - igrigorik

LayoutTests/imported/w3c/web-platform-tests/user-timing/OWNERS

1 @plehegar
2 @igrigorik
3 @toddreifsteck

LayoutTests/imported/w3c/web-platform-tests/user-timing/buffered-flag.any-expected.txt

 1CONSOLE MESSAGE: TypeError: Member PerformanceObserverInit.entryTypes is required and must be an instance of sequence
 2CONSOLE MESSAGE: TypeError: Member PerformanceObserverInit.entryTypes is required and must be an instance of sequence
 3
 4Harness Error (FAIL), message = TypeError: Member PerformanceObserverInit.entryTypes is required and must be an instance of sequence
 5
 6TIMEOUT PerformanceObserver with buffered flag sees previous marks Test timed out
 7TIMEOUT PerformanceObserver with buffered flag sees previous measures Test timed out
 8
 9Harness Error (FAIL), message = TypeError: Member PerformanceObserverInit.entryTypes is required and must be an instance of sequence
 10
 11TIMEOUT PerformanceObserver with buffered flag sees previous marks Test timed out
 12TIMEOUT PerformanceObserver with buffered flag sees previous measures Test timed out
 13

LayoutTests/imported/w3c/web-platform-tests/user-timing/buffered-flag.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/buffered-flag.any.js

 1async_test(t => {
 2 // First observer creates second in callback to ensure the entry has been dispatched by the time
 3 // the second observer begins observing.
 4 new PerformanceObserver(() => {
 5 // Second observer requires 'buffered: true' to see an entry.
 6 new PerformanceObserver(t.step_func_done(list => {
 7 const entries = list.getEntries();
 8 assert_equals(entries.length, 1, 'There should be 1 mark entry.');
 9 assert_equals(entries[0].entryType, 'mark');
 10 })).observe({type: 'mark', buffered: true});
 11 }).observe({entryTypes: ['mark']});
 12 performance.mark('foo');
 13}, 'PerformanceObserver with buffered flag sees previous marks');
 14
 15async_test(t => {
 16 // First observer creates second in callback to ensure the entry has been dispatched by the time
 17 // the second observer begins observing.
 18 new PerformanceObserver(() => {
 19 // Second observer requires 'buffered: true' to see an entry.
 20 new PerformanceObserver(t.step_func_done(list => {
 21 const entries = list.getEntries();
 22 assert_equals(entries.length, 1, 'There should be 1 measure entry.');
 23 assert_equals(entries[0].entryType, 'measure');
 24 })).observe({type: 'measure', buffered: true});
 25 }).observe({entryTypes: ['measure']});
 26 performance.measure('bar');
 27}, 'PerformanceObserver with buffered flag sees previous measures');

LayoutTests/imported/w3c/web-platform-tests/user-timing/buffered-flag.any.worker-expected.txt

 1
 2Harness Error (FAIL), message = Error in remote http://localhost:8800/user-timing/buffered-flag.any.js: TypeError: Member PerformanceObserverInit.entryTypes is required and must be an instance of sequence
 3
 4TIMEOUT PerformanceObserver with buffered flag sees previous marks Test timed out
 5TIMEOUT PerformanceObserver with buffered flag sees previous measures Test timed out
 6

LayoutTests/imported/w3c/web-platform-tests/user-timing/buffered-flag.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/clearMarks-expected.txt

 1Description
 2
 3This test validates functionality of the interface window.performance.clearMarks.
 4
 5
 6PASS First loop: checking entries after removing "". There should be 2 entries.
 7PASS First loop: checking entries after removing "". Entries in entrylist should be in order.
 8PASS First loop: checking entries after removing "". Entry_list 0. Entry "1" should be one that we have set.
 9PASS First loop: checking entries after removing "". Entry_list 0. entryType should be "mark".
 10PASS First loop: checking entries after removing "". Entry_list 0. startTime should greater than 0.
 11PASS First loop: checking entries after removing "". Entry_list 0. duration of mark should be 0.
 12PASS First loop: checking entries after removing "". Entry_list 1. Entry "abc" should be one that we have set.
 13PASS First loop: checking entries after removing "". Entry_list 1. entryType should be "mark".
 14PASS First loop: checking entries after removing "". Entry_list 1. startTime should greater than 0.
 15PASS First loop: checking entries after removing "". Entry_list 1. duration of mark should be 0.
 16PASS First loop: marks that we cleared for "" should not exist anymore.
 17PASS First loop: checking entries after removing "1". There should be 1 entries.
 18PASS First loop: checking entries after removing "1". Entries in entrylist should be in order.
 19PASS First loop: checking entries after removing "1". Entry_list 0. Entry "abc" should be one that we have set.
 20PASS First loop: checking entries after removing "1". Entry_list 0. entryType should be "mark".
 21PASS First loop: checking entries after removing "1". Entry_list 0. startTime should greater than 0.
 22PASS First loop: checking entries after removing "1". Entry_list 0. duration of mark should be 0.
 23PASS First loop: marks that we cleared for "1" should not exist anymore.
 24PASS First loop: checking entries after removing "abc". There should be 0 entries.
 25PASS First loop: checking entries after removing "abc". Entries in entrylist should be in order.
 26PASS First loop: marks that we cleared for "abc" should not exist anymore.
 27PASS No marks should exist after we clear all.
 28PASS Second loop: checking entries after removing "". There should be 4 entries.
 29PASS Second loop: checking entries after removing "". Entries in entrylist should be in order.
 30PASS Second loop: checking entries after removing "". Entry_list 0. Entry "1" should be one that we have set.
 31PASS Second loop: checking entries after removing "". Entry_list 0. entryType should be "mark".
 32PASS Second loop: checking entries after removing "". Entry_list 0. startTime should greater than 0.
 33PASS Second loop: checking entries after removing "". Entry_list 0. duration of mark should be 0.
 34PASS Second loop: checking entries after removing "". Entry_list 1. Entry "1" should be one that we have set.
 35PASS Second loop: checking entries after removing "". Entry_list 1. entryType should be "mark".
 36PASS Second loop: checking entries after removing "". Entry_list 1. startTime should greater than 0.
 37PASS Second loop: checking entries after removing "". Entry_list 1. duration of mark should be 0.
 38PASS Second loop: checking entries after removing "". Entry_list 2. Entry "abc" should be one that we have set.
 39PASS Second loop: checking entries after removing "". Entry_list 2. entryType should be "mark".
 40PASS Second loop: checking entries after removing "". Entry_list 2. startTime should greater than 0.
 41PASS Second loop: checking entries after removing "". Entry_list 2. duration of mark should be 0.
 42PASS Second loop: checking entries after removing "". Entry_list 3. Entry "abc" should be one that we have set.
 43PASS Second loop: checking entries after removing "". Entry_list 3. entryType should be "mark".
 44PASS Second loop: checking entries after removing "". Entry_list 3. startTime should greater than 0.
 45PASS Second loop: checking entries after removing "". Entry_list 3. duration of mark should be 0.
 46PASS Second loop: marks that we cleared for "" should not exist anymore.
 47PASS Second loop: checking entries after removing "1". There should be 2 entries.
 48PASS Second loop: checking entries after removing "1". Entries in entrylist should be in order.
 49PASS Second loop: checking entries after removing "1". Entry_list 0. Entry "abc" should be one that we have set.
 50PASS Second loop: checking entries after removing "1". Entry_list 0. entryType should be "mark".
 51PASS Second loop: checking entries after removing "1". Entry_list 0. startTime should greater than 0.
 52PASS Second loop: checking entries after removing "1". Entry_list 0. duration of mark should be 0.
 53PASS Second loop: checking entries after removing "1". Entry_list 1. Entry "abc" should be one that we have set.
 54PASS Second loop: checking entries after removing "1". Entry_list 1. entryType should be "mark".
 55PASS Second loop: checking entries after removing "1". Entry_list 1. startTime should greater than 0.
 56PASS Second loop: checking entries after removing "1". Entry_list 1. duration of mark should be 0.
 57PASS Second loop: marks that we cleared for "1" should not exist anymore.
 58PASS Second loop: checking entries after removing "abc". There should be 0 entries.
 59PASS Second loop: checking entries after removing "abc". Entries in entrylist should be in order.
 60PASS Second loop: marks that we cleared for "abc" should not exist anymore.
 61PASS Nothing should happen if we clear a non-exist mark.
 62PASS No marks should exist when we clear all.
 63

LayoutTests/imported/w3c/web-platform-tests/user-timing/clearMarks.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta charset="utf-8" />
 5<title>functionality test of window.performance.clearMarks</title>
 6<link rel="author" title="Intel" href="http://www.intel.com/" />
 7<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
 8<script src="/resources/testharness.js"></script>
 9<script src="/resources/testharnessreport.js"></script>
 10<script src="/common/performance-timeline-utils.js"></script>
 11<script src="resources/webperftestharness.js"></script>
 12<script src="resources/webperftestharnessextension.js"></script>
 13<script>
 14setup({ explicit_done: true });
 15
 16function onload_test()
 17{
 18 const entrylist_checker = new performance_entrylist_checker('mark');
 19 const string_mark_names = mark_names.map(function (x) { return String(x)});
 20 mark_names.forEach(function(name) {
 21 performance.mark(name);
 22 });
 23
 24 for (let i = 0; i < mark_names.length; ++i)
 25 {
 26 performance.clearMarks(mark_names[i]);
 27 const retained_entries = performance.getEntriesByType('mark');
 28 const non_retained_entries = performance.getEntriesByName(mark_names[i], 'mark');
 29 entrylist_checker.entrylist_check(retained_entries, mark_names.length - i - 1, string_mark_names,
 30 'First loop: checking entries after removing "' + mark_names[i] + '". ');
 31 test_equals(non_retained_entries.length, 0,
 32 'First loop: marks that we cleared for "' + mark_names[i] + '" should not exist anymore.');
 33 }
 34
 35 mark_names.forEach(function(name) {
 36 performance.mark(name);
 37 });
 38 performance.clearMarks();
 39 test_equals(performance.getEntriesByType('mark').length, 0, 'No marks should exist after we clear all.');
 40
 41 // Following cases test clear existed mark name that is tied for two times.
 42 mark_names.forEach(function(name) {
 43 performance.mark(name);
 44 });
 45 mark_names.forEach(function(name) {
 46 performance.mark(name);
 47 });
 48
 49 for (let i = 0; i < mark_names.length; ++i)
 50 {
 51 performance.clearMarks(mark_names[i]);
 52 const retained_entries = performance.getEntriesByType('mark');
 53 const non_retained_entries = performance.getEntriesByName(mark_names[i], 'mark');
 54 entrylist_checker.entrylist_check(retained_entries, (mark_names.length - i - 1) * 2, string_mark_names,
 55 'Second loop: checking entries after removing "' + mark_names[i] + '". ');
 56 test_equals(non_retained_entries.length, 0,
 57 'Second loop: marks that we cleared for "' + mark_names[i] + '" should not exist anymore.');
 58 }
 59
 60 // Following cases test clear functionality when mark names are tied for two times.
 61 mark_names.forEach(function(name) {
 62 performance.mark(name);
 63 });
 64 mark_names.forEach(function(name) {
 65 performance.mark(name);
 66 });
 67 var entry_number_before_useless_clear = performance.getEntriesByType('Mark').length;
 68 performance.clearMarks('NonExist');
 69 var entry_number_after_useless_clear = performance.getEntriesByType('Mark').length;
 70 test_equals(entry_number_before_useless_clear, entry_number_after_useless_clear, 'Nothing should happen if we clear a non-exist mark.');
 71
 72 performance.clearMarks();
 73 test_equals(performance.getEntriesByType('mark').length, 0, 'No marks should exist when we clear all.');
 74
 75 done();
 76}
 77</script>
 78</head>
 79<body onload=onload_test()>
 80 <h1>Description</h1>
 81 <p>This test validates functionality of the interface window.performance.clearMarks.</p>
 82 <div id="log"></div>
 83</body>
 84</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/clearMeasures-expected.txt

 1Description
 2
 3This test validates functionality of the interface window.performance.clearMeasures.
 4
 5
 6PASS First loop: checking entries after removing "". There should be 2 entries.
 7PASS First loop: checking entries after removing "". Entries in entrylist should be in order.
 8PASS First loop: checking entries after removing "". Entry_list 0. Entry "aaa" should be one that we have set.
 9PASS First loop: checking entries after removing "". Entry_list 0. entryType should be "measure".
 10PASS First loop: checking entries after removing "". Entry_list 0. startTime should be a number.
 11PASS First loop: checking entries after removing "". Entry_list 0. duration should be a number.
 12PASS First loop: checking entries after removing "". Entry_list 1. Entry "2" should be one that we have set.
 13PASS First loop: checking entries after removing "". Entry_list 1. entryType should be "measure".
 14PASS First loop: checking entries after removing "". Entry_list 1. startTime should be a number.
 15PASS First loop: checking entries after removing "". Entry_list 1. duration should be a number.
 16PASS First loop: measure "" should not exist anymore after we cleared it.
 17PASS First loop: checking entries after removing "2". There should be 1 entries.
 18PASS First loop: checking entries after removing "2". Entries in entrylist should be in order.
 19PASS First loop: checking entries after removing "2". Entry_list 0. Entry "aaa" should be one that we have set.
 20PASS First loop: checking entries after removing "2". Entry_list 0. entryType should be "measure".
 21PASS First loop: checking entries after removing "2". Entry_list 0. startTime should be a number.
 22PASS First loop: checking entries after removing "2". Entry_list 0. duration should be a number.
 23PASS First loop: measure "2" should not exist anymore after we cleared it.
 24PASS First loop: checking entries after removing "aaa". There should be 0 entries.
 25PASS First loop: checking entries after removing "aaa". Entries in entrylist should be in order.
 26PASS First loop: measure "aaa" should not exist anymore after we cleared it.
 27PASS No measures should exist after we clear all (after first loop).
 28PASS Second loop: checking entries after removing "". There should be 4 entries.
 29PASS Second loop: checking entries after removing "". Entries in entrylist should be in order.
 30PASS Second loop: checking entries after removing "". Entry_list 0. Entry "aaa" should be one that we have set.
 31PASS Second loop: checking entries after removing "". Entry_list 0. entryType should be "measure".
 32PASS Second loop: checking entries after removing "". Entry_list 0. startTime should be a number.
 33PASS Second loop: checking entries after removing "". Entry_list 0. duration should be a number.
 34PASS Second loop: checking entries after removing "". Entry_list 1. Entry "aaa" should be one that we have set.
 35PASS Second loop: checking entries after removing "". Entry_list 1. entryType should be "measure".
 36PASS Second loop: checking entries after removing "". Entry_list 1. startTime should be a number.
 37PASS Second loop: checking entries after removing "". Entry_list 1. duration should be a number.
 38PASS Second loop: checking entries after removing "". Entry_list 2. Entry "2" should be one that we have set.
 39PASS Second loop: checking entries after removing "". Entry_list 2. entryType should be "measure".
 40PASS Second loop: checking entries after removing "". Entry_list 2. startTime should be a number.
 41PASS Second loop: checking entries after removing "". Entry_list 2. duration should be a number.
 42PASS Second loop: checking entries after removing "". Entry_list 3. Entry "2" should be one that we have set.
 43PASS Second loop: checking entries after removing "". Entry_list 3. entryType should be "measure".
 44PASS Second loop: checking entries after removing "". Entry_list 3. startTime should be a number.
 45PASS Second loop: checking entries after removing "". Entry_list 3. duration should be a number.
 46PASS Second loop: measure "" should not exist anymore after we cleared it.
 47PASS Second loop: checking entries after removing "2". There should be 2 entries.
 48PASS Second loop: checking entries after removing "2". Entries in entrylist should be in order.
 49PASS Second loop: checking entries after removing "2". Entry_list 0. Entry "aaa" should be one that we have set.
 50PASS Second loop: checking entries after removing "2". Entry_list 0. entryType should be "measure".
 51PASS Second loop: checking entries after removing "2". Entry_list 0. startTime should be a number.
 52PASS Second loop: checking entries after removing "2". Entry_list 0. duration should be a number.
 53PASS Second loop: checking entries after removing "2". Entry_list 1. Entry "aaa" should be one that we have set.
 54PASS Second loop: checking entries after removing "2". Entry_list 1. entryType should be "measure".
 55PASS Second loop: checking entries after removing "2". Entry_list 1. startTime should be a number.
 56PASS Second loop: checking entries after removing "2". Entry_list 1. duration should be a number.
 57PASS Second loop: measure "2" should not exist anymore after we cleared it.
 58PASS Second loop: checking entries after removing "aaa". There should be 0 entries.
 59PASS Second loop: checking entries after removing "aaa". Entries in entrylist should be in order.
 60PASS Second loop: measure "aaa" should not exist anymore after we cleared it.
 61PASS Nothing should happen if we clear a non-exist measure
 62PASS No measures should exist when we clear all (after second loop).
 63

LayoutTests/imported/w3c/web-platform-tests/user-timing/clearMeasures.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta charset="utf-8" />
 5<title>functionality test of window.performance.clearMeasures</title>
 6<link rel="author" title="Intel" href="http://www.intel.com/" />
 7<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
 8<script src="/resources/testharness.js"></script>
 9<script src="/resources/testharnessreport.js"></script>
 10<script src="/common/performance-timeline-utils.js"></script>
 11<script src="resources/webperftestharness.js"></script>
 12<script src="resources/webperftestharnessextension.js"></script>
 13<script>
 14setup({ explicit_done: true });
 15
 16function onload_test()
 17{
 18 const context = new PerformanceContext(window.performance);
 19 const entrylist_checker = new performance_entrylist_checker('measure');
 20 const measure_names = measures.map(function(x) {return x[0];});
 21
 22 mark_names.forEach(function(name) {
 23 context.mark(name);
 24 });
 25 measures.forEach(context.initialMeasures, context);
 26 for (let i = 0; i < measures.length; ++i)
 27 {
 28 context.clearMeasures(measures[i][0]);
 29 const retained_entries = context.getEntriesByType('measure');
 30 const non_retained_entries = context.getEntriesByName(measures[i][0], 'measure');
 31 entrylist_checker.entrylist_check(retained_entries, measures.length - i - 1, measure_names,
 32 'First loop: checking entries after removing "' + measures[i][0] + '". ');
 33 test_equals(non_retained_entries.length, 0,
 34 'First loop: measure "' + measures[i][0] + '" should not exist anymore after we cleared it.');
 35 }
 36
 37 measures.forEach(context.initialMeasures, context);
 38 context.clearMeasures();
 39 test_equals(context.getEntriesByType('measure').length, 0, 'No measures should exist after we clear all (after first loop).');
 40
 41 // Following cases test clear existed measure name that is tied twice.
 42 measures.forEach(context.initialMeasures, context);
 43 mark_names.forEach(function(name) {
 44 context.mark(name);
 45 });
 46 measures.forEach(context.initialMeasures, context);
 47 for (let i = 0; i < measures.length; ++i)
 48 {
 49 context.clearMeasures(measures[i][0]);
 50 const retained_entries = context.getEntriesByType('measure');
 51 const non_retained_entries = context.getEntriesByName(measures[i][0], 'measure');
 52 entrylist_checker.entrylist_check(retained_entries, (measures.length - i - 1) * 2, measure_names,
 53 'Second loop: checking entries after removing "' + measures[i][0] + '". ');
 54 test_equals(non_retained_entries.length, 0,
 55 'Second loop: measure "' + measures[i][0] +'" should not exist anymore after we cleared it.');
 56 }
 57
 58 // Following cases test clear functionality when measure names are tied twice.
 59 measures.forEach(context.initialMeasures, context);
 60 measures.forEach(context.initialMeasures, context);
 61 const entry_number_before_useless_clear = context.getEntriesByType('measure').length;
 62 context.clearMeasures('NonExist');
 63 const entry_number_after_useless_clear = context.getEntriesByType('measure').length;
 64 test_equals(entry_number_before_useless_clear, entry_number_after_useless_clear, 'Nothing should happen if we clear a non-exist measure');
 65 context.clearMeasures();
 66 test_equals(context.getEntriesByType('measure').length, 0, 'No measures should exist when we clear all (after second loop).');
 67
 68 done();
 69}
 70</script>
 71</head>
 72<body onload=onload_test()>
 73 <h1>Description</h1>
 74 <p>This test validates functionality of the interface window.performance.clearMeasures.</p>
 75 <div id="log"></div>
 76</body>
 77</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_all_measures.any.js

11test(function()
22{
3  self.performance.mark("mark1", "responseStart");
 3 self.performance.mark("mark1");
44 self.performance.measure("measure1", "mark1");
5  self.performance.mark("mark2", "responseStart");
 5 self.performance.mark("mark2");
66 self.performance.measure("measure2", "mark2");
77
88 // test that two measures have been created

LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_non_existent_measure.any.js

11test(function()
22{
3  self.performance.mark("mark1", "responseStart");
 3 self.performance.mark("mark1");
44 self.performance.measure("measure1", "mark1");
5  self.performance.mark("mark2", "responseStart");
 5 self.performance.mark("mark2");
66 self.performance.measure("measure2", "mark2");
77
88 // test that two measures have been created

LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_one_measure.any.js

11test(function()
22{
3  self.performance.mark("mark1", "responseStart");
 3 self.performance.mark("mark1");
44 self.performance.measure("measure1", "mark1");
5  self.performance.mark("mark2", "responseStart");
 5 self.performance.mark("mark2");
66 self.performance.measure("measure2", "mark2");
77
88 // test that two measures have been created

LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.any-expected.txt

 1
 2PASS idl_test setup
 3PASS idl_test validation
 4PASS Partial interface Performance: original interface defined
 5PASS Partial interface Performance: member names are unique
 6PASS PerformanceMark interface: existence and properties of interface object
 7FAIL PerformanceMark interface object length assert_equals: wrong value for PerformanceMark.length expected 1 but got 0
 8PASS PerformanceMark interface object name
 9PASS PerformanceMark interface: existence and properties of interface prototype object
 10PASS PerformanceMark interface: existence and properties of interface prototype object's "constructor" property
 11PASS PerformanceMark interface: existence and properties of interface prototype object's @@unscopables property
 12FAIL PerformanceMark interface: attribute detail assert_true: The prototype object must have a property "detail" expected true got false
 13PASS PerformanceMark must be primary interface of mark
 14PASS Stringification of mark
 15FAIL PerformanceMark interface: mark must inherit property "detail" with the proper type assert_inherits: property "detail" not found in prototype chain
 16PASS PerformanceMeasure interface: existence and properties of interface object
 17PASS PerformanceMeasure interface object length
 18PASS PerformanceMeasure interface object name
 19PASS PerformanceMeasure interface: existence and properties of interface prototype object
 20PASS PerformanceMeasure interface: existence and properties of interface prototype object's "constructor" property
 21PASS PerformanceMeasure interface: existence and properties of interface prototype object's @@unscopables property
 22FAIL PerformanceMeasure interface: attribute detail assert_true: The prototype object must have a property "detail" expected true got false
 23PASS PerformanceMeasure must be primary interface of measure
 24PASS Stringification of measure
 25FAIL PerformanceMeasure interface: measure must inherit property "detail" with the proper type assert_inherits: property "detail" not found in prototype chain
 26PASS Performance interface: operation mark(DOMString, optional PerformanceMarkOptions)
 27PASS Performance interface: operation clearMarks(optional DOMString)
 28PASS Performance interface: operation measure(DOMString, optional (DOMString or PerformanceMeasureOptions), optional DOMString)
 29PASS Performance interface: operation clearMeasures(optional DOMString)
 30PASS Performance interface: performance must inherit property "mark(DOMString, optional PerformanceMarkOptions)" with the proper type
 31PASS Performance interface: calling mark(DOMString, optional PerformanceMarkOptions) on performance with too few arguments must throw TypeError
 32PASS Performance interface: performance must inherit property "clearMarks(optional DOMString)" with the proper type
 33PASS Performance interface: calling clearMarks(optional DOMString) on performance with too few arguments must throw TypeError
 34PASS Performance interface: performance must inherit property "measure(DOMString, optional (DOMString or PerformanceMeasureOptions), optional DOMString)" with the proper type
 35PASS Performance interface: calling measure(DOMString, optional (DOMString or PerformanceMeasureOptions), optional DOMString) on performance with too few arguments must throw TypeError
 36PASS Performance interface: performance must inherit property "clearMeasures(optional DOMString)" with the proper type
 37PASS Performance interface: calling clearMeasures(optional DOMString) on performance with too few arguments must throw TypeError
 38

LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.any.js

 1// META: global=window,worker
 2// META: script=/resources/WebIDLParser.js
 3// META: script=/resources/idlharness.js
 4// META: timeout=long
 5
 6// https://w3c.github.io/user-timing/
 7
 8'use strict';
 9
 10idl_test(
 11 ['user-timing'],
 12 ['hr-time', 'performance-timeline', 'dom'],
 13 idl_array => {
 14 try {
 15 performance.mark('test');
 16 performance.measure('test');
 17 for (const m of performance.getEntriesByType('mark')) {
 18 self.mark = m;
 19 }
 20 for (const m of performance.getEntriesByType('measure')) {
 21 self.measure = m;
 22 }
 23 } catch (e) {
 24 // Will be surfaced when mark is undefined below.
 25 }
 26
 27 idl_array.add_objects({
 28 Performance: ['performance'],
 29 PerformanceMark: ['mark'],
 30 PerformanceMeasure: ['measure'],
 31 });
 32 }
 33);

LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.any.worker-expected.txt

 1
 2PASS idl_test setup
 3PASS idl_test validation
 4PASS Partial interface Performance: original interface defined
 5PASS Partial interface Performance: member names are unique
 6PASS PerformanceMark interface: existence and properties of interface object
 7FAIL PerformanceMark interface object length assert_equals: wrong value for PerformanceMark.length expected 1 but got 0
 8PASS PerformanceMark interface object name
 9PASS PerformanceMark interface: existence and properties of interface prototype object
 10PASS PerformanceMark interface: existence and properties of interface prototype object's "constructor" property
 11PASS PerformanceMark interface: existence and properties of interface prototype object's @@unscopables property
 12FAIL PerformanceMark interface: attribute detail assert_true: The prototype object must have a property "detail" expected true got false
 13PASS PerformanceMark must be primary interface of mark
 14PASS Stringification of mark
 15FAIL PerformanceMark interface: mark must inherit property "detail" with the proper type assert_inherits: property "detail" not found in prototype chain
 16PASS PerformanceMeasure interface: existence and properties of interface object
 17PASS PerformanceMeasure interface object length
 18PASS PerformanceMeasure interface object name
 19PASS PerformanceMeasure interface: existence and properties of interface prototype object
 20PASS PerformanceMeasure interface: existence and properties of interface prototype object's "constructor" property
 21PASS PerformanceMeasure interface: existence and properties of interface prototype object's @@unscopables property
 22FAIL PerformanceMeasure interface: attribute detail assert_true: The prototype object must have a property "detail" expected true got false
 23PASS PerformanceMeasure must be primary interface of measure
 24PASS Stringification of measure
 25FAIL PerformanceMeasure interface: measure must inherit property "detail" with the proper type assert_inherits: property "detail" not found in prototype chain
 26PASS Performance interface: operation mark(DOMString, optional PerformanceMarkOptions)
 27PASS Performance interface: operation clearMarks(optional DOMString)
 28PASS Performance interface: operation measure(DOMString, optional (DOMString or PerformanceMeasureOptions), optional DOMString)
 29PASS Performance interface: operation clearMeasures(optional DOMString)
 30PASS Performance interface: performance must inherit property "mark(DOMString, optional PerformanceMarkOptions)" with the proper type
 31PASS Performance interface: calling mark(DOMString, optional PerformanceMarkOptions) on performance with too few arguments must throw TypeError
 32PASS Performance interface: performance must inherit property "clearMarks(optional DOMString)" with the proper type
 33PASS Performance interface: calling clearMarks(optional DOMString) on performance with too few arguments must throw TypeError
 34PASS Performance interface: performance must inherit property "measure(DOMString, optional (DOMString or PerformanceMeasureOptions), optional DOMString)" with the proper type
 35PASS Performance interface: calling measure(DOMString, optional (DOMString or PerformanceMeasureOptions), optional DOMString) on performance with too few arguments must throw TypeError
 36PASS Performance interface: performance must inherit property "clearMeasures(optional DOMString)" with the proper type
 37PASS Performance interface: calling clearMeasures(optional DOMString) on performance with too few arguments must throw TypeError
 38

LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.html

1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>User Timing IDL tests</title>
6 <link rel="author" title="W3C" href="http://www.w3.org/" />
7 <link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
8 <link rel="help" href="http://www.w3.org/TR/user-timing/#performancemark"/>
9 <link rel="help" href="http://www.w3.org/TR/user-timing/#performancemeasure"/>
10 <script src="/resources/testharness.js"></script>
11 <script src="/resources/testharnessreport.js"></script>
12 <script src="/resources/WebIDLParser.js"></script>
13 <script src="/resources/idlharness.js"></script>
14 </head>
15 <body>
16 <h1>User Timing IDL tests</h1>
17 <div id="log"></div>
18 
19 <pre id='untested_idl' style='display:none'>
20 [Exposed=(Window,Worker)]
21 interface Performance {
22 };
23 
24 [Exposed=(Window,Worker)]
25 interface PerformanceEntry {
26 };
27 </pre>
28 
29 <pre id='idl'>
30 partial interface Performance {
31  void mark(DOMString markName);
32  void clearMarks(optional DOMString markName);
33 
34  void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
35  void clearMeasures(optional DOMString measureName);
36 };
37 
38 [Exposed=(Window,Worker)]
39 interface PerformanceMark : PerformanceEntry {
40 };
41 
42 [Exposed=(Window,Worker)]
43 interface PerformanceMeasure : PerformanceEntry {
44 };
45 
46 </pre>
47 
48 <script>
49 
50 (function() {
51  var idl_array = new IdlArray();
52 
53  idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
54  idl_array.add_idls(document.getElementById("idl").textContent);
55 
56  idl_array.add_objects({Performance: ["window.performance"]});
57 
58  idl_array.test();
59 })();
60 
61 </script>
62 </body>
63 </html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/invoke_with_timing_attributes.html

1515 <script>
1616function emit_test(attrName) {
1717 test(function() {
18  assert_throws("SyntaxError", function() { window.performance.mark(attrName); });
 18 assert_throws_dom("SyntaxError", function() { window.performance.mark(attrName); });
1919 }, "performance.mark should throw if used with timing attribute " + attrName);
2020}
2121for (var i in timingAttributes) {

LayoutTests/imported/w3c/web-platform-tests/user-timing/invoke_without_parameter.html

1515 <div id="log"></div>
1616 <script>
1717test(function () {
18  assert_throws(new TypeError(), function () { window.performance.mark() });
 18 assert_throws_js(TypeError, function () { window.performance.mark() });
1919}, "window.performance.mark() throws a TypeError exception when invoke without a parameter.");
2020
2121test(function () {
22  assert_throws(new TypeError(), function () { window.performance.measure(); });
 22 assert_throws_js(TypeError, function () { window.performance.measure(); });
2323}, "window.performance.measure() throws a TypeError exception when invoke without a parameter.");
2424 </script>
2525 </body>

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-entry-constructor.any-expected.txt

 1
 2FAIL Mark entry can be created by 'new PerformanceMark(string)'. function is not a constructor (evaluating 'new PerformanceMark("name")')
 3FAIL Mark entry can be created by 'new PerformanceMark(string, {})'. function is not a constructor (evaluating 'new PerformanceMark("name", {})')
 4FAIL Mark entry can be created by 'new PerformanceMark(string, {startTime})'. function is not a constructor (evaluating 'new PerformanceMark("name", {startTime: 1})')
 5FAIL Mark entry can be created by 'new PerformanceMark(string, {detail})'. function is not a constructor (evaluating 'new PerformanceMark("name", {detail: {info: "abc"}})')
 6FAIL Mark entry can be created by 'new PerformanceMark(string, {startTime, detail})'. function is not a constructor (evaluating 'new PerformanceMark("name", {startTime: 1, detail: {info: "abc"}})')
 7FAIL Using new PerformanceMark() shouldn't add the entry to performance timeline. function is not a constructor (evaluating 'new PerformanceMark("name")')
 8

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-entry-constructor.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-entry-constructor.any.js

 1// META: script=resources/user-timing-helper.js
 2
 3test(()=>{
 4 const entry = new PerformanceMark("name");
 5 assert_true(entry instanceof PerformanceMark);
 6 checkEntry(entry, {name: "name", entryType: "mark"});
 7}, "Mark entry can be created by 'new PerformanceMark(string)'.");
 8
 9test(()=>{
 10 const entry = new PerformanceMark("name", {});
 11 assert_true(entry instanceof PerformanceMark);
 12 checkEntry(entry, {name: "name", entryType: "mark"});
 13}, "Mark entry can be created by 'new PerformanceMark(string, {})'.");
 14
 15test(()=>{
 16 const entry = new PerformanceMark("name", {startTime: 1});
 17 assert_true(entry instanceof PerformanceMark);
 18 checkEntry(entry, {name: "name", entryType: "mark", startTime: 1});
 19}, "Mark entry can be created by 'new PerformanceMark(string, {startTime})'.");
 20
 21test(()=>{
 22 const entry = new PerformanceMark("name", {detail: {info: "abc"}});
 23 assert_true(entry instanceof PerformanceMark);
 24 checkEntry(entry, {name: "name", entryType: "mark", detail: {info: "abc"}});
 25}, "Mark entry can be created by 'new PerformanceMark(string, {detail})'.");
 26
 27test(()=>{
 28 const entry =
 29 new PerformanceMark("name", {startTime: 1, detail: {info: "abc"}});
 30 assert_true(entry instanceof PerformanceMark);
 31 checkEntry(entry, {name: "name", entryType: "mark", startTime: 1, detail: {info: "abc"}});
 32}, "Mark entry can be created by " +
 33 "'new PerformanceMark(string, {startTime, detail})'.");
 34
 35test(()=>{
 36 const entry = new PerformanceMark("name");
 37 assert_true(entry instanceof PerformanceMark);
 38 checkEntry(entry, {name: "name", entryType: "mark"});
 39 assert_equals(performance.getEntriesByName("name").length, 0);
 40}, "Using new PerformanceMark() shouldn't add the entry to performance timeline.");

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-entry-constructor.any.worker-expected.txt

 1
 2FAIL Mark entry can be created by 'new PerformanceMark(string)'. function is not a constructor (evaluating 'new PerformanceMark("name")')
 3FAIL Mark entry can be created by 'new PerformanceMark(string, {})'. function is not a constructor (evaluating 'new PerformanceMark("name", {})')
 4FAIL Mark entry can be created by 'new PerformanceMark(string, {startTime})'. function is not a constructor (evaluating 'new PerformanceMark("name", {startTime: 1})')
 5FAIL Mark entry can be created by 'new PerformanceMark(string, {detail})'. function is not a constructor (evaluating 'new PerformanceMark("name", {detail: {info: "abc"}})')
 6FAIL Mark entry can be created by 'new PerformanceMark(string, {startTime, detail})'. function is not a constructor (evaluating 'new PerformanceMark("name", {startTime: 1, detail: {info: "abc"}})')
 7FAIL Using new PerformanceMark() shouldn't add the entry to performance timeline. function is not a constructor (evaluating 'new PerformanceMark("name")')
 8

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-entry-constructor.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-errors.any-expected.txt

 1
 2FAIL Number should be rejected as the mark-options. assert_throws_js: Number passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", 123); }" did not throw
 3FAIL NaN should be rejected as the mark-options. assert_throws_js: NaN passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", NaN); }" did not throw
 4FAIL Infinity should be rejected as the mark-options. assert_throws_js: Infinity passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", Infinity); }" did not throw
 5FAIL String should be rejected as the mark-options. assert_throws_js: String passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", "string"); }" did not throw
 6

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-errors.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-errors.any.js

 1test(function() {
 2 assert_throws_js(TypeError, function() { self.performance.mark("mark1", 123); }, "Number passed as a dict argument should cause type-error.")
 3}, "Number should be rejected as the mark-options.")
 4
 5test(function() {
 6 assert_throws_js(TypeError, function() { self.performance.mark("mark1", NaN); }, "NaN passed as a dict argument should cause type-error.")
 7}, "NaN should be rejected as the mark-options.")
 8
 9test(function() {
 10 assert_throws_js(TypeError, function() { self.performance.mark("mark1", Infinity); }, "Infinity passed as a dict argument should cause type-error.")
 11}, "Infinity should be rejected as the mark-options.")
 12
 13test(function() {
 14 assert_throws_js(TypeError, function() { self.performance.mark("mark1", "string"); }, "String passed as a dict argument should cause type-error.")
 15}, "String should be rejected as the mark-options.")

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-errors.any.worker-expected.txt

 1
 2FAIL Number should be rejected as the mark-options. assert_throws_js: Number passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", 123); }" did not throw
 3FAIL NaN should be rejected as the mark-options. assert_throws_js: NaN passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", NaN); }" did not throw
 4FAIL Infinity should be rejected as the mark-options. assert_throws_js: Infinity passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", Infinity); }" did not throw
 5FAIL String should be rejected as the mark-options. assert_throws_js: String passed as a dict argument should cause type-error. function "function () { self.performance.mark("mark1", "string"); }" did not throw
 6

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-errors.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-expected.txt

 1Description
 2
 3This test validates functionality of the interface window.performance.mark.
 4
 5
 6PASS There should be 0 marks
 7PASS Checking all entries.There should be 3 entries.
 8PASS Checking all entries.Entries in entrylist should be in order.
 9PASS Checking all entries.Entry_list 0. Entry "1" should be one that we have set.
 10PASS Checking all entries.Entry_list 0. entryType should be "mark".
 11PASS Checking all entries.Entry_list 0. startTime should greater than 0.
 12PASS Checking all entries.Entry_list 0. duration of mark should be 0.
 13PASS Checking all entries.Entry_list 1. Entry "abc" should be one that we have set.
 14PASS Checking all entries.Entry_list 1. entryType should be "mark".
 15PASS Checking all entries.Entry_list 1. startTime should greater than 0.
 16PASS Checking all entries.Entry_list 1. duration of mark should be 0.
 17PASS Checking all entries.Entry_list 2. Entry "" should be one that we have set.
 18PASS Checking all entries.Entry_list 2. entryType should be "mark".
 19PASS Checking all entries.Entry_list 2. startTime should greater than 0.
 20PASS Checking all entries.Entry_list 2. duration of mark should be 0.
 21PASS First loop: checking entry of name "1".There should be 1 entries.
 22PASS First loop: checking entry of name "1".Entries in entrylist should be in order.
 23PASS First loop: checking entry of name "1".Entry_list 0. Entry "1" should be one that we have set.
 24PASS First loop: checking entry of name "1".Entry_list 0. entryType should be "mark".
 25PASS First loop: checking entry of name "1".Entry_list 0. startTime should greater than 0.
 26PASS First loop: checking entry of name "1".Entry_list 0. duration of mark should be 0.
 27PASS First loop: checking entry of name "abc".There should be 1 entries.
 28PASS First loop: checking entry of name "abc".Entries in entrylist should be in order.
 29PASS First loop: checking entry of name "abc".Entry_list 0. Entry "abc" should be one that we have set.
 30PASS First loop: checking entry of name "abc".Entry_list 0. entryType should be "mark".
 31PASS First loop: checking entry of name "abc".Entry_list 0. startTime should greater than 0.
 32PASS First loop: checking entry of name "abc".Entry_list 0. duration of mark should be 0.
 33PASS First loop: checking entry of name "".There should be 1 entries.
 34PASS First loop: checking entry of name "".Entries in entrylist should be in order.
 35PASS First loop: checking entry of name "".Entry_list 0. Entry "" should be one that we have set.
 36PASS First loop: checking entry of name "".Entry_list 0. entryType should be "mark".
 37PASS First loop: checking entry of name "".Entry_list 0. startTime should greater than 0.
 38PASS First loop: checking entry of name "".Entry_list 0. duration of mark should be 0.
 39PASS Checking all doubly marked entries.There should be 6 entries.
 40PASS Checking all doubly marked entries.Entries in entrylist should be in order.
 41PASS Checking all doubly marked entries.Entry_list 0. Entry "1" should be one that we have set.
 42PASS Checking all doubly marked entries.Entry_list 0. entryType should be "mark".
 43PASS Checking all doubly marked entries.Entry_list 0. startTime should greater than 0.
 44PASS Checking all doubly marked entries.Entry_list 0. duration of mark should be 0.
 45PASS Checking all doubly marked entries.Entry_list 1. Entry "abc" should be one that we have set.
 46PASS Checking all doubly marked entries.Entry_list 1. entryType should be "mark".
 47PASS Checking all doubly marked entries.Entry_list 1. startTime should greater than 0.
 48PASS Checking all doubly marked entries.Entry_list 1. duration of mark should be 0.
 49PASS Checking all doubly marked entries.Entry_list 2. Entry "" should be one that we have set.
 50PASS Checking all doubly marked entries.Entry_list 2. entryType should be "mark".
 51PASS Checking all doubly marked entries.Entry_list 2. startTime should greater than 0.
 52PASS Checking all doubly marked entries.Entry_list 2. duration of mark should be 0.
 53PASS Checking all doubly marked entries.Entry_list 3. Entry "1" should be one that we have set.
 54PASS Checking all doubly marked entries.Entry_list 3. entryType should be "mark".
 55PASS Checking all doubly marked entries.Entry_list 3. startTime should greater than 0.
 56PASS Checking all doubly marked entries.Entry_list 3. duration of mark should be 0.
 57PASS Checking all doubly marked entries.Entry_list 4. Entry "abc" should be one that we have set.
 58PASS Checking all doubly marked entries.Entry_list 4. entryType should be "mark".
 59PASS Checking all doubly marked entries.Entry_list 4. startTime should greater than 0.
 60PASS Checking all doubly marked entries.Entry_list 4. duration of mark should be 0.
 61PASS Checking all doubly marked entries.Entry_list 5. Entry "" should be one that we have set.
 62PASS Checking all doubly marked entries.Entry_list 5. entryType should be "mark".
 63PASS Checking all doubly marked entries.Entry_list 5. startTime should greater than 0.
 64PASS Checking all doubly marked entries.Entry_list 5. duration of mark should be 0.
 65PASS Second loop step 0: checking entries of name "1".There should be 2 entries.
 66PASS Second loop step 0: checking entries of name "1".Entries in entrylist should be in order.
 67PASS Second loop step 0: checking entries of name "1".Entry_list 0. Entry "1" should be one that we have set.
 68PASS Second loop step 0: checking entries of name "1".Entry_list 0. entryType should be "mark".
 69PASS Second loop step 0: checking entries of name "1".Entry_list 0. startTime should greater than 0.
 70PASS Second loop step 0: checking entries of name "1".Entry_list 0. duration of mark should be 0.
 71PASS Second loop step 0: checking entries of name "1".Entry_list 1. Entry "1" should be one that we have set.
 72PASS Second loop step 0: checking entries of name "1".Entry_list 1. entryType should be "mark".
 73PASS Second loop step 0: checking entries of name "1".Entry_list 1. startTime should greater than 0.
 74PASS Second loop step 0: checking entries of name "1".Entry_list 1. duration of mark should be 0.
 75PASS Second loop step 1: checking entries of name "abc".There should be 2 entries.
 76PASS Second loop step 1: checking entries of name "abc".Entries in entrylist should be in order.
 77PASS Second loop step 1: checking entries of name "abc".Entry_list 0. Entry "abc" should be one that we have set.
 78PASS Second loop step 1: checking entries of name "abc".Entry_list 0. entryType should be "mark".
 79PASS Second loop step 1: checking entries of name "abc".Entry_list 0. startTime should greater than 0.
 80PASS Second loop step 1: checking entries of name "abc".Entry_list 0. duration of mark should be 0.
 81PASS Second loop step 1: checking entries of name "abc".Entry_list 1. Entry "abc" should be one that we have set.
 82PASS Second loop step 1: checking entries of name "abc".Entry_list 1. entryType should be "mark".
 83PASS Second loop step 1: checking entries of name "abc".Entry_list 1. startTime should greater than 0.
 84PASS Second loop step 1: checking entries of name "abc".Entry_list 1. duration of mark should be 0.
 85PASS Second loop step 2: checking entries of name "".There should be 2 entries.
 86PASS Second loop step 2: checking entries of name "".Entries in entrylist should be in order.
 87PASS Second loop step 2: checking entries of name "".Entry_list 0. Entry "" should be one that we have set.
 88PASS Second loop step 2: checking entries of name "".Entry_list 0. entryType should be "mark".
 89PASS Second loop step 2: checking entries of name "".Entry_list 0. startTime should greater than 0.
 90PASS Second loop step 2: checking entries of name "".Entry_list 0. duration of mark should be 0.
 91PASS Second loop step 2: checking entries of name "".Entry_list 1. Entry "" should be one that we have set.
 92PASS Second loop step 2: checking entries of name "".Entry_list 1. entryType should be "mark".
 93PASS Second loop step 2: checking entries of name "".Entry_list 1. startTime should greater than 0.
 94PASS Second loop step 2: checking entries of name "".Entry_list 1. duration of mark should be 0.
 95PASS Second loop step 3: checking entries of name "1".There should be 2 entries.
 96PASS Second loop step 3: checking entries of name "1".Entries in entrylist should be in order.
 97PASS Second loop step 3: checking entries of name "1".Entry_list 0. Entry "1" should be one that we have set.
 98PASS Second loop step 3: checking entries of name "1".Entry_list 0. entryType should be "mark".
 99PASS Second loop step 3: checking entries of name "1".Entry_list 0. startTime should greater than 0.
 100PASS Second loop step 3: checking entries of name "1".Entry_list 0. duration of mark should be 0.
 101PASS Second loop step 3: checking entries of name "1".Entry_list 1. Entry "1" should be one that we have set.
 102PASS Second loop step 3: checking entries of name "1".Entry_list 1. entryType should be "mark".
 103PASS Second loop step 3: checking entries of name "1".Entry_list 1. startTime should greater than 0.
 104PASS Second loop step 3: checking entries of name "1".Entry_list 1. duration of mark should be 0.
 105PASS Second loop step 4: checking entries of name "abc".There should be 2 entries.
 106PASS Second loop step 4: checking entries of name "abc".Entries in entrylist should be in order.
 107PASS Second loop step 4: checking entries of name "abc".Entry_list 0. Entry "abc" should be one that we have set.
 108PASS Second loop step 4: checking entries of name "abc".Entry_list 0. entryType should be "mark".
 109PASS Second loop step 4: checking entries of name "abc".Entry_list 0. startTime should greater than 0.
 110PASS Second loop step 4: checking entries of name "abc".Entry_list 0. duration of mark should be 0.
 111PASS Second loop step 4: checking entries of name "abc".Entry_list 1. Entry "abc" should be one that we have set.
 112PASS Second loop step 4: checking entries of name "abc".Entry_list 1. entryType should be "mark".
 113PASS Second loop step 4: checking entries of name "abc".Entry_list 1. startTime should greater than 0.
 114PASS Second loop step 4: checking entries of name "abc".Entry_list 1. duration of mark should be 0.
 115PASS Second loop step 5: checking entries of name "".There should be 2 entries.
 116PASS Second loop step 5: checking entries of name "".Entries in entrylist should be in order.
 117PASS Second loop step 5: checking entries of name "".Entry_list 0. Entry "" should be one that we have set.
 118PASS Second loop step 5: checking entries of name "".Entry_list 0. entryType should be "mark".
 119PASS Second loop step 5: checking entries of name "".Entry_list 0. startTime should greater than 0.
 120PASS Second loop step 5: checking entries of name "".Entry_list 0. duration of mark should be 0.
 121PASS Second loop step 5: checking entries of name "".Entry_list 1. Entry "" should be one that we have set.
 122PASS Second loop step 5: checking entries of name "".Entry_list 1. entryType should be "mark".
 123PASS Second loop step 5: checking entries of name "".Entry_list 1. startTime should greater than 0.
 124PASS Second loop step 5: checking entries of name "".Entry_list 1. duration of mark should be 0.
 125

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-l3.any-expected.txt

 1
 2FAIL mark entries' detail and startTime are customizable. undefined is not an object (evaluating 'ae.name')
 3

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-l3.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-l3.any.js

 1// META: script=resources/user-timing-helper.js
 2
 3async_test(function (t) {
 4 let mark_entries = [];
 5 const expected_entries =
 6 [{ entryType: "mark", name: "mark1", detail: null},
 7 { entryType: "mark", name: "mark2", detail: null},
 8 { entryType: "mark", name: "mark3", detail: null},
 9 { entryType: "mark", name: "mark4", detail: null},
 10 { entryType: "mark", name: "mark5", detail: null},
 11 { entryType: "mark", name: "mark6", detail: {}},
 12 { entryType: "mark", name: "mark7", detail: {info: 'abc'}},
 13 { entryType: "mark", name: "mark8", detail: null, startTime: 234.56},
 14 { entryType: "mark", name: "mark9", detail: {count: 3}, startTime: 345.67}];
 15 const observer = new PerformanceObserver(
 16 t.step_func(function (entryList, obs) {
 17 mark_entries =
 18 mark_entries.concat(entryList.getEntries());
 19 if (mark_entries.length >= expected_entries.length) {
 20 checkEntries(mark_entries, expected_entries);
 21 observer.disconnect();
 22 t.done();
 23 }
 24 })
 25 );
 26 self.performance.clearMarks();
 27 observer.observe({entryTypes: ["mark"]});
 28 const returned_entries = [];
 29 returned_entries.push(self.performance.mark("mark1"));
 30 returned_entries.push(self.performance.mark("mark2", undefined));
 31 returned_entries.push(self.performance.mark("mark3", null));
 32 returned_entries.push(self.performance.mark("mark4", {}));
 33 returned_entries.push(self.performance.mark("mark5", {detail: null}));
 34 returned_entries.push(self.performance.mark("mark6", {detail: {}}));
 35 returned_entries.push(self.performance.mark("mark7", {detail: {info: 'abc'}}));
 36 returned_entries.push(self.performance.mark("mark8", {startTime: 234.56}));
 37 returned_entries.push(self.performance.mark("mark9", {detail: {count: 3}, startTime: 345.67}));
 38 checkEntries(returned_entries, expected_entries);
 39}, "mark entries' detail and startTime are customizable.");

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-l3.any.worker-expected.txt

 1
 2FAIL mark entries' detail and startTime are customizable. undefined is not an object (evaluating 'ae.name')
 3

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-l3.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-feature-detection-expected.txt

 1
 2PASS Test PerformanceMark existence and feature detection
 3PASS Test PerformanceMeasure existence and feature detection
 4

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-feature-detection.html

 1<!DOCTYPE HTML>
 2<meta charset=utf-8>
 3<title>User Timing: L2 vs L3 feature detection</title>
 4<script src="/resources/testharness.js"></script>
 5<script src="/resources/testharnessreport.js"></script>
 6<script>
 7 test(() => {
 8 // Feature detection for PerformanceMark.
 9 assert_equals(typeof(PerformanceMark.prototype), "object");
 10 // Test for UserTiming L3.
 11 if (PerformanceMark.prototype.hasOwnProperty('detail')) {
 12 assert_equals(typeof(performance.mark("mark")), "object",
 13 "performance.mark should return an object in UserTiming L3.");
 14 }
 15 // Test for UserTiming L2.
 16 else {
 17 assert_equals(typeof(performance.mark("mark")), "undefined",
 18 "performance.mark should be void in UserTiming L2.");
 19 }
 20 }, "Test PerformanceMark existence and feature detection");
 21
 22 test(() => {
 23 // Feature detection for PerformanceMeasure.
 24 assert_equals(typeof(PerformanceMeasure.prototype), "object");
 25 // Test for UserTiming L3.
 26 if (PerformanceMeasure.prototype.hasOwnProperty('detail')) {
 27 assert_equals(typeof(performance.measure("measure")), "object",
 28 "performance.measure should return an object in UserTiming L3.");
 29 }
 30 // Test for UserTiming L2.
 31 else {
 32 assert_equals(typeof(performance.measure("measure")), "undefined",
 33 "performance.measure should be void in UserTiming L2.");
 34 }
 35 }, "Test PerformanceMeasure existence and feature detection");
 36</script>

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-return-objects.any-expected.txt

 1
 2FAIL L3: performance.measure(name) should return an entry. assert_true: expected true got false
 3FAIL L3: performance.measure(name, param1) should return an entry. The string did not match the expected pattern.
 4FAIL L3: performance.measure(name, param1, param2) should return an entry. assert_true: expected true got false
 5FAIL L3: performance.mark(name) should return an entry. assert_true: expected true got false
 6FAIL L3: performance.mark(name, param) should return an entry. assert_true: expected true got false
 7

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-return-objects.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-return-objects.any.js

 1async_test(function (t) {
 2 self.performance.clearMeasures();
 3 const measure = self.performance.measure("measure1");
 4 assert_true(measure instanceof PerformanceMeasure);
 5 t.done();
 6}, "L3: performance.measure(name) should return an entry.");
 7
 8async_test(function (t) {
 9 self.performance.clearMeasures();
 10 const measure = self.performance.measure("measure2",
 11 { start: 12, end: 23 });
 12 assert_true(measure instanceof PerformanceMeasure);
 13 t.done();
 14}, "L3: performance.measure(name, param1) should return an entry.");
 15
 16async_test(function (t) {
 17 self.performance.clearMeasures();
 18 self.performance.mark("1");
 19 self.performance.mark("2");
 20 const measure = self.performance.measure("measure3", "1", "2");
 21 assert_true(measure instanceof PerformanceMeasure);
 22 t.done();
 23}, "L3: performance.measure(name, param1, param2) should return an entry.");
 24
 25async_test(function (t) {
 26 self.performance.clearMarks();
 27 const mark = self.performance.mark("mark1");
 28 assert_true(mark instanceof PerformanceMark);
 29 t.done();
 30}, "L3: performance.mark(name) should return an entry.");
 31
 32async_test(function (t) {
 33 self.performance.clearMarks();
 34 const mark = self.performance.mark("mark2", { startTime: 34 });
 35 assert_true(mark instanceof PerformanceMark);
 36 t.done();
 37}, "L3: performance.mark(name, param) should return an entry.");

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-return-objects.any.worker-expected.txt

 1
 2FAIL L3: performance.measure(name) should return an entry. assert_true: expected true got false
 3FAIL L3: performance.measure(name, param1) should return an entry. No mark named '[object Object]' exists
 4FAIL L3: performance.measure(name, param1, param2) should return an entry. assert_true: expected true got false
 5FAIL L3: performance.mark(name) should return an entry. assert_true: expected true got false
 6FAIL L3: performance.mark(name, param) should return an entry. assert_true: expected true got false
 7

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-return-objects.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta charset="utf-8" />
 5<title>functionality test of window.performance.mark</title>
 6<link rel="author" title="Intel" href="http://www.intel.com/" />
 7<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
 8<script src="/resources/testharness.js"></script>
 9<script src="/resources/testharnessreport.js"></script>
 10<script src="/common/performance-timeline-utils.js"></script>
 11<script src="resources/webperftestharness.js"></script>
 12<script src="resources/webperftestharnessextension.js"></script>
 13<script>
 14setup({ explicit_done: true });
 15
 16function onload_test()
 17{
 18 const entrylist_checker = new performance_entrylist_checker('mark');
 19 const string_mark_names = mark_names.map(function (x) { return String(x)});
 20
 21 test_equals(performance.getEntriesByType("mark").length, 0, 'There should be ' + 0 + ' marks');
 22 mark_names.forEach(function(name) {
 23 performance.mark(name);
 24 });
 25 let mark_entrylist = performance.getEntriesByType('mark');
 26
 27 entrylist_checker.entrylist_check(mark_entrylist, mark_names.length, string_mark_names, 'Checking all entries.');
 28
 29 for (let i = 0; i < mark_entrylist.length; ++i)
 30 {
 31 const mark_entrylist_by_name = performance.getEntriesByName(mark_entrylist[i].name, 'mark');
 32 entrylist_checker.entrylist_check(mark_entrylist_by_name, 1, string_mark_names,
 33 'First loop: checking entry of name "' + mark_entrylist[i].name + '".');
 34 }
 35
 36 mark_names.forEach(function(name) {
 37 performance.mark(name);
 38 });
 39 mark_entrylist = performance.getEntriesByType('mark');
 40 entrylist_checker.entrylist_check(mark_entrylist, mark_names.length * 2, string_mark_names, 'Checking all doubly marked entries.');
 41
 42 for (let i = 0; i < mark_entrylist.length; ++i)
 43 {
 44 const mark_entrylist_by_name = performance.getEntriesByName(mark_entrylist[i].name, 'mark');
 45 entrylist_checker.entrylist_check(mark_entrylist_by_name, 2, string_mark_names,
 46 'Second loop step ' + i + ': checking entries of name "' + mark_entrylist[i].name + '".');
 47 }
 48
 49 done();
 50}
 51</script>
 52</head>
 53<body onload=onload_test()>
 54 <h1>Description</h1>
 55 <p>This test validates functionality of the interface window.performance.mark.</p>
 56 <div id="log"></div>
 57</body>
 58</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark_exceptions-expected.txt

@@Description
33This test validates that the performance.mark() method throws a SYNTAX_ERR exception whenever a navigation timing attribute is provided for the name parameter.
44
55
 6PASS window.performance.mark() throws a TypeError exception.
67PASS window.performance.mark("navigationStart") throws a SyntaxError exception.
78PASS window.performance.mark("unloadEventStart") throws a SyntaxError exception.
89PASS window.performance.mark("unloadEventEnd") throws a SyntaxError exception.

LayoutTests/imported/w3c/web-platform-tests/user-timing/mark_exceptions.html

1212 <script>
1313function test_exception(attrName) {
1414 test(function () {
15  assert_throws(new SyntaxError(), function () {
 15 assert_throws_dom("SyntaxError", function () {
1616 window.performance.mark(attrName);
1717 })
1818 }, "window.performance.mark(\"" + attrName + "\") throws a SyntaxError exception.");
1919}
2020
 21test(() => {
 22 assert_throws_js(TypeError, function() {
 23 window.performance.mark();
 24 });
 25}, 'window.performance.mark() throws a TypeError exception.')
 26
2127// loop through mark scenarios
2228for (var i in timingAttributes) {
2329 test_exception(timingAttributes[i]);

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-exceptions-expected.txt

 1This tests that 'performance.measure' throws exceptions with reasonable messages.
 2
 3PASS Passing 'unloadEventStart' as a mark to measure API should cause error when the mark is empty.
 4PASS Passing 'unloadEventEnd' as a mark to measure API should cause error when the mark is empty.
 5PASS Passing 'redirectStart' as a mark to measure API should cause error when the mark is empty.
 6PASS Passing 'redirectEnd' as a mark to measure API should cause error when the mark is empty.
 7PASS Passing 'secureConnectionStart' as a mark to measure API should cause error when the mark is empty.
 8PASS Passing 'domInteractive' as a mark to measure API should cause error when the mark is empty.
 9PASS Passing 'domContentLoadedEventStart' as a mark to measure API should cause error when the mark is empty.
 10PASS Passing 'domContentLoadedEventEnd' as a mark to measure API should cause error when the mark is empty.
 11PASS Passing 'domComplete' as a mark to measure API should cause error when the mark is empty.
 12PASS Passing 'loadEventStart' as a mark to measure API should cause error when the mark is empty.
 13PASS Passing 'loadEventEnd' as a mark to measure API should cause error when the mark is empty.
 14PASS Passing 51.15 as a mark to measure API should cause error.
 15PASS Passing DoesNotExist as a mark to measure API should cause error.
 16

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-exceptions.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4 This tests that 'performance.measure' throws exceptions with reasonable messages.
 5</head>
 6<body>
 7<script src="/resources/testharness.js"></script>
 8<script src="/resources/testharnessreport.js"></script>
 9<script>
 10 window.performance.clearMarks();
 11 window.performance.clearMeasures();
 12
 13 window.performance.mark('mark');
 14
 15 const eventMarks = [
 16 'unloadEventStart',
 17 'unloadEventEnd',
 18 'redirectStart',
 19 'redirectEnd',
 20 'secureConnectionStart',
 21 'domInteractive',
 22 'domContentLoadedEventStart',
 23 'domContentLoadedEventEnd',
 24 'domComplete',
 25 'loadEventStart',
 26 'loadEventEnd',
 27 ];
 28 eventMarks.forEach(function(name) {
 29 test(()=>{
 30 assert_throws_dom("InvalidAccessError", ()=>{
 31 window.performance.measure("measuring", name, "mark");
 32 }, "Should throw");
 33 }, `Passing '${name}' as a mark to measure API should cause error when the mark is empty.`);
 34 });
 35
 36 const args = [
 37 51.15, // Verify that number is parsed as string, not number.
 38 "DoesNotExist", // Non-existant mark name should cause error.
 39 ];
 40 args.forEach(each => {
 41 test(()=>{
 42 assert_throws_dom("SyntaxError", ()=>{
 43 window.performance.measure("measuring", each, "mark");
 44 }, "Should throw");
 45 }, `Passing ${each} as a mark to measure API should cause error.`);
 46 });
 47</script>
 48</body>
 49</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-expected.txt

@@This test validates that the performance.measure() method is working properly. T
55"measure_no_start_no_end": created using a measure() call without a startMark or endMark provided
66"measure_start_no_end": created using a measure() call with only the startMark provided
77"measure_start_end": created using a measure() call with both a startMark or endMark provided
 8"measure_no_start_end": created using a measure() call with only the endMark provided
89"measure_no_start_no_end": duplicate of the first measure, used to confirm names can be re-used
910After creating each measure, the existence of these measures is validated by calling performance.getEntriesByName() (both with and without the entryType parameter provided), performance.getEntriesByType(), and performance.getEntries()
1011

@@PASS window.performance.getEntriesByName("measure_start_end")[0].name == "measur
2122PASS window.performance.getEntriesByName("measure_start_end")[0].startTime is correct
2223PASS window.performance.getEntriesByName("measure_start_end")[0].entryType == "measure"
2324PASS window.performance.getEntriesByName("measure_start_end")[0].duration is approximately correct (up to 20ms difference allowed)
 25PASS window.performance.getEntriesByName("measure_no_start_end")[0].name == "measure_no_start_end"
 26PASS window.performance.getEntriesByName("measure_no_start_end")[0].startTime is correct
 27PASS window.performance.getEntriesByName("measure_no_start_end")[0].entryType == "measure"
 28PASS window.performance.getEntriesByName("measure_no_start_end")[0].duration is approximately correct (up to 20ms difference allowed)
2429PASS window.performance.getEntriesByName("measure_no_start_no_end")[1].name == "measure_no_start_no_end"
2530PASS window.performance.getEntriesByName("measure_no_start_no_end")[1].startTime is correct
2631PASS window.performance.getEntriesByName("measure_no_start_no_end")[1].entryType == "measure"

@@PASS window.performance.getEntriesByName("measure_no_start_no_end")[1].duration
2833PASS window.performance.getEntriesByName("measure_no_start_no_end", "measure")[0] returns an object containing the "measure_no_start_no_end" measure in the correct order, and its value matches the "measure_no_start_no_end" measure returned by window.performance.getEntriesByName("measure_no_start_no_end")
2934PASS window.performance.getEntriesByName("measure_start_no_end", "measure")[0] returns an object containing the "measure_start_no_end" measure in the correct order, and its value matches the "measure_start_no_end" measure returned by window.performance.getEntriesByName("measure_start_no_end")
3035PASS window.performance.getEntriesByName("measure_start_end", "measure")[0] returns an object containing the "measure_start_end" measure in the correct order, and its value matches the "measure_start_end" measure returned by window.performance.getEntriesByName("measure_start_end")
 36PASS window.performance.getEntriesByName("measure_no_start_end", "measure")[0] returns an object containing the "measure_no_start_end" measure in the correct order, and its value matches the "measure_no_start_end" measure returned by window.performance.getEntriesByName("measure_no_start_end")
3137PASS window.performance.getEntriesByName("measure_no_start_no_end", "measure")[1] returns an object containing the "measure_no_start_no_end" measure in the correct order, and its value matches the "measure_no_start_no_end" measure returned by window.performance.getEntriesByName("measure_no_start_no_end")
3238PASS window.performance.getEntries() returns an object containing the "measure_no_start_no_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_no_start_no_end")[0].
3339PASS window.performance.getEntries() returns an object containing the "measure_start_no_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_start_no_end")[0].
3440PASS window.performance.getEntries() returns an object containing the "measure_start_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_start_end")[0].
 41PASS window.performance.getEntries() returns an object containing the "measure_no_start_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_no_start_end")[0].
3542PASS window.performance.getEntries() returns an object containing the "measure_no_start_no_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_no_start_no_end")[1].
3643PASS window.performance.getEntries() returns an object containing all test measures in order.
3744PASS window.performance.getEntriesByType("measure") returns an object containing the "measure_no_start_no_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_no_start_no_end")[0].
3845PASS window.performance.getEntriesByType("measure") returns an object containing the "measure_start_no_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_start_no_end")[0].
3946PASS window.performance.getEntriesByType("measure") returns an object containing the "measure_start_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_start_end")[0].
 47PASS window.performance.getEntriesByType("measure") returns an object containing the "measure_no_start_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_no_start_end")[0].
4048PASS window.performance.getEntriesByType("measure") returns an object containing the "measure_no_start_no_end" measure, and it's value matches the measure returned by window.performance.getEntriesByName("measure_no_start_no_end")[1].
4149PASS window.performance.getEntriesByType("measure") returns an object containing all test measures in order.
4250

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-l3.any-expected.txt

 1
 2FAIL When the end mark is given and the start is unprovided, the end time of the measure entry should be the end mark's time, the start time should be 0. undefined is not an object (evaluating 'measureEntry.startTime')
 3FAIL When the start mark is given and the end is unprovided, the start time of the measure entry should be the start mark's time, the end should be now. undefined is not an object (evaluating 'measureEntry.startTime')
 4FAIL When start and end mark are both given, the start time and end time of the measure entry should be the the marks' time, repectively undefined is not an object (evaluating 'entry.startTime')
 5

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-l3.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-l3.any.js

 1// META: script=resources/user-timing-helper.js
 2
 3function endTime(entry) {
 4 return entry.startTime + entry.duration;
 5}
 6
 7test(function() {
 8 performance.clearMarks();
 9 performance.clearMeasures();
 10 const markEntry = performance.mark("mark", {startTime: 123});
 11 const measureEntry = performance.measure("A", undefined, "mark");
 12 assert_equals(measureEntry.startTime, 0);
 13 assert_equals(endTime(measureEntry), markEntry.startTime);
 14}, "When the end mark is given and the start is unprovided, the end time of the measure entry should be the end mark's time, the start time should be 0.");
 15
 16test(function() {
 17 performance.clearMarks();
 18 performance.clearMeasures();
 19 const markEntry = performance.mark("mark", {startTime: 123});
 20 const endMin = performance.now();
 21 const measureEntry = performance.measure("A", "mark", undefined);
 22 const endMax = performance.now();
 23 assert_equals(measureEntry.startTime, markEntry.startTime);
 24 assert_greater_than_equal(endTime(measureEntry), endMin);
 25 assert_greater_than_equal(endMax, endTime(measureEntry));
 26}, "When the start mark is given and the end is unprovided, the start time of the measure entry should be the start mark's time, the end should be now.");
 27
 28test(function() {
 29 performance.clearMarks();
 30 performance.clearMeasures();
 31 const markEntry = performance.mark("mark", {startTime: 123});
 32 const measureEntry = performance.measure("A", "mark", "mark");
 33 assert_equals(endTime(measureEntry), markEntry.startTime);
 34 assert_equals(measureEntry.startTime, markEntry.startTime);
 35}, "When start and end mark are both given, the start time and end time of the measure entry should be the the marks' time, repectively");

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-l3.any.worker-expected.txt

 1
 2FAIL When the end mark is given and the start is unprovided, the end time of the measure entry should be the end mark's time, the start time should be 0. undefined is not an object (evaluating 'measureEntry.startTime')
 3FAIL When the start mark is given and the end is unprovided, the start time of the measure entry should be the start mark's time, the end should be now. undefined is not an object (evaluating 'measureEntry.startTime')
 4FAIL When start and end mark are both given, the start time and end time of the measure entry should be the the marks' time, repectively undefined is not an object (evaluating 'entry.startTime')
 5

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-l3.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-with-dict.any-expected.txt

 1
 2FAIL measure entries' detail and start/end are customizable The string did not match the expected pattern.
 3FAIL measure should throw a TypeError when passed an invalid argument combination assert_throws_js: measure should throw a TypeError when passed an options object and an end time function "function () {
 4 self.performance.measure("optionsAndNumberEnd", {'start': 2}, 12);
 5 }" threw object "SyntaxError: The string did not match the expected pattern." ("SyntaxError") expected instance of function "function TypeError() {
 6 [native code]
 7}" ("TypeError")
 8

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-with-dict.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-with-dict.any.js

 1// META: script=resources/user-timing-helper.js
 2
 3function cleanupPerformanceTimeline() {
 4 performance.clearMarks();
 5 performance.clearMeasures();
 6}
 7
 8async_test(function (t) {
 9 this.add_cleanup(cleanupPerformanceTimeline);
 10 let measureEntries = [];
 11 const timeStamp1 = 784.4;
 12 const timeStamp2 = 1234.5;
 13 const timeStamp3 = 66.6;
 14 const timeStamp4 = 5566;
 15 const expectedEntries =
 16 [{ entryType: "measure", name: "measure1", detail: null, startTime: 0 },
 17 { entryType: "measure", name: "measure2", detail: null, startTime: 0 },
 18 { entryType: "measure", name: "measure3", detail: null, startTime: 0 },
 19 { entryType: "measure", name: "measure4", detail: null },
 20 { entryType: "measure", name: "measure5", detail: null, startTime: 0 },
 21 { entryType: "measure", name: "measure6", detail: null, startTime: timeStamp1 },
 22 { entryType: "measure", name: "measure7", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 },
 23 { entryType: "measure", name: "measure8", detail: null, startTime: 0 },
 24 { entryType: "measure", name: "measure9", detail: null, startTime: 0 },
 25 { entryType: "measure", name: "measure10", detail: null, startTime: timeStamp1 },
 26 { entryType: "measure", name: "measure11", detail: null, startTime: timeStamp3 },
 27 { entryType: "measure", name: "measure12", detail: null, startTime: 0 },
 28 { entryType: "measure", name: "measure13", detail: null, startTime: 0 },
 29 { entryType: "measure", name: "measure14", detail: null, startTime: timeStamp3, duration: timeStamp1 - timeStamp3 },
 30 { entryType: "measure", name: "measure15", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 },
 31 { entryType: "measure", name: "measure16", detail: null, startTime: timeStamp1 },
 32 { entryType: "measure", name: "measure17", detail: { customInfo: 159 }, startTime: timeStamp3, duration: timeStamp2 - timeStamp3 },
 33 { entryType: "measure", name: "measure18", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 },
 34 { entryType: "measure", name: "measure19", detail: null, startTime: timeStamp1, duration: timeStamp2 - timeStamp1 },
 35 { entryType: "measure", name: "measure20", detail: null, startTime: 0 },
 36 { entryType: "measure", name: "measure21", detail: null, startTime: 0 },
 37 { entryType: "measure", name: "measure22", detail: null, startTime: 0 },
 38 { entryType: "measure", name: "measure23", detail: null, startTime: 0 }];
 39 const observer = new PerformanceObserver(
 40 t.step_func(function (entryList, obs) {
 41 measureEntries =
 42 measureEntries.concat(entryList.getEntries());
 43 if (measureEntries.length >= expectedEntries.length) {
 44 checkEntries(measureEntries, expectedEntries);
 45 observer.disconnect();
 46 t.done();
 47 }
 48 })
 49 );
 50 observer.observe({ entryTypes: ["measure"] });
 51 self.performance.mark("mark1", { detail: { randomInfo: 3 }, startTime: timeStamp1 });
 52 self.performance.mark("mark2", { startTime: timeStamp2 });
 53
 54 const returnedEntries = [];
 55 returnedEntries.push(self.performance.measure("measure1"));
 56 returnedEntries.push(self.performance.measure("measure2", undefined));
 57 returnedEntries.push(self.performance.measure("measure3", null));
 58 returnedEntries.push(self.performance.measure("measure4", 'mark1'));
 59 returnedEntries.push(
 60 self.performance.measure("measure5", null, 'mark1'));
 61 returnedEntries.push(
 62 self.performance.measure("measure6", 'mark1', undefined));
 63 returnedEntries.push(
 64 self.performance.measure("measure7", 'mark1', 'mark2'));
 65 returnedEntries.push(
 66 self.performance.measure("measure8", {}));
 67 returnedEntries.push(
 68 self.performance.measure("measure9", { start: undefined }));
 69 returnedEntries.push(
 70 self.performance.measure("measure10", { start: 'mark1' }));
 71 returnedEntries.push(
 72 self.performance.measure("measure11", { start: timeStamp3 }));
 73 returnedEntries.push(
 74 self.performance.measure("measure12", { end: undefined }));
 75 returnedEntries.push(
 76 self.performance.measure("measure13", { end: 'mark1' }));
 77 returnedEntries.push(
 78 self.performance.measure("measure14", { start: timeStamp3, end: 'mark1' }));
 79 returnedEntries.push(
 80 self.performance.measure("measure15", { start: timeStamp1, end: timeStamp2, detail: undefined }));
 81 returnedEntries.push(
 82 self.performance.measure("measure16", { start: 'mark1', end: undefined, detail: null }));
 83 returnedEntries.push(
 84 self.performance.measure("measure17", { start: timeStamp3, end: 'mark2', detail: { customInfo: 159 }}));
 85 returnedEntries.push(
 86 self.performance.measure("measure18", { start: timeStamp1, duration: timeStamp2 - timeStamp1 }));
 87 returnedEntries.push(
 88 self.performance.measure("measure19", { duration: timeStamp2 - timeStamp1, end: timeStamp2 }));
 89 // {}, null, undefined, invalid-dict passed to startOrOptions are interpreted as start time being 0.
 90 returnedEntries.push(self.performance.measure("measure20", {}, 'mark1'));
 91 returnedEntries.push(self.performance.measure("measure21", null, 'mark1'));
 92 returnedEntries.push(self.performance.measure("measure22", undefined, 'mark1'));
 93 returnedEntries.push(self.performance.measure("measure23", { invalidDict:1 }, 'mark1'));
 94 checkEntries(returnedEntries, expectedEntries);
 95}, "measure entries' detail and start/end are customizable");
 96
 97test(function() {
 98 this.add_cleanup(cleanupPerformanceTimeline);
 99 assert_throws_js(TypeError, function() {
 100 self.performance.measure("optionsAndNumberEnd", {'start': 2}, 12);
 101 }, "measure should throw a TypeError when passed an options object and an end time");
 102 assert_throws_js(TypeError, function() {
 103 self.performance.measure("optionsAndMarkEnd", {'start': 2}, 'mark1');
 104 }, "measure should throw a TypeError when passed an options object and an end mark");
 105 assert_throws_js(TypeError, function() {
 106 self.performance.measure("negativeStartInOptions", {'start': -1});
 107 }, "measure cannot have a negative time stamp.");
 108 assert_throws_js(TypeError, function() {
 109 self.performance.measure("negativeEndInOptions", {'end': -1});
 110 }, "measure cannot have a negative time stamp for end.");
 111}, "measure should throw a TypeError when passed an invalid argument combination");
 112

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-with-dict.any.worker-expected.txt

 1
 2FAIL measure entries' detail and start/end are customizable No mark named 'null' exists
 3FAIL measure should throw a TypeError when passed an invalid argument combination assert_throws_js: measure should throw a TypeError when passed an options object and an end time function "function () {
 4 self.performance.measure("optionsAndNumberEnd", {'start': 2}, 12);
 5 }" threw object "SyntaxError: No mark named '12' exists" ("SyntaxError") expected instance of function "function TypeError() {
 6 [native code]
 7}" ("TypeError")
 8

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-with-dict.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure.html

5757 order: undefined,
5858 found: false
5959 },
 60 {
 61 name: "measure_no_start_end",
 62 startMark: undefined,
 63 endMark: "mark_end",
 64 startTime: undefined,
 65 duration: undefined,
 66 entryType: "measure",
 67 entryMatch: undefined,
 68 order: undefined,
 69 found: false
 70 },
 71 // intentional duplicate of the first measure, used to confirm names can be re-used
6072 {
6173 name: "measure_no_start_no_end",
6274 startMark: undefined,

6981 found: false
7082 }
7183 ];
 84 // the index of the duplicate "measure_no_start_no_end"
 85 const duplicate_index = TEST_MEASURES.map(m=>m.name).lastIndexOf('measure_no_start_no_end');
7286
7387 setup({explicit_done: true});
7488

7690
7791 function onload_test()
7892 {
79  // test for existance of User Timing and Performance Timeline interface
 93 // test for existence of User Timing and Performance Timeline interface
8094 if (!has_required_interfaces())
8195 {
8296 test_true(false,

150164 scenario.startTime = startMarkValue;
151165
152166 // when endMark is provided to the measure() call, the value of the mark whose name is
153  // provided is used for the startMark
 167 // provided is used for the endMark
154168 scenario.duration = endMarkValue - startMarkValue;
155169 }
 170 else if (scenario.startMark == undefined && scenario.endMark != undefined)
 171 {
 172 // endMark is defined but startMark is undefined, provide both parameters
 173 window.performance.measure(scenario.name, scenario.startMark, scenario.endMark);
 174
 175 // when startMark isn't provided to the measure() call, a DOMHighResTimeStamp corresponding
 176 // to the navigationStart attribute with a timebase of the same attribute is used; this is
 177 // equivalent to 0
 178 scenario.startTime = 0;
 179
 180 // when endMark is provided to the measure() call, the value of the mark whose name is
 181 // provided is used for the endMark
 182 scenario.duration = endMarkValue;
 183 } else
 184 {
 185 test_true(false, 'Test measure scenario unhandled');
 186 }
156187 }
157188
158189 // test that expected measures are returned by getEntriesByName

162193 // for all test measures, the test will be validate the test measure against the first entry returned
163194 // by getEntriesByName(), except for the last measure, where since it is a duplicate measure, the test
164195 // will validate it against the second entry returned by getEntriesByName()
165  test_measure(entries[(i == 3 ? 1 : 0)],
 196 test_measure(entries[(i == duplicate_index ? 1 : 0)],
166197 "window.performance.getEntriesByName(\"" + TEST_MEASURES[i].name + "\")[" +
167  (i == 3 ? 1 : 0) + "]",
 198 (i == duplicate_index ? 1 : 0) + "]",
168199 TEST_MEASURES[i].name,
169200 TEST_MEASURES[i].startTime,
170201 TEST_MEASURES[i].duration);
171  TEST_MEASURES[i].entryMatch = entries[(i == 3 ? 1 : 0)];
 202 TEST_MEASURES[i].entryMatch = entries[(i == duplicate_index ? 1 : 0)];
172203 }
173204
174205 // test that expected measures are returned by getEntriesByName with the entryType parameter provided

176207 {
177208 entries = window.performance.getEntriesByName(TEST_MEASURES[i].name, "measure");
178209
179  test_true(match_entries(entries[(i == 3 ? 1 : 0)], TEST_MEASURES[i].entryMatch),
 210 test_true(match_entries(entries[(i == duplicate_index ? 1 : 0)], TEST_MEASURES[i].entryMatch),
180211 "window.performance.getEntriesByName(\"" + TEST_MEASURES[i].name + "\", \"measure\")[" +
181  (i == 3 ? 1 : 0) + "] returns an object containing the \"" + TEST_MEASURES[i].name +
 212 (i == duplicate_index ? 1 : 0) + "] returns an object containing the \"" + TEST_MEASURES[i].name +
182213 "\" measure in the correct order, and its value matches the \"" + TEST_MEASURES[i].name +
183214 "\" measure returned by window.performance.getEntriesByName(\"" + TEST_MEASURES[i].name +
184215 "\")");

260291 measureEntryListCommand + " returns an object containing the \"" +
261292 measureScenarios[i].name + "\" measure, and it's value matches the measure " +
262293 "returned by window.performance.getEntriesByName(\"" + measureScenarios[i].name +
263  "\")[" + (i == 3 ? 1 : 0) + "].");
 294 "\")[" + (i == duplicate_index ? 1 : 0) + "].");
264295
265296 measureEntryList[j].found = true;
266297 measureScenarios[i].found = true;

318349 provided</li>
319350 <li>"measure_start_no_end": created using a measure() call with only the startMark provided</li>
320351 <li>"measure_start_end": created using a measure() call with both a startMark or endMark provided</li>
 352 <li>"measure_no_start_end": created using a measure() call with only the endMark provided</li>
321353 <li>"measure_no_start_no_end": duplicate of the first measure, used to confirm names can be re-used</li>
322354 </ul>
323355 After creating each measure, the existence of these measures is validated by calling

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_associated_with_navigation_timing-expected.txt

 1Description
 2
 3This test validates functionality of the interface window.performance.measure using keywords from the Navigation Timing spec.
 4
 5
 6PASS Measure of navigationStart to now should be positive value.
 7PASS Measure of navigationStart to loadEventEnd should be positive value.
 8PASS Measure of current mark to navigationStart should be negative value.
 9PASS loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".
 10PASS Second measure of current mark to navigationStart should be negative value.
 11PASS Measures of loadTime should have same duration.
 12PASS Measure from domComplete event to most recent mark "a" should have longer duration.
 13PASS Measure from most recent mark to navigationStart should have longer duration.
 14

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_associated_with_navigation_timing.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta charset="utf-8" />
 5<title>functionality test of window.performance.measure</title>
 6<link rel="author" title="Intel" href="http://www.intel.com/" />
 7<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
 8<script src="/resources/testharness.js"></script>
 9<script src="/resources/testharnessreport.js"></script>
 10<script src="/common/performance-timeline-utils.js"></script>
 11<script src="resources/webperftestharness.js"></script>
 12<script src="resources/webperftestharnessextension.js"></script>
 13<script>
 14setup({ explicit_done: true });
 15
 16function onload_test()
 17{
 18 const measures_for_timing_order = [
 19 ['nav2now', 'navigationStart'],
 20 ['loadTime', 'navigationStart', 'loadEventEnd'],
 21 ['loadEventEnd2a', 'loadEventEnd', 'abc'],
 22 ['nav2a', 'navigationStart', 'abc'],
 23 ['domComplete2a', 'domComplete', 'abc'],
 24 ['negativeValue', 1, 'navigationStart'],
 25 ];
 26 const context = new PerformanceContext(window.performance);
 27
 28 mark_names.forEach(function(name) {
 29 context.mark(name);
 30 });
 31 measures_for_timing_order.forEach(context.initialMeasures, context);
 32 test_greater_than(context.getEntriesByName('nav2now', 'measure')[0].duration, 0, 'Measure of navigationStart to now should be positive value.');
 33 test_greater_than(context.getEntriesByName('loadTime', 'measure')[0].duration, 0, 'Measure of navigationStart to loadEventEnd should be positive value.');
 34 test_greater_than(0, context.getEntriesByName('negativeValue', 'measure')[0].duration, 'Measure of current mark to navigationStart should be negative value.');
 35 test_equals(context.getEntriesByName('loadTime', 'measure')[0].duration + context.getEntriesByName('loadEventEnd2a', 'measure')[0].duration, context.getEntriesByName('nav2a', 'measure')[0].duration, 'loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".');
 36
 37 // Following cases test for scenarios that measure names are tied twice.
 38 mark_names.forEach(function(name) {
 39 context.mark(name);
 40 });
 41 measures_for_timing_order.forEach(context.initialMeasures, context);
 42
 43 test_greater_than(context.getEntriesByName('nav2now', 'measure')[1].duration, context.getEntriesByName('nav2now', 'measure')[0].duration, 'Second measure of current mark to navigationStart should be negative value.');
 44 test_equals(context.getEntriesByName('loadTime', 'measure')[0].duration, context.getEntriesByName('loadTime', 'measure')[1].duration, 'Measures of loadTime should have same duration.');
 45 test_greater_than(context.getEntriesByName('domComplete2a', 'measure')[1].duration, context.getEntriesByName('domComplete2a', 'measure')[0].duration, 'Measure from domComplete event to most recent mark "a" should have longer duration.');
 46 test_greater_than(context.getEntriesByName('negativeValue', 'measure')[0].duration, context.getEntriesByName('negativeValue', 'measure')[1].duration, 'Measure from most recent mark to navigationStart should have longer duration.');
 47
 48 done();
 49}
 50</script>
 51</head>
 52<body onload="setTimeout(onload_test,0)">
 53 <h1>Description</h1>
 54 <p>This test validates functionality of the interface window.performance.measure using keywords from the Navigation Timing spec.</p>
 55 <div id="log"></div>
 56</body>
 57</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_exception-expected.txt

 1Description
 2
 3This test validates all exception scenarios of method window.performance.measure in User Timing API
 4
 5
 6PASS Invocation of performance.measure() should throw TypeError Exception.
 7PASS Invocation of performance.measure("Exception1", "NonExistMark1") should throw SYNTAX_ERR Exception.
 8PASS Invocation of performance.measure("Exception2", "NonExistMark1", "navigationStart") should throw SYNTAX_ERR Exception.
 9PASS Invocation of performance.measure("Exception3", "navigationStart", "NonExistMark1") should throw SYNTAX_ERR Exception.
 10PASS Invocation of performance.measure("Exception4", "NonExistMark1", "ExistMark") should throw SYNTAX_ERR Exception.
 11PASS Invocation of performance.measure("Exception5", "ExistMark", "NonExistMark1") should throw SYNTAX_ERR Exception.
 12PASS Invocation of performance.measure("Exception6", "NonExistMark1", "NonExistMark2") should throw SYNTAX_ERR Exception.
 13PASS Invocation of performance.measure("Exception7", "redirectStart") should throw INVALID_ACCESS_ERR Exception.
 14FAIL Invocation of performance.measure("Exception8", {"detail": "non-empty"}) should throw TypeError Exception. assert_throws_js: Invocation of performance.measure("Exception8", {"detail": "non-empty"}) should throw TypeError Exception. function "function () {eval(func_str)}" threw object "SyntaxError: The string did not match the expected pattern." ("SyntaxError") expected instance of function "function TypeError() {
 15 [native code]
 16}" ("TypeError")
 17FAIL Invocation of performance.measure("Exception9", {"start": 1, "duration": 2, "end": 3}) should throw TypeError Exception. assert_throws_js: Invocation of performance.measure("Exception9", {"start": 1, "duration": 2, "end": 3}) should throw TypeError Exception. function "function () {eval(func_str)}" threw object "SyntaxError: The string did not match the expected pattern." ("SyntaxError") expected instance of function "function TypeError() {
 18 [native code]
 19}" ("TypeError")
 20

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_exception.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta charset="utf-8" />
 5<title>exception test of window.performance.measure</title>
 6<link rel="author" title="Intel" href="http://www.intel.com/" />
 7<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
 8<script src="/resources/testharness.js"></script>
 9<script src="/resources/testharnessreport.js"></script>
 10<script src="/common/performance-timeline-utils.js"></script>
 11<script src="resources/webperftestharness.js"></script>
 12<script src="resources/webperftestharnessextension.js"></script>
 13</head>
 14
 15<body>
 16<h1>Description</h1>
 17<p>This test validates all exception scenarios of method window.performance.measure in User Timing API</p>
 18
 19<div id="log"></div>
 20<script>
 21performance.mark('ExistMark');
 22test_method_throw_exception('performance.measure()', TypeError);
 23test_method_throw_exception('performance.measure("Exception1", "NonExistMark1")', 'SYNTAX_ERR');
 24test_method_throw_exception('performance.measure("Exception2", "NonExistMark1", "navigationStart")', 'SYNTAX_ERR');
 25test_method_throw_exception('performance.measure("Exception3", "navigationStart", "NonExistMark1")', 'SYNTAX_ERR');
 26test_method_throw_exception('performance.measure("Exception4", "NonExistMark1", "ExistMark")', 'SYNTAX_ERR');
 27test_method_throw_exception('performance.measure("Exception5", "ExistMark", "NonExistMark1")', 'SYNTAX_ERR');
 28test_method_throw_exception('performance.measure("Exception6", "NonExistMark1", "NonExistMark2")', 'SYNTAX_ERR');
 29test_method_throw_exception('performance.measure("Exception7", "redirectStart")', 'INVALID_ACCESS_ERR');
 30test_method_throw_exception('performance.measure("Exception8", {"detail": "non-empty"})', TypeError);
 31test_method_throw_exception('performance.measure("Exception9", {"start": 1, "duration": 2, "end": 3})', TypeError);
 32</script>
 33</body>
 34</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_exceptions_navigation_timing.html

@@setup(function () {
2727});
2828
2929test(function () {
30  assert_throws("InvalidAccessError", function () {
 30 assert_throws_dom("InvalidAccessError", function () {
3131 window.performance.measure("measure", zeroedNavTimingAtt);
3232 });
3333}, "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\"), where \"" +

@@test(function () {
3535 "InvalidAccessError exception.");
3636
3737test(function () {
38  assert_throws("InvalidAccessError", function () {
 38 assert_throws_dom("InvalidAccessError", function () {
3939 window.performance.measure("measure", zeroedNavTimingAtt, "responseEnd");
4040 });
4141}, "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", " +

@@test(function () {
4343 "attribute with a value of 0, throws a InvalidAccessError exception.");
4444
4545test(function () {
46  assert_throws("InvalidAccessError", function () {
 46 assert_throws_dom("InvalidAccessError", function () {
4747 window.performance.measure("measure", "navigationStart", zeroedNavTimingAtt);
4848 });
4949}, "window.performance.measure(\"measure\", \"navigationStart\", \"" + zeroedNavTimingAtt +

@@test(function () {
5151 "value of 0, throws a InvalidAccessError exception.");
5252
5353test(function () {
54  assert_throws("InvalidAccessError", function () {
 54 assert_throws_dom("InvalidAccessError", function () {
5555 window.performance.measure("measure", zeroedNavTimingAtt, zeroedNavTimingAtt);
5656 });
5757}, "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", \"" +

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_navigation_timing.html

7373
7474 function onload_test()
7575 {
76  // test for existance of User Timing and Performance Timeline interface
 76 // test for existence of User Timing and Performance Timeline interface
7777 if (!has_required_interfaces())
7878 {
7979 test_true(false,

LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_syntax_err.any.js

@@test(function () {
55 self.performance.measure("measure", "existing_mark");
66}, "Create a mark \"existing_mark\"");
77test(function () {
8  assert_throws(new SyntaxError(), function () {
 8 assert_throws_dom("SyntaxError", function () {
99 self.performance.measure("measure", "mark");
1010 });
1111}, "self.performance.measure(\"measure\", \"mark\"), where \"mark\" is a non-existent mark, " +
1212 "throws a SyntaxError exception.");
1313
1414test(function () {
15  assert_throws(new SyntaxError(), function () {
 15 assert_throws_dom("SyntaxError", function () {
1616 self.performance.measure("measure", "mark", "existing_mark");
1717 });
1818}, "self.performance.measure(\"measure\", \"mark\", \"existing_mark\"), where \"mark\" is a " +
1919 "non-existent mark, throws a SyntaxError exception.");
2020
2121test(function () {
22  assert_throws(new SyntaxError(), function () {
 22 assert_throws_dom("SyntaxError", function () {
2323 self.performance.measure("measure", "existing_mark", "mark");
2424 });
2525}, "self.performance.measure(\"measure\", \"existing_mark\", \"mark\"), where \"mark\" " +
2626 "is a non-existent mark, throws a SyntaxError exception.");
2727
2828test(function () {
29  assert_throws(new SyntaxError(), function () {
 29 assert_throws_dom("SyntaxError", function () {
3030 self.performance.measure("measure", "mark", "mark");
3131 });
3232}, "self.performance.measure(\"measure\", \"mark\", \"mark\"), where \"mark\" is a " +

LayoutTests/imported/w3c/web-platform-tests/user-timing/measures-expected.txt

 1Description
 2
 3This test validates functionality of the interface window.performance.measure.
 4
 5
 6PASS There should be 0 entries returned.
 7PASS Checking all entries.There should be 3 entries.
 8PASS Checking all entries.Entries in entrylist should be in order.
 9PASS Checking all entries.Entry_list 0. Entry "aaa" should be one that we have set.
 10PASS Checking all entries.Entry_list 0. entryType should be "measure".
 11PASS Checking all entries.Entry_list 0. startTime should be a number.
 12PASS Checking all entries.Entry_list 0. duration should be a number.
 13PASS Checking all entries.Entry_list 1. Entry "" should be one that we have set.
 14PASS Checking all entries.Entry_list 1. entryType should be "measure".
 15PASS Checking all entries.Entry_list 1. startTime should be a number.
 16PASS Checking all entries.Entry_list 1. duration should be a number.
 17PASS Checking all entries.Entry_list 2. Entry "2" should be one that we have set.
 18PASS Checking all entries.Entry_list 2. entryType should be "measure".
 19PASS Checking all entries.Entry_list 2. startTime should be a number.
 20PASS Checking all entries.Entry_list 2. duration should be a number.
 21PASS First loop: checking entry of name "aaa".There should be 1 entries.
 22PASS First loop: checking entry of name "aaa".Entries in entrylist should be in order.
 23PASS First loop: checking entry of name "aaa".Entry_list 0. Entry "aaa" should be one that we have set.
 24PASS First loop: checking entry of name "aaa".Entry_list 0. entryType should be "measure".
 25PASS First loop: checking entry of name "aaa".Entry_list 0. startTime should be a number.
 26PASS First loop: checking entry of name "aaa".Entry_list 0. duration should be a number.
 27PASS First loop: checking entry of name "".There should be 1 entries.
 28PASS First loop: checking entry of name "".Entries in entrylist should be in order.
 29PASS First loop: checking entry of name "".Entry_list 0. Entry "" should be one that we have set.
 30PASS First loop: checking entry of name "".Entry_list 0. entryType should be "measure".
 31PASS First loop: checking entry of name "".Entry_list 0. startTime should be a number.
 32PASS First loop: checking entry of name "".Entry_list 0. duration should be a number.
 33PASS First loop: checking entry of name "2".There should be 1 entries.
 34PASS First loop: checking entry of name "2".Entries in entrylist should be in order.
 35PASS First loop: checking entry of name "2".Entry_list 0. Entry "2" should be one that we have set.
 36PASS First loop: checking entry of name "2".Entry_list 0. entryType should be "measure".
 37PASS First loop: checking entry of name "2".Entry_list 0. startTime should be a number.
 38PASS First loop: checking entry of name "2".Entry_list 0. duration should be a number.
 39PASS Checking all doubly measured entries.There should be 6 entries.
 40PASS Checking all doubly measured entries.Entries in entrylist should be in order.
 41PASS Checking all doubly measured entries.Entry_list 0. Entry "aaa" should be one that we have set.
 42PASS Checking all doubly measured entries.Entry_list 0. entryType should be "measure".
 43PASS Checking all doubly measured entries.Entry_list 0. startTime should be a number.
 44PASS Checking all doubly measured entries.Entry_list 0. duration should be a number.
 45PASS Checking all doubly measured entries.Entry_list 1. Entry "aaa" should be one that we have set.
 46PASS Checking all doubly measured entries.Entry_list 1. entryType should be "measure".
 47PASS Checking all doubly measured entries.Entry_list 1. startTime should be a number.
 48PASS Checking all doubly measured entries.Entry_list 1. duration should be a number.
 49PASS Checking all doubly measured entries.Entry_list 2. Entry "" should be one that we have set.
 50PASS Checking all doubly measured entries.Entry_list 2. entryType should be "measure".
 51PASS Checking all doubly measured entries.Entry_list 2. startTime should be a number.
 52PASS Checking all doubly measured entries.Entry_list 2. duration should be a number.
 53PASS Checking all doubly measured entries.Entry_list 3. Entry "" should be one that we have set.
 54PASS Checking all doubly measured entries.Entry_list 3. entryType should be "measure".
 55PASS Checking all doubly measured entries.Entry_list 3. startTime should be a number.
 56PASS Checking all doubly measured entries.Entry_list 3. duration should be a number.
 57PASS Checking all doubly measured entries.Entry_list 4. Entry "2" should be one that we have set.
 58PASS Checking all doubly measured entries.Entry_list 4. entryType should be "measure".
 59PASS Checking all doubly measured entries.Entry_list 4. startTime should be a number.
 60PASS Checking all doubly measured entries.Entry_list 4. duration should be a number.
 61PASS Checking all doubly measured entries.Entry_list 5. Entry "2" should be one that we have set.
 62PASS Checking all doubly measured entries.Entry_list 5. entryType should be "measure".
 63PASS Checking all doubly measured entries.Entry_list 5. startTime should be a number.
 64PASS Checking all doubly measured entries.Entry_list 5. duration should be a number.
 65PASS Second loop step 0: checking entry of name "aaa".There should be 2 entries.
 66PASS Second loop step 0: checking entry of name "aaa".Entries in entrylist should be in order.
 67PASS Second loop step 0: checking entry of name "aaa".Entry_list 0. Entry "aaa" should be one that we have set.
 68PASS Second loop step 0: checking entry of name "aaa".Entry_list 0. entryType should be "measure".
 69PASS Second loop step 0: checking entry of name "aaa".Entry_list 0. startTime should be a number.
 70PASS Second loop step 0: checking entry of name "aaa".Entry_list 0. duration should be a number.
 71PASS Second loop step 0: checking entry of name "aaa".Entry_list 1. Entry "aaa" should be one that we have set.
 72PASS Second loop step 0: checking entry of name "aaa".Entry_list 1. entryType should be "measure".
 73PASS Second loop step 0: checking entry of name "aaa".Entry_list 1. startTime should be a number.
 74PASS Second loop step 0: checking entry of name "aaa".Entry_list 1. duration should be a number.
 75PASS Second loop step 1: checking entry of name "aaa".There should be 2 entries.
 76PASS Second loop step 1: checking entry of name "aaa".Entries in entrylist should be in order.
 77PASS Second loop step 1: checking entry of name "aaa".Entry_list 0. Entry "aaa" should be one that we have set.
 78PASS Second loop step 1: checking entry of name "aaa".Entry_list 0. entryType should be "measure".
 79PASS Second loop step 1: checking entry of name "aaa".Entry_list 0. startTime should be a number.
 80PASS Second loop step 1: checking entry of name "aaa".Entry_list 0. duration should be a number.
 81PASS Second loop step 1: checking entry of name "aaa".Entry_list 1. Entry "aaa" should be one that we have set.
 82PASS Second loop step 1: checking entry of name "aaa".Entry_list 1. entryType should be "measure".
 83PASS Second loop step 1: checking entry of name "aaa".Entry_list 1. startTime should be a number.
 84PASS Second loop step 1: checking entry of name "aaa".Entry_list 1. duration should be a number.
 85PASS Second loop step 2: checking entry of name "".There should be 2 entries.
 86PASS Second loop step 2: checking entry of name "".Entries in entrylist should be in order.
 87PASS Second loop step 2: checking entry of name "".Entry_list 0. Entry "" should be one that we have set.
 88PASS Second loop step 2: checking entry of name "".Entry_list 0. entryType should be "measure".
 89PASS Second loop step 2: checking entry of name "".Entry_list 0. startTime should be a number.
 90PASS Second loop step 2: checking entry of name "".Entry_list 0. duration should be a number.
 91PASS Second loop step 2: checking entry of name "".Entry_list 1. Entry "" should be one that we have set.
 92PASS Second loop step 2: checking entry of name "".Entry_list 1. entryType should be "measure".
 93PASS Second loop step 2: checking entry of name "".Entry_list 1. startTime should be a number.
 94PASS Second loop step 2: checking entry of name "".Entry_list 1. duration should be a number.
 95PASS Second loop step 3: checking entry of name "".There should be 2 entries.
 96PASS Second loop step 3: checking entry of name "".Entries in entrylist should be in order.
 97PASS Second loop step 3: checking entry of name "".Entry_list 0. Entry "" should be one that we have set.
 98PASS Second loop step 3: checking entry of name "".Entry_list 0. entryType should be "measure".
 99PASS Second loop step 3: checking entry of name "".Entry_list 0. startTime should be a number.
 100PASS Second loop step 3: checking entry of name "".Entry_list 0. duration should be a number.
 101PASS Second loop step 3: checking entry of name "".Entry_list 1. Entry "" should be one that we have set.
 102PASS Second loop step 3: checking entry of name "".Entry_list 1. entryType should be "measure".
 103PASS Second loop step 3: checking entry of name "".Entry_list 1. startTime should be a number.
 104PASS Second loop step 3: checking entry of name "".Entry_list 1. duration should be a number.
 105PASS Second loop step 4: checking entry of name "2".There should be 2 entries.
 106PASS Second loop step 4: checking entry of name "2".Entries in entrylist should be in order.
 107PASS Second loop step 4: checking entry of name "2".Entry_list 0. Entry "2" should be one that we have set.
 108PASS Second loop step 4: checking entry of name "2".Entry_list 0. entryType should be "measure".
 109PASS Second loop step 4: checking entry of name "2".Entry_list 0. startTime should be a number.
 110PASS Second loop step 4: checking entry of name "2".Entry_list 0. duration should be a number.
 111PASS Second loop step 4: checking entry of name "2".Entry_list 1. Entry "2" should be one that we have set.
 112PASS Second loop step 4: checking entry of name "2".Entry_list 1. entryType should be "measure".
 113PASS Second loop step 4: checking entry of name "2".Entry_list 1. startTime should be a number.
 114PASS Second loop step 4: checking entry of name "2".Entry_list 1. duration should be a number.
 115PASS Second loop step 5: checking entry of name "2".There should be 2 entries.
 116PASS Second loop step 5: checking entry of name "2".Entries in entrylist should be in order.
 117PASS Second loop step 5: checking entry of name "2".Entry_list 0. Entry "2" should be one that we have set.
 118PASS Second loop step 5: checking entry of name "2".Entry_list 0. entryType should be "measure".
 119PASS Second loop step 5: checking entry of name "2".Entry_list 0. startTime should be a number.
 120PASS Second loop step 5: checking entry of name "2".Entry_list 0. duration should be a number.
 121PASS Second loop step 5: checking entry of name "2".Entry_list 1. Entry "2" should be one that we have set.
 122PASS Second loop step 5: checking entry of name "2".Entry_list 1. entryType should be "measure".
 123PASS Second loop step 5: checking entry of name "2".Entry_list 1. startTime should be a number.
 124PASS Second loop step 5: checking entry of name "2".Entry_list 1. duration should be a number.
 125

LayoutTests/imported/w3c/web-platform-tests/user-timing/measures.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<meta charset="utf-8" />
 5<title>functionality test of window.performance.measure</title>
 6<link rel="author" title="Intel" href="http://www.intel.com/" />
 7<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
 8<script src="/resources/testharness.js"></script>
 9<script src="/resources/testharnessreport.js"></script>
 10<script src="/common/performance-timeline-utils.js"></script>
 11<script src="resources/webperftestharness.js"></script>
 12<script src="resources/webperftestharnessextension.js"></script>
 13<script>
 14setup({ explicit_done: true });
 15
 16function onload_test()
 17{
 18 const context = new PerformanceContext(window.performance);
 19 const entrylist_checker = new performance_entrylist_checker('measure');
 20 const measure_names = measures.map(function(x) {return x[0];});
 21
 22 test_equals(context.getEntriesByType('measure').length, 0, 'There should be ' + 0 + ' entries returned.');
 23
 24 mark_names.forEach(function(name) {
 25 context.mark(name);
 26 });
 27 measures.forEach(context.initialMeasures, context);
 28
 29 let measure_entrylist = context.getEntriesByType('measure');
 30 entrylist_checker.entrylist_check(measure_entrylist, measures.length, measure_names,
 31 'Checking all entries.');
 32
 33 for (let i = 0; i < measure_entrylist.length; ++i)
 34 {
 35 const measure_entrylist_by_name = context.getEntriesByName(measure_entrylist[i].name, 'measure');
 36 entrylist_checker.entrylist_check(measure_entrylist_by_name, 1, measure_names,
 37 'First loop: checking entry of name "' + measure_entrylist[i].name + '".');
 38 }
 39
 40 // Following cases test for scenarios that measure names are tied for two times
 41 mark_names.forEach(function(name) {
 42 context.mark(name);
 43 });
 44 measures.forEach(context.initialMeasures, context);
 45
 46 measure_entrylist = context.getEntriesByType('measure');
 47 entrylist_checker.entrylist_check(measure_entrylist, measures.length * 2, measure_names,
 48 'Checking all doubly measured entries.');
 49
 50 for (let i = 0; i < measure_entrylist.length; ++i)
 51 {
 52 const measure_entrylist_by_name = context.getEntriesByName(measure_entrylist[i].name, 'measure');
 53 entrylist_checker.entrylist_check(measure_entrylist_by_name, 2, measure_names,
 54 'Second loop step ' + i + ': checking entry of name "' + measure_entrylist[i].name + '".');
 55 }
 56
 57 done();
 58}
 59</script>
 60</head>
 61<body onload=onload_test()>
 62 <h1>Description</h1>
 63 <p>This test validates functionality of the interface window.performance.measure.</p>
 64 <div id="log"></div>
 65</body>
 66</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/performance-measure-invalid.worker-expected.txt

 1
 2FAIL When converting 'navigationStart' to a timestamp, the global object has to be a Window object. assert_throws_js: function "() => {
 3 performance.measure('name', 'navigationStart', 'navigationStart');
 4 }" threw object "SyntaxError: No mark named 'navigationStart' exists" ("SyntaxError") expected instance of function "function TypeError() {
 5 [native code]
 6}" ("TypeError")
 7

LayoutTests/imported/w3c/web-platform-tests/user-timing/performance-measure-invalid.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/performance-measure-invalid.worker.js

 1importScripts("/resources/testharness.js");
 2
 3test(() => {
 4 assert_throws_js(TypeError, () => {
 5 performance.measure('name', 'navigationStart', 'navigationStart');
 6 });
 7}, "When converting 'navigationStart' to a timestamp, the global object has to be a Window object.");
 8
 9done();

LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/user-timing-helper.js

 1// Compares a list of performance entries to a predefined one.
 2// actualEntries is an array of performance entries from the user agent,
 3// and expectedEntries is an array of performance entries minted by the test.
 4// The comparison doesn't assert the order of the entries.
 5function checkEntries(actualEntries, expectedEntries) {
 6 assert_equals(actualEntries.length, expectedEntries.length,
 7 `The length of actual and expected entries should match.
 8 actual: ${JSON.stringify(actualEntries)},
 9 expected: ${JSON.stringify(expectedEntries)}`);
 10 const actualEntrySet = new Set(actualEntries.map(ae=>ae.name));
 11 assert_equals(actualEntrySet.size, actualEntries.length, `Actual entry names are not unique: ${JSON.stringify(actualEntries)}`);
 12 const expectedEntrySet = new Set(expectedEntries.map(ee=>ee.name));
 13 assert_equals(expectedEntrySet.size, expectedEntries.length, `Expected entry names are not unique: ${JSON.stringify(expectedEntries)}`);
 14 actualEntries.forEach(ae=>{
 15 const expectedEntry = expectedEntries.find(e=>e.name === ae.name);
 16 assert_true(!!expectedEntry, `Entry name '${ae.name}' was not found.`);
 17 checkEntry(ae, expectedEntry);
 18 });
 19}
 20
 21function checkEntry(entry, {name, entryType, startTime, detail, duration}) {
 22 assert_equals(entry.name, name);
 23 assert_equals(entry.entryType, entryType);
 24 if (startTime !== undefined)
 25 assert_equals(entry.startTime, startTime);
 26 if (detail !== undefined)
 27 assert_equals(JSON.stringify(entry.detail), JSON.stringify(detail));
 28 if (duration !== undefined)
 29 assert_equals(entry.duration, duration);
 30}

LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/w3c-import.log

11The tests in this directory were imported from the W3C repository.
22Do NOT modify these tests directly in WebKit.
33Instead, create a pull request on the WPT github:
4  https://github.com/w3c/web-platform-tests
 4 https://github.com/web-platform-tests/wpt
55
66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
77

@@Property values requiring vendor prefixes:
1414None
1515------------------------------------------------------------------------
1616List of files:
 17/LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/user-timing-helper.js
1718/LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/webperftestharness.js
1819/LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/webperftestharnessextension.js

LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/webperftestharness.js

@@policies and contribution forms [3].
66[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
77[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
88[3] http://www.w3.org/2004/10/27-testcases
 9
 10author: W3C http://www.w3.org/
 11help: http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute
912 */
1013
1114//

@@function test_namespace(child_name, skip_root)
5558{
5659 if (skip_root === undefined) {
5760 var msg = 'window.performance is defined';
58  wp_test(function () { assert_true(performanceNamespace !== undefined, msg); }, msg,{author:"W3C http://www.w3.org/",help:"http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute",assert:"The window.performance attribute provides a hosting area for performance related attributes. "});
 61 wp_test(function () { assert_true(performanceNamespace !== undefined, msg); }, msg);
5962 }
6063
6164 if (child_name !== undefined) {
6265 var msg2 = 'window.performance.' + child_name + ' is defined';
63  wp_test(function() { assert_true(performanceNamespace[child_name] !== undefined, msg2); }, msg2,{author:"W3C http://www.w3.org/",help:"http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute",assert:"The window.performance attribute provides a hosting area for performance related attributes. "});
 66 wp_test(function() { assert_true(performanceNamespace[child_name] !== undefined, msg2); }, msg2);
6467 }
6568}
6669

LayoutTests/imported/w3c/web-platform-tests/user-timing/resources/webperftestharnessextension.js

@@function test_method_exists(method, method_name, properties)
3232
3333function test_method_throw_exception(func_str, exception, msg)
3434{
35  var exception_name = typeof exception === "object" ? exception.name : exception;
 35 let exception_name;
 36 let test_func;
 37 if (typeof exception == "function") {
 38 exception_name = exception.name;
 39 test_func = assert_throws_js;
 40 } else {
 41 exception_name = exception;
 42 test_func = assert_throws_dom;
 43 }
3644 var msg = 'Invocation of ' + func_str + ' should throw ' + exception_name + ' Exception.';
37  wp_test(function() { assert_throws(exception, function() {eval(func_str)}, msg); }, msg);
 45 wp_test(function() { test_func(exception, function() {eval(func_str)}, msg); }, msg);
3846}
3947
4048function test_noless_than(value, greater_than, msg, properties)

@@function test_resource_entries(entries, expected_entries)
8896 }
8997 }
9098}
 99
91100function performance_entrylist_checker(type)
92101{
93  var entryType = type;
 102 const entryType = type;
94103
95  function entry_check(entry, expectedNames)
 104 function entry_check(entry, expectedNames, testDescription = '')
96105 {
97  var msg = 'Entry \"' + entry.name + '\" should be one that we have set.';
 106 const msg = testDescription + 'Entry \"' + entry.name + '\" should be one that we have set.';
98107 wp_test(function() { assert_in_array(entry.name, expectedNames, msg); }, msg);
99  test_equals(entry.entryType, entryType, 'entryType should be \"' + entryType + '\".');
 108 test_equals(entry.entryType, entryType, testDescription + 'entryType should be \"' + entryType + '\".');
100109 if (type === "measure") {
101  test_true(isFinite(entry.startTime), 'startTime should be a number.');
102  test_true(isFinite(entry.duration), 'duration should be a number.');
 110 test_true(isFinite(entry.startTime), testDescription + 'startTime should be a number.');
 111 test_true(isFinite(entry.duration), testDescription + 'duration should be a number.');
103112 } else if (type === "mark") {
104  test_greater_than(entry.startTime, 0, 'startTime should greater than 0.');
105  test_equals(entry.duration, 0, 'duration of mark should be 0.');
 113 test_greater_than(entry.startTime, 0, testDescription + 'startTime should greater than 0.');
 114 test_equals(entry.duration, 0, testDescription + 'duration of mark should be 0.');
106115 }
107116 }
108117
109118 function entrylist_order_check(entryList)
110119 {
111  var inOrder = true;
112  for (var i = 0; i < entryList.length - 1; ++i)
 120 let inOrder = true;
 121 for (let i = 0; i < entryList.length - 1; ++i)
113122 {
114123 if (entryList[i + 1].startTime < entryList[i].startTime) {
115124 inOrder = false;

@@function performance_entrylist_checker(type)
119128 return inOrder;
120129 }
121130
122  function entrylist_check(entryList, expectedLength, expectedNames)
 131 function entrylist_check(entryList, expectedLength, expectedNames, testDescription = '')
123132 {
124  test_equals(entryList.length, expectedLength, 'There should be ' + expectedLength + ' entries.');
125  test_true(entrylist_order_check(entryList), 'Entries in entrylist should be in order.');
126  for (var i = 0; i < entryList.length; ++i)
 133 test_equals(entryList.length, expectedLength, testDescription + 'There should be ' + expectedLength + ' entries.');
 134 test_true(entrylist_order_check(entryList), testDescription + 'Entries in entrylist should be in order.');
 135 for (let i = 0; i < entryList.length; ++i)
127136 {
128  entry_check(entryList[i], expectedNames);
 137 entry_check(entryList[i], expectedNames, testDescription + 'Entry_list ' + i + '. ');
129138 }
130139 }
131140

LayoutTests/imported/w3c/web-platform-tests/user-timing/structured-serialize-detail.any-expected.txt

 1
 2FAIL The detail property in the mark constructor should be structured-clone. function is not a constructor (evaluating 'new PerformanceMark("A", { detail })')
 3FAIL The detail property in the mark method should be structured-clone. undefined is not an object (evaluating 'markEntry.detail')
 4FAIL When accessing detail from a mark entry and the detail is not provided, just return a null value. undefined is not an object (evaluating 'markEntry.detail')
 5FAIL Mark: Throw an exception when the detail property cannot be structured-serialized. assert_throws_dom: Trying to structured-serialize a Symbol. function "()=>{
 6 new PerformanceMark("A", { detail });
 7 }" threw object "TypeError: function is not a constructor (evaluating 'new PerformanceMark("A", { detail })')" that is not a DOMException DataCloneError: property "code" is equal to undefined, expected 25
 8FAIL The detail property in the measure method should be structured-clone. The string did not match the expected pattern.
 9FAIL The detail property in the measure method should be the same reference. The string did not match the expected pattern.
 10FAIL When accessing detail from a measure entry and the detail is not provided, just return a null value. undefined is not an object (evaluating 'measureEntry.detail')
 11FAIL Measure: Throw an exception when the detail property cannot be structured-serialized. assert_throws_dom: Trying to structured-serialize a Symbol. function "()=>{
 12 performance.measure("A", { start: 0, detail });
 13 }" threw object "SyntaxError: The string did not match the expected pattern." that is not a DOMException DataCloneError: property "code" is equal to 12, expected 25
 14FAIL The detail object is cloned when passed to mark API. undefined is not an object (evaluating 'mark.detail')
 15

LayoutTests/imported/w3c/web-platform-tests/user-timing/structured-serialize-detail.any.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/structured-serialize-detail.any.js

 1test(function() {
 2 performance.clearMarks();
 3 const detail = { randomInfo: 123 }
 4 const markEntry = new PerformanceMark("A", { detail });
 5 assert_equals(markEntry.detail.randomInfo, detail.randomInfo);
 6 assert_not_equals(markEntry.detail, detail);
 7}, "The detail property in the mark constructor should be structured-clone.");
 8
 9test(function() {
 10 performance.clearMarks();
 11 const detail = { randomInfo: 123 }
 12 const markEntry = performance.mark("A", { detail });
 13 assert_not_equals(markEntry.detail, detail);
 14}, "The detail property in the mark method should be structured-clone.");
 15
 16test(function() {
 17 performance.clearMarks();
 18 const markEntry = performance.mark("A");
 19 assert_equals(markEntry.detail, null);
 20}, "When accessing detail from a mark entry and the detail is not provided, just return a null value.");
 21
 22test(function() {
 23 performance.clearMarks();
 24 const detail = { unserializable: Symbol() };
 25 assert_throws_dom("DataCloneError", ()=>{
 26 new PerformanceMark("A", { detail });
 27 }, "Trying to structured-serialize a Symbol.");
 28}, "Mark: Throw an exception when the detail property cannot be structured-serialized.");
 29
 30test(function() {
 31 performance.clearMeasures();
 32 const detail = { randomInfo: 123 }
 33 const measureEntry = performance.measure("A", { start: 0, detail });
 34 assert_not_equals(measureEntry.detail, detail);
 35}, "The detail property in the measure method should be structured-clone.");
 36
 37test(function() {
 38 performance.clearMeasures();
 39 const detail = { randomInfo: 123 }
 40 const measureEntry = performance.measure("A", { start: 0, detail });
 41 assert_equals(measureEntry.detail, measureEntry.detail);
 42}, "The detail property in the measure method should be the same reference.");
 43
 44test(function() {
 45 performance.clearMeasures();
 46 const measureEntry = performance.measure("A");
 47 assert_equals(measureEntry.detail, null);
 48}, "When accessing detail from a measure entry and the detail is not provided, just return a null value.");
 49
 50test(function() {
 51 performance.clearMeasures();
 52 const detail = { unserializable: Symbol() };
 53 assert_throws_dom("DataCloneError", ()=>{
 54 performance.measure("A", { start: 0, detail });
 55 }, "Trying to structured-serialize a Symbol.");
 56}, "Measure: Throw an exception when the detail property cannot be structured-serialized.");
 57
 58test(function() {
 59 const bar = { 1: 2 };
 60 const detail = { foo: 1, bar };
 61 const mark = performance.mark("m", { detail });
 62 detail.foo = 2;
 63 assert_equals(mark.detail.foo, 1);
 64}, "The detail object is cloned when passed to mark API.");

LayoutTests/imported/w3c/web-platform-tests/user-timing/structured-serialize-detail.any.worker-expected.txt

 1
 2FAIL The detail property in the mark constructor should be structured-clone. function is not a constructor (evaluating 'new PerformanceMark("A", { detail })')
 3FAIL The detail property in the mark method should be structured-clone. undefined is not an object (evaluating 'markEntry.detail')
 4FAIL When accessing detail from a mark entry and the detail is not provided, just return a null value. undefined is not an object (evaluating 'markEntry.detail')
 5FAIL Mark: Throw an exception when the detail property cannot be structured-serialized. assert_throws_dom: Trying to structured-serialize a Symbol. function "()=>{
 6 new PerformanceMark("A", { detail });
 7 }" threw object "TypeError: function is not a constructor (evaluating 'new PerformanceMark("A", { detail })')" that is not a DOMException DataCloneError: property "code" is equal to undefined, expected 25
 8FAIL The detail property in the measure method should be structured-clone. No mark named '[object Object]' exists
 9FAIL The detail property in the measure method should be the same reference. No mark named '[object Object]' exists
 10FAIL When accessing detail from a measure entry and the detail is not provided, just return a null value. undefined is not an object (evaluating 'measureEntry.detail')
 11FAIL Measure: Throw an exception when the detail property cannot be structured-serialized. assert_throws_dom: Trying to structured-serialize a Symbol. function "()=>{
 12 performance.measure("A", { start: 0, detail });
 13 }" threw object "SyntaxError: No mark named '[object Object]' exists" that is not a DOMException DataCloneError: property "code" is equal to 12, expected 25
 14FAIL The detail object is cloned when passed to mark API. undefined is not an object (evaluating 'mark.detail')
 15

LayoutTests/imported/w3c/web-platform-tests/user-timing/structured-serialize-detail.any.worker.html

 1<!-- This file is required for WebKit test infrastructure to run the templated test -->
02\ No newline at end of file

LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt

1 CONSOLE MESSAGE: ReferenceError: Can't find variable: wp_test
2 
3 Harness Error (FAIL), message = ReferenceError: Can't find variable: wp_test
4 
5 Description
6 
7 This test validates exception scenarios of invoking mark() and measure() with timing attributes as value.
8 
9 

LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html

1 <!DOCTYPE html>
2 <html>
3  <head>
4  <meta charset="utf-8" />
5  <title>exception test of performance.mark and performance.measure</title>
6  <meta rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
7  <script src="/resources/testharness.js"></script>
8  <script src="/resources/testharnessreport.js"></script>
9  <script src="resources/webperftestharness.js"></script>
10  </head>
11  <body>
12  <script>
13  setup({explicit_done: true});
14  test_namespace();
15 
16  test(function() {
17  for (var i in timingAttributes) {
18  assert_throws("SyntaxError", function() { window.performance.mark(timingAttributes[i]); });
19  assert_throws("SyntaxError", function() { window.performance.measure(timingAttributes[i]); });
20  }
21  }, "performance.mark and performance.measure should throw if used with timing attribute values");
22 
23  fetch_tests_from_worker(new Worker("test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js"));
24 
25  done();
26 
27  </script>
28  <h1>Description</h1>
29  <p>This test validates exception scenarios of invoking mark() and measure() with timing attributes as value.</p>
30  <div id="log"></div>
31  </body>
32 </html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js

1 importScripts("/resources/testharness.js");
2 importScripts("resources/webperftestharness.js");
3 
4 test(function() {
5  for (var i in timingAttributes) {
6  performance.mark(timingAttributes[i]);
7  performance.clearMarks(timingAttributes[i]);
8 
9  performance.measure(timingAttributes[i]);
10  performance.clearMeasures(timingAttributes[i]);
11  }
12 }, "performance.mark and performance.measure should not throw if used with timing attribute values in workers");
13 
14 done();

LayoutTests/imported/w3c/web-platform-tests/user-timing/user-timing-tojson-expected.txt

 1
 2PASS Test toJSON() in PerformanceMark
 3PASS Test toJSON() in PerformanceMeasure
 4

LayoutTests/imported/w3c/web-platform-tests/user-timing/user-timing-tojson.html

 1<!doctype html>
 2<html>
 3<head>
 4<script src="/resources/testharness.js"></script>
 5<script src="/resources/testharnessreport.js"></script>
 6</head>
 7<body>
 8<script>
 9const keys = [
 10 'name',
 11 'entryType',
 12 'startTime',
 13 'duration',
 14];
 15test(() => {
 16 performance.mark('a');
 17 const markEntries = performance.getEntriesByType('mark');
 18 assert_equals(1, markEntries.length);
 19 const markEntry = markEntries[0];
 20 assert_equals(markEntry.entryType, 'mark');
 21 assert_equals(typeof(markEntry.toJSON), 'function');
 22 const markJSON = markEntry.toJSON();
 23 assert_equals(typeof(markJSON), 'object');
 24 for (const key of keys) {
 25 assert_equals(markJSON[key], markEntry[key], `PerformanceMark ${key} entry does not match its toJSON value`);
 26 }
 27}, 'Test toJSON() in PerformanceMark');
 28
 29test(() => {
 30 performance.measure('m');
 31 const measureEntries = performance.getEntriesByType('measure');
 32 assert_equals(1, measureEntries.length);
 33 const measureEntry = measureEntries[0];
 34 assert_equals(measureEntry.entryType, 'measure');
 35 assert_equals(typeof(measureEntry.toJSON), 'function');
 36 const measureJSON = measureEntry.toJSON();
 37 assert_equals(typeof(measureJSON), 'object');
 38 for (const key of keys) {
 39 assert_equals(measureJSON[key], measureEntry[key], `PerformanceMeasure ${key} entry does not match its toJSON value`);
 40 }
 41}, 'Test toJSON() in PerformanceMeasure');
 42</script>
 43</body>
 44</html>

LayoutTests/imported/w3c/web-platform-tests/user-timing/w3c-import.log

@@Property values requiring vendor prefixes:
1414None
1515------------------------------------------------------------------------
1616List of files:
17 /LayoutTests/imported/w3c/web-platform-tests/user-timing/OWNERS
 17/LayoutTests/imported/w3c/web-platform-tests/user-timing/META.yml
 18/LayoutTests/imported/w3c/web-platform-tests/user-timing/buffered-flag.any.js
 19/LayoutTests/imported/w3c/web-platform-tests/user-timing/clearMarks.html
 20/LayoutTests/imported/w3c/web-platform-tests/user-timing/clearMeasures.html
1821/LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_all_marks.any.js
1922/LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_all_measures.any.js
2023/LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_non_existent_mark.any.js

@@List of files:
2225/LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_one_mark.any.js
2326/LayoutTests/imported/w3c/web-platform-tests/user-timing/clear_one_measure.any.js
2427/LayoutTests/imported/w3c/web-platform-tests/user-timing/entry_type.any.js
25 /LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.html
 28/LayoutTests/imported/w3c/web-platform-tests/user-timing/idlharness.any.js
2629/LayoutTests/imported/w3c/web-platform-tests/user-timing/invoke_with_timing_attributes.html
2730/LayoutTests/imported/w3c/web-platform-tests/user-timing/invoke_with_timing_attributes.worker.js
2831/LayoutTests/imported/w3c/web-platform-tests/user-timing/invoke_without_parameter.html
 32/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-entry-constructor.any.js
 33/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-errors.any.js
 34/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-l3.any.js
 35/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-feature-detection.html
 36/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark-measure-return-objects.any.js
2937/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark.any.js
 38/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark.html
3039/LayoutTests/imported/w3c/web-platform-tests/user-timing/mark_exceptions.html
 40/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-exceptions.html
 41/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-l3.any.js
 42/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure-with-dict.any.js
3143/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure.html
 44/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_associated_with_navigation_timing.html
 45/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_exception.html
3246/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_exceptions_navigation_timing.html
3347/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_navigation_timing.html
3448/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_syntax_err.any.js
 49/LayoutTests/imported/w3c/web-platform-tests/user-timing/measures.html
 50/LayoutTests/imported/w3c/web-platform-tests/user-timing/performance-measure-invalid.worker.js
 51/LayoutTests/imported/w3c/web-platform-tests/user-timing/structured-serialize-detail.any.js
3552/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.js
 53/LayoutTests/imported/w3c/web-platform-tests/user-timing/user-timing-tojson.html
3654/LayoutTests/imported/w3c/web-platform-tests/user-timing/user_timing_exists.any.js