WebKit Bugzilla
Attachment 359492 Details for
Bug 193428
: Implement PerformanceObserver.supportedEntryTypes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193428-20190118103407.patch (text/plain), 88.10 KB, created by
cvazac
on 2019-01-18 08:34:08 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cvazac
Created:
2019-01-18 08:34:08 PST
Size:
88.10 KB
patch
obsolete
>Subversion Revision: 240149 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d87b9c076a3b9c17a9e4f7577c742169192e321c..b4b7ce62bb99cbbb338e4f1474a6a5e529286163 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-18 Charles Vazac <cvazac@akamai.com> >+ >+ Implement PerformanceObserver.supportedEntryTypes >+ https://bugs.webkit.org/show_bug.cgi?id=193428 >+ >+ PerformanceObserver.supportedEntryTypes should return an array of >+ entryTypes that can be observed per specification >+ https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is covered by web-platform-tests >+ LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html. >+ >+ * page/PerformanceObserver.cpp: >+ (WebCore::PerformanceObserver::supportedEntryTypes): >+ * page/PerformanceObserver.h: >+ * page/PerformanceObserver.idl: >+ > 2019-01-18 Charlie Turner <cturner@igalia.com> > > [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages >diff --git a/Source/WebCore/page/PerformanceObserver.cpp b/Source/WebCore/page/PerformanceObserver.cpp >index 4a3c9ffd2c6366340e3d430d5d18f2952bc82528..c9e02c300c66ce6f38470268b285cb833fee287c 100644 >--- a/Source/WebCore/page/PerformanceObserver.cpp >+++ b/Source/WebCore/page/PerformanceObserver.cpp >@@ -113,4 +113,15 @@ void PerformanceObserver::deliver() > InspectorInstrumentation::didFireObserverCallback(cookie); > } > >+Vector<String> PerformanceObserver::supportedEntryTypes() >+{ >+ return { >+ // FIXME: <https://webkit.org/b/184363> Add support for Navigation Timing Level 2 >+ // "navigation"_s, >+ "mark"_s, >+ "measure"_s, >+ "resource"_s >+ }; >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/page/PerformanceObserver.h b/Source/WebCore/page/PerformanceObserver.h >index 8ab101656d74f57d66a9b53d12963573a313e32d..6ab21f041a152cb80642906d314abb3ef185ef6d 100644 >--- a/Source/WebCore/page/PerformanceObserver.h >+++ b/Source/WebCore/page/PerformanceObserver.h >@@ -49,6 +49,8 @@ public: > return adoptRef(*new PerformanceObserver(context, WTFMove(callback))); > } > >+ static Vector<String> supportedEntryTypes(); >+ > void disassociate(); > > ExceptionOr<void> observe(Init&&); >diff --git a/Source/WebCore/page/PerformanceObserver.idl b/Source/WebCore/page/PerformanceObserver.idl >index f4914be755e21accb400c00ecbb1ca642628ce46..87ede75f62b1c4fb42879d099e4c3162834ab8c1 100644 >--- a/Source/WebCore/page/PerformanceObserver.idl >+++ b/Source/WebCore/page/PerformanceObserver.idl >@@ -36,6 +36,7 @@ > ] interface PerformanceObserver { > [MayThrowException] void observe(PerformanceObserverInit options); > void disconnect(); >+ static readonly attribute FrozenArray<DOMString> supportedEntryTypes; > }; > > dictionary PerformanceObserverInit { >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 02d3c2e4b3d975456db164f4f3fa52b039a17b3e..ab7a45e1139252b34ac7150b502aa23a0fc07f2d 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-14 Charles Vazac <cvazac@akamai.com> >+ >+ Implement PerformanceObserver.supportedEntryTypes >+ https://bugs.webkit.org/show_bug.cgi?id=193428 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/resource-timing/supported_resource_type.any-expected.txt: >+ * web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt: >+ > 2019-01-14 Charles Vazac <cvazac@akamai.com> > > Import current Resource-Timing WPTs >diff --git a/LayoutTests/imported/w3c/resources/import-expectations.json b/LayoutTests/imported/w3c/resources/import-expectations.json >index 995219326a93eec7b52b0578350d5c90fa98e5e7..49e8efe5e120d25fb1634afeefd18a115cb840cc 100644 >--- a/LayoutTests/imported/w3c/resources/import-expectations.json >+++ b/LayoutTests/imported/w3c/resources/import-expectations.json >@@ -283,7 +283,7 @@ > "web-platform-tests/payment-method-basic-card": "skip", > "web-platform-tests/payment-method-id": "skip", > "web-platform-tests/payment-request": "import", >- "web-platform-tests/performance-timeline": "skip", >+ "web-platform-tests/performance-timeline": "import", > "web-platform-tests/pointerevents": "import", > "web-platform-tests/pointerlock": "skip", > "web-platform-tests/preload": "skip", >diff --git a/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..57978bf26db0e413cbf2d4c2f38639c41a25fc50 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+FAIL supportedEntryTypes contains 'navigation'. assert_true: There should be an entry 'navigation' in PerformanceObserver.supportedEntryTypes expected true got false >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.html b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.js b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..3239c7d29ffb11cbfebda12b4e5420bca0131094 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.js >@@ -0,0 +1,20 @@ >+test(() => { >+ if (typeof PerformanceObserver.supportedEntryTypes === "undefined") >+ assert_unreached("supportedEntryTypes is not supported."); >+ assert_true(PerformanceObserver.supportedEntryTypes.includes("navigation"), >+ "There should be an entry 'navigation' in PerformanceObserver.supportedEntryTypes"); >+}, "supportedEntryTypes contains 'navigation'."); >+ >+if (typeof PerformanceObserver.supportedEntryTypes !== "undefined") { >+ const entryType = "navigation"; >+ if (PerformanceObserver.supportedEntryTypes.includes(entryType)) { >+ promise_test(async() => { >+ await new Promise((resolve) => { >+ new PerformanceObserver(function (list, observer) { >+ observer.disconnect(); >+ resolve(); >+ }).observe({entryTypes: [entryType]}); >+ }) >+ }, `'${entryType}' entries should be observable.`) >+ } >+} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..57978bf26db0e413cbf2d4c2f38639c41a25fc50 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+FAIL supportedEntryTypes contains 'navigation'. assert_true: There should be an entry 'navigation' in PerformanceObserver.supportedEntryTypes expected true got false >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/supported_navigation_type.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/META.yml b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/META.yml >new file mode 100644 >index 0000000000000000000000000000000000000000..46f16ae5f31aa388cfd1f7ff759a5df44d17fd0a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/META.yml >@@ -0,0 +1,5 @@ >+spec: https://w3c.github.io/performance-timeline/ >+suggested_reviewers: >+ - plehegar >+ - igrigorik >+ - toddreifsteck >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..04eb1491794b628fcee9fce97d19afdce155fa4e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any-expected.txt >@@ -0,0 +1,4 @@ >+ >+FAIL getEntriesByType values are case sensitive assert_equals: getEntriesByType('RESOURCE').length expected 0 but got 3 >+PASS getEntriesByName values are case sensitive >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..588b59cc6a796b64aa4ad42137700430805a1d16 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.js >@@ -0,0 +1,29 @@ >+ test(function () { >+ assert_equals(typeof self.performance, "object"); >+ assert_equals(typeof self.performance.getEntriesByType, "function"); >+ var lowerList = self.performance.getEntriesByType("resource"); >+ var upperList = self.performance.getEntriesByType("RESOURCE"); >+ var mixedList = self.performance.getEntriesByType("ReSoUrCe"); >+ >+ assert_not_equals(lowerList.length, 0, "Resource entries exist"); >+ assert_equals(upperList.length, 0, "getEntriesByType('RESOURCE').length"); >+ assert_equals(mixedList.length, 0, "getEntriesByType('ReSoUrCe').length"); >+ >+ }, "getEntriesByType values are case sensitive"); >+ >+ test(function () { >+ assert_equals(typeof self.performance, "object"); >+ assert_equals(typeof self.performance.getEntriesByName, "function"); >+ var origin = self.location.protocol + "//" + self.location.host; >+ var location1 = origin.toUpperCase() + "/resources/testharness.js"; >+ var location2 = self.location.protocol + "//" >+ + self.location.host.toUpperCase() + "/resources/testharness.js"; >+ var lowerList = self.performance.getEntriesByName(origin + "/resources/testharness.js"); >+ var upperList = self.performance.getEntriesByName(location1); >+ var mixedList = self.performance.getEntriesByName(location2); >+ >+ assert_equals(lowerList.length, 1, "Resource entry exist"); >+ assert_equals(upperList.length, 0, "getEntriesByName('" + location1 + "').length"); >+ assert_equals(mixedList.length, 0, "getEntriesByName('" + location2 + "').length"); >+ >+ }, "getEntriesByName values are case sensitive"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6239d69bb4647365570c08a7772e5c0f24c1975b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker-expected.txt >@@ -0,0 +1,4 @@ >+ >+FAIL getEntriesByType values are case sensitive assert_equals: getEntriesByType('RESOURCE').length expected 0 but got 2 >+PASS getEntriesByName values are case sensitive >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..54f7e7345bc920d006f1c950fd59f606899467ff >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Get invalid entries from worker and window. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html >new file mode 100644 >index 0000000000000000000000000000000000000000..33d6589e275e265180e0571ca3103dbf9aa179b8 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html >@@ -0,0 +1,27 @@ >+<!doctype html> >+<html> >+<head> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<script> >+async_test(function(t) { >+ performance.mark('windowMark'); >+ const worker = new Worker("resources/worker-invalid-entries.js"); >+ worker.onmessage = function(event) { >+ assert_equals(event.data['invalid'], 0, 'The worker must have 0 invalid entries.'); >+ assert_equals(event.data['mark'], 1, 'The worker must have 1 mark entry.'); >+ assert_equals(event.data['measure'], 0, 'The worker must have 0 measure entries.'); >+ assert_equals(performance.getEntriesByType('invalid').length, 0, >+ 'The window must have 0 invalid entries.'); >+ assert_equals(performance.getEntriesByType('mark').length, 1, >+ 'The window must have 1 mark entry.'); >+ assert_equals(performance.getEntriesByType('measure').length, 0, >+ 'The window must have 0 measure entries.') >+ t.done(); >+ } >+}, 'Get invalid entries from worker and window.'); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d052cd84b71678f2f1fa86babd9cc675678331d1 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any-expected.txt >@@ -0,0 +1,31 @@ >+ >+PASS Untitled >+FAIL idl_test setup promise_test: Unhandled rejection with value: object "Got an error before parsing any named definition: Unrecognised tokens, line 1 (tokens: "{\"error\": {\"message\"") >+[ >+ { >+ "type": "{", >+ "value": "{", >+ "trivia": "" >+ }, >+ { >+ "type": "string", >+ "value": "\"error\"", >+ "trivia": "" >+ }, >+ { >+ "type": ":", >+ "value": ":", >+ "trivia": "" >+ }, >+ { >+ "type": "{", >+ "value": "{", >+ "trivia": " " >+ }, >+ { >+ "type": "string", >+ "value": "\"message\"", >+ "trivia": "" >+ } >+]" >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..585bda92dced217354f93fb5beebe6d930890c0e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.js >@@ -0,0 +1,51 @@ >+// META: global=window,worker >+// META: script=/resources/WebIDLParser.js >+// META: script=/resources/idlharness.js >+ >+// https://w3c.github.io/performance-timeline/ >+ >+'use strict'; >+ >+promise_test(async t => { >+ const observe = new Promise((resolve, reject) => { >+ try { >+ self.observer = new PerformanceObserver((entries, observer) => { >+ self.entryList = entries; >+ self.mark = entries.getEntries()[0]; >+ resolve(); >+ }); >+ observer.observe({ entryTypes: ['mark'] }); >+ performance.mark('test'); >+ } catch (e) { >+ reject(e); >+ } >+ }); >+ const timeout = new Promise((_, reject) => { >+ t.step_timeout(() => reject('Timed out waiting for observation'), 3000); >+ }); >+ const user = await fetch('/interfaces/user-timing.idl').then(r => r.text()); >+ const execute_test = () => { >+ idl_test( >+ ['performance-timeline'], >+ ['hr-time', 'dom'], >+ idl_array => { >+ idl_array.add_idls(user, {only: ['PerformanceMark']}); >+ idl_array.add_objects({ >+ Performance: ['performance'], >+ // NOTE: PerformanceMark cascadingly tests PerformanceEntry >+ PerformanceMark: ['mark'], >+ PerformanceObserver: ['observer'], >+ PerformanceObserverEntryList: ['entryList'], >+ }); >+ } >+ ); >+ }; >+ >+ return Promise.race([observe, timeout]).then( >+ execute_test, >+ reason => { >+ execute_test(); >+ return Promise.reject(reason); >+ } >+ ); >+}) >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d052cd84b71678f2f1fa86babd9cc675678331d1 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.worker-expected.txt >@@ -0,0 +1,31 @@ >+ >+PASS Untitled >+FAIL idl_test setup promise_test: Unhandled rejection with value: object "Got an error before parsing any named definition: Unrecognised tokens, line 1 (tokens: "{\"error\": {\"message\"") >+[ >+ { >+ "type": "{", >+ "value": "{", >+ "trivia": "" >+ }, >+ { >+ "type": "string", >+ "value": "\"error\"", >+ "trivia": "" >+ }, >+ { >+ "type": ":", >+ "value": ":", >+ "trivia": "" >+ }, >+ { >+ "type": "{", >+ "value": "{", >+ "trivia": " " >+ }, >+ { >+ "type": "string", >+ "value": "\"message\"", >+ "trivia": "" >+ } >+]" >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f141b11c52f49d617524b0b10bf7161311d032e4 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test toJSON() in PerformanceEntry >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..44f0156eec19241970028c28e5897be4d6f1cb81 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.js >@@ -0,0 +1,21 @@ >+test(() => { >+ performance.mark('markName'); >+ performance.measure('measureName'); >+ >+ const entries = performance.getEntries(); >+ const performanceEntryKeys = [ >+ 'name', >+ 'entryType', >+ 'startTime', >+ 'duration' >+ ]; >+ for (let i = 0; i < entries.length; ++i) { >+ assert_equals(typeof(entries[i].toJSON), 'function'); >+ const json = entries[i].toJSON(); >+ assert_equals(typeof(json), 'object'); >+ for (const key of performanceEntryKeys) { >+ assert_equals(json[key], entries[i][key], >+ `entries[${i}].toJSON().${key} should match entries[${i}].${key}`); >+ } >+ } >+}, 'Test toJSON() in PerformanceEntry'); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f141b11c52f49d617524b0b10bf7161311d032e4 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test toJSON() in PerformanceEntry >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceobservers.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceobservers.js >new file mode 100644 >index 0000000000000000000000000000000000000000..3f357374efdfc2245ee63ff54eb557291449f9db >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceobservers.js >@@ -0,0 +1,44 @@ >+// Compares a performance entry to a predefined one >+// perfEntriesToCheck is an array of performance entries from the user agent >+// expectedEntries is an array of performance entries minted by the test >+function checkEntries(perfEntriesToCheck, expectedEntries) { >+ function findMatch(pe) { >+ // we match based on entryType and name >+ for (var i = expectedEntries.length - 1; i >= 0; i--) { >+ var ex = expectedEntries[i]; >+ if (ex.entryType === pe.entryType && ex.name === pe.name) { >+ return ex; >+ } >+ } >+ return null; >+ } >+ >+ assert_equals(perfEntriesToCheck.length, expectedEntries.length, "performance entries must match"); >+ >+ perfEntriesToCheck.forEach(function (pe1) { >+ assert_not_equals(findMatch(pe1), null, "Entry matches"); >+ }); >+} >+ >+// Waits for performance.now to advance. Since precision reduction might >+// cause it to return the same value across multiple calls. >+function wait() { >+ var now = performance.now(); >+ while (now === performance.now()) >+ continue; >+} >+ >+// Ensure the entries list is sorted by startTime. >+function checkSorted(entries) { >+ assert_not_equals(entries.length, 0, "entries list must not be empty"); >+ if (!entries.length) >+ return; >+ >+ var sorted = false; >+ var lastStartTime = entries[0].startTime; >+ for (var i = 1; i < entries.length; ++i) { >+ var currStartTime = entries[i].startTime; >+ assert_less_than_equal(lastStartTime, currStartTime, "entry list must be sorted by startTime"); >+ lastStartTime = currStartTime; >+ } >+} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b5f6fd5653539327caebc9aa81679692ca0bfde7 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS PerformanceObserver modifications inside callback should update filtering and not clear buffer >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8f1b09bc377120802401de1b247aa57db7414c68 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.js >@@ -0,0 +1,66 @@ >+// META: script=performanceobservers.js >+ >+ async_test(function (t) { >+ var callbackCount = 0; >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ callbackCount++; >+ >+ if (callbackCount === 1) { >+ checkEntries(entryList.getEntries(), [ >+ {entryType: "measure", name: "measure1"}, >+ ]); >+ observer.observe({entryTypes: ["mark"]}); >+ self.performance.mark("mark2"); >+ self.performance.measure("measure2"); >+ return; >+ } >+ >+ if (callbackCount === 2) { >+ checkEntries(entryList.getEntries(), [ >+ {entryType: "mark", name: "mark2"}, >+ ]); >+ self.performance.mark("mark-before-change-observe-state-to-measure"); >+ self.performance.measure("measure-before-change-observe-state-to-measure"); >+ observer.observe({entryTypes: ["measure"]}); >+ self.performance.mark("mark3"); >+ self.performance.measure("measure3"); >+ return; >+ } >+ >+ if (callbackCount === 3) { >+ checkEntries(entryList.getEntries(), [ >+ {entryType: "measure", name: "measure3"}, >+ {entryType: "mark", name: "mark-before-change-observe-state-to-measure"}, >+ ]); >+ self.performance.mark("mark-before-change-observe-state-to-both"); >+ self.performance.measure("measure-before-change-observe-state-to-both"); >+ observer.observe({entryTypes: ["mark", "measure"]}); >+ self.performance.mark("mark4"); >+ self.performance.measure("measure4"); >+ return; >+ } >+ >+ if (callbackCount === 4) { >+ checkEntries(entryList.getEntries(), [ >+ {entryType: "measure", name: "measure-before-change-observe-state-to-both"}, >+ {entryType: "measure", name: "measure4"}, >+ {entryType: "mark", name: "mark4"}, >+ ]); >+ self.performance.mark("mark-before-disconnect"); >+ self.performance.measure("measure-before-disconnect"); >+ observer.disconnect(); >+ self.performance.mark("mark-after-disconnect"); >+ self.performance.measure("measure-after-disconnect"); >+ t.done(); >+ return; >+ } >+ >+ assert_unreached("The callback must not be invoked after disconnecting"); >+ }) >+ ); >+ >+ observer.observe({entryTypes: ["measure"]}); >+ self.performance.mark("mark1"); >+ self.performance.measure("measure1"); >+ }, "PerformanceObserver modifications inside callback should update filtering and not clear buffer"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b5f6fd5653539327caebc9aa81679692ca0bfde7 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS PerformanceObserver modifications inside callback should update filtering and not clear buffer >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..aa406ca6dc3a6def8d9da16c9e2b4cf6c28a09d7 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS disconnected callbacks must not be invoked >+PASS disconnecting an unconnected observer is a no-op >+PASS An observer disconnected after a mark must not have its callback invoked >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..5f5fb5aa43ba46268f8c355fdc93c6f1829968b4 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.js >@@ -0,0 +1,37 @@ >+// META: script=performanceobservers.js >+ >+ async_test(function (t) { >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ assert_unreached("This callback must not be invoked"); >+ }) >+ ); >+ observer.observe({entryTypes: ["mark", "measure", "navigation"]}); >+ observer.disconnect(); >+ self.performance.mark("mark1"); >+ self.performance.measure("measure1"); >+ t.step_timeout(function () { >+ t.done(); >+ }, 2000); >+ }, "disconnected callbacks must not be invoked"); >+ >+ test(function () { >+ var obs = new PerformanceObserver(function () { return true; }); >+ obs.disconnect(); >+ obs.disconnect(); >+ }, "disconnecting an unconnected observer is a no-op"); >+ >+ async_test(function (t) { >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ assert_unreached("This callback must not be invoked"); >+ }) >+ ); >+ observer.observe({entryTypes: ["mark"]}); >+ self.performance.mark("mark1"); >+ observer.disconnect(); >+ self.performance.mark("mark2"); >+ t.step_timeout(function () { >+ t.done(); >+ }, 2000); >+ }, "An observer disconnected after a mark must not have its callback invoked"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..aa406ca6dc3a6def8d9da16c9e2b4cf6c28a09d7 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.worker-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS disconnected callbacks must not be invoked >+PASS disconnecting an unconnected observer is a no-op >+PASS An observer disconnected after a mark must not have its callback invoked >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..579c56835819f7fbe648abae51524d8c4b201f2c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS getEntries, getEntriesByType, getEntriesByName sort order >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b0c781a3c0c03bf81e820168bdf70b536275040b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.js >@@ -0,0 +1,64 @@ >+// META: script=performanceobservers.js >+ >+ async_test(function (t) { >+ var stored_entries = []; >+ var stored_entries_by_type = []; >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ >+ stored_entries = entryList.getEntries(); >+ stored_entries_by_type = entryList.getEntriesByType("mark"); >+ stored_entries_by_name = entryList.getEntriesByName("name-repeat"); >+ var startTimeOfMark2 = entryList.getEntriesByName("mark2")[0].startTime; >+ >+ checkSorted(stored_entries); >+ checkEntries(stored_entries, [ >+ {entryType: "measure", name: "measure1"}, >+ {entryType: "measure", name: "measure2"}, >+ {entryType: "measure", name: "measure3"}, >+ {entryType: "measure", name: "name-repeat"}, >+ {entryType: "mark", name: "mark1"}, >+ {entryType: "mark", name: "mark2"}, >+ {entryType: "measure", name: "measure-matching-mark2-1"}, >+ {entryType: "measure", name: "measure-matching-mark2-2"}, >+ {entryType: "mark", name: "name-repeat"}, >+ {entryType: "mark", name: "name-repeat"}, >+ ]); >+ >+ checkSorted(stored_entries_by_type); >+ checkEntries(stored_entries_by_type, [ >+ {entryType: "mark", name: "mark1"}, >+ {entryType: "mark", name: "mark2"}, >+ {entryType: "mark", name: "name-repeat"}, >+ {entryType: "mark", name: "name-repeat"}, >+ ]); >+ >+ checkSorted(stored_entries_by_name); >+ checkEntries(stored_entries_by_name, [ >+ {entryType: "measure", name: "name-repeat"}, >+ {entryType: "mark", name: "name-repeat"}, >+ {entryType: "mark", name: "name-repeat"}, >+ ]); >+ >+ observer.disconnect(); >+ t.done(); >+ }) >+ ); >+ >+ observer.observe({entryTypes: ["mark", "measure"]}); >+ >+ self.performance.mark("mark1"); >+ self.performance.measure("measure1"); >+ wait(); // Ensure mark1 !== mark2 startTime by making sure performance.now advances. >+ self.performance.mark("mark2"); >+ self.performance.measure("measure2"); >+ self.performance.measure("measure-matching-mark2-1", "mark2"); >+ wait(); // Ensure mark2 !== mark3 startTime by making sure performance.now advances. >+ self.performance.mark("name-repeat"); >+ self.performance.measure("measure3"); >+ self.performance.measure("measure-matching-mark2-2", "mark2"); >+ wait(); // Ensure name-repeat startTime will differ. >+ self.performance.mark("name-repeat"); >+ wait(); // Ensure name-repeat startTime will differ. >+ self.performance.measure("name-repeat"); >+ }, "getEntries, getEntriesByType, getEntriesByName sort order"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..579c56835819f7fbe648abae51524d8c4b201f2c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS getEntries, getEntriesByType, getEntriesByName sort order >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9fbb8fce1692bd0b8a20bb88c74fca88c83d58a6 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS getEntries, getEntriesByType and getEntriesByName work >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..36169d5dbd6e0e20506d20146585dbc89e750c25 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.js >@@ -0,0 +1,38 @@ >+// META: script=performanceobservers.js >+ >+ async_test(function (t) { >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ checkEntries(entryList.getEntries(), >+ [{ entryType: "mark", name: "mark1"}], "getEntries"); >+ >+ checkEntries(entryList.getEntriesByType("mark"), >+ [{ entryType: "mark", name: "mark1"}], "getEntriesByType"); >+ assert_equals(entryList.getEntriesByType("measure").length, 0, >+ "getEntriesByType with no expected entry"); >+ assert_equals(entryList.getEntriesByType("234567").length, 0, >+ "getEntriesByType with no expected entry"); >+ >+ checkEntries(entryList.getEntriesByName("mark1"), >+ [{ entryType: "mark", name: "mark1"}], "getEntriesByName"); >+ assert_equals(entryList.getEntriesByName("mark2").length, 0, >+ "getEntriesByName with no expected entry"); >+ assert_equals(entryList.getEntriesByName("234567").length, 0, >+ "getEntriesByName with no expected entry"); >+ >+ checkEntries(entryList.getEntriesByName("mark1", "mark"), >+ [{ entryType: "mark", name: "mark1"}], "getEntriesByName with a type"); >+ assert_equals(entryList.getEntriesByName("mark1", "measure").length, 0, >+ "getEntriesByName with a type with no expected entry"); >+ assert_equals(entryList.getEntriesByName("mark2", "measure").length, 0, >+ "getEntriesByName with a type with no expected entry"); >+ assert_equals(entryList.getEntriesByName("mark1", "234567").length, 0, >+ "getEntriesByName with a type with no expected entry"); >+ >+ observer.disconnect(); >+ t.done(); >+ }) >+ ); >+ observer.observe({entryTypes: ["mark"]}); >+ self.performance.mark("mark1"); >+ }, "getEntries, getEntriesByType and getEntriesByName work"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9fbb8fce1692bd0b8a20bb88c74fca88c83d58a6 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS getEntries, getEntriesByType and getEntriesByName work >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d920107ce2d39ed5241a329d492b25905350397a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS entries are observable >+PASS mark entries are observable >+PASS measure entries are observable >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0b205e094c75e10bc1b93ff966aea0fd23a586f8 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.js >@@ -0,0 +1,61 @@ >+// META: script=performanceobservers.js >+ >+ async_test(function (t) { >+ var stored_entries = []; >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ stored_entries = >+ stored_entries.concat(entryList.getEntries()); >+ if (stored_entries.length >= 4) { >+ checkEntries(stored_entries, >+ [{ entryType: "mark", name: "mark1"}, >+ { entryType: "mark", name: "mark2"}, >+ { entryType: "measure", name: "measure1"}, >+ { entryType: "measure", name: "measure2"}]); >+ observer.disconnect(); >+ t.done(); >+ } >+ }) >+ ); >+ observer.observe({entryTypes: ["mark", "measure"]}); >+ }, "entries are observable"); >+ >+ async_test(function (t) { >+ var mark_entries = []; >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ mark_entries = >+ mark_entries.concat(entryList.getEntries()); >+ if (mark_entries.length >= 2) { >+ checkEntries(mark_entries, >+ [{ entryType: "mark", name: "mark1"}, >+ { entryType: "mark", name: "mark2"}]); >+ observer.disconnect(); >+ t.done(); >+ } >+ }) >+ ); >+ observer.observe({entryTypes: ["mark"]}); >+ self.performance.mark("mark1"); >+ self.performance.mark("mark2"); >+ }, "mark entries are observable"); >+ >+ async_test(function (t) { >+ var measure_entries = []; >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ measure_entries = >+ measure_entries.concat(entryList.getEntries()); >+ if (measure_entries.length >= 2) { >+ checkEntries(measure_entries, >+ [{ entryType: "measure", name: "measure1"}, >+ { entryType: "measure", name: "measure2"}]); >+ observer.disconnect(); >+ t.done(); >+ } >+ }) >+ ); >+ observer.observe({entryTypes: ["measure"]}); >+ self.performance.measure("measure1"); >+ self.performance.measure("measure2"); >+ }, "measure entries are observable"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d920107ce2d39ed5241a329d492b25905350397a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.worker-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS entries are observable >+PASS mark entries are observable >+PASS measure entries are observable >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..8add82fae8e270ba3c010d749d00bd75a3a509b4 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe-expected.txt >@@ -0,0 +1,9 @@ >+PerformanceObservers: PerformanceObserverInit.buffered >+ >+PerformanceObserverInit.buffered should retrieve previously buffered entries >+ >+ >+Harness Error (TIMEOUT), message = null >+ >+TIMEOUT PerformanceObserverInit.buffered should retrieve previously buffered entries Test timed out >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..55ce3d3e38f8d2deb903b550c2e5b4a66bf40fb3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any-expected.txt >@@ -0,0 +1,9 @@ >+ >+PASS no entryTypes throws a TypeError >+PASS entryTypes must be a sequence or throw a TypeError >+FAIL Empty sequence entryTypes is a no-op entryTypes cannot be an empty list >+FAIL Unknown entryTypes are no-op entryTypes contained only unsupported types >+PASS Filter unsupported entryType entryType names within the entryTypes sequence >+FAIL Check observer callback parameter and this values assert_equals: observer is the this value expected object "[object Window]" but got object "[object PerformanceObserver]" >+PASS replace observer if already present >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8520c26e504d1fc036e90f76aeb37ccb628db132 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.js >@@ -0,0 +1,72 @@ >+// META: script=performanceobservers.js >+ >+ test(function () { >+ var obs = new PerformanceObserver(function () { return true; }); >+ assert_throws(new TypeError(), function () { >+ obs.observe({}); >+ }); >+ assert_throws(new TypeError(), function () { >+ obs.observe({entryType: []}); >+ }); >+ }, "no entryTypes throws a TypeError"); >+ test(function () { >+ var obs = new PerformanceObserver(function () { return true; }); >+ assert_throws(new TypeError(), function () { >+ obs.observe({entryTypes: "mark"}); >+ }); >+ }, "entryTypes must be a sequence or throw a TypeError"); >+ >+ test(function () { >+ var obs = new PerformanceObserver(function () { return true; }); >+ obs.observe({entryTypes: []}); >+ }, "Empty sequence entryTypes is a no-op"); >+ >+ test(function () { >+ var obs = new PerformanceObserver(function () { return true; }); >+ obs.observe({entryTypes: ["this-cannot-match-an-entryType"]}); >+ obs.observe({entryTypes: ["marks","navigate", "resources"]}); >+ }, "Unknown entryTypes are no-op"); >+ >+ test(function () { >+ var obs = new PerformanceObserver(function () { return true; }); >+ obs.observe({entryTypes: ["mark","this-cannot-match-an-entryType"]}); >+ obs.observe({entryTypes: ["this-cannot-match-an-entryType","mark"]}); >+ obs.observe({entryTypes: ["mark"], others: true}); >+ }, "Filter unsupported entryType entryType names within the entryTypes sequence"); >+ >+ async_test(function (t) { >+ var finish = t.step_func(function () { t.done(); }); >+ var observer = new PerformanceObserver( >+ function (entryList, obs) { >+ var self = this; >+ t.step(function () { >+ assert_true(entryList instanceof PerformanceObserverEntryList, "first callback parameter must be a PerformanceObserverEntryList instance"); >+ assert_true(obs instanceof PerformanceObserver, "second callback parameter must be a PerformanceObserver instance"); >+ assert_equals(observer, self, "observer is the this value"); >+ assert_equals(observer, obs, "observer is second parameter"); >+ assert_equals(self, obs, "this and second parameter are the same"); >+ observer.disconnect(); >+ finish(); >+ }); >+ } >+ ); >+ self.performance.clearMarks(); >+ observer.observe({entryTypes: ["mark"]}); >+ self.performance.mark("mark1"); >+ }, "Check observer callback parameter and this values"); >+ >+ async_test(function (t) { >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ checkEntries(entryList.getEntries(), >+ [{ entryType: "measure", name: "measure1"}]); >+ observer.disconnect(); >+ t.done(); >+ }) >+ ); >+ self.performance.clearMarks(); >+ observer.observe({entryTypes: ["mark"]}); >+ observer.observe({entryTypes: ["measure"]}); >+ self.performance.mark("mark1"); >+ self.performance.measure("measure1"); >+ }, "replace observer if already present"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cbde592e3153f41a58e5165a82736c36598ba371 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.worker-expected.txt >@@ -0,0 +1,9 @@ >+ >+PASS no entryTypes throws a TypeError >+PASS entryTypes must be a sequence or throw a TypeError >+FAIL Empty sequence entryTypes is a no-op entryTypes cannot be an empty list >+FAIL Unknown entryTypes are no-op entryTypes contained only unsupported types >+PASS Filter unsupported entryType entryType names within the entryTypes sequence >+FAIL Check observer callback parameter and this values assert_equals: observer is the this value expected object "[object DedicatedWorkerGlobalScope]" but got object "[object PerformanceObserver]" >+PASS replace observer if already present >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d65c8a40c981e1e79db9096df3a6991ab62b1e0a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.html >@@ -0,0 +1,83 @@ >+<!DOCTYPE HTML> >+<meta charset=utf-8> >+<title>PerformanceObservers: PerformanceObserverInit.buffered</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="performanceobservers.js"></script> >+<h1>PerformanceObservers: PerformanceObserverInit.buffered</h1> >+<p> >+PerformanceObserverInit.buffered should retrieve previously buffered entries >+</p> >+<div id="log"></div> >+<script> >+ async_test(function (t) { >+ function initTest() { >+ new PerformanceObserver(function (entryList, observer) { >+ entryList.getEntries().forEach(function(entry) { >+ if (shouldExclude(entry)) { >+ return; >+ } >+ >+ observedEntries.push(entry); >+ if (observedEntries.length === entryTypes.length) { >+ observer.disconnect(); >+ runTest(); >+ } >+ }); >+ }).observe({entryTypes}); >+ >+ // creates a `resource` entry >+ var img = document.createElement("img"); >+ img.src = "./resources/square.png"; >+ document.body.appendChild(img); >+ >+ performance.mark("markName"); // creates a `mark` entry >+ performance.measure("measureName"); // creates a `measure` entry >+ } >+ function shouldExclude(entry) { >+ // exclude all `resource` entries that aren't for "square.png" >+ return entry.entryType === "resource" && >+ entry.name.indexOf("square.png") === -1; >+ } >+ function runTest() { >+ // this PerformanceObserver is a nop because we've already been notified about all of our `entryTypes` >+ var po_nop = new PerformanceObserver(function (entryList, observer) { >+ if (entryList.getEntries().find(function(entry) { >+ return !shouldExclude(entry); >+ })) { >+ assert_unreached("this PerformanceObserver callback should never be called"); >+ } >+ }); >+ po_nop.observe({ >+ entryTypes, >+ buffered: false >+ }); >+ >+ // this PerformanceObserver should be notified about the previously buffered entries >+ const bufferedEntries = []; >+ new PerformanceObserver(function (entryList, observer) { >+ entryList.getEntries().forEach(function(entry) { >+ if (shouldExclude(entry)) { >+ return; >+ } >+ >+ bufferedEntries.push(entry); >+ if (bufferedEntries.length === entryTypes.length) { >+ observer.disconnect(); >+ po_nop.disconnect(); >+ checkEntries(bufferedEntries, observedEntries); >+ t.done(); >+ } >+ }); >+ }).observe({ >+ entryTypes, >+ buffered: true >+ }); >+ } >+ >+ const entryTypes = ["navigation", "resource", "mark", "measure"]; >+ const observedEntries = []; >+ initTest(); >+ }, "PerformanceObserverInit.buffered should retrieve previously buffered entries"); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d39b9e348d348e49e2d0e81b14653955e47f0509 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource-expected.txt >@@ -0,0 +1,7 @@ >+PerformanceObservers: resource >+ >+New resources will queue a PerformanceEntry. >+ >+ >+PASS resource entries are observable >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource.html >new file mode 100644 >index 0000000000000000000000000000000000000000..00c173eeae921fbecc3eeea54d8adfa6b9ed5365 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource.html >@@ -0,0 +1,48 @@ >+<!DOCTYPE HTML> >+<meta charset=utf-8> >+<title>PerformanceObservers: resource</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="performanceobservers.js"></script> >+<h1>PerformanceObservers: resource</h1> >+<p> >+New resources will <a href="https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry">queue a PerformanceEntry</a>. >+</p> >+<div id="log"></div> >+<script> >+ async_test(function (t) { >+ function path(pathname) { >+ var filename = pathname.substring(pathname.lastIndexOf('/')+1); >+ return pathname.substring(0, pathname.length - filename.length); >+ } >+ var gUniqueCounter = 0; >+ function generateUniqueValues() { >+ return Date.now() + "-" + (++gUniqueCounter); >+ } >+ var stored_entries = []; >+ var img_location = document.location.origin + path(document.location.pathname) >+ + "resources/square.png?random="; >+ var img1 = img_location + generateUniqueValues(); >+ var img2 = img_location + generateUniqueValues(); >+ var observer = new PerformanceObserver( >+ t.step_func(function (entryList, obs) { >+ stored_entries = >+ stored_entries.concat(entryList.getEntriesByType("resource")); >+ if (stored_entries.length >= 2) { >+ checkEntries(stored_entries, >+ [{ entryType: "resource", name: img1}, >+ { entryType: "resource", name: img2}]); >+ observer.disconnect(); >+ t.done(); >+ } >+ }) >+ ); >+ observer.observe({entryTypes: ["resource"]}); >+ var img = document.createElement("img"); >+ img.src = img1; >+ document.body.appendChild(img); >+ img = document.createElement("img"); >+ img.src = img2; >+ document.body.appendChild(img); >+ }, "resource entries are observable"); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ba32b0ad704311e684abdeec7401bd51c5e94f8b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+FAIL Test PerformanceObserver's takeRecords() observer.takeRecords is not a function. (In 'observer.takeRecords()', 'observer.takeRecords' is undefined) >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..86ad397b0a5c379d0129d43c92952bc6c8c5c0cf >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.js >@@ -0,0 +1,34 @@ >+// META: title=PerformanceObserver: takeRecords >+// META: script=performanceobservers.js >+ >+async_test(function (t) { >+ const observer = new PerformanceObserver(function (entryList, observer) { >+ assert_unreached('This callback should not have been called.') >+ }); >+ let entries = observer.takeRecords(); >+ checkEntries(entries, [], 'No records before observe'); >+ observer.observe({entryTypes: ['mark']}); >+ assert_equals(typeof(observer.takeRecords), 'function'); >+ entries = observer.takeRecords(); >+ checkEntries(entries, [], 'No records just from observe'); >+ performance.mark('a'); >+ performance.mark('b'); >+ entries = observer.takeRecords(); >+ checkEntries(entries, [ >+ {entryType: 'mark', name: 'a'}, >+ {entryType: 'mark', name: 'b'} >+ ]); >+ performance.mark('c'); >+ performance.mark('d'); >+ performance.mark('e'); >+ entries = observer.takeRecords(); >+ checkEntries(entries, [ >+ {entryType: 'mark', name: 'c'}, >+ {entryType: 'mark', name: 'd'}, >+ {entryType: 'mark', name: 'e'} >+ ]); >+ entries = observer.takeRecords(); >+ checkEntries(entries, [], 'No entries right after takeRecords'); >+ observer.disconnect(); >+ t.done(); >+ }, "Test PerformanceObserver's takeRecords()"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ba32b0ad704311e684abdeec7401bd51c5e94f8b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+FAIL Test PerformanceObserver's takeRecords() observer.takeRecords is not a function. (In 'observer.takeRecords()', 'observer.takeRecords' is undefined) >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/square.png b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/square.png >new file mode 100644 >index 0000000000000000000000000000000000000000..be211bc377180386eec7e891485e083a2c45841e >GIT binary patch >literal 249 >zcmeAS@N?(olHy`uVBq!ia0vp^&Oq$I!2~4F*~E4MDaPU;cPEB*=VV?2IV|apzK#qG >z8~eHcB(eheoCO|{#S9F5he4R}c>anMpkSY;i(^QJ^V@3&IS(i>usHtKSF4Sf>dC%O >z><G`3T7`Aa$Eu#m-rw<9;=bmbCwtWHc3Qt|2%Ns_%GUpaAN}?SzdvIAQtHLDn@9CZ >zH?GcJ5S=Ez`^wRE>l*WB#=Z#>-@S`%S8CZt@7Oo5h)`6&={0M#tksJI@9JEj%NRUe >L{an^LB{Ts5<eg&& > >literal 0 >HcmV?d00001 > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..82ca8236a0f3ec98df5721030fd34e6f0f48482d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/w3c-import.log >@@ -0,0 +1,19 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/square.png >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-invalid-entries.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-invalid-entries.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-invalid-entries.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bd7fba2ccf4b6ab7e604273c25010e31e443e376 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-invalid-entries.js >@@ -0,0 +1,6 @@ >+performance.mark('workerMark'); >+postMessage({ >+ 'invalid' : performance.getEntriesByType('invalid').length, >+ 'mark' : performance.getEntriesByType('mark').length, >+ 'measure' : performance.getEntriesByType('measure').length >+}); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a72fe81c47feace765613a0962f2a7e63f71fa25 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js >@@ -0,0 +1,6 @@ >+try { >+ new PerformanceObserver(() => true); >+ postMessage("SUCCESS"); >+} catch (ex) { >+ postMessage("FAILURE"); >+} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4ed68f98cbd621ad44c6a88a88b6f04e172278e0 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS supportedEntryTypes exists and returns entries in alphabetical order >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a0225ad2f76fdcfebb0a7c9aff9bd0030ecf86aa >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.js >@@ -0,0 +1,12 @@ >+test(() => { >+ if (typeof PerformanceObserver.supportedEntryTypes === "undefined") >+ assert_unreached("supportedEntryTypes is not supported."); >+ const types = PerformanceObserver.supportedEntryTypes; >+ assert_greater_than(types.length, 0, >+ "There should be at least one entry in supportedEntryTypes."); >+ for (let i = 1; i < types.length; i++) { >+ assert_true(types[i-1] < types[i], >+ "The strings '" + types[i-1] + "' and '" + types[i] + >+ "' are repeated or they are not in alphabetical order.") >+ } >+}, "supportedEntryTypes exists and returns entries in alphabetical order"); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4ed68f98cbd621ad44c6a88a88b6f04e172278e0 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS supportedEntryTypes exists and returns entries in alphabetical order >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..2bc778dcbfdb7d0c6fa6c6c7449eb781eaa08459 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/w3c-import.log >@@ -0,0 +1,34 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/META.yml >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/idlharness.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceentry-tojson.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/performanceobservers.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-callback-mutate.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-disconnect.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-entries-sort.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-getentries.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-mark-measure.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-observe.html >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-resource.html >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/po-takeRecords.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/supportedEntryTypes.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.js >+/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7c8930d1c720e18f950e6c8ec1e847e9c631b0ba >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any-expected.txt >@@ -0,0 +1,4 @@ >+ >+PASS Verifies the resolution of performance.now() is at least 5 microseconds. >+PASS Verifies the resolution of entry.startTime is at least 5 microseconds. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.js b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..46e0489352f09767dc847615bd64464946f9088e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.js >@@ -0,0 +1,25 @@ >+function testTimeResolution(highResTimeFunc, funcString) { >+ test(() => { >+ const t0 = highResTimeFunc(); >+ let t1 = highResTimeFunc(); >+ while (t0 == t1) { >+ t1 = highResTimeFunc(); >+ } >+ const epsilon = 1e-5; >+ assert_greater_than_equal(t1 - t0, 0.005 - epsilon, 'The second ' + funcString + ' should be much greater than the first'); >+ }, 'Verifies the resolution of ' + funcString + ' is at least 5 microseconds.'); >+} >+ >+function timeByPerformanceNow() { >+ return performance.now(); >+} >+ >+function timeByUserTiming() { >+ performance.mark('timer'); >+ const time = performance.getEntriesByName('timer')[0].startTime; >+ performance.clearMarks('timer'); >+ return time; >+} >+ >+testTimeResolution(timeByPerformanceNow, 'performance.now()'); >+testTimeResolution(timeByUserTiming, 'entry.startTime'); >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7c8930d1c720e18f950e6c8ec1e847e9c631b0ba >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.worker-expected.txt >@@ -0,0 +1,4 @@ >+ >+PASS Verifies the resolution of performance.now() is at least 5 microseconds. >+PASS Verifies the resolution of entry.startTime is at least 5 microseconds. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/webtiming-resolution.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..09acdbae9ebe26905d61b0d6d88049e988f8530a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Worker: Test Performance Observer inside a worker. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fc92bc971003f2ea92fbd169d8dd7a64d062062d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html >@@ -0,0 +1,18 @@ >+<!doctype html> >+<html> >+<head> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<script> >+async_test(function(t) { >+ const worker = new Worker("resources/worker-with-performance-observer.js"); >+ worker.onmessage = function(event) { >+ t.step(() => assert_equals(event.data, 'SUCCESS')); >+ t.done(); >+ } >+}, 'Worker: Test Performance Observer inside a worker.'); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt >index df46af53fd74b6b04b86738bc2107b5265991ac6..0dc5926a0d57c70e80300f47ae5e10b925085187 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt >@@ -1,3 +1,4 @@ > >-FAIL supportedEntryTypes contains 'resource'. assert_unreached: supportedEntryTypes is not supported. Reached unreachable code >+PASS supportedEntryTypes contains 'resource'. >+PASS 'resource' entries should be observable. > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js >index 6096ad714904fdd5c0085b33b4240301cdb952fb..31e40096ddb2c3a8e38ddbeec00a67ca7a91ce59 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js >@@ -4,3 +4,21 @@ > assert_true(PerformanceObserver.supportedEntryTypes.includes("resource"), > "There should be an entry 'resource' in PerformanceObserver.supportedEntryTypes"); > }, "supportedEntryTypes contains 'resource'."); >+ >+if (typeof PerformanceObserver.supportedEntryTypes !== "undefined") { >+ const entryType = "resource"; >+ if (PerformanceObserver.supportedEntryTypes.includes(entryType)) { >+ promise_test(async() => { >+ await new Promise((resolve) => { >+ new PerformanceObserver(function (list, observer) { >+ observer.disconnect(); >+ resolve(); >+ }).observe({entryTypes: [entryType]}); >+ >+ // Force the PerformanceEntry. >+ // Use `self` for Workers. >+ fetch(self.location.href + "?" + Math.random()); >+ }) >+ }, `'${entryType}' entries should be observable.`) >+ } >+} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt >index df46af53fd74b6b04b86738bc2107b5265991ac6..0dc5926a0d57c70e80300f47ae5e10b925085187 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt >@@ -1,3 +1,4 @@ > >-FAIL supportedEntryTypes contains 'resource'. assert_unreached: supportedEntryTypes is not supported. Reached unreachable code >+PASS supportedEntryTypes contains 'resource'. >+PASS 'resource' entries should be observable. > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0298bebb74dbd51d23642f8aedc45239ec360807 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS supportedEntryTypes contains 'mark' and 'measure'. >+PASS 'mark' entries should be observable. >+PASS 'measure' entries should be observable. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.html b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.js b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ea3b2fe9dc90f70f3998a94a1460460b8b8b5992 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.js >@@ -0,0 +1,37 @@ >+test(() => { >+ if (typeof PerformanceObserver.supportedEntryTypes === "undefined") >+ assert_unreached("supportedEntryTypes is not supported."); >+ const types = PerformanceObserver.supportedEntryTypes; >+ assert_true(types.includes("mark"), >+ "There should be 'mark' in PerformanceObserver.supportedEntryTypes"); >+ assert_true(types.includes("measure"), >+ "There should be 'measure' in PerformanceObserver.supportedEntryTypes"); >+ assert_greater_than(types.indexOf("measure"), types.indexOf('mark'), >+ "The 'measure' entry should appear after the 'mark' entry"); >+}, "supportedEntryTypes contains 'mark' and 'measure'."); >+ >+if (typeof PerformanceObserver.supportedEntryTypes !== "undefined") { >+ const entryTypes = { >+ "mark": () => { >+ performance.mark('foo'); >+ }, >+ "measure": () => { >+ performance.measure('bar'); >+ } >+ } >+ for (let entryType in entryTypes) { >+ if (PerformanceObserver.supportedEntryTypes.includes(entryType)) { >+ promise_test(async() => { >+ await new Promise((resolve) => { >+ new PerformanceObserver(function (list, observer) { >+ observer.disconnect(); >+ resolve(); >+ }).observe({entryTypes: [entryType]}); >+ >+ // Force the PerformanceEntry. >+ entryTypes[entryType](); >+ }) >+ }, `'${entryType}' entries should be observable.`) >+ } >+ } >+} >diff --git a/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0298bebb74dbd51d23642f8aedc45239ec360807 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.worker-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS supportedEntryTypes contains 'mark' and 'measure'. >+PASS 'mark' entries should be observable. >+PASS 'measure' entries should be observable. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/user-timing/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/user-timing/w3c-import.log >index 32703cdabf1575d8200db40112c96b3a6f83125e..a9f3ec8d1ff1c5395c89b383d27b9c2639ad87f6 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/user-timing/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/user-timing/w3c-import.log >@@ -1,7 +1,7 @@ > The tests in this directory were imported from the W3C repository. > Do NOT modify these tests directly in WebKit. > Instead, create a pull request on the WPT github: >- https://github.com/w3c/web-platform-tests >+ https://github.com/web-platform-tests/wpt > > Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport > >@@ -32,4 +32,5 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_exceptions_navigation_timing.html > /LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_navigation_timing.html > /LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_syntax_err.any.js >+/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.js > /LayoutTests/imported/w3c/web-platform-tests/user-timing/user_timing_exists.any.js
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193428
:
359123
|
359125
|
359128
|
359129
|
359167
|
359492
|
359518
|
359519