Changeset 240454 in webkit


Ignore:
Timestamp:
Jan 24, 2019 4:04:52 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Implement PerformanceObserver.supportedEntryTypes
https://bugs.webkit.org/show_bug.cgi?id=193428

LayoutTests/imported/w3c:

Patch by Charles Vazac <cvazac@akamai.com> on 2019-01-24
Reviewed by Joseph Pecoraro.

  • web-platform-tests/resource-timing/supported_resource_type.any-expected.txt:
  • web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt:

Source/WebCore:

PerformanceObserver.supportedEntryTypes should return an array of
entryTypes that can be observed per specification
https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute

Patch by Charles Vazac <cvazac@akamai.com> on 2019-01-24
Reviewed by Joseph Pecoraro.

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:
Location:
trunk
Files:
19 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r240334 r240454  
     12019-01-24  Charles Vazac  <cvazac@akamai.com>
     2
     3        Implement PerformanceObserver.supportedEntryTypes
     4        https://bugs.webkit.org/show_bug.cgi?id=193428
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * web-platform-tests/resource-timing/supported_resource_type.any-expected.txt:
     9        * web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt:
     10
    1112019-01-23  Oriol Brufau  <obrufau@igalia.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt

    r239959 r240454  
    11
    2 FAIL supportedEntryTypes contains 'resource'. assert_unreached: supportedEntryTypes is not supported. Reached unreachable code
     2PASS supportedEntryTypes contains 'resource'.
     3PASS 'resource' entries should be observable.
    34
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js

    r239959 r240454  
    55    "There should be an entry 'resource' in PerformanceObserver.supportedEntryTypes");
    66}, "supportedEntryTypes contains 'resource'.");
     7
     8if (typeof PerformanceObserver.supportedEntryTypes !== "undefined") {
     9  const entryType = "resource";
     10  if (PerformanceObserver.supportedEntryTypes.includes(entryType)) {
     11    promise_test(async() => {
     12      await new Promise((resolve) => {
     13        new PerformanceObserver(function (list, observer) {
     14          observer.disconnect();
     15          resolve();
     16        }).observe({entryTypes: [entryType]});
     17
     18        // Force the PerformanceEntry.
     19        // Use `self` for Workers.
     20        fetch(self.location.href + "?" + Math.random());
     21      })
     22    }, `'${entryType}' entries should be observable.`)
     23  }
     24}
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt

    r239959 r240454  
    11
    2 FAIL supportedEntryTypes contains 'resource'. assert_unreached: supportedEntryTypes is not supported. Reached unreachable code
     2PASS supportedEntryTypes contains 'resource'.
     3PASS 'resource' entries should be observable.
    34
  • trunk/LayoutTests/imported/w3c/web-platform-tests/user-timing/w3c-import.log

    r216354 r240454  
    22Do NOT modify these tests directly in WebKit.
    33Instead, create a pull request on the WPT github:
    4         https://github.com/w3c/web-platform-tests
     4        https://github.com/web-platform-tests/wpt
    55
    66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
     
    3333/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_navigation_timing.html
    3434/LayoutTests/imported/w3c/web-platform-tests/user-timing/measure_syntax_err.any.js
     35/LayoutTests/imported/w3c/web-platform-tests/user-timing/supported-usertiming-types.any.js
    3536/LayoutTests/imported/w3c/web-platform-tests/user-timing/user_timing_exists.any.js
  • trunk/Source/WebCore/ChangeLog

    r240453 r240454  
     12019-01-24  Charles Vazac  <cvazac@akamai.com>
     2
     3        Implement PerformanceObserver.supportedEntryTypes
     4        https://bugs.webkit.org/show_bug.cgi?id=193428
     5
     6        PerformanceObserver.supportedEntryTypes should return an array of
     7        entryTypes that can be observed per specification
     8        https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
     9
     10        Reviewed by Joseph Pecoraro.
     11
     12        This is covered by web-platform-tests
     13        LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
     14
     15        * page/PerformanceObserver.cpp:
     16        (WebCore::PerformanceObserver::supportedEntryTypes):
     17        * page/PerformanceObserver.h:
     18        * page/PerformanceObserver.idl:
     19
    1202019-01-24  Truitt Savell  <tsavell@apple.com>
    221
  • trunk/Source/WebCore/page/PerformanceObserver.cpp

    r239397 r240454  
    114114}
    115115
     116Vector<String> PerformanceObserver::supportedEntryTypes()
     117{
     118    return {
     119        // FIXME: <https://webkit.org/b/184363> Add support for Navigation Timing Level 2
     120        // "navigation"_s,
     121        "mark"_s,
     122        "measure"_s,
     123        "resource"_s
     124    };
     125}
     126
    116127} // namespace WebCore
  • trunk/Source/WebCore/page/PerformanceObserver.h

    r233053 r240454  
    5050    }
    5151
     52    static Vector<String> supportedEntryTypes();
     53
    5254    void disassociate();
    5355
  • trunk/Source/WebCore/page/PerformanceObserver.idl

    r233053 r240454  
    3737    [MayThrowException] void observe(PerformanceObserverInit options);
    3838    void disconnect();
     39    static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
    3940};
    4041
Note: See TracChangeset for help on using the changeset viewer.