haikuwebkit/LayoutTests/performance-api/performance-timeline-api-ex...

90 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

Implement PerformanceObserver https://bugs.webkit.org/show_bug.cgi?id=167546 <rdar://problem/30247959> Reviewed by Ryosuke Niwa. Source/JavaScriptCore: * runtime/CommonIdentifiers.h: Source/WebCore: This implements PerformanceObserver from Performance Timeline Level 2: https://w3c.github.io/performance-timeline/ Tests: performance-api/performance-observer-api.html performance-api/performance-observer-basic.html performance-api/performance-observer-callback-mutate.html performance-api/performance-observer-callback-task.html performance-api/performance-observer-entry-sort.html performance-api/performance-observer-exception.html performance-api/performance-observer-nested.html performance-api/performance-observer-order.html performance-api/performance-observer-periodic.html performance-api/performance-timeline-api.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: New files. * page/Performance.h: * page/Performance.cpp: (WebCore::Performance::mark): (WebCore::Performance::measure): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::unregisterPerformanceObserver): (WebCore::Performance::queueEntry): Register PerformanceObservers with the Performance object. When new PerformanceEntries are created (Mark and Measure right now) check them against observers. * page/PerformanceEntry.cpp: (WebCore::PerformanceEntry::PerformanceEntry): (WebCore::PerformanceEntry::typeForEntryTypeString): * page/PerformanceEntry.h: (WebCore::PerformanceEntry::type): Give PerformanceEntry a convenience enum for easy comparison and to know if it is one of the built-in known types (which the PerformanceObserver API takes into account). * page/PerformanceObserver.cpp: Added. (WebCore::PerformanceObserver::PerformanceObserver): (WebCore::PerformanceObserver::observe): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::queueEntry): (WebCore::PerformanceObserver::deliver): * page/PerformanceObserver.h: (WebCore::PerformanceObserver::create): (WebCore::PerformanceObserver::typeFilter): - TypeErrors on observe bad behavior - Completely replace types filter on observe - Handle register and unregister - Handle calling the callback * page/PerformanceObserverCallback.idl: Added. * page/PerformanceObserverEntryList.cpp: Added. (WebCore::PerformanceObserverEntryList::PerformanceObserverEntryList): (WebCore::PerformanceObserverEntryList::getEntries): (WebCore::PerformanceObserverEntryList::getEntriesByType): (WebCore::PerformanceObserverEntryList::getEntriesByName): * page/PerformanceObserverEntryList.h: (WebCore::PerformanceObserverEntryList::create): * page/PerformanceObserverEntryList.idl: Added. Implement sorting and filtering of entries. * page/PerformanceObserver.idl: Added. * page/PerformanceObserverCallback.h: (WebCore::PerformanceObserverCallback::~PerformanceObserverCallback): Mostly autogenerated. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): (WebCore::UserTiming::measure): * page/PerformanceUserTiming.h: Update these to return the entry so it can be passed on to any interested PerformanceObservers. Source/WebInspectorUI: * UserInterface/Models/NativeFunctionParameters.js: Improve API view display of built-in performance methods. LayoutTests: * performance-api/performance-observer-api-expected.txt: Added. * performance-api/performance-observer-api.html: Added. * performance-api/performance-observer-basic-expected.txt: Added. * performance-api/performance-observer-basic.html: Added. * performance-api/performance-observer-callback-mutate-expected.txt: Added. * performance-api/performance-observer-callback-mutate.html: Added. * performance-api/performance-observer-callback-task-expected.txt: Added. * performance-api/performance-observer-callback-task.html: Added. * performance-api/performance-observer-entry-sort-expected.txt: Added. * performance-api/performance-observer-entry-sort.html: Added. * performance-api/performance-observer-exception-expected.txt: Added. * performance-api/performance-observer-exception.html: Added. * performance-api/performance-observer-nested-expected.txt: Added. * performance-api/performance-observer-nested.html: Added. * performance-api/performance-observer-order-expected.txt: Added. * performance-api/performance-observer-order.html: Added. * performance-api/performance-observer-periodic-expected.txt: Added. * performance-api/performance-observer-periodic.html: Added. PerformanceObserver tests. * performance-api/performance-timeline-api-expected.txt: Added. * performance-api/performance-timeline-api.html: Added. Performance timeline tests. * platform/efl/js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/js/dom/global-constructors-attributes-expected.txt: New global constructors. Canonical link: https://commits.webkit.org/184646@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-31 06:21:35 +00:00
Basic Interface test for performance-timeline APIs.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PerformanceEntry
PASS PerformanceEntry is defined.
PASS "name" in PerformanceEntry.prototype is true
PASS "entryType" in PerformanceEntry.prototype is true
PASS "startTime" in PerformanceEntry.prototype is true
PASS "duration" in PerformanceEntry.prototype is true
JSDOMConstructorNotConstructable should be a constructor https://bugs.webkit.org/show_bug.cgi?id=215554 <rdar://problem/65770688> Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/FileAPI/file/send-file-form-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-iso-2022-jp.tentative-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-utf-8-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-windows-1252.tentative-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-x-user-defined.tentative-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-baseURL.tentative-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disabled-regular-sheet-insertion-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-modify-after-removal-expected.txt: * web-platform-tests/custom-elements/Document-createElement-expected.txt: * web-platform-tests/custom-elements/Document-createElementNS-expected.txt: * web-platform-tests/custom-elements/HTMLElement-attachInternals-expected.txt: * web-platform-tests/custom-elements/HTMLElement-constructor-expected.txt: * web-platform-tests/custom-elements/builtin-coverage-expected.txt: * web-platform-tests/custom-elements/customized-built-in-constructor-exceptions-expected.txt: * web-platform-tests/custom-elements/htmlconstructor/newtarget-expected.txt: * web-platform-tests/custom-elements/parser/serializing-html-fragments-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLAreaElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLBaseElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLButtonElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLCanvasElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLDataElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLDetailsElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLEmbedElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLFieldSetElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLImageElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLLIElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLLabelElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMapElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMediaElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMetaElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMeterElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLModElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLOListElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLOptGroupElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLParamElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLProgressElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLQuoteElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLSlotElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLStyleElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLTableCellElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLTableColElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLTimeElement-expected.txt: * web-platform-tests/custom-elements/upgrading/Document-importNode-expected.txt: * web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt: * web-platform-tests/dom/nodes/Node-appendChild-cereactions-vs-script.window-expected.txt: * web-platform-tests/html/editing/dnd/datastore/datatransfer-constructor-001-expected.txt: * web-platform-tests/html/editing/dnd/datastore/datatransfer-types-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-0/submit-file.sub-expected.txt: * web-platform-tests/service-workers/service-worker/data-transfer-files.https-expected.txt: * web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt: * web-platform-tests/user-timing/mark-entry-constructor.any-expected.txt: * web-platform-tests/user-timing/mark-entry-constructor.any.worker-expected.txt: * web-platform-tests/user-timing/structured-serialize-detail.any-expected.txt: * web-platform-tests/user-timing/structured-serialize-detail.any.worker-expected.txt: * web-platform-tests/webrtc/RTCIceTransport-extension.https-expected.txt: Source/WebCore: Test: js/dom/window-is-constructor.html While JSDOMConstructorNotConstructable throws an error, still it should be a constructor, which means, `IsConstructor(JSDOMConstructorNotConstructable)` should be true. To fix it, we add getConstructData which configures a function throwing an error. * bindings/js/JSDOMConstructorNotConstructable.h: LayoutTests: * editing/async-clipboard/clipboard-interfaces-expected.txt: * editing/undo-manager/undo-manager-interfaces-expected.txt: * fast/dom/MutationObserver/mutation-record-constructor-expected.txt: * http/wpt/html/browsers/the-window-object/window-is-constructor-expected.txt: Added. * http/wpt/html/browsers/the-window-object/window-is-constructor.html: Added. * js/interface-objects-expected.txt: * performance-api/paint-timing/paint-timing-apis-expected.txt: * performance-api/performance-observer-api-expected.txt: * performance-api/performance-timeline-api-expected.txt: * performance-api/resource-timing-apis-expected.txt: * performance-api/user-timing-apis-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLInputElement-expected.txt: * platform/mac-wk2/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt: Canonical link: https://commits.webkit.org/228320@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-17 07:37:12 +00:00
PASS new PerformanceEntry() threw exception TypeError: Illegal constructor.
Implement PerformanceObserver https://bugs.webkit.org/show_bug.cgi?id=167546 <rdar://problem/30247959> Reviewed by Ryosuke Niwa. Source/JavaScriptCore: * runtime/CommonIdentifiers.h: Source/WebCore: This implements PerformanceObserver from Performance Timeline Level 2: https://w3c.github.io/performance-timeline/ Tests: performance-api/performance-observer-api.html performance-api/performance-observer-basic.html performance-api/performance-observer-callback-mutate.html performance-api/performance-observer-callback-task.html performance-api/performance-observer-entry-sort.html performance-api/performance-observer-exception.html performance-api/performance-observer-nested.html performance-api/performance-observer-order.html performance-api/performance-observer-periodic.html performance-api/performance-timeline-api.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: New files. * page/Performance.h: * page/Performance.cpp: (WebCore::Performance::mark): (WebCore::Performance::measure): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::unregisterPerformanceObserver): (WebCore::Performance::queueEntry): Register PerformanceObservers with the Performance object. When new PerformanceEntries are created (Mark and Measure right now) check them against observers. * page/PerformanceEntry.cpp: (WebCore::PerformanceEntry::PerformanceEntry): (WebCore::PerformanceEntry::typeForEntryTypeString): * page/PerformanceEntry.h: (WebCore::PerformanceEntry::type): Give PerformanceEntry a convenience enum for easy comparison and to know if it is one of the built-in known types (which the PerformanceObserver API takes into account). * page/PerformanceObserver.cpp: Added. (WebCore::PerformanceObserver::PerformanceObserver): (WebCore::PerformanceObserver::observe): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::queueEntry): (WebCore::PerformanceObserver::deliver): * page/PerformanceObserver.h: (WebCore::PerformanceObserver::create): (WebCore::PerformanceObserver::typeFilter): - TypeErrors on observe bad behavior - Completely replace types filter on observe - Handle register and unregister - Handle calling the callback * page/PerformanceObserverCallback.idl: Added. * page/PerformanceObserverEntryList.cpp: Added. (WebCore::PerformanceObserverEntryList::PerformanceObserverEntryList): (WebCore::PerformanceObserverEntryList::getEntries): (WebCore::PerformanceObserverEntryList::getEntriesByType): (WebCore::PerformanceObserverEntryList::getEntriesByName): * page/PerformanceObserverEntryList.h: (WebCore::PerformanceObserverEntryList::create): * page/PerformanceObserverEntryList.idl: Added. Implement sorting and filtering of entries. * page/PerformanceObserver.idl: Added. * page/PerformanceObserverCallback.h: (WebCore::PerformanceObserverCallback::~PerformanceObserverCallback): Mostly autogenerated. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): (WebCore::UserTiming::measure): * page/PerformanceUserTiming.h: Update these to return the entry so it can be passed on to any interested PerformanceObservers. Source/WebInspectorUI: * UserInterface/Models/NativeFunctionParameters.js: Improve API view display of built-in performance methods. LayoutTests: * performance-api/performance-observer-api-expected.txt: Added. * performance-api/performance-observer-api.html: Added. * performance-api/performance-observer-basic-expected.txt: Added. * performance-api/performance-observer-basic.html: Added. * performance-api/performance-observer-callback-mutate-expected.txt: Added. * performance-api/performance-observer-callback-mutate.html: Added. * performance-api/performance-observer-callback-task-expected.txt: Added. * performance-api/performance-observer-callback-task.html: Added. * performance-api/performance-observer-entry-sort-expected.txt: Added. * performance-api/performance-observer-entry-sort.html: Added. * performance-api/performance-observer-exception-expected.txt: Added. * performance-api/performance-observer-exception.html: Added. * performance-api/performance-observer-nested-expected.txt: Added. * performance-api/performance-observer-nested.html: Added. * performance-api/performance-observer-order-expected.txt: Added. * performance-api/performance-observer-order.html: Added. * performance-api/performance-observer-periodic-expected.txt: Added. * performance-api/performance-observer-periodic.html: Added. PerformanceObserver tests. * performance-api/performance-timeline-api-expected.txt: Added. * performance-api/performance-timeline-api.html: Added. Performance timeline tests. * platform/efl/js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/js/dom/global-constructors-attributes-expected.txt: New global constructors. Canonical link: https://commits.webkit.org/184646@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-31 06:21:35 +00:00
Performance extensions
PASS Performance.prototype.getEntries is defined.
PASS Performance.prototype.getEntriesByType is defined.
PASS Performance.prototype.getEntriesByName is defined.
PASS performance.getEntries() instanceof Array is true
PASS performance.getEntries().length === 1 is true
Add support for Navigation Timing Level 2 https://bugs.webkit.org/show_bug.cgi?id=184363 Reviewed by Ryosuke Niwa. LayoutTests/imported/w3c: * web-platform-tests/navigation-timing/META.yml: Added. * web-platform-tests/navigation-timing/dom_interactive_image_document-expected.txt: Added. * web-platform-tests/navigation-timing/dom_interactive_image_document.html: Added. * web-platform-tests/navigation-timing/dom_interactive_media_document-expected.txt: Added. * web-platform-tests/navigation-timing/dom_interactive_media_document.html: Added. * web-platform-tests/navigation-timing/idlharness.window.js: * web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_attributes_exist.html: Added. This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl * web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_attributes_values.html: Added. This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl * web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt: * web-platform-tests/navigation-timing/nav2_test_document_open.html: * web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt: * web-platform-tests/navigation-timing/nav2_test_document_replaced.html: * web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt: * web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt: * web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html: * web-platform-tests/navigation-timing/nav2_test_instance_accessors-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_instance_accessors.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_iframe-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html: * web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html: * web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html: * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin-expected.txt: Added. This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html: Copied from LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt: This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html: * web-platform-tests/navigation-timing/nav2_test_redirect_none-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_redirect_none.html: Added. * web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt: This test failure needs further investigation. * web-platform-tests/navigation-timing/nav2_test_redirect_server.html: * web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt: This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html: * web-platform-tests/navigation-timing/nav2_test_unique_nav_instances-expected.txt: Added. This test failure needs further investigation. * web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html: Added. * web-platform-tests/navigation-timing/po-navigation-expected.txt: Added. * web-platform-tests/navigation-timing/po-navigation.html: Added. * web-platform-tests/navigation-timing/resources/webperftestharness.js: (test_namespace): (test_attribute_exists): (test_enum): * web-platform-tests/navigation-timing/secure-connection-start-reuse.https-expected.txt: Added. * web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html: Added. * web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: This test has been marked as flaky. It needs to be fixed to not rely on no initial connection reuse. * web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt: * web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt: * web-platform-tests/navigation-timing/test_document_onload-expected.txt: Added. * web-platform-tests/navigation-timing/test_document_onload.html: Added. This test failure needs further investigation. * web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt: * web-platform-tests/navigation-timing/unload-event-same-origin-check.html: * web-platform-tests/performance-timeline/META.yml: Added. * web-platform-tests/performance-timeline/buffered-flag-after-timeout.any.js: Added. (async_test.t.t.step_timeout): * web-platform-tests/performance-timeline/buffered-flag-observer.any.js: Added. * web-platform-tests/performance-timeline/get-invalid-entries-expected.txt: Added. * web-platform-tests/performance-timeline/get-invalid-entries.html: Added. * web-platform-tests/performance-timeline/idlharness.any.js: Added. (async idl_array): * web-platform-tests/performance-timeline/multiple-buffered-flag-observers.any.js: Added. (promise_test): * web-platform-tests/performance-timeline/not-clonable-expected.txt: Added. * web-platform-tests/performance-timeline/not-clonable.html: Added. * web-platform-tests/performance-timeline/observer-buffered-false.any.js: Added. (async_test.t.t.step_timeout): * web-platform-tests/performance-timeline/performanceentry-tojson.any.js: Added. (test): * web-platform-tests/performance-timeline/po-callback-mutate.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-disconnect-removes-observed-types.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-disconnect.any.js: Added. (async_test): (test): * web-platform-tests/performance-timeline/po-entries-sort.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-getentries.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-mark-measure.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-observe-expected.txt: Added. * web-platform-tests/performance-timeline/po-observe-repeated-type.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-observe.html: Added. * web-platform-tests/performance-timeline/po-resource-expected.txt: Added. * web-platform-tests/performance-timeline/po-resource.html: Added. * web-platform-tests/performance-timeline/po-takeRecords.any.js: Added. (async_test): * web-platform-tests/performance-timeline/resources/postmessage-entry.html: Added. * web-platform-tests/performance-timeline/resources/worker-invalid-entries.js: Added. * web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js: Added. (catch): * web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt: This test failure needs further investigation. It's a bindings generation problem I've unsuccessfully looked into before. * web-platform-tests/performance-timeline/supportedEntryTypes.any.js: (test): * web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt: * web-platform-tests/performance-timeline/webtiming-resolution.any.js: Added. (testTimeResolution): (timeByUserTiming): * web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt: Added. * web-platform-tests/performance-timeline/worker-with-performance-observer.html: Added. * web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt: This existing test failure needs more investigation. We are probably close to a fix after this patch. Source/WebCore: This is basically just a new shape for exposing the same data as window.performance.navigation, but with a shape that fits better into the rest of the performance timeline measurements that have been added to the web platform since performance.navigation. I noted that exposing transfer size is problematic, and some of the tests for reading transfer size still fail. There are still a few relatively minor test failures to fix in future patches. Each one is annotated in the LayoutTests ChangeLogs. Tests: imported/w3c/web-platform-tests/navigation-timing/dom_interactive_image_document.html imported/w3c/web-platform-tests/navigation-timing/dom_interactive_media_document.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_exist.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_instance_accessors.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_none.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html imported/w3c/web-platform-tests/navigation-timing/po-navigation.html imported/w3c/web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html imported/w3c/web-platform-tests/navigation-timing/test_document_onload.html imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html imported/w3c/web-platform-tests/performance-timeline/not-clonable.html imported/w3c/web-platform-tests/performance-timeline/po-observe.html imported/w3c/web-platform-tests/performance-timeline/po-resource.html imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPerformanceEntryCustom.cpp: (WebCore::toJSNewlyCreated): * dom/Document.cpp: (WebCore::Document::setReadyState): Sometimes the ready state jumps right to Complete without hitting Interactive along the way. When this happens, we want to mark both m_documentTiming.domComplete and m_documentTiming.domInteractive. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::notifyFinished): Call addNavigationTiming in notifyFinished to create the navigation timing object when we are done navigating * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didFinishLoading): * loader/ResourceLoader.h: * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::fromLoad): Add a URL parameter. Sometimes we need to use the request's URL and sometimes the response's. Different specs written at different times. (WebCore::ResourceTiming::populateServerTiming const): (WebCore::ResourceTiming::populateServerTiming): Deleted. * loader/ResourceTiming.h: (WebCore::ResourceTiming::url const): (WebCore::ResourceTiming::initiator const): (WebCore::ResourceTiming::loadTiming const): (WebCore::ResourceTiming::networkLoadMetrics const): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::reportResourceTiming): * page/Performance.cpp: (WebCore::Performance::getEntries const): (WebCore::Performance::getEntriesByType const): (WebCore::Performance::getEntriesByName const): (WebCore::Performance::appendBufferedEntriesByType const): (WebCore::Performance::addNavigationTiming): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::queueEntry): (WebCore::Performance::scheduleTaskIfNeeded): * page/Performance.h: * page/PerformanceEntry.h: (WebCore::PerformanceEntry::startTime const): (WebCore::PerformanceEntry::duration const): (WebCore::PerformanceEntry::isResource const): Deleted. (WebCore::PerformanceEntry::isMark const): Deleted. (WebCore::PerformanceEntry::isMeasure const): Deleted. (WebCore::PerformanceEntry::isPaint const): Deleted. * page/PerformanceMark.h: (isType): Deleted. SPECIALIZE_TYPE_TRAITS_BEGIN/END doesn't work well with PerformanceNavigationTiming which inherits from PerformanceResourceTiming which both have distinct types. is<PerformanceResourceTiming> doesn't give us the info we need. I replaced that with "switch (entry->performanceEntryType())" in the one place it's used, and it works like a charm. Also renamed type to performanceEntryType so it doesn't conflict with PerformanceNavigationTiming::type, which is specified in the idl. * page/PerformanceMeasure.h: (isType): Deleted. * page/PerformanceNavigationTiming.cpp: Added. (WebCore::toPerformanceNavigationTimingNavigationType): (WebCore::PerformanceNavigationTiming::PerformanceNavigationTiming): (WebCore::PerformanceNavigationTiming::millisecondsSinceOrigin const): (WebCore::PerformanceNavigationTiming::sameOriginCheckFails const): (WebCore::PerformanceNavigationTiming::unloadEventStart const): (WebCore::PerformanceNavigationTiming::unloadEventEnd const): (WebCore::PerformanceNavigationTiming::domInteractive const): (WebCore::PerformanceNavigationTiming::domContentLoadedEventStart const): (WebCore::PerformanceNavigationTiming::domContentLoadedEventEnd const): (WebCore::PerformanceNavigationTiming::domComplete const): (WebCore::PerformanceNavigationTiming::loadEventStart const): (WebCore::PerformanceNavigationTiming::loadEventEnd const): (WebCore::PerformanceNavigationTiming::type const): (WebCore::PerformanceNavigationTiming::redirectCount const): (WebCore::PerformanceNavigationTiming::startTime const): (WebCore::PerformanceNavigationTiming::duration const): * page/PerformanceNavigationTiming.h: Added. * page/PerformanceNavigationTiming.idl: Copied from Source/WebCore/page/PerformanceObserver.idl. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::takeRecords): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::deliver): (WebCore::PerformanceObserver::supportedEntryTypes): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.cpp: (WebCore::PerformanceObserverEntryList::getEntriesByName const): * page/PerformancePaintTiming.h: (isType): Deleted. * page/PerformanceResourceTiming.cpp: (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): (WebCore::PerformanceResourceTiming::nextHopProtocol const): (WebCore::PerformanceResourceTiming::redirectStart const): (WebCore::PerformanceResourceTiming::redirectEnd const): (WebCore::PerformanceResourceTiming::fetchStart const): (WebCore::PerformanceResourceTiming::domainLookupStart const): (WebCore::PerformanceResourceTiming::domainLookupEnd const): (WebCore::PerformanceResourceTiming::connectStart const): (WebCore::PerformanceResourceTiming::connectEnd const): (WebCore::PerformanceResourceTiming::secureConnectionStart const): (WebCore::PerformanceResourceTiming::requestStart const): (WebCore::PerformanceResourceTiming::responseStart const): (WebCore::PerformanceResourceTiming::responseEnd const): (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp const): * page/PerformanceResourceTiming.h: (WebCore::PerformanceResourceTiming::initiatorType const): (isType): Deleted. * page/PerformanceResourceTiming.idl: * platform/network/BlobResourceHandle.cpp: (WebCore::doNotifyFinish): * platform/network/NetworkLoadMetrics.h: * platform/network/ResourceHandleClient.h: (WebCore::ResourceHandleClient::didFinishLoading): * platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::didFinishLoading): * platform/network/SynchronousLoaderClient.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading): Pass metrics including the response end time from NSURLConnection so we don't assert in WebKitLegacy. * platform/network/cocoa/NetworkLoadMetrics.mm: (WebCore::copyTimingData): Use currentRequest instead of passing in the response so we can call it from didFinishLoading, where we don't have a response stored anywhere. We're just looking for whether it's http or https, so the currentRequest (which is the request after all the redirects) fits our purpose. * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::handleDataURL): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]): Source/WebKit: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Mark reused TLS connections in complete metrics like I did in incomplete metrics in r277493. Source/WebKitLegacy: * WebCoreSupport/PingHandle.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * TestExpectations: Annoyingly secure_connection_start_non_zero.https.html becomes flaky with a correct implementation because it assumes that no connection is reused. However, when running this test after other tests, another connection is often reused. * performance-api/paint-timing/performance-observer-first-contentful-paint-expected.txt: * performance-api/paint-timing/performance-observer-first-contentful-paint.html: * performance-api/performance-observer-api-expected.txt: * performance-api/performance-timeline-api-expected.txt: * performance-api/resources/timeline-api.js: * platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Next hop protocol isn't implemented in ResourceHandle. That's probably no big deal because WebKitLegacy is deprecated and not used by Safari. Canonical link: https://commits.webkit.org/237930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 00:33:02 +00:00
PASS performance.mark("test"); did not throw exception.
PASS performance.getEntries().length === 2 is true
PASS performance.getEntries()[markIndex] instanceof PerformanceEntry is true
PASS performance.getEntries()[markIndex].name is "test"
PASS performance.getEntries()[markIndex].entryType is "mark"
PASS typeof performance.getEntries()[markIndex].startTime === "number" is true
PASS typeof performance.getEntries()[markIndex].duration === "number" is true
Implement PerformanceObserver https://bugs.webkit.org/show_bug.cgi?id=167546 <rdar://problem/30247959> Reviewed by Ryosuke Niwa. Source/JavaScriptCore: * runtime/CommonIdentifiers.h: Source/WebCore: This implements PerformanceObserver from Performance Timeline Level 2: https://w3c.github.io/performance-timeline/ Tests: performance-api/performance-observer-api.html performance-api/performance-observer-basic.html performance-api/performance-observer-callback-mutate.html performance-api/performance-observer-callback-task.html performance-api/performance-observer-entry-sort.html performance-api/performance-observer-exception.html performance-api/performance-observer-nested.html performance-api/performance-observer-order.html performance-api/performance-observer-periodic.html performance-api/performance-timeline-api.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: New files. * page/Performance.h: * page/Performance.cpp: (WebCore::Performance::mark): (WebCore::Performance::measure): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::unregisterPerformanceObserver): (WebCore::Performance::queueEntry): Register PerformanceObservers with the Performance object. When new PerformanceEntries are created (Mark and Measure right now) check them against observers. * page/PerformanceEntry.cpp: (WebCore::PerformanceEntry::PerformanceEntry): (WebCore::PerformanceEntry::typeForEntryTypeString): * page/PerformanceEntry.h: (WebCore::PerformanceEntry::type): Give PerformanceEntry a convenience enum for easy comparison and to know if it is one of the built-in known types (which the PerformanceObserver API takes into account). * page/PerformanceObserver.cpp: Added. (WebCore::PerformanceObserver::PerformanceObserver): (WebCore::PerformanceObserver::observe): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::queueEntry): (WebCore::PerformanceObserver::deliver): * page/PerformanceObserver.h: (WebCore::PerformanceObserver::create): (WebCore::PerformanceObserver::typeFilter): - TypeErrors on observe bad behavior - Completely replace types filter on observe - Handle register and unregister - Handle calling the callback * page/PerformanceObserverCallback.idl: Added. * page/PerformanceObserverEntryList.cpp: Added. (WebCore::PerformanceObserverEntryList::PerformanceObserverEntryList): (WebCore::PerformanceObserverEntryList::getEntries): (WebCore::PerformanceObserverEntryList::getEntriesByType): (WebCore::PerformanceObserverEntryList::getEntriesByName): * page/PerformanceObserverEntryList.h: (WebCore::PerformanceObserverEntryList::create): * page/PerformanceObserverEntryList.idl: Added. Implement sorting and filtering of entries. * page/PerformanceObserver.idl: Added. * page/PerformanceObserverCallback.h: (WebCore::PerformanceObserverCallback::~PerformanceObserverCallback): Mostly autogenerated. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): (WebCore::UserTiming::measure): * page/PerformanceUserTiming.h: Update these to return the entry so it can be passed on to any interested PerformanceObservers. Source/WebInspectorUI: * UserInterface/Models/NativeFunctionParameters.js: Improve API view display of built-in performance methods. LayoutTests: * performance-api/performance-observer-api-expected.txt: Added. * performance-api/performance-observer-api.html: Added. * performance-api/performance-observer-basic-expected.txt: Added. * performance-api/performance-observer-basic.html: Added. * performance-api/performance-observer-callback-mutate-expected.txt: Added. * performance-api/performance-observer-callback-mutate.html: Added. * performance-api/performance-observer-callback-task-expected.txt: Added. * performance-api/performance-observer-callback-task.html: Added. * performance-api/performance-observer-entry-sort-expected.txt: Added. * performance-api/performance-observer-entry-sort.html: Added. * performance-api/performance-observer-exception-expected.txt: Added. * performance-api/performance-observer-exception.html: Added. * performance-api/performance-observer-nested-expected.txt: Added. * performance-api/performance-observer-nested.html: Added. * performance-api/performance-observer-order-expected.txt: Added. * performance-api/performance-observer-order.html: Added. * performance-api/performance-observer-periodic-expected.txt: Added. * performance-api/performance-observer-periodic.html: Added. PerformanceObserver tests. * performance-api/performance-timeline-api-expected.txt: Added. * performance-api/performance-timeline-api.html: Added. Performance timeline tests. * platform/efl/js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/js/dom/global-constructors-attributes-expected.txt: New global constructors. Canonical link: https://commits.webkit.org/184646@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-31 06:21:35 +00:00
PASS performance.getEntriesByType() threw exception TypeError: Not enough arguments.
PASS performance.getEntriesByType("not-real").length === 0 is true
PASS performance.getEntriesByType("mark").length === 1 is true
PASS performance.getEntriesByType("mark")[0] instanceof PerformanceEntry is true
PASS performance.getEntriesByType("mark")[0].name is "test"
PASS performance.getEntriesByType("mark")[0].entryType is "mark"
PASS typeof performance.getEntriesByType("mark")[0].startTime === "number" is true
PASS typeof performance.getEntriesByType("mark")[0].duration === "number" is true
PASS performance.getEntriesByName() threw exception TypeError: Not enough arguments.
PASS performance.getEntriesByName("not-real").length === 0 is true
PASS performance.getEntriesByName("test").length === 1 is true
PASS performance.getEntriesByName("test")[0] instanceof PerformanceEntry is true
PASS performance.getEntriesByName("test")[0].name is "test"
PASS performance.getEntriesByName("test")[0].entryType is "mark"
PASS typeof performance.getEntriesByName("test")[0].startTime === "number" is true
PASS typeof performance.getEntriesByName("test")[0].duration === "number" is true
PASS performance.getEntriesByName("test", "not-real").length === 0 is true
PASS performance.getEntriesByName("test", "mark").length === 1 is true
Support Performance API (performance.now(), UserTiming) in Workers https://bugs.webkit.org/show_bug.cgi?id=167717 Reviewed by Ryosuke Niwa. Source/WebCore: Tests: performance-api/performance-mark-name.html performance-api/performance-now-api.html performance-api/performance-now-time-origin-in-worker.html performance-api/user-timing-apis.html * CMakeLists.txt: * DerivedSources.make: New files. * page/DOMWindow.idl: * page/GlobalPerformance.idl: * workers/WorkerGlobalScope.idl: Add partial interface for performance attribute. * page/Performance.idl: * page/PerformanceEntry.idl: * page/PerformanceMark.idl: * page/PerformanceMeasure.idl: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.idl: Expose these to Workers. * page/Performance.cpp: (WebCore::Performance::Performance): (WebCore::Performance::contextDestroyed): * page/Performance.h: Use the EventQueue variant that works with any ScriptExectionContext. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::PerformanceObserver): Get the Performance base in a Worker context. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): Only reject legacy special mark names in a Window, not a Worker. (WebCore::UserTiming::findExistingMarkStartTime): Simple implementation returns 0 as the start time in Workers. The spec is currently imprecise here, but it does not have the unusual PerformanceTiming behavior in a Window which is part of User Timing 1. * workers/Worker.cpp: (WebCore::Worker::create): (WebCore::Worker::notifyFinished): * workers/Worker.h: Record the moment of Worker creation. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::performance): * workers/WorkerGlobalScope.h: Construct the Performance object with the moment of creation (timeOrigin). * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: Pass the moment of creation (timeOrigin) through to WorkerGlobalScope creation. LayoutTests: * js/dom/global-constructors-attributes-dedicated-worker-expected.txt: Updated now that Performance classes are in Workers. * performance-api/performance-now-api-expected.txt: Added. * performance-api/performance-now-api.html: Added. * performance-api/performance-now-time-origin-in-worker-expected.txt: Added. * performance-api/performance-now-time-origin-in-worker.html: Added. New tests to cover performance.now. * performance-api/performance-mark-name-expected.txt: Added. * performance-api/performance-mark-name.html: Added. * performance-api/resources/mark-name.js: Added. * performance-api/resources/user-timing-api.js: Added. * performance-api/user-timing-apis-expected.txt: Added. * performance-api/user-timing-apis.html: Added. New tests to cover user-timing and performance.mark behavior. * performance-api/performance-observer-api-expected.txt: * performance-api/performance-observer-api.html: * performance-api/performance-observer-basic-expected.txt: * performance-api/performance-observer-basic.html: * performance-api/performance-timeline-api-expected.txt: * performance-api/performance-timeline-api.html: * performance-api/resources/now-api.js: Added. * performance-api/resources/observer-api.js: Copied from LayoutTests/performance-api/performance-observer-api.html. * performance-api/resources/observer-basic.js: Copied from LayoutTests/performance-api/performance-observer-basic.html. * performance-api/resources/time-origin-in-worker.js: Added. * performance-api/resources/timeline-api.js: Copied from LayoutTests/performance-api/performance-timeline-api.html. Update some of the existing tests to check in a Document and Worker. * imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt: Minor progression. Canonical link: https://commits.webkit.org/184803@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-02 22:07:28 +00:00
Starting worker: resources/timeline-api.js
[Worker] PerformanceEntry
PASS [Worker] PerformanceEntry is defined.
PASS [Worker] "name" in PerformanceEntry.prototype is true
PASS [Worker] "entryType" in PerformanceEntry.prototype is true
PASS [Worker] "startTime" in PerformanceEntry.prototype is true
PASS [Worker] "duration" in PerformanceEntry.prototype is true
JSDOMConstructorNotConstructable should be a constructor https://bugs.webkit.org/show_bug.cgi?id=215554 <rdar://problem/65770688> Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/FileAPI/file/send-file-form-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-iso-2022-jp.tentative-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-utf-8-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-windows-1252.tentative-expected.txt: * web-platform-tests/FileAPI/file/send-file-form-x-user-defined.tentative-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-baseURL.tentative-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disabled-regular-sheet-insertion-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-duplicate-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-constructable-expected.txt: * web-platform-tests/css/cssom/CSSStyleSheet-modify-after-removal-expected.txt: * web-platform-tests/custom-elements/Document-createElement-expected.txt: * web-platform-tests/custom-elements/Document-createElementNS-expected.txt: * web-platform-tests/custom-elements/HTMLElement-attachInternals-expected.txt: * web-platform-tests/custom-elements/HTMLElement-constructor-expected.txt: * web-platform-tests/custom-elements/builtin-coverage-expected.txt: * web-platform-tests/custom-elements/customized-built-in-constructor-exceptions-expected.txt: * web-platform-tests/custom-elements/htmlconstructor/newtarget-expected.txt: * web-platform-tests/custom-elements/parser/serializing-html-fragments-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLAreaElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLBaseElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLButtonElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLCanvasElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLDataElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLDetailsElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLEmbedElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLFieldSetElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLImageElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLLIElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLLabelElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMapElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMediaElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMetaElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLMeterElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLModElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLOListElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLOptGroupElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLParamElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLProgressElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLQuoteElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLSlotElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLStyleElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLTableCellElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLTableColElement-expected.txt: * web-platform-tests/custom-elements/reactions/HTMLTimeElement-expected.txt: * web-platform-tests/custom-elements/upgrading/Document-importNode-expected.txt: * web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt: * web-platform-tests/dom/nodes/Node-appendChild-cereactions-vs-script.window-expected.txt: * web-platform-tests/html/editing/dnd/datastore/datatransfer-constructor-001-expected.txt: * web-platform-tests/html/editing/dnd/datastore/datatransfer-types-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-0/submit-file.sub-expected.txt: * web-platform-tests/service-workers/service-worker/data-transfer-files.https-expected.txt: * web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt: * web-platform-tests/user-timing/mark-entry-constructor.any-expected.txt: * web-platform-tests/user-timing/mark-entry-constructor.any.worker-expected.txt: * web-platform-tests/user-timing/structured-serialize-detail.any-expected.txt: * web-platform-tests/user-timing/structured-serialize-detail.any.worker-expected.txt: * web-platform-tests/webrtc/RTCIceTransport-extension.https-expected.txt: Source/WebCore: Test: js/dom/window-is-constructor.html While JSDOMConstructorNotConstructable throws an error, still it should be a constructor, which means, `IsConstructor(JSDOMConstructorNotConstructable)` should be true. To fix it, we add getConstructData which configures a function throwing an error. * bindings/js/JSDOMConstructorNotConstructable.h: LayoutTests: * editing/async-clipboard/clipboard-interfaces-expected.txt: * editing/undo-manager/undo-manager-interfaces-expected.txt: * fast/dom/MutationObserver/mutation-record-constructor-expected.txt: * http/wpt/html/browsers/the-window-object/window-is-constructor-expected.txt: Added. * http/wpt/html/browsers/the-window-object/window-is-constructor.html: Added. * js/interface-objects-expected.txt: * performance-api/paint-timing/paint-timing-apis-expected.txt: * performance-api/performance-observer-api-expected.txt: * performance-api/performance-timeline-api-expected.txt: * performance-api/resource-timing-apis-expected.txt: * performance-api/user-timing-apis-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLInputElement-expected.txt: * platform/mac-wk2/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt: Canonical link: https://commits.webkit.org/228320@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-17 07:37:12 +00:00
PASS [Worker] new PerformanceEntry() threw exception TypeError: Illegal constructor.
[Worker]
Support Performance API (performance.now(), UserTiming) in Workers https://bugs.webkit.org/show_bug.cgi?id=167717 Reviewed by Ryosuke Niwa. Source/WebCore: Tests: performance-api/performance-mark-name.html performance-api/performance-now-api.html performance-api/performance-now-time-origin-in-worker.html performance-api/user-timing-apis.html * CMakeLists.txt: * DerivedSources.make: New files. * page/DOMWindow.idl: * page/GlobalPerformance.idl: * workers/WorkerGlobalScope.idl: Add partial interface for performance attribute. * page/Performance.idl: * page/PerformanceEntry.idl: * page/PerformanceMark.idl: * page/PerformanceMeasure.idl: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.idl: Expose these to Workers. * page/Performance.cpp: (WebCore::Performance::Performance): (WebCore::Performance::contextDestroyed): * page/Performance.h: Use the EventQueue variant that works with any ScriptExectionContext. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::PerformanceObserver): Get the Performance base in a Worker context. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): Only reject legacy special mark names in a Window, not a Worker. (WebCore::UserTiming::findExistingMarkStartTime): Simple implementation returns 0 as the start time in Workers. The spec is currently imprecise here, but it does not have the unusual PerformanceTiming behavior in a Window which is part of User Timing 1. * workers/Worker.cpp: (WebCore::Worker::create): (WebCore::Worker::notifyFinished): * workers/Worker.h: Record the moment of Worker creation. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::performance): * workers/WorkerGlobalScope.h: Construct the Performance object with the moment of creation (timeOrigin). * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: Pass the moment of creation (timeOrigin) through to WorkerGlobalScope creation. LayoutTests: * js/dom/global-constructors-attributes-dedicated-worker-expected.txt: Updated now that Performance classes are in Workers. * performance-api/performance-now-api-expected.txt: Added. * performance-api/performance-now-api.html: Added. * performance-api/performance-now-time-origin-in-worker-expected.txt: Added. * performance-api/performance-now-time-origin-in-worker.html: Added. New tests to cover performance.now. * performance-api/performance-mark-name-expected.txt: Added. * performance-api/performance-mark-name.html: Added. * performance-api/resources/mark-name.js: Added. * performance-api/resources/user-timing-api.js: Added. * performance-api/user-timing-apis-expected.txt: Added. * performance-api/user-timing-apis.html: Added. New tests to cover user-timing and performance.mark behavior. * performance-api/performance-observer-api-expected.txt: * performance-api/performance-observer-api.html: * performance-api/performance-observer-basic-expected.txt: * performance-api/performance-observer-basic.html: * performance-api/performance-timeline-api-expected.txt: * performance-api/performance-timeline-api.html: * performance-api/resources/now-api.js: Added. * performance-api/resources/observer-api.js: Copied from LayoutTests/performance-api/performance-observer-api.html. * performance-api/resources/observer-basic.js: Copied from LayoutTests/performance-api/performance-observer-basic.html. * performance-api/resources/time-origin-in-worker.js: Added. * performance-api/resources/timeline-api.js: Copied from LayoutTests/performance-api/performance-timeline-api.html. Update some of the existing tests to check in a Document and Worker. * imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt: Minor progression. Canonical link: https://commits.webkit.org/184803@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-02 22:07:28 +00:00
[Worker] Performance extensions
PASS [Worker] Performance.prototype.getEntries is defined.
PASS [Worker] Performance.prototype.getEntriesByType is defined.
PASS [Worker] Performance.prototype.getEntriesByName is defined.
PASS [Worker] performance.getEntries() instanceof Array is true
PASS [Worker] performance.getEntries().length === 0 is true
PASS [Worker] performance.mark("test"); did not throw exception.
PASS [Worker] performance.getEntries().length === 1 is true
Add support for Navigation Timing Level 2 https://bugs.webkit.org/show_bug.cgi?id=184363 Reviewed by Ryosuke Niwa. LayoutTests/imported/w3c: * web-platform-tests/navigation-timing/META.yml: Added. * web-platform-tests/navigation-timing/dom_interactive_image_document-expected.txt: Added. * web-platform-tests/navigation-timing/dom_interactive_image_document.html: Added. * web-platform-tests/navigation-timing/dom_interactive_media_document-expected.txt: Added. * web-platform-tests/navigation-timing/dom_interactive_media_document.html: Added. * web-platform-tests/navigation-timing/idlharness.window.js: * web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_attributes_exist.html: Added. This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl * web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_attributes_values.html: Added. This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl * web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt: * web-platform-tests/navigation-timing/nav2_test_document_open.html: * web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt: * web-platform-tests/navigation-timing/nav2_test_document_replaced.html: * web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt: * web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt: * web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html: * web-platform-tests/navigation-timing/nav2_test_instance_accessors-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_instance_accessors.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_iframe-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html: * web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html: * web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html: * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin-expected.txt: Added. This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html: Copied from LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt: This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html: * web-platform-tests/navigation-timing/nav2_test_redirect_none-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_redirect_none.html: Added. * web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt: This test failure needs further investigation. * web-platform-tests/navigation-timing/nav2_test_redirect_server.html: * web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt: This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html: * web-platform-tests/navigation-timing/nav2_test_unique_nav_instances-expected.txt: Added. This test failure needs further investigation. * web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html: Added. * web-platform-tests/navigation-timing/po-navigation-expected.txt: Added. * web-platform-tests/navigation-timing/po-navigation.html: Added. * web-platform-tests/navigation-timing/resources/webperftestharness.js: (test_namespace): (test_attribute_exists): (test_enum): * web-platform-tests/navigation-timing/secure-connection-start-reuse.https-expected.txt: Added. * web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html: Added. * web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: This test has been marked as flaky. It needs to be fixed to not rely on no initial connection reuse. * web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt: * web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt: * web-platform-tests/navigation-timing/test_document_onload-expected.txt: Added. * web-platform-tests/navigation-timing/test_document_onload.html: Added. This test failure needs further investigation. * web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt: * web-platform-tests/navigation-timing/unload-event-same-origin-check.html: * web-platform-tests/performance-timeline/META.yml: Added. * web-platform-tests/performance-timeline/buffered-flag-after-timeout.any.js: Added. (async_test.t.t.step_timeout): * web-platform-tests/performance-timeline/buffered-flag-observer.any.js: Added. * web-platform-tests/performance-timeline/get-invalid-entries-expected.txt: Added. * web-platform-tests/performance-timeline/get-invalid-entries.html: Added. * web-platform-tests/performance-timeline/idlharness.any.js: Added. (async idl_array): * web-platform-tests/performance-timeline/multiple-buffered-flag-observers.any.js: Added. (promise_test): * web-platform-tests/performance-timeline/not-clonable-expected.txt: Added. * web-platform-tests/performance-timeline/not-clonable.html: Added. * web-platform-tests/performance-timeline/observer-buffered-false.any.js: Added. (async_test.t.t.step_timeout): * web-platform-tests/performance-timeline/performanceentry-tojson.any.js: Added. (test): * web-platform-tests/performance-timeline/po-callback-mutate.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-disconnect-removes-observed-types.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-disconnect.any.js: Added. (async_test): (test): * web-platform-tests/performance-timeline/po-entries-sort.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-getentries.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-mark-measure.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-observe-expected.txt: Added. * web-platform-tests/performance-timeline/po-observe-repeated-type.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-observe.html: Added. * web-platform-tests/performance-timeline/po-resource-expected.txt: Added. * web-platform-tests/performance-timeline/po-resource.html: Added. * web-platform-tests/performance-timeline/po-takeRecords.any.js: Added. (async_test): * web-platform-tests/performance-timeline/resources/postmessage-entry.html: Added. * web-platform-tests/performance-timeline/resources/worker-invalid-entries.js: Added. * web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js: Added. (catch): * web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt: This test failure needs further investigation. It's a bindings generation problem I've unsuccessfully looked into before. * web-platform-tests/performance-timeline/supportedEntryTypes.any.js: (test): * web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt: * web-platform-tests/performance-timeline/webtiming-resolution.any.js: Added. (testTimeResolution): (timeByUserTiming): * web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt: Added. * web-platform-tests/performance-timeline/worker-with-performance-observer.html: Added. * web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt: This existing test failure needs more investigation. We are probably close to a fix after this patch. Source/WebCore: This is basically just a new shape for exposing the same data as window.performance.navigation, but with a shape that fits better into the rest of the performance timeline measurements that have been added to the web platform since performance.navigation. I noted that exposing transfer size is problematic, and some of the tests for reading transfer size still fail. There are still a few relatively minor test failures to fix in future patches. Each one is annotated in the LayoutTests ChangeLogs. Tests: imported/w3c/web-platform-tests/navigation-timing/dom_interactive_image_document.html imported/w3c/web-platform-tests/navigation-timing/dom_interactive_media_document.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_exist.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_instance_accessors.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_none.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html imported/w3c/web-platform-tests/navigation-timing/po-navigation.html imported/w3c/web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html imported/w3c/web-platform-tests/navigation-timing/test_document_onload.html imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html imported/w3c/web-platform-tests/performance-timeline/not-clonable.html imported/w3c/web-platform-tests/performance-timeline/po-observe.html imported/w3c/web-platform-tests/performance-timeline/po-resource.html imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPerformanceEntryCustom.cpp: (WebCore::toJSNewlyCreated): * dom/Document.cpp: (WebCore::Document::setReadyState): Sometimes the ready state jumps right to Complete without hitting Interactive along the way. When this happens, we want to mark both m_documentTiming.domComplete and m_documentTiming.domInteractive. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::notifyFinished): Call addNavigationTiming in notifyFinished to create the navigation timing object when we are done navigating * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didFinishLoading): * loader/ResourceLoader.h: * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::fromLoad): Add a URL parameter. Sometimes we need to use the request's URL and sometimes the response's. Different specs written at different times. (WebCore::ResourceTiming::populateServerTiming const): (WebCore::ResourceTiming::populateServerTiming): Deleted. * loader/ResourceTiming.h: (WebCore::ResourceTiming::url const): (WebCore::ResourceTiming::initiator const): (WebCore::ResourceTiming::loadTiming const): (WebCore::ResourceTiming::networkLoadMetrics const): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::reportResourceTiming): * page/Performance.cpp: (WebCore::Performance::getEntries const): (WebCore::Performance::getEntriesByType const): (WebCore::Performance::getEntriesByName const): (WebCore::Performance::appendBufferedEntriesByType const): (WebCore::Performance::addNavigationTiming): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::queueEntry): (WebCore::Performance::scheduleTaskIfNeeded): * page/Performance.h: * page/PerformanceEntry.h: (WebCore::PerformanceEntry::startTime const): (WebCore::PerformanceEntry::duration const): (WebCore::PerformanceEntry::isResource const): Deleted. (WebCore::PerformanceEntry::isMark const): Deleted. (WebCore::PerformanceEntry::isMeasure const): Deleted. (WebCore::PerformanceEntry::isPaint const): Deleted. * page/PerformanceMark.h: (isType): Deleted. SPECIALIZE_TYPE_TRAITS_BEGIN/END doesn't work well with PerformanceNavigationTiming which inherits from PerformanceResourceTiming which both have distinct types. is<PerformanceResourceTiming> doesn't give us the info we need. I replaced that with "switch (entry->performanceEntryType())" in the one place it's used, and it works like a charm. Also renamed type to performanceEntryType so it doesn't conflict with PerformanceNavigationTiming::type, which is specified in the idl. * page/PerformanceMeasure.h: (isType): Deleted. * page/PerformanceNavigationTiming.cpp: Added. (WebCore::toPerformanceNavigationTimingNavigationType): (WebCore::PerformanceNavigationTiming::PerformanceNavigationTiming): (WebCore::PerformanceNavigationTiming::millisecondsSinceOrigin const): (WebCore::PerformanceNavigationTiming::sameOriginCheckFails const): (WebCore::PerformanceNavigationTiming::unloadEventStart const): (WebCore::PerformanceNavigationTiming::unloadEventEnd const): (WebCore::PerformanceNavigationTiming::domInteractive const): (WebCore::PerformanceNavigationTiming::domContentLoadedEventStart const): (WebCore::PerformanceNavigationTiming::domContentLoadedEventEnd const): (WebCore::PerformanceNavigationTiming::domComplete const): (WebCore::PerformanceNavigationTiming::loadEventStart const): (WebCore::PerformanceNavigationTiming::loadEventEnd const): (WebCore::PerformanceNavigationTiming::type const): (WebCore::PerformanceNavigationTiming::redirectCount const): (WebCore::PerformanceNavigationTiming::startTime const): (WebCore::PerformanceNavigationTiming::duration const): * page/PerformanceNavigationTiming.h: Added. * page/PerformanceNavigationTiming.idl: Copied from Source/WebCore/page/PerformanceObserver.idl. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::takeRecords): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::deliver): (WebCore::PerformanceObserver::supportedEntryTypes): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.cpp: (WebCore::PerformanceObserverEntryList::getEntriesByName const): * page/PerformancePaintTiming.h: (isType): Deleted. * page/PerformanceResourceTiming.cpp: (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): (WebCore::PerformanceResourceTiming::nextHopProtocol const): (WebCore::PerformanceResourceTiming::redirectStart const): (WebCore::PerformanceResourceTiming::redirectEnd const): (WebCore::PerformanceResourceTiming::fetchStart const): (WebCore::PerformanceResourceTiming::domainLookupStart const): (WebCore::PerformanceResourceTiming::domainLookupEnd const): (WebCore::PerformanceResourceTiming::connectStart const): (WebCore::PerformanceResourceTiming::connectEnd const): (WebCore::PerformanceResourceTiming::secureConnectionStart const): (WebCore::PerformanceResourceTiming::requestStart const): (WebCore::PerformanceResourceTiming::responseStart const): (WebCore::PerformanceResourceTiming::responseEnd const): (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp const): * page/PerformanceResourceTiming.h: (WebCore::PerformanceResourceTiming::initiatorType const): (isType): Deleted. * page/PerformanceResourceTiming.idl: * platform/network/BlobResourceHandle.cpp: (WebCore::doNotifyFinish): * platform/network/NetworkLoadMetrics.h: * platform/network/ResourceHandleClient.h: (WebCore::ResourceHandleClient::didFinishLoading): * platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::didFinishLoading): * platform/network/SynchronousLoaderClient.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading): Pass metrics including the response end time from NSURLConnection so we don't assert in WebKitLegacy. * platform/network/cocoa/NetworkLoadMetrics.mm: (WebCore::copyTimingData): Use currentRequest instead of passing in the response so we can call it from didFinishLoading, where we don't have a response stored anywhere. We're just looking for whether it's http or https, so the currentRequest (which is the request after all the redirects) fits our purpose. * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::handleDataURL): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]): Source/WebKit: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Mark reused TLS connections in complete metrics like I did in incomplete metrics in r277493. Source/WebKitLegacy: * WebCoreSupport/PingHandle.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * TestExpectations: Annoyingly secure_connection_start_non_zero.https.html becomes flaky with a correct implementation because it assumes that no connection is reused. However, when running this test after other tests, another connection is often reused. * performance-api/paint-timing/performance-observer-first-contentful-paint-expected.txt: * performance-api/paint-timing/performance-observer-first-contentful-paint.html: * performance-api/performance-observer-api-expected.txt: * performance-api/performance-timeline-api-expected.txt: * performance-api/resources/timeline-api.js: * platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Next hop protocol isn't implemented in ResourceHandle. That's probably no big deal because WebKitLegacy is deprecated and not used by Safari. Canonical link: https://commits.webkit.org/237930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 00:33:02 +00:00
PASS [Worker] performance.getEntries()[markIndex] instanceof PerformanceEntry is true
PASS [Worker] performance.getEntries()[markIndex].name is "test"
PASS [Worker] performance.getEntries()[markIndex].entryType is "mark"
PASS [Worker] typeof performance.getEntries()[markIndex].startTime === "number" is true
PASS [Worker] typeof performance.getEntries()[markIndex].duration === "number" is true
Support Performance API (performance.now(), UserTiming) in Workers https://bugs.webkit.org/show_bug.cgi?id=167717 Reviewed by Ryosuke Niwa. Source/WebCore: Tests: performance-api/performance-mark-name.html performance-api/performance-now-api.html performance-api/performance-now-time-origin-in-worker.html performance-api/user-timing-apis.html * CMakeLists.txt: * DerivedSources.make: New files. * page/DOMWindow.idl: * page/GlobalPerformance.idl: * workers/WorkerGlobalScope.idl: Add partial interface for performance attribute. * page/Performance.idl: * page/PerformanceEntry.idl: * page/PerformanceMark.idl: * page/PerformanceMeasure.idl: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.idl: Expose these to Workers. * page/Performance.cpp: (WebCore::Performance::Performance): (WebCore::Performance::contextDestroyed): * page/Performance.h: Use the EventQueue variant that works with any ScriptExectionContext. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::PerformanceObserver): Get the Performance base in a Worker context. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): Only reject legacy special mark names in a Window, not a Worker. (WebCore::UserTiming::findExistingMarkStartTime): Simple implementation returns 0 as the start time in Workers. The spec is currently imprecise here, but it does not have the unusual PerformanceTiming behavior in a Window which is part of User Timing 1. * workers/Worker.cpp: (WebCore::Worker::create): (WebCore::Worker::notifyFinished): * workers/Worker.h: Record the moment of Worker creation. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::performance): * workers/WorkerGlobalScope.h: Construct the Performance object with the moment of creation (timeOrigin). * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: Pass the moment of creation (timeOrigin) through to WorkerGlobalScope creation. LayoutTests: * js/dom/global-constructors-attributes-dedicated-worker-expected.txt: Updated now that Performance classes are in Workers. * performance-api/performance-now-api-expected.txt: Added. * performance-api/performance-now-api.html: Added. * performance-api/performance-now-time-origin-in-worker-expected.txt: Added. * performance-api/performance-now-time-origin-in-worker.html: Added. New tests to cover performance.now. * performance-api/performance-mark-name-expected.txt: Added. * performance-api/performance-mark-name.html: Added. * performance-api/resources/mark-name.js: Added. * performance-api/resources/user-timing-api.js: Added. * performance-api/user-timing-apis-expected.txt: Added. * performance-api/user-timing-apis.html: Added. New tests to cover user-timing and performance.mark behavior. * performance-api/performance-observer-api-expected.txt: * performance-api/performance-observer-api.html: * performance-api/performance-observer-basic-expected.txt: * performance-api/performance-observer-basic.html: * performance-api/performance-timeline-api-expected.txt: * performance-api/performance-timeline-api.html: * performance-api/resources/now-api.js: Added. * performance-api/resources/observer-api.js: Copied from LayoutTests/performance-api/performance-observer-api.html. * performance-api/resources/observer-basic.js: Copied from LayoutTests/performance-api/performance-observer-basic.html. * performance-api/resources/time-origin-in-worker.js: Added. * performance-api/resources/timeline-api.js: Copied from LayoutTests/performance-api/performance-timeline-api.html. Update some of the existing tests to check in a Document and Worker. * imported/w3c/web-platform-tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes-expected.txt: Minor progression. Canonical link: https://commits.webkit.org/184803@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-02 22:07:28 +00:00
PASS [Worker] performance.getEntriesByType() threw exception TypeError: Not enough arguments.
PASS [Worker] performance.getEntriesByType("not-real").length === 0 is true
PASS [Worker] performance.getEntriesByType("mark").length === 1 is true
PASS [Worker] performance.getEntriesByType("mark")[0] instanceof PerformanceEntry is true
PASS [Worker] performance.getEntriesByType("mark")[0].name is "test"
PASS [Worker] performance.getEntriesByType("mark")[0].entryType is "mark"
PASS [Worker] typeof performance.getEntriesByType("mark")[0].startTime === "number" is true
PASS [Worker] typeof performance.getEntriesByType("mark")[0].duration === "number" is true
PASS [Worker] performance.getEntriesByName() threw exception TypeError: Not enough arguments.
PASS [Worker] performance.getEntriesByName("not-real").length === 0 is true
PASS [Worker] performance.getEntriesByName("test").length === 1 is true
PASS [Worker] performance.getEntriesByName("test")[0] instanceof PerformanceEntry is true
PASS [Worker] performance.getEntriesByName("test")[0].name is "test"
PASS [Worker] performance.getEntriesByName("test")[0].entryType is "mark"
PASS [Worker] typeof performance.getEntriesByName("test")[0].startTime === "number" is true
PASS [Worker] typeof performance.getEntriesByName("test")[0].duration === "number" is true
PASS [Worker] performance.getEntriesByName("test", "not-real").length === 0 is true
PASS [Worker] performance.getEntriesByName("test", "mark").length === 1 is true
Implement PerformanceObserver https://bugs.webkit.org/show_bug.cgi?id=167546 <rdar://problem/30247959> Reviewed by Ryosuke Niwa. Source/JavaScriptCore: * runtime/CommonIdentifiers.h: Source/WebCore: This implements PerformanceObserver from Performance Timeline Level 2: https://w3c.github.io/performance-timeline/ Tests: performance-api/performance-observer-api.html performance-api/performance-observer-basic.html performance-api/performance-observer-callback-mutate.html performance-api/performance-observer-callback-task.html performance-api/performance-observer-entry-sort.html performance-api/performance-observer-exception.html performance-api/performance-observer-nested.html performance-api/performance-observer-order.html performance-api/performance-observer-periodic.html performance-api/performance-timeline-api.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: New files. * page/Performance.h: * page/Performance.cpp: (WebCore::Performance::mark): (WebCore::Performance::measure): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::unregisterPerformanceObserver): (WebCore::Performance::queueEntry): Register PerformanceObservers with the Performance object. When new PerformanceEntries are created (Mark and Measure right now) check them against observers. * page/PerformanceEntry.cpp: (WebCore::PerformanceEntry::PerformanceEntry): (WebCore::PerformanceEntry::typeForEntryTypeString): * page/PerformanceEntry.h: (WebCore::PerformanceEntry::type): Give PerformanceEntry a convenience enum for easy comparison and to know if it is one of the built-in known types (which the PerformanceObserver API takes into account). * page/PerformanceObserver.cpp: Added. (WebCore::PerformanceObserver::PerformanceObserver): (WebCore::PerformanceObserver::observe): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::queueEntry): (WebCore::PerformanceObserver::deliver): * page/PerformanceObserver.h: (WebCore::PerformanceObserver::create): (WebCore::PerformanceObserver::typeFilter): - TypeErrors on observe bad behavior - Completely replace types filter on observe - Handle register and unregister - Handle calling the callback * page/PerformanceObserverCallback.idl: Added. * page/PerformanceObserverEntryList.cpp: Added. (WebCore::PerformanceObserverEntryList::PerformanceObserverEntryList): (WebCore::PerformanceObserverEntryList::getEntries): (WebCore::PerformanceObserverEntryList::getEntriesByType): (WebCore::PerformanceObserverEntryList::getEntriesByName): * page/PerformanceObserverEntryList.h: (WebCore::PerformanceObserverEntryList::create): * page/PerformanceObserverEntryList.idl: Added. Implement sorting and filtering of entries. * page/PerformanceObserver.idl: Added. * page/PerformanceObserverCallback.h: (WebCore::PerformanceObserverCallback::~PerformanceObserverCallback): Mostly autogenerated. * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): (WebCore::UserTiming::measure): * page/PerformanceUserTiming.h: Update these to return the entry so it can be passed on to any interested PerformanceObservers. Source/WebInspectorUI: * UserInterface/Models/NativeFunctionParameters.js: Improve API view display of built-in performance methods. LayoutTests: * performance-api/performance-observer-api-expected.txt: Added. * performance-api/performance-observer-api.html: Added. * performance-api/performance-observer-basic-expected.txt: Added. * performance-api/performance-observer-basic.html: Added. * performance-api/performance-observer-callback-mutate-expected.txt: Added. * performance-api/performance-observer-callback-mutate.html: Added. * performance-api/performance-observer-callback-task-expected.txt: Added. * performance-api/performance-observer-callback-task.html: Added. * performance-api/performance-observer-entry-sort-expected.txt: Added. * performance-api/performance-observer-entry-sort.html: Added. * performance-api/performance-observer-exception-expected.txt: Added. * performance-api/performance-observer-exception.html: Added. * performance-api/performance-observer-nested-expected.txt: Added. * performance-api/performance-observer-nested.html: Added. * performance-api/performance-observer-order-expected.txt: Added. * performance-api/performance-observer-order.html: Added. * performance-api/performance-observer-periodic-expected.txt: Added. * performance-api/performance-observer-periodic.html: Added. PerformanceObserver tests. * performance-api/performance-timeline-api-expected.txt: Added. * performance-api/performance-timeline-api.html: Added. Performance timeline tests. * platform/efl/js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/js/dom/global-constructors-attributes-expected.txt: New global constructors. Canonical link: https://commits.webkit.org/184646@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-31 06:21:35 +00:00
PASS successfullyParsed is true
TEST COMPLETE