WebKit Bugzilla
Attachment 359518 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-20190118141009.patch (text/plain), 19.88 KB, created by
cvazac
on 2019-01-18 12:10:10 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cvazac
Created:
2019-01-18 12:10:10 PST
Size:
19.88 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..0570561ba1a88685c4c473ecc290fc117eefcf56 100644 >--- a/LayoutTests/imported/w3c/resources/import-expectations.json >+++ b/LayoutTests/imported/w3c/resources/import-expectations.json >@@ -356,4 +356,4 @@ > "web-platform-tests/worklets": "skip", > "web-platform-tests/x-frame-options": "skip", > "web-platform-tests/xhr": "import" >-} >\ No newline at end of file >+} >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/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/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/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