WebKit Bugzilla
Attachment 358749 Details for
Bug 193302
: Import current Resource-Timing WPTs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193302-20190109165616.patch (text/plain), 164.11 KB, created by
cvazac
on 2019-01-09 14:56:18 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cvazac
Created:
2019-01-09 14:56:18 PST
Size:
164.11 KB
patch
obsolete
>Subversion Revision: 239680 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1486382618788f2984e185d879169f8de3964695..6a91c02e4c798399206b94bc94cfff598d59d361 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-09 Charles Vazac <cvazac@akamai.com> >+ >+ Import current Resource-Timing WPTs >+ https://bugs.webkit.org/show_bug.cgi?id=193302 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestExpectations: >+ * tests-options.json: >+ > 2019-01-07 Claudio Saavedra <csaavedra@igalia.com> > > [WPE][GTK] Skip css-painting-api tests >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 60ce6517d77823c4bbca6d055fad9a3c78e9e667..3773ace5dd5bdc85359cfd49fd49e38c6655f48e 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,75 @@ >+2019-01-09 Charles Vazac <cvazac@akamai.com> >+ >+ Import current Resource-Timing WPTs >+ https://bugs.webkit.org/show_bug.cgi?id=193302 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/resource-timing/.idea/workspace.xml: Added. >+ * web-platform-tests/resource-timing/SyntheticResponse.py: >+ (main): >+ * web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-add-after-full-event.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-add-then-clear.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-then-increased.html: Added. >+ * web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt: Added. >+ * web-platform-tests/resource-timing/buffer-full-when-populate-entries.html: Added. >+ * web-platform-tests/resource-timing/document-domain-no-impact-loader.sub-expected.txt: Added. >+ * web-platform-tests/resource-timing/document-domain-no-impact-loader.sub.html: Added. >+ * web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub-expected.txt: Added. >+ * web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html: Added. >+ * web-platform-tests/resource-timing/resource-timing-level1.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.js. >+ (assertInvariants): >+ (window.onload): >+ * web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt: Added. >+ * web-platform-tests/resource-timing/resource-timing-level1.sub.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.html. >+ * web-platform-tests/resource-timing/resource_connection_reuse.html: >+ * web-platform-tests/resource-timing/resource_timing.worker.js: >+ * web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries-expected.txt: Removed. >+ * web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries.html: Removed. >+ * web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback-expected.txt: Removed. >+ * web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html: Removed. >+ * web-platform-tests/resource-timing/resources/buffer-full-utilities.js: Added. >+ (let.appendScript): >+ (let.waitForNextTask): >+ (let.waitForEventToFire.return.new.Promise): >+ (let.waitForEventToFire): >+ * web-platform-tests/resource-timing/resources/document-domain-no-impact.sub.html: Added. >+ * web-platform-tests/resource-timing/resources/iframe-setdomain.sub.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-setdomain.sub.html. >+ * web-platform-tests/resource-timing/resources/w3c-import.log: >+ * web-platform-tests/resource-timing/resources/webperftestharness.js: >+ (wp_test): >+ (test_namespace): >+ * web-platform-tests/resource-timing/resources/webperftestharnessextension.js: >+ (test_resource_entries): >+ (performance_entrylist_checker): Deleted. >+ * web-platform-tests/resource-timing/single-entry-per-resource.html: >+ * web-platform-tests/resource-timing/supported_resource_type.any-expected.txt: Added. >+ * web-platform-tests/resource-timing/supported_resource_type.any.html: Added. >+ * web-platform-tests/resource-timing/supported_resource_type.any.js: Added. >+ (test): >+ * web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt: Added. >+ * web-platform-tests/resource-timing/supported_resource_type.any.worker.html: Added. >+ * web-platform-tests/resource-timing/test_resource_timing.https-expected.txt: Added. >+ * web-platform-tests/resource-timing/test_resource_timing.https.html: Added. >+ * web-platform-tests/resource-timing/test_resource_timing.js: >+ (resource_load): >+ * web-platform-tests/resource-timing/w3c-import.log: >+ > 2019-01-05 Youenn Fablet <youenn@apple.com> > > Service Worker fetch should obey its referrer policy >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 4d5c642b9a2b70e5c26b0e6af498f4465f17876c..fd6df7a07000482f3a61a977dd225a1f5380c8d0 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -379,7 +379,6 @@ imported/w3c/web-platform-tests/mediacapture-fromelement/creation.html [ Pass Fa > webkit.org/b/180240 imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html [ Pass Failure ] > webkit.org/b/189906 imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html [ Skip ] > webkit.org/b/189905 imported/w3c/web-platform-tests/resource-timing/resource_initiator_types.html [ Pass Failure ] >-webkit.org/b/189910 imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html [ Pass Failure ] > webkit.org/b/190523 imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html [ Pass Failure ] > > # These tests time out >@@ -751,8 +750,12 @@ imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.any.html [ DumpJSC > imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-preflight.any.html [ DumpJSConsoleLogInStdErr ] > imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html [ DumpJSConsoleLogInStdErr ] > >-webkit.org/b/161088 imported/w3c/web-platform-tests/resource-timing/resource-timing.html [ Pass Failure ] > imported/w3c/web-platform-tests/resource-timing/test_resource_timing.html [ Pass Failure ] >+imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html [ Timeout ] >+imported/w3c/web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html [ Timeout ] >+ >+imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.html [ Failure ] >+imported/w3c/web-platform-tests/resource-timing/resource_reparenting.html [ Failure ] > > webkit.org/b/168357 http/wpt/resource-timing/rt-initiatorType-media.html [ Failure ] > webkit.org/b/168448 http/wpt/resource-timing/rt-shared-resource-in-frames.html [ Pass Failure ] >@@ -2883,8 +2886,6 @@ fast/gradients/conic-two-hints.html [ Skip ] > > webkit.org/b/187773 http/tests/webAPIStatistics [ Skip ] > >-webkit.org/b/189997 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ] >- > # This is fallout from turning Web Animations on. > webkit.org/b/190032 animations/animation-playstate-paused-style-resolution.html [ Failure ] > webkit.org/b/190032 compositing/backing/backing-store-attachment-fill-forwards-animation.html [ Failure ] >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/.idea/workspace.xml b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/.idea/workspace.xml >new file mode 100644 >index 0000000000000000000000000000000000000000..aa1e1c379a7959977b0c2081a52a367fe366961f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/.idea/workspace.xml >@@ -0,0 +1,224 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<project version="4"> >+ <component name="ChangeListManager"> >+ <list default="true" id="a8675c8e-1070-4c3a-beea-3364bac5ee40" name="Default" comment="" /> >+ <ignored path="$PROJECT_DIR$/.tmp/" /> >+ <ignored path="$PROJECT_DIR$/temp/" /> >+ <ignored path="$PROJECT_DIR$/tmp/" /> >+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> >+ <option name="TRACKING_ENABLED" value="true" /> >+ <option name="SHOW_DIALOG" value="false" /> >+ <option name="HIGHLIGHT_CONFLICTS" value="true" /> >+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> >+ <option name="LAST_RESOLUTION" value="IGNORE" /> >+ </component> >+ <component name="CreatePatchCommitExecutor"> >+ <option name="PATCH_PATH" value="" /> >+ </component> >+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> >+ <component name="FavoritesManager"> >+ <favorites_list name="resource-timing" /> >+ </component> >+ <component name="FileEditorManager"> >+ <leaf /> >+ </component> >+ <component name="FindInProjectRecents"> >+ <findStrings> >+ <find>supp</find> >+ <find>worker</find> >+ </findStrings> >+ </component> >+ <component name="IdeDocumentHistory"> >+ <option name="CHANGED_PATHS"> >+ <list> >+ <option value="$PROJECT_DIR$/w3c-import.log" /> >+ <option value="$PROJECT_DIR$/supported_resource_type.any.js" /> >+ </list> >+ </option> >+ </component> >+ <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" /> >+ <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" /> >+ <component name="JsGulpfileManager"> >+ <detection-done>true</detection-done> >+ <sorting>DEFINITION_ORDER</sorting> >+ </component> >+ <component name="ProjectFrameBounds"> >+ <option name="y" value="23" /> >+ <option name="width" value="1440" /> >+ <option name="height" value="731" /> >+ </component> >+ <component name="ProjectView"> >+ <navigator currentView="ProjectPane" proportions="" version="1"> >+ <flattenPackages /> >+ <showMembers /> >+ <showModules /> >+ <showLibraryContents /> >+ <hideEmptyPackages /> >+ <abbreviatePackageNames /> >+ <autoscrollToSource /> >+ <autoscrollFromSource ProjectPane="true" /> >+ <sortByType /> >+ <manualOrder /> >+ <foldersAlwaysOnTop value="true" /> >+ </navigator> >+ <panes> >+ <pane id="Scope" /> >+ <pane id="ProjectPane"> >+ <subPane> >+ <PATH> >+ <PATH_ELEMENT> >+ <option name="myItemId" value="resource-timing" /> >+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> >+ </PATH_ELEMENT> >+ <PATH_ELEMENT> >+ <option name="myItemId" value="resource-timing" /> >+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> >+ </PATH_ELEMENT> >+ </PATH> >+ </subPane> >+ </pane> >+ <pane id="Scratches" /> >+ </panes> >+ </component> >+ <component name="PropertiesComponent"> >+ <property name="WebServerToolWindowFactoryState" value="false" /> >+ <property name="HbShouldOpenHtmlAsHb" value="" /> >+ <property name="nodejs_interpreter_path" value="/usr/local/bin/node" /> >+ <property name="js.eslint.eslintPackage" value="" /> >+ <property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" /> >+ <property name="SearchEverywhereHistoryKey" value="supported_resource_type.any.js	FILE	file:///Users/cvazac/WebKit/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js supported_resource_type.any.html	FILE	file:///Users/cvazac/WebKit/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.html" /> >+ </component> >+ <component name="RunManager"> >+ <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> >+ <method /> >+ </configuration> >+ <configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test"> >+ <method /> >+ </configuration> >+ <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma"> >+ <config-file value="" /> >+ <node-interpreter value="project" /> >+ <envs /> >+ <method /> >+ </configuration> >+ <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor"> >+ <config-file value="" /> >+ <node-interpreter value="project" /> >+ <envs /> >+ <method /> >+ </configuration> >+ <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug"> >+ <method /> >+ </configuration> >+ <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir=""> >+ <method /> >+ </configuration> >+ <configuration default="true" type="cucumber.js" factoryName="Cucumber.js"> >+ <option name="cucumberJsArguments" value="" /> >+ <option name="executablePath" /> >+ <option name="filePath" /> >+ <method /> >+ </configuration> >+ <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js"> >+ <method /> >+ </configuration> >+ <configuration default="true" type="js.build_tools.npm" factoryName="npm"> >+ <command value="run-script" /> >+ <scripts /> >+ <node-interpreter value="project" /> >+ <envs /> >+ <method /> >+ </configuration> >+ <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha"> >+ <node-interpreter>project</node-interpreter> >+ <node-options /> >+ <working-directory /> >+ <pass-parent-env>true</pass-parent-env> >+ <envs /> >+ <ui /> >+ <extra-mocha-options /> >+ <test-kind>DIRECTORY</test-kind> >+ <test-directory /> >+ <recursive>false</recursive> >+ <method /> >+ </configuration> >+ </component> >+ <component name="ShelveChangesManager" show_recycled="false"> >+ <option name="remove_strategy" value="false" /> >+ </component> >+ <component name="SvnConfiguration"> >+ <configuration /> >+ </component> >+ <component name="TaskManager"> >+ <task active="true" id="Default" summary="Default task"> >+ <changelist id="a8675c8e-1070-4c3a-beea-3364bac5ee40" name="Default" comment="" /> >+ <created>1547065694238</created> >+ <option name="number" value="Default" /> >+ <option name="presentableId" value="Default" /> >+ <updated>1547065694238</updated> >+ <workItem from="1547065695993" duration="3558000" /> >+ </task> >+ <servers /> >+ </component> >+ <component name="TimeTrackingManager"> >+ <option name="totallyTimeSpent" value="3558000" /> >+ </component> >+ <component name="ToolWindowManager"> >+ <frame x="0" y="23" width="1440" height="731" extended-state="0" /> >+ <editor active="false" /> >+ <layout> >+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> >+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> >+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> >+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> >+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> >+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> >+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> >+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> >+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> >+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> >+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> >+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> >+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> >+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> >+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> >+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> >+ </layout> >+ </component> >+ <component name="TypeScriptGeneratedFilesManager"> >+ <option name="processedProjectFiles" value="true" /> >+ </component> >+ <component name="VcsContentAnnotationSettings"> >+ <option name="myLimit" value="2678400000" /> >+ </component> >+ <component name="XDebuggerManager"> >+ <breakpoint-manager /> >+ <watches-manager /> >+ </component> >+ <component name="editorHistoryManager"> >+ <entry file="file://$PROJECT_DIR$/supported_resource_type.any.html"> >+ <provider selected="true" editor-type-id="text-editor"> >+ <state relative-caret-position="0"> >+ <caret line="0" column="26" lean-forward="true" selection-start-line="0" selection-start-column="26" selection-end-line="0" selection-end-column="26" /> >+ <folding /> >+ </state> >+ </provider> >+ </entry> >+ <entry file="file://$PROJECT_DIR$/w3c-import.log"> >+ <provider selected="true" editor-type-id="text-editor"> >+ <state relative-caret-position="240"> >+ <caret line="12" column="42" lean-forward="true" selection-start-line="12" selection-start-column="42" selection-end-line="12" selection-end-column="42" /> >+ <folding /> >+ </state> >+ </provider> >+ </entry> >+ <entry file="file://$PROJECT_DIR$/supported_resource_type.any.js"> >+ <provider selected="true" editor-type-id="text-editor"> >+ <state relative-caret-position="120"> >+ <caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" /> >+ <folding /> >+ </state> >+ </provider> >+ </entry> >+ </component> >+</project> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py >index a17a3e9c1a2ffe5770a6536433c9d075ae94d252..26e0a8017d6c2c7b51c94998f34a79fa20eb1e12 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py >@@ -1,26 +1,48 @@ > import urllib >-import time >+import sys, os >+sys.path.append(os.path.join(os.path.dirname(__file__), "../common/")) >+import sleep > > def main(request, response): > index = request.request_path.index("?") > args = request.request_path[index+1:].split("&") >- headersSent = 0 >+ headers = [] >+ statusSent = False >+ headersSent = False > for arg in args: > if arg.startswith("ignored"): > continue > elif arg.endswith("ms"): >- time.sleep(float(arg[0:-2]) / 1E3); >+ sleep.sleep_at_least(float(arg[0:-2])) > elif arg.startswith("redirect:"): > return (302, "WEBPERF MARKETING"), [("Location", urllib.unquote(arg[9:]))], "TEST" > elif arg.startswith("mime:"): >- response.headers.set("Content-Type", urllib.unquote(arg[5:])) >+ headers.append(("Content-Type", urllib.unquote(arg[5:]))) > elif arg.startswith("send:"): > text = urllib.unquote(arg[5:]) >- if headersSent == 0: >- response.write_status_headers() >- headersSent = 1 >+ >+ if not statusSent: >+ # Default to a 200 status code. >+ response.writer.write_status(200) >+ statusSent = True >+ if not headersSent: >+ for key, value in headers: >+ response.writer.write_header(key, value) >+ response.writer.end_headers() >+ headersSent = True > > response.writer.write_content(text) >+ elif arg.startswith("status:"): >+ code = int(urllib.unquote(arg[7:])) >+ response.writer.write_status(code) >+ if code // 100 == 1: >+ # Terminate informational 1XX responses with an empty line. >+ response.writer.end_headers() >+ else: >+ statusSent = True >+ elif arg == "flush": >+ response.writer.flush() >+ > # else: > # error " INVALID ARGUMENT %s" % arg > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6fa3acaabcc1c98347f4d9527ffc0ab352810721 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that entry was added to the buffer after a buffer full event >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html >new file mode 100644 >index 0000000000000000000000000000000000000000..73ad841e92fddff1e05395241d69a0079e7a84da >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html >@@ -0,0 +1,80 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<meta charset="utf-8"> >+<link rel="help" href="https://w3c.github.io/resource-timing/#dom-performance-setresourcetimingbuffersize"> >+<title>This test validates that setResourceTimingBufferFull behaves appropriately when set to the current buffer level.</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+let eventFired = false; >+let loadRandomResource = () => { >+ return fetch(window.location.href + "?" + Math.random()); >+} >+ >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(100); >+}); >+ >+let loadResourcesToFillFutureBuffer = () => { >+ return new Promise(resolve => { >+ // Gather up 3 Resource Entries to kick off the rest of test behavior. >+ let resources = 0; >+ let observer = new PerformanceObserver(function(list) { >+ resources += list.getEntriesByType("resource").length; >+ if (resources !== 3) >+ return; >+ observer.disconnect(); >+ resolve(); >+ }); >+ observer.observe({entryTypes: ["resource"]}); >+ for (let i = 0; i < 3; ++i) >+ loadRandomResource(); >+ }); >+}; >+ >+let setBufferFullEventAndBufferSize = () => { >+ performance.setResourceTimingBufferSize(3); >+ performance.onresourcetimingbufferfull = function() { >+ eventFired = true; >+ performance.clearResourceTimings(); >+ }; >+}; >+ >+let clearAndAddAnotherEntryToBuffer = () => { >+ return new Promise(resolve => { >+ performance.clearResourceTimings(); >+ loadRandomResource().then(resolve); >+ }); >+}; >+ >+let testThatEntryWasAdded = () => { >+ return new Promise((resolve, reject) => { >+ let waitForIt = function() { >+ if (performance.getEntriesByType("resource").length) { >+ resolve(); >+ } else { >+ reject("After buffer full, entry never added to primary"); >+ } >+ } >+ step_timeout(waitForIt, 0); >+ }); >+}; >+ >+promise_test(async () => { >+ await loadResourcesToFillFutureBuffer(); >+ setBufferFullEventAndBufferSize(); >+ // Overflow the buffer. >+ await loadRandomResource(); >+ await waitForEventToFire(); >+ await clearAndAddAnotherEntryToBuffer(); >+ // Since we have no strict guarantees when an entry will be added to the >+ // buffer, waiting till next task to try to avoid flakiness. >+ await waitForNextTask(); >+ await testThatEntryWasAdded(); >+}, "Test that entry was added to the buffer after a buffer full event"); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9428c867e1da33846614b84060cc34576dfb3aaa >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that entries synchronously added to the buffer during the callback don't get dropped if the buffer is increased >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d61d2af05c6730c57703e7ba9482067689e78fbb >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html >@@ -0,0 +1,51 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates that synchronously adding entries in onresourcetimingbufferfull callback results in these entries being properly handled.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 1; >+ >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(resource_timing_buffer_size); >+}); >+ >+let overflowTheBufferAndWaitForEvent = () => { >+ return new Promise(resolve => { >+ var add_entry = () => { >+ performance.setResourceTimingBufferSize(resource_timing_buffer_size + 1); >+ // The sync entry is added to the secondary buffer, so will be the last one there and eventually dropped. >+ xhrScript("resources/empty.js?xhr"); >+ resolve(); >+ } >+ performance.addEventListener('resourcetimingbufferfull', add_entry); >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ appendScript('resources/empty_script.js'); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 2, >+ 'Both entries should be stored in resource timing buffer since its increases size once it overflows.'); >+ assert_true(entries[0].name.includes('empty.js'), "empty.js is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty_script.js'), "empty_script.js is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithSingleResource("resources/empty.js"); >+ await overflowTheBufferAndWaitForEvent(); >+ // TODO(yoav): Figure out why this task is needed >+ await waitForNextTask(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that entries synchronously added to the buffer during the callback are dropped"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b37c47b23fb5026480683594b964ee712abbe708 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html >@@ -0,0 +1,50 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates that synchronously adding entries in onresourcetimingbufferfull callback results in these entries being properly handled.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 1; >+ >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(resource_timing_buffer_size); >+}); >+ >+let overflowTheBufferAndWaitForEvent = () => { >+ return new Promise(resolve => { >+ var add_entry = () => { >+ performance.setResourceTimingBufferSize(resource_timing_buffer_size + 2); >+ xhrScript("resources/empty.js?xhr"); >+ resolve(); >+ } >+ performance.addEventListener('resourcetimingbufferfull', add_entry); >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ appendScript('resources/empty_script.js'); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 3, >+ 'All entries should be stored in resource timing buffer since its increases size once it overflows.'); >+ assert_true(entries[0].name.includes('empty.js'), "empty.js is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty_script.js'), "empty_script.js is in the entries buffer"); >+ assert_true(entries[2].name.includes('empty.js?xhr'), "empty.js?xhr is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithSingleResource("resources/empty.js"); >+ await overflowTheBufferAndWaitForEvent(); >+ await waitForNextTask(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that entries synchronously added to the buffer during the callback don't get dropped if the buffer is increased"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a0ea4c3d1f8bfcc71ea556ffabe055f2d88dc0ed >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt >@@ -0,0 +1,6 @@ >+CONSOLE MESSAGE: line 2659: Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code >+ >+Harness Error (FAIL), message = Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code >+ >+FAIL Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one assert_equals: the last 3 resources should be in the buffer, since the first one was cleared expected 3 but got 0 >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html >new file mode 100644 >index 0000000000000000000000000000000000000000..710852ced55f716a348cc9e6865d7a8b7048a46a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html >@@ -0,0 +1,49 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates that synchronously adding entries in onresourcetimingbufferfull callback results in these entries being properly handled.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 1; >+ >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ performance.addEventListener('resourcetimingbufferfull', () => { assert_unreached("resourcetimingbufferfull should not fire")}); >+}); >+ >+let overflowTheBuffer = () => { >+ // These resources overflow the entry buffer, and go into the secondary buffer. >+ xhrScript('resources/empty.js?xhr2'); >+ xhrScript('resources/empty.js?xhr3'); >+ performance.clearResourceTimings(); >+ performance.setResourceTimingBufferSize(3); >+ xhrScript('resources/empty.js?xhr4'); >+ window.entriesAfterAddition = performance.getEntriesByType('resource'); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 3, >+ 'the last 3 resources should be in the buffer, since the first one was cleared'); >+ assert_true(entries[0].name.includes('empty.js?xhr2'), "empty.js?xhr2 is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty.js?xhr3'), "empty.js?xhr3 is in the entries buffer"); >+ assert_true(entries[2].name.includes('empty.js?xhr4'), "empty.js?xhr4 is in the entries buffer"); >+ assert_equals(entriesAfterAddition.length, 0, "No entries should have been added to the primary buffer before the task to 'fire a buffer full event'."); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithSingleResource("resources/empty.js"); >+ overflowTheBuffer(); >+ await waitForNextTask(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e6de33ded1b73345a763692a1bac9138c8f208de >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html >@@ -0,0 +1,49 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates that decreasing the buffer size in onresourcetimingbufferfull callback does not result in extra entries being dropped.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 2; >+let eventFired = false; >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ let resize = () => { >+ performance.setResourceTimingBufferSize(resource_timing_buffer_size - 1); >+ eventFired = true; >+ } >+ performance.addEventListener('resourcetimingbufferfull', resize); >+}); >+ >+let overflowTheBuffer = () => { >+ return new Promise(resolve => { >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ // Since the buffer size doesn't increase, it will eventually be dropped. >+ appendScript('resources/empty_script.js', resolve); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 2, >+ 'Both entries should be stored in resource timing buffer since it decreased its limit only after it overflowed.'); >+ assert_true(entries[0].name.includes('empty.js'), "empty.js is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty.js?second'), "empty.js?second is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithTwoResources('resources/empty.js'); >+ await overflowTheBuffer(); >+ await waitForEventToFire(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that decreasing the buffer limit during the callback does not drop entries"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..acccc24d008348c718b508300c7eb8badb0db8f5 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that increasing the buffer during the callback is enough for entries not to be dropped >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b46d2d65690a886837b8ea7621f3926081552d97 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html >@@ -0,0 +1,49 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates increasing the buffer size in onresourcetimingbufferfull callback of resource timing.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 1; >+let eventFired = false; >+ >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ var increase = function() { >+ performance.setResourceTimingBufferSize(resource_timing_buffer_size * 2); >+ eventFired = true; >+ } >+ performance.addEventListener('resourcetimingbufferfull', increase); >+}); >+ >+let overflowTheBuffer = () => { >+ return new Promise(resolve => { >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ appendScript('resources/empty_script.js', resolve); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 2, >+ 'Both entries should be stored in resource timing buffer since its increases size once it overflows.'); >+ assert_true(entries[0].name.includes('empty.js'), "empty.js is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty_script.js'), "empty_script.js is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithSingleResource("resources/empty.js"); >+ await overflowTheBuffer(); >+ await waitForEventToFire(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that increasing the buffer during the callback is enough for entries not to be dropped"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..14cdeef7ca1a30ee987cd0539274b1cae97bc5ee >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that entries in the secondary buffer are not exposed during the callback and before they are copied to the primary buffer >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d46d4692a55b9cbef1aa5f882f38887e1f7940e9 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html >@@ -0,0 +1,56 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates the buffer doesn't contain more entries than it should inside onresourcetimingbufferfull callback.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+let resource_timing_buffer_size = 2; >+let eventFired = false; >+ >+setup(() => { >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ var resize = function() { >+ assert_equals(performance.getEntriesByType("resource").length, resource_timing_buffer_size, "resource timing buffer in resourcetimingbufferfull is the size of the limit"); >+ ++resource_timing_buffer_size; >+ performance.setResourceTimingBufferSize(resource_timing_buffer_size); >+ xhrScript("resources/empty.js?xhr"); >+ assert_equals(performance.getEntriesByType("resource").length, resource_timing_buffer_size - 1, "A sync request was not added to the primary buffer just yet, because it is full"); >+ ++resource_timing_buffer_size; >+ performance.setResourceTimingBufferSize(resource_timing_buffer_size); >+ eventFired = true; >+ } >+ performance.addEventListener('resourcetimingbufferfull', resize); >+}); >+ >+let overflowTheBuffer = () => { >+ return new Promise(resolve => { >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ appendScript('resources/empty_script.js', resolve); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, resource_timing_buffer_size, >+ 'All 4 entries should be stored in resource timing buffer.'); >+ assert_true(entries[0].name.includes('empty.js'), "empty.js is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty.js?second'), "empty.js?second is in the entries buffer"); >+ assert_true(entries[2].name.includes('empty_script.js'), "empty_script.js is in the entries buffer"); >+ assert_true(entries[3].name.includes('empty.js?xhr'), "empty.js?xhr is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithTwoResources('resources/empty.js'); >+ await overflowTheBuffer(); >+ await waitForEventToFire(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that entries in the secondary buffer are not exposed during the callback and before they are copied to the primary buffer"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d44ef50a2b0be4942f36f53388bc327519b9934d >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that entries added and event firing happened in the right sequence >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html >new file mode 100644 >index 0000000000000000000000000000000000000000..1e5486ec2cdfc442876ba1f5b2c524985e70e5b5 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html >@@ -0,0 +1,82 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<meta charset="utf-8"> >+<link rel="help" href="https://w3c.github.io/resource-timing/#dom-performance-setresourcetimingbuffersize"> >+<title>This test validates that setResourceTimingBufferFull behaves appropriately when set to the current buffer level.</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+let eventFired = false; >+ >+let loadRandomResource = () => { >+ return fetch(window.location.href + "?" + Math.random()); >+}; >+ >+setup(() => { >+ // Get the browser into a consistent state. >+ clearBufferAndSetSize(100); >+ window.result = ""; >+}); >+ >+let fillUpTheBuffer = () => { >+ return new Promise(resolve => { >+ // Gather up 3 Resource Entries to kick off the rest of test behavior. >+ let resources = 0; >+ let observer = new PerformanceObserver(list => { >+ resources += list.getEntriesByType("resource").length; >+ if (resources !== 3) >+ return; >+ observer.disconnect(); >+ resolve(); >+ }); >+ observer.observe({entryTypes: ["resource"]}); >+ for (let i = 0; i < 3; ++i) >+ loadRandomResource(); >+ }); >+}; >+ >+let setBufferSize = () => { >+ performance.onresourcetimingbufferfull = () => { >+ eventFired = true; >+ window.result += "Event Fired with " + performance.getEntriesByType("resource").length + " entries. "; >+ performance.clearResourceTimings(); >+ }; >+ window.result += "before setLimit(3). "; >+ performance.setResourceTimingBufferSize(3); >+ window.result += "after setLimit(3). "; >+}; >+ >+let overflowTheBuffer = () => { >+ return new Promise(resolve => { >+ loadRandomResource().then(() => { >+ window.result += "after loading 4th resource. "; >+ resolve(); >+ }); >+ }); >+}; >+ >+let checkResult = () => { >+ return new Promise((resolve, reject) => { >+ if (window.result != "before setLimit(3). after setLimit(3). after loading 4th resource. Event Fired with 3 entries. ") { >+ reject("Non matching value: " + window.result); >+ } >+ let entries = performance.getEntriesByType("resource"); >+ if (entries.length != 1) { >+ reject("Number of entries in resource timing buffer is unexpected: " + entries.length); >+ } >+ resolve(); >+ }); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBuffer(); >+ setBufferSize(); >+ await overflowTheBuffer(); >+ await waitForEventToFire(); >+ await checkResult(); >+}, "Test that entries added and event firing happened in the right sequence"); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..aa3808a763db2124d1cffbded1558c17272b1f1e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that entries overflowing the buffer trigger the buffer full event, can be stored, and find themselves in the primary buffer after it's cleared. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f0791cba6b39fb4b7e1af09077772f1ee3b42744 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html >@@ -0,0 +1,55 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates the behavior of read and clear operation in onresourcetimingbufferfull callback of resource timing.</title> >+<link rel="author" title="Intel" href="http://www.intel.com/" /> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 1; >+let global_buffer = []; >+let eventFired = false; >+ >+setup(() => { >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ let store_and_clear = function() { >+ const entryList = performance.getEntriesByType('resource'); >+ entryList.forEach(function (entry) { >+ global_buffer.push(entry); >+ }); >+ performance.clearResourceTimings(); >+ eventFired = true; >+ } >+ performance.addEventListener('resourcetimingbufferfull', store_and_clear); >+}); >+ >+let overflowTheBuffer = () => { >+ return new Promise(resolve => { >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ appendScript('resources/empty_script.js', resolve); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 1, >+ "Only the last entry should be stored in resource timing buffer since it's cleared once it overflows."); >+ assert_equals(global_buffer.length, 1, '1 resource timing entry should be moved to global buffer.'); >+ assert_true(global_buffer[0].name.includes('empty.js'), "empty.js is in the global buffer"); >+ assert_true(entries[0].name.includes('empty_script.js'), "empty_script.js is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithSingleResource("resources/empty.js"); >+ await overflowTheBuffer(); >+ await waitForEventToFire(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that entries overflowing the buffer trigger the buffer full event, can be stored, and find themselves in the primary buffer after it's cleared."); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b47fa53c1923a6fa9773374ef1cb25b8b51bcb07 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt >@@ -0,0 +1,6 @@ >+CONSOLE MESSAGE: line 2659: Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code >+ >+Harness Error (FAIL), message = Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code >+ >+FAIL Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event assert_equals: All resources should be in the buffer, since its size was increased expected 3 but got 1 >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2265077fc15a277c3352da215fa5ac8a276c60aa >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html >@@ -0,0 +1,44 @@ >+<!DOCTYPE HTML> >+<html> >+<head onload> >+<meta charset="utf-8" /> >+<title>This test validates that synchronously adding entries in onresourcetimingbufferfull callback results in these entries being properly handled.</title> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 1; >+ >+setup(() => { >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ performance.addEventListener('resourcetimingbufferfull', () => { assert_unreached("resourcetimingbufferfull should not fire"); }); >+}); >+ >+let overflowTheBuffer = () => { >+ // These resources overflow the entry buffer, and go into the secondary buffer. >+ xhrScript('resources/empty.js?xhr2'); >+ xhrScript('resources/empty.js?xhr3'); >+ performance.setResourceTimingBufferSize(3); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ let entries = performance.getEntriesByType('resource'); >+ assert_equals(entries.length, 3, >+ 'All resources should be in the buffer, since its size was increased'); >+ assert_true(entries[0].name.includes('empty.js'), "empty.js?xhr2 is in the entries buffer"); >+ assert_true(entries[1].name.includes('empty.js?xhr2'), "empty.js?xhr3 is in the entries buffer"); >+ assert_true(entries[2].name.includes('empty.js?xhr3'), "empty.js?xhr3 is in the entries buffer"); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithSingleResource("resources/empty.js"); >+ overflowTheBuffer(); >+ await waitForNextTask(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..88ccc9de30f0e1b1d89a65848d7f20c839e4aa90 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html >new file mode 100644 >index 0000000000000000000000000000000000000000..00d2ae0e4426f4644f70e921751fffc327de46d6 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html >@@ -0,0 +1,46 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<meta charset="utf-8" /> >+<link rel="author" title="Intel" href="http://www.intel.com/" /> >+<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >+<title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/buffer-full-utilities.js"></script> >+</head> >+<body> >+<script> >+const resource_timing_buffer_size = 2; >+let bufferFullCount = 0; >+let eventFired = false; >+setup(() => { >+ clearBufferAndSetSize(resource_timing_buffer_size); >+ performance.addEventListener('resourcetimingbufferfull', e => { >+ assert_equals(e.bubbles, false, "Event bubbles attribute is false"); >+ bufferFullCount++; >+ eventFired = true; >+ }); >+}); >+ >+let overflowTheBuffer = () => { >+ return new Promise(resolve => { >+ // This resource overflows the entry buffer, and goes into the secondary buffer. >+ appendScript('resources/empty_script.js', resolve); >+ }); >+}; >+ >+let testThatBufferContainsTheRightResources = () => { >+ assert_equals(performance.getEntriesByType('resource').length, resource_timing_buffer_size, 'There should only be |bufferSize| resource entries.'); >+ assert_equals(bufferFullCount, 1, 'onresourcetimingbufferfull should have been invoked once.'); >+}; >+ >+promise_test(async () => { >+ await fillUpTheBufferWithTwoResources('resources/empty.js'); >+ await overflowTheBuffer(); >+ await waitForEventToFire(); >+ testThatBufferContainsTheRightResources(); >+}, "Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..782ee5e90a1d2d73252212c8f795e72044bcbab0 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub-expected.txt >@@ -0,0 +1,6 @@ >+Blocked access to external URL http://www.localhost:8801/resource-timing/resources/document-domain-no-impact.sub.html >+ >+Harness Error (TIMEOUT), message = null >+ >+NOTRUN Finite resource timing entries buffer size >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8a1c433a5c3a7b79d92b797ee1057c624d4a9866 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<meta charset="utf-8"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<script> >+ const t = async_test("Finite resource timing entries buffer size"); >+ addEventListener("message", t.step_func_done(e => { >+ assert_equals(e.data, "PASS", "Document domain had no impact on the timing-allow check"); >+ })); >+window.open("//{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/document-domain-no-impact.sub.html"); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-setdomain.sub.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-setdomain.sub.html >deleted file mode 100644 >index 944ee10c44259ac84281cd802144068583d539db..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-setdomain.sub.html >+++ /dev/null >@@ -1,14 +0,0 @@ >-<!DOCTYPE html> >-<html> >-<head> >- <title>domain: {{domains[www]}}</title> >-</head> >-<body> >- <script> >- // The purpose of this IFrame is to change the 'document.domain' >- document.domain = "{{domains[www]}}"; >- </script> >- The resource-timings.html test loads this document into an IFrame to vet that setting >- 'document.domain' does not effect the timing allowed. >-</body> >-</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..dc217ce480d458d337d8fcfb8d438b03ffc1d708 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub-expected.txt >@@ -0,0 +1,6 @@ >+Blocked access to external URL http://www1.localhost:8801/resource-timing/resources/nested.css >+Blocked access to external URL http://www1.localhost:8801/resource-timing/resources/nested.css >+Some content >+ >+PASS Make sure that resources fetched by cross origin CSS are not in the timeline. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html >new file mode 100644 >index 0000000000000000000000000000000000000000..92d94a17ec0df642b0a500dbd9fb5aa06eaacb64 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html >@@ -0,0 +1,25 @@ >+<!DOCTYPE HTML> >+<meta charset=utf-8> >+<title>Make sure that resources fetched by cross origin CSS are not in the timeline.</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<body> >+<!-- The stylesheet is fetched from http://www1.webâplatform.test:64941/resource-timing/resources/nested.css --> >+<link rel=stylesheet id=cross_origin_style href="//{{domains[www1]}}:{{ports[http][1]}}{{location[path]}}/../resources/nested.css"> >+<script> >+ const t = async_test("Make sure that resources fetched by cross origin CSS are not in the timeline."); >+ window.addEventListener("load", function() { >+ // A timeout is needed as entries are not guaranteed to be in the timeline before onload triggers. >+ t.step_timeout(function() { >+ const url = (new URL(document.getElementById("cross_origin_style").href)); >+ const prefix = url.protocol + "//" + url.host; >+ assert_equals(performance.getEntriesByName(prefix + "/resource-timing/resources/resource_timing_test0.css?id=n1").length, 0, "Import should not be in timeline"); >+ assert_equals(performance.getEntriesByName(prefix + "/fonts/Ahem.ttf?id=n1").length, 0, "Font should not be in timeline"); >+ assert_equals(performance.getEntriesByName(prefix + "/resource-timing/resources/blue.png?id=n1").length, 0, "Image should not be in timeline"); >+ t.done(); >+ },100); >+ }); >+</script> >+<ol>Some content</ol> >+</body> >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.js >new file mode 100644 >index 0000000000000000000000000000000000000000..95b5cdfb1ed0ca2bbfd6b692ad565512218dd7a4 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.js >@@ -0,0 +1,517 @@ >+"use strict"; >+ >+window.onload = >+ function () { >+ setup({ explicit_timeout: true }); >+ >+ /** Number of milliseconds to delay when the server injects pauses into the response. >+ >+ This should be large enough that we can distinguish it from noise with high confidence, >+ but small enough that tests complete quickly. */ >+ var serverStepDelay = 250; >+ >+ var mimeHtml = "text/html"; >+ var mimeText = "text/plain"; >+ var mimePng = "image/png"; >+ var mimeScript = "application/javascript"; >+ var mimeCss = "text/css"; >+ >+ /** Hex encoding of a a 150x50px green PNG. */ >+ var greenPng = "0x89504E470D0A1A0A0000000D494844520000006400000032010300000090FBECFD00000003504C544500FF00345EC0A80000000F49444154281563601805A36068020002BC00011BDDE3900000000049454E44AE426082"; >+ >+ /** Array containing test cases to run. Initially, it contains the one-off 'about:blank" test, >+ but additional cases are pushed below by expanding templates. */ >+ var testCases = [ >+ { >+ description: "No timeline entry for about:blank", >+ test: >+ function (test) { >+ // Insert an empty IFrame. >+ var frame = document.createElement("iframe"); >+ >+ // Wait for the IFrame to load and ensure there is no resource entry for it on the timeline. >+ // >+ // We use the 'createOnloadCallbackFn()' helper which is normally invoked by 'initiateFetch()' >+ // to avoid setting the IFrame's src. It registers a test step for us, finds our entry on the >+ // resource timeline, and wraps our callback function to automatically vet invariants. >+ frame.onload = createOnloadCallbackFn(test, frame, "about:blank", >+ function (initiator, entry) { >+ assert_equals(entry, undefined, "Inserting an IFrame with a src of 'about:blank' must not add an entry to the timeline."); >+ assertInvariants( >+ test, >+ function () { >+ test.done(); >+ }); >+ }); >+ >+ document.body.appendChild(frame); >+ >+ // Paranoid check that the new IFrame has loaded about:blank. >+ assert_equals( >+ frame.contentWindow.location.href, >+ "about:blank", >+ "'Src' of new <iframe> must be 'about:blank'."); >+ } >+ }, >+ ]; >+ >+ // Create cached/uncached tests from the following array of templates. For each template entry, >+ // we add two identical test cases to 'testCases'. The first case initiates a fetch to populate the >+ // cache. The second request initiates a fetch with the same URL to cover the case where we hit >+ // the cache (if the caching policy permits caching). >+ [ >+ { initiator: "iframe", response: "(done)", mime: mimeHtml }, >+ { initiator: "xmlhttprequest", response: "(done)", mime: mimeText }, >+ // Multiple browsers seem to cheat a bit and race onLoad of images. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >+ // { initiator: "img", response: greenPng, mime: mimePng }, >+ { initiator: "script", response: '"";', mime: mimeScript }, >+ { initiator: "link", response: ".unused{}", mime: mimeCss }, >+ ] >+ .forEach(function (template) { >+ testCases.push({ >+ description: "'" + template.initiator + " (Populate cache): The initial request populates the cache (if appropriate).", >+ test: function (test) { >+ initiateFetch( >+ test, >+ template.initiator, >+ getSyntheticUrl( >+ "mime:" + encodeURIComponent(template.mime) >+ + "&send:" + encodeURIComponent(template.response), >+ /* allowCaching = */ true), >+ function (initiator, entry) { >+ test.done(); >+ }); >+ } >+ }); >+ >+ testCases.push({ >+ description: "'" + template.initiator + " (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any).", >+ test: function (test) { >+ initiateFetch( >+ test, >+ template.initiator, >+ getSyntheticUrl( >+ "mime:" + encodeURIComponent(template.mime) >+ + "&send:" + encodeURIComponent(template.response), >+ /* allowCaching = */ true), >+ function (initiator, entry) { >+ test.done(); >+ }); >+ } >+ }); >+ }); >+ >+ // Create responseStart/responseEnd tests from the following array of templates. In this test, the server delays before >+ // responding with responsePart1, then delays again before completing with responsePart2. The test looks for the expected >+ // pauses before responseStart and responseEnd. >+ [ >+ { initiator: "iframe", responsePart1: serverStepDelay + "ms;", responsePart2: (serverStepDelay * 2) + "ms;(done)", mime: mimeHtml }, >+ { initiator: "xmlhttprequest", responsePart1: serverStepDelay + "ms;", responsePart2: (serverStepDelay * 2) + "ms;(done)", mime: mimeText }, >+ // Multiple browsers seem to cheat a bit and race img.onLoad and setting responseEnd. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >+ // { initiator: "img", responsePart1: greenPng.substring(0, greenPng.length / 2), responsePart2: "0x" + greenPng.substring(greenPng.length / 2, greenPng.length), mime: mimePng }, >+ { initiator: "script", responsePart1: '"', responsePart2: '";', mime: mimeScript }, >+ { initiator: "link", responsePart1: ".unused{", responsePart2: "}", mime: mimeCss }, >+ ] >+ .forEach(function (template) { >+ testCases.push({ >+ description: "'" + template.initiator + ": " + serverStepDelay + "ms delay before 'responseStart', another " + serverStepDelay + "ms delay before 'responseEnd'.", >+ test: function (test) { >+ initiateFetch( >+ test, >+ template.initiator, >+ getSyntheticUrl(serverStepDelay + "ms" // Wait, then echo back responsePart1 >+ + "&mime:" + encodeURIComponent(template.mime) >+ + "&send:" + encodeURIComponent(template.responsePart1) >+ + "&" + serverStepDelay + "ms" // Wait, then echo back responsePart2 >+ + "&send:" + encodeURIComponent(template.responsePart2)), >+ >+ function (initiator, entry) { >+ // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >+ // If no redirects (or equivalent) occur, this redirectStart/End must return zero. >+ assert_equals(entry.redirectStart, 0, "When no redirect occurs, redirectStart must be 0."); >+ assert_equals(entry.redirectEnd, 0, "When no redirect occurs, redirectEnd must be 0."); >+ >+ // Server creates a gap between 'requestStart' and 'responseStart'. >+ assert_greater_than_equal( >+ entry.responseStart, >+ entry.requestStart + serverStepDelay, >+ "'responseStart' must be " + serverStepDelay + "ms later than 'requestStart'."); >+ >+ // Server creates a gap between 'responseStart' and 'responseEnd'. >+ assert_greater_than_equal( >+ entry.responseEnd, >+ entry.responseStart + serverStepDelay, >+ "'responseEnd' must be " + serverStepDelay + "ms later than 'responseStart'."); >+ >+ test.done(); >+ }); >+ } >+ }); >+ }); >+ >+ // Create redirectEnd/responseStart tests from the following array of templates. In this test, the server delays before >+ // redirecting to a new synthetic response, then delays again before responding with 'response'. The test looks for the >+ // expected pauses before redirectEnd and responseStart. >+ [ >+ { initiator: "iframe", response: serverStepDelay + "ms;redirect;" + (serverStepDelay * 2) + "ms;(done)", mime: mimeHtml }, >+ { initiator: "xmlhttprequest", response: serverStepDelay + "ms;redirect;" + (serverStepDelay * 2) + "ms;(done)", mime: mimeText }, >+ // Multiple browsers seem to cheat a bit and race img.onLoad and setting responseEnd. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >+ // { initiator: "img", response: greenPng, mime: mimePng }, >+ { initiator: "script", response: '"";', mime: mimeScript }, >+ { initiator: "link", response: ".unused{}", mime: mimeCss }, >+ ] >+ .forEach(function (template) { >+ testCases.push({ >+ description: "'" + template.initiator + " (Redirected): " + serverStepDelay + "ms delay before 'redirectEnd', another " + serverStepDelay + "ms delay before 'responseStart'.", >+ test: function (test) { >+ initiateFetch( >+ test, >+ template.initiator, >+ getSyntheticUrl(serverStepDelay + "ms" // Wait, then redirect to a second page that waits >+ + "&redirect:" // before echoing back the response. >+ + encodeURIComponent( >+ getSyntheticUrl(serverStepDelay + "ms" >+ + "&mime:" + encodeURIComponent(template.mime) >+ + "&send:" + encodeURIComponent(template.response)))), >+ function (initiator, entry) { >+ // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >+ // "[If redirected, startTime] MUST return the same value as redirectStart. >+ assert_equals(entry.startTime, entry.redirectStart, "startTime must be equal to redirectStart."); >+ >+ // Server creates a gap between 'redirectStart' and 'redirectEnd'. >+ assert_greater_than_equal( >+ entry.redirectEnd, >+ entry.redirectStart + serverStepDelay, >+ "'redirectEnd' must be " + serverStepDelay + "ms later than 'redirectStart'."); >+ >+ // Server creates a gap between 'requestStart' and 'responseStart'. >+ assert_greater_than_equal( >+ entry.responseStart, >+ entry.requestStart + serverStepDelay, >+ "'responseStart' must be " + serverStepDelay + "ms later than 'requestStart'."); >+ >+ test.done(); >+ }); >+ } >+ }); >+ }); >+ >+ // Ensure that responseStart only measures the time up to the first few >+ // bytes of the header response. This is tested by writing an HTTP 1.1 >+ // status line, followed by a flush, then a pause before the end of the >+ // headers. The test makes sure that responseStart is not delayed by >+ // this pause. >+ [ >+ { initiator: "iframe", response: "(done)", mime: mimeHtml }, >+ { initiator: "xmlhttprequest", response: "(done)", mime: mimeText }, >+ { initiator: "script", response: '"";', mime: mimeScript }, >+ { initiator: "link", response: ".unused{}", mime: mimeCss }, >+ ] >+ .forEach(function (template) { >+ testCases.push({ >+ description: "'" + template.initiator + " " + serverStepDelay + "ms delay in headers does not affect responseStart'", >+ test: function (test) { >+ initiateFetch( >+ test, >+ template.initiator, >+ getSyntheticUrl("status:200" >+ + "&flush" >+ + "&" + serverStepDelay + "ms" >+ + "&mime:" + template.mime >+ + "&send:" + encodeURIComponent(template.response)), >+ function (initiator, entry) { >+ // Test that the delay between 'responseStart' and >+ // 'responseEnd' includes the delay, which implies >+ // that 'responseStart' was measured at the time of >+ // status line receipt. >+ assert_greater_than_equal( >+ entry.responseEnd, >+ entry.responseStart + serverStepDelay, >+ "Delay after HTTP/1.1 status should not affect 'responseStart'."); >+ >+ test.done(); >+ }); >+ } >+ }); >+ }); >+ >+ // Test that responseStart uses the timing of 1XX responses by >+ // synthesizing a delay between a 100 and 200 status, and verifying that >+ // this delay is included before responseEnd. If the delay is not >+ // included, this implies that the 200 status line was (incorrectly) used >+ // for responseStart timing, despite the 100 response arriving earlier. >+ // >+ // Source: "In the case where more than one response is available for a >+ // request, due to an Informational 1xx response, the reported >+ // responseStart value is that of the first response to the last >+ // request." >+ [ >+ { initiator: "iframe", response: "(done)", mime: mimeHtml }, >+ { initiator: "xmlhttprequest", response: "(done)", mime: mimeText }, >+ { initiator: "script", response: '"";', mime: mimeScript }, >+ { initiator: "link", response: ".unused{}", mime: mimeCss }, >+ ] >+ .forEach(function (template) { >+ testCases.push({ >+ description: "'" + template.initiator + " responseStart uses 1XX (first) response timings'", >+ test: function (test) { >+ initiateFetch( >+ test, >+ template.initiator, >+ getSyntheticUrl("status:100" >+ + "&flush" >+ + "&" + serverStepDelay + "ms" >+ + "&status:200" >+ + "&mime:" + template.mime >+ + "&send:" + encodeURIComponent(template.response)), >+ function (initiator, entry) { >+ assert_greater_than_equal( >+ entry.responseEnd, >+ entry.responseStart + serverStepDelay, >+ "HTTP/1.1 1XX (first) response should determine 'responseStart' timing."); >+ >+ test.done(); >+ }); >+ } >+ }); >+ }); >+ >+ // Function to run the next case in the queue. >+ var currentTestIndex = -1; >+ function runNextCase() { >+ var testCase = testCases[++currentTestIndex]; >+ if (testCase !== undefined) { >+ async_test(testCase.test, testCase.description); >+ } >+ } >+ >+ // When a test completes, run the next case in the queue. >+ add_result_callback(runNextCase); >+ >+ // Start the first test. >+ runNextCase(); >+ >+ /** Iterates through all resource entries on the timeline, vetting all invariants. */ >+ function assertInvariants(test, done) { >+ // Multiple browsers seem to cheat a bit and race img.onLoad and setting responseEnd. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >+ // Yield for 100ms to workaround a suspected race where window.onload fires before >+ // script visible side-effects from the wininet/urlmon thread have finished. >+ test.step_timeout( >+ test.step_func( >+ function () { >+ performance >+ .getEntriesByType("resource") >+ .forEach( >+ function (entry, index, entries) { >+ assertResourceEntryInvariants(entry); >+ }); >+ >+ done(); >+ }), >+ 100); >+ } >+ >+ /** Assets the invariants for a resource timeline entry. */ >+ function assertResourceEntryInvariants(actual) { >+ // Example from http://w3c.github.io/resource-timing/#resources-included: >+ // "If an HTML IFRAME element is added via markup without specifying a src attribute, >+ // the user agent may load the about:blank document for the IFRAME. If at a later time >+ // the src attribute is changed dynamically via script, the user agent may fetch the new >+ // URL resource for the IFRAME. In this case, only the fetch of the new URL would be >+ // included as a PerformanceResourceTiming object in the Performance Timeline." >+ assert_not_equals( >+ actual.name, >+ "about:blank", >+ "Fetch for 'about:blank' must not appear in timeline."); >+ >+ assert_not_equals(actual.startTime, 0, "startTime"); >+ >+ // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >+ // "[If redirected, startTime] MUST return the same value as redirectStart. Otherwise, >+ // [startTime] MUST return the same value as fetchStart." >+ assert_in_array(actual.startTime, [actual.redirectStart, actual.fetchStart], >+ "startTime must be equal to redirectStart or fetchStart."); >+ >+ // redirectStart <= redirectEnd <= fetchStart <= domainLookupStart <= domainLookupEnd <= connectStart >+ assert_less_than_equal(actual.redirectStart, actual.redirectEnd, "redirectStart <= redirectEnd"); >+ assert_less_than_equal(actual.redirectEnd, actual.fetchStart, "redirectEnd <= fetchStart"); >+ assert_less_than_equal(actual.fetchStart, actual.domainLookupStart, "fetchStart <= domainLookupStart"); >+ assert_less_than_equal(actual.domainLookupStart, actual.domainLookupEnd, "domainLookupStart <= domainLookupEnd"); >+ assert_less_than_equal(actual.domainLookupEnd, actual.connectStart, "domainLookupEnd <= connectStart"); >+ >+ // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >+ // "This attribute is optional. User agents that don't have this attribute available MUST set it >+ // as undefined. [...] If the secureConnectionStart attribute is available but HTTPS is not used, >+ // this attribute MUST return zero." >+ assert_true(actual.secureConnectionStart == undefined || >+ actual.secureConnectionStart == 0 || >+ actual.secureConnectionStart >= actual.connectEnd, "secureConnectionStart time"); >+ >+ // connectStart <= connectEnd <= requestStart <= responseStart <= responseEnd >+ assert_less_than_equal(actual.connectStart, actual.connectEnd, "connectStart <= connectEnd"); >+ assert_less_than_equal(actual.connectEnd, actual.requestStart, "connectEnd <= requestStart"); >+ assert_less_than_equal(actual.requestStart, actual.responseStart, "requestStart <= responseStart"); >+ assert_less_than_equal(actual.responseStart, actual.responseEnd, "responseStart <= responseEnd"); >+ } >+ >+ /** Helper function to resolve a relative URL */ >+ function canonicalize(url) { >+ var div = document.createElement('div'); >+ div.innerHTML = "<a></a>"; >+ div.firstChild.href = url; >+ div.innerHTML = div.innerHTML; >+ return div.firstChild.href; >+ } >+ >+ /** Generates a unique string, used by getSyntheticUrl() to avoid hitting the cache. */ >+ function createUniqueQueryArgument() { >+ var result = >+ "ignored_" >+ + Date.now() >+ + "-" >+ + ((Math.random() * 0xFFFFFFFF) >>> 0) >+ + "-" >+ + syntheticRequestCount; >+ >+ return result; >+ } >+ >+ /** Count of the calls to getSyntheticUrl(). Used by createUniqueQueryArgument() to generate unique strings. */ >+ var syntheticRequestCount = 0; >+ >+ /** Return a URL to a server that will synthesize an HTTP response using the given >+ commands. (See SyntheticResponse.aspx). */ >+ function getSyntheticUrl(commands, allowCache) { >+ syntheticRequestCount++; >+ >+ var url = >+ canonicalize("./SyntheticResponse.py") // ASP.NET page that will synthesize the response. >+ + "?" + commands; // Commands that will be used. >+ >+ if (allowCache !== true) { // If caching is disallowed, append a unique argument >+ url += "&" + createUniqueQueryArgument(); // to the URL's query string. >+ } >+ >+ return url; >+ } >+ >+ /** Given an 'initiatorType' (e.g., "img") , it triggers the appropriate type of fetch for the specified >+ url and invokes 'onloadCallback' when the fetch completes. If the fetch caused an entry to be created >+ on the resource timeline, the entry is passed to the callback. */ >+ function initiateFetch(test, initiatorType, url, onloadCallback) { >+ assertInvariants( >+ test, >+ function () { >+ log("--- Begin: " + url); >+ >+ switch (initiatorType) { >+ case "script": >+ case "img": >+ case "iframe": { >+ var element = document.createElement(initiatorType); >+ document.body.appendChild(element); >+ element.onload = createOnloadCallbackFn(test, element, url, onloadCallback); >+ element.src = url; >+ break; >+ } >+ case "link": { >+ var element = document.createElement(initiatorType); >+ element.rel = "stylesheet"; >+ document.body.appendChild(element); >+ element.onload = createOnloadCallbackFn(test, element, url, onloadCallback); >+ element.href = url; >+ break; >+ } >+ case "xmlhttprequest": { >+ var xhr = new XMLHttpRequest(); >+ xhr.open('GET', url, true); >+ xhr.onreadystatechange = createOnloadCallbackFn(test, xhr, url, onloadCallback); >+ xhr.send(); >+ break; >+ } >+ default: >+ assert_unreached("Unsupported initiatorType '" + initiatorType + "'."); >+ break; >+ }}); >+ } >+ >+ /** Used by 'initiateFetch' to register a test step for the asynchronous callback, vet invariants, >+ find the matching resource timeline entry (if any), and pass it to the given 'onloadCallback' >+ when invoked. */ >+ function createOnloadCallbackFn(test, initiator, url, onloadCallback) { >+ // Remember the number of entries on the timeline prior to initiating the fetch: >+ var beforeEntryCount = performance.getEntriesByType("resource").length; >+ >+ return test.step_func( >+ function() { >+ // If the fetch was initiated by XHR, we're subscribed to the 'onreadystatechange' event. >+ // Ignore intermediate callbacks and wait for the XHR to complete. >+ if (Object.getPrototypeOf(initiator) === XMLHttpRequest.prototype) { >+ if (initiator.readyState != 4) { >+ return; >+ } >+ } >+ >+ var entries = performance.getEntriesByType("resource"); >+ var candidateEntry = entries[entries.length - 1]; >+ >+ switch (entries.length - beforeEntryCount) >+ { >+ case 0: >+ candidateEntry = undefined; >+ break; >+ case 1: >+ // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >+ // "This attribute MUST return the resolved URL of the requested resource. This attribute >+ // MUST NOT change even if the fetch redirected to a different URL." >+ assert_equals(candidateEntry.name, url, "'name' did not match expected 'url'."); >+ logResourceEntry(candidateEntry); >+ break; >+ default: >+ assert_unreached("At most, 1 entry should be added to the performance timeline during a fetch."); >+ break; >+ } >+ >+ assertInvariants( >+ test, >+ function () { >+ onloadCallback(initiator, candidateEntry); >+ }); >+ }); >+ } >+ >+ /** Log the given text to the document element with id='output' */ >+ function log(text) { >+ var output = document.getElementById("output"); >+ output.textContent += text + "\r\n"; >+ } >+ >+ add_completion_callback(function () { >+ var output = document.getElementById("output"); >+ var button = document.createElement('button'); >+ output.parentNode.insertBefore(button, output); >+ button.onclick = function () { >+ var showButton = output.style.display == 'none'; >+ output.style.display = showButton ? null : 'none'; >+ button.textContent = showButton ? 'Hide details' : 'Show details'; >+ } >+ button.onclick(); >+ var iframes = document.querySelectorAll('iframe'); >+ for (var i = 0; i < iframes.length; i++) >+ iframes[i].parentNode.removeChild(iframes[i]); >+ }); >+ >+ /** pretty print a resource timeline entry. */ >+ function logResourceEntry(entry) { >+ log("[" + entry.entryType + "] " + entry.name); >+ >+ ["startTime", "redirectStart", "redirectEnd", "fetchStart", "domainLookupStart", "domainLookupEnd", "connectStart", "secureConnectionStart", "connectEnd", "requestStart", "responseStart", "responseEnd"] >+ .forEach( >+ function (property, index, array) { >+ var value = entry[property]; >+ log(property + ":\t" + value); >+ }); >+ >+ log("\r\n"); >+ } >+ }; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5ce703a3f84a4089a304cd6cf046bd68eb90124e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt >@@ -0,0 +1,11 @@ >+ >+Harness Error (TIMEOUT), message = null >+ >+PASS No timeline entry for about:blank >+PASS 'iframe (Populate cache): The initial request populates the cache (if appropriate). >+PASS 'iframe (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). >+PASS 'xmlhttprequest (Populate cache): The initial request populates the cache (if appropriate). >+PASS 'xmlhttprequest (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). >+TIMEOUT 'script (Populate cache): The initial request populates the cache (if appropriate). Test timed out >+TIMEOUT 'script (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). Test timed out >+Show details >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub.html >new file mode 100644 >index 0000000000000000000000000000000000000000..093d2542218fbe48b134230b4d9d65e1ef1d4c10 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub.html >@@ -0,0 +1,19 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <title>Resource-Timing Level 1</title> >+ <meta name="timeout" content="long"> >+ <!-- To aid debugability, explicitly link the testharness's CSS to avoid demand >+ loading it while the test executes. --> >+ <script src="/resources/testharness.js"></script> >+ <script src="/resources/testharnessreport.js"></script> >+ >+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> >+ <link rel="help" href="https://w3c.github.io/resource-timing/"> >+</head> >+<body> >+ <div id="log"></div> >+ <pre id="output"></pre> >+ <script src="resource-timing-level1.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.html >deleted file mode 100644 >index 9f899f7ac4f0886f30d0b4bcb183dfbf00e1be19..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.html >+++ /dev/null >@@ -1,18 +0,0 @@ >-<!DOCTYPE html> >-<html> >-<head> >- <title>Resource-Timing Level 1</title> >- <!-- To aid debugability, explicitly link the testharness's CSS to avoid demand >- loading it while the test executes. --> >- <script src="/resources/testharness.js"></script> >- <script src="/resources/testharnessreport.js"></script> >- >- <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> >- <link rel="help" href="https://w3c.github.io/resource-timing/"> >-</head> >-<body> >- <div id="log"></div> >- <pre id="output"></pre> >- <script src="resource-timing.js"></script> >-</body> >-</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.js >deleted file mode 100644 >index 9167013a5adb29c6ef37d17613ce7a35a2f07350..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.js >+++ /dev/null >@@ -1,465 +0,0 @@ >-"use strict"; >- >-window.onload = >- function () { >- setup({ explicit_timeout: true }); >- >- /** Number of milliseconds to delay when the server injects pauses into the response. >- >- This should be large enough that we can distinguish it from noise with high confidence, >- but small enough that tests complete quickly. */ >- var serverStepDelay = 250; >- >- var mimeHtml = "text/html"; >- var mimeText = "text/plain"; >- var mimePng = "image/png"; >- var mimeScript = "application/javascript"; >- var mimeCss = "text/css"; >- >- /** Hex encoding of a a 150x50px green PNG. */ >- var greenPng = "0x89504E470D0A1A0A0000000D494844520000006400000032010300000090FBECFD00000003504C544500FF00345EC0A80000000F49444154281563601805A36068020002BC00011BDDE3900000000049454E44AE426082"; >- >- /** Array containing test cases to run. Initially, it contains the one-off 'about:blank" test, >- but additional cases are pushed below by expanding templates. */ >- var testCases = [ >- { >- description: "No timeline entry for about:blank", >- test: >- function (test) { >- // Insert an empty IFrame. >- var frame = document.createElement("iframe"); >- >- // Wait for the IFrame to load and ensure there is no resource entry for it on the timeline. >- // >- // We use the 'createOnloadCallbackFn()' helper which is normally invoked by 'initiateFetch()' >- // to avoid setting the IFrame's src. It registers a test step for us, finds our entry on the >- // resource timeline, and wraps our callback function to automatically vet invariants. >- frame.onload = createOnloadCallbackFn(test, frame, "about:blank", >- function (initiator, entry) { >- assert_equals(entry, undefined, "Inserting an IFrame with a src of 'about:blank' must not add an entry to the timeline."); >- assertInvariants( >- test, >- function () { >- test.done(); >- }); >- }); >- >- document.body.appendChild(frame); >- >- // Paranoid check that the new IFrame has loaded about:blank. >- assert_equals( >- frame.contentWindow.location.href, >- "about:blank", >- "'Src' of new <iframe> must be 'about:blank'."); >- } >- }, >- { >- description: "Setting 'document.domain' does not effect same-origin checks", >- test: >- function (test) { >- initiateFetch( >- test, >- "iframe", >- canonicalize("iframe-setdomain.sub.html"), >- function (initiator, entry) { >- // Ensure that the script inside the IFrame has successfully changed the IFrame's domain. >- assert_throws( >- null, >- function () { >- assert_not_equals(frame.contentWindow.document, null); >- }, >- "Test Error: IFrame is not recognized as cross-domain."); >- >- // To verify that setting 'document.domain' did not change the results of the timing allow check, >- // verify that the following non-zero properties return their value. >- ["domainLookupStart", "domainLookupEnd", "connectStart", "connectEnd"] >- .forEach(function(property) { >- assert_greater_than(entry.connectEnd, 0, >- "Property should be non-zero because timing allow check ignores 'document.domain'."); >- }); >- test.done(); >- }); >- } >- } >- ]; >- >- // Create cached/uncached tests from the following array of templates. For each template entry, >- // we add two identical test cases to 'testCases'. The first case initiates a fetch to populate the >- // cache. The second request initiates a fetch with the same URL to cover the case where we hit >- // the cache (if the caching policy permits caching). >- [ >- { initiator: "iframe", response: "(done)", mime: mimeHtml }, >- { initiator: "xmlhttprequest", response: "(done)", mime: mimeText }, >- // Multiple browsers seem to cheat a bit and race onLoad of images. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >- // { initiator: "img", response: greenPng, mime: mimePng }, >- { initiator: "script", response: '"";', mime: mimeScript }, >- { initiator: "link", response: ".unused{}", mime: mimeCss }, >- ] >- .forEach(function (template) { >- testCases.push({ >- description: "'" + template.initiator + " (Populate cache): The initial request populates the cache (if appropriate).", >- test: function (test) { >- initiateFetch( >- test, >- template.initiator, >- getSyntheticUrl( >- "mime:" + encodeURIComponent(template.mime) >- + "&send:" + encodeURIComponent(template.response), >- /* allowCaching = */ true), >- function (initiator, entry) { >- test.done(); >- }); >- } >- }); >- >- testCases.push({ >- description: "'" + template.initiator + " (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any).", >- test: function (test) { >- initiateFetch( >- test, >- template.initiator, >- getSyntheticUrl( >- "mime:" + encodeURIComponent(template.mime) >- + "&send:" + encodeURIComponent(template.response), >- /* allowCaching = */ true), >- function (initiator, entry) { >- test.done(); >- }); >- } >- }); >- }); >- >- // Create responseStart/responseEnd tests from the following array of templates. In this test, the server delays before >- // responding with responsePart1, then delays again before completing with responsePart2. The test looks for the expected >- // pauses before responseStart and responseEnd. >- [ >- { initiator: "iframe", responsePart1: serverStepDelay + "ms;", responsePart2: (serverStepDelay * 2) + "ms;(done)", mime: mimeHtml }, >- { initiator: "xmlhttprequest", responsePart1: serverStepDelay + "ms;", responsePart2: (serverStepDelay * 2) + "ms;(done)", mime: mimeText }, >- // Multiple browsers seem to cheat a bit and race img.onLoad and setting responseEnd. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >- // { initiator: "img", responsePart1: greenPng.substring(0, greenPng.length / 2), responsePart2: "0x" + greenPng.substring(greenPng.length / 2, greenPng.length), mime: mimePng }, >- { initiator: "script", responsePart1: '"', responsePart2: '";', mime: mimeScript }, >- { initiator: "link", responsePart1: ".unused{", responsePart2: "}", mime: mimeCss }, >- ] >- .forEach(function (template) { >- testCases.push({ >- description: "'" + template.initiator + ": " + serverStepDelay + "ms delay before 'responseStart', another " + serverStepDelay + "ms delay before 'responseEnd'.", >- test: function (test) { >- initiateFetch( >- test, >- template.initiator, >- getSyntheticUrl(serverStepDelay + "ms" // Wait, then echo back responsePart1 >- + "&mime:" + encodeURIComponent(template.mime) >- + "&send:" + encodeURIComponent(template.responsePart1) >- + "&" + serverStepDelay + "ms" // Wait, then echo back responsePart2 >- + "&send:" + encodeURIComponent(template.responsePart2)), >- >- function (initiator, entry) { >- // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >- // If no redirects (or equivalent) occur, this redirectStart/End must return zero. >- assert_equals(entry.redirectStart, 0, "When no redirect occurs, redirectStart must be 0."); >- assert_equals(entry.redirectEnd, 0, "When no redirect occurs, redirectEnd must be 0."); >- >- // Server creates a gap between 'requestStart' and 'responseStart'. >- assert_greater_than_equal( >- entry.responseStart, >- entry.requestStart + serverStepDelay, >- "'responseStart' must be " + serverStepDelay + "ms later than 'requestStart'."); >- >- // Server creates a gap between 'responseStart' and 'responseEnd'. >- assert_greater_than_equal( >- entry.responseEnd, >- entry.responseStart + serverStepDelay, >- "'responseEnd' must be " + serverStepDelay + "ms later than 'responseStart'."); >- >- test.done(); >- }); >- } >- }); >- }); >- >- // Create redirectEnd/responseStart tests from the following array of templates. In this test, the server delays before >- // redirecting to a new synthetic response, then delays again before responding with 'response'. The test looks for the >- // expected pauses before redirectEnd and responseStart. >- [ >- { initiator: "iframe", response: serverStepDelay + "ms;redirect;" + (serverStepDelay * 2) + "ms;(done)", mime: mimeHtml }, >- { initiator: "xmlhttprequest", response: serverStepDelay + "ms;redirect;" + (serverStepDelay * 2) + "ms;(done)", mime: mimeText }, >- // Multiple browsers seem to cheat a bit and race img.onLoad and setting responseEnd. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >- // { initiator: "img", response: greenPng, mime: mimePng }, >- { initiator: "script", response: '"";', mime: mimeScript }, >- { initiator: "link", response: ".unused{}", mime: mimeCss }, >- ] >- .forEach(function (template) { >- testCases.push({ >- description: "'" + template.initiator + " (Redirected): " + serverStepDelay + "ms delay before 'redirectEnd', another " + serverStepDelay + "ms delay before 'responseStart'.", >- test: function (test) { >- initiateFetch( >- test, >- template.initiator, >- getSyntheticUrl(serverStepDelay + "ms" // Wait, then redirect to a second page that waits >- + "&redirect:" // before echoing back the response. >- + encodeURIComponent( >- getSyntheticUrl(serverStepDelay + "ms" >- + "&mime:" + encodeURIComponent(template.mime) >- + "&send:" + encodeURIComponent(template.response)))), >- function (initiator, entry) { >- // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >- // "[If redirected, startTime] MUST return the same value as redirectStart. >- assert_equals(entry.startTime, entry.redirectStart, "startTime must be equal to redirectStart."); >- >- // Server creates a gap between 'redirectStart' and 'redirectEnd'. >- assert_greater_than_equal( >- entry.redirectEnd, >- entry.redirectStart + serverStepDelay, >- "'redirectEnd' must be " + serverStepDelay + "ms later than 'redirectStart'."); >- >- // Server creates a gap between 'requestStart' and 'responseStart'. >- assert_greater_than_equal( >- entry.responseStart, >- entry.requestStart + serverStepDelay, >- "'responseStart' must be " + serverStepDelay + "ms later than 'requestStart'."); >- >- test.done(); >- }); >- } >- }); >- }); >- >- // Function to run the next case in the queue. >- var currentTestIndex = -1; >- function runNextCase() { >- var testCase = testCases[++currentTestIndex]; >- if (testCase !== undefined) { >- async_test(testCase.test, testCase.description); >- } >- } >- >- // When a test completes, run the next case in the queue. >- add_result_callback(runNextCase); >- >- // Start the first test. >- runNextCase(); >- >- /** Iterates through all resource entries on the timeline, vetting all invariants. */ >- function assertInvariants(test, done) { >- // Multiple browsers seem to cheat a bit and race img.onLoad and setting responseEnd. Microsoft https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/2379187 >- // Yield for 100ms to workaround a suspected race where window.onload fires before >- // script visible side-effects from the wininet/urlmon thread have finished. >- window.setTimeout( >- test.step_func( >- function () { >- performance >- .getEntriesByType("resource") >- .forEach( >- function (entry, index, entries) { >- assertResourceEntryInvariants(entry); >- }); >- >- done(); >- }), >- 100); >- } >- >- /** Assets the invariants for a resource timeline entry. */ >- function assertResourceEntryInvariants(actual) { >- // Example from http://w3c.github.io/resource-timing/#resources-included: >- // "If an HTML IFRAME element is added via markup without specifying a src attribute, >- // the user agent may load the about:blank document for the IFRAME. If at a later time >- // the src attribute is changed dynamically via script, the user agent may fetch the new >- // URL resource for the IFRAME. In this case, only the fetch of the new URL would be >- // included as a PerformanceResourceTiming object in the Performance Timeline." >- assert_not_equals( >- actual.name, >- "about:blank", >- "Fetch for 'about:blank' must not appear in timeline."); >- >- assert_not_equals(actual.startTime, 0, "startTime"); >- >- // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >- // "[If redirected, startTime] MUST return the same value as redirectStart. Otherwise, >- // [startTime] MUST return the same value as fetchStart." >- assert_in_array(actual.startTime, [actual.redirectStart, actual.fetchStart], >- "startTime must be equal to redirectStart or fetchStart."); >- >- // redirectStart <= redirectEnd <= fetchStart <= domainLookupStart <= domainLookupEnd <= connectStart >- assert_less_than_equal(actual.redirectStart, actual.redirectEnd, "redirectStart <= redirectEnd"); >- assert_less_than_equal(actual.redirectEnd, actual.fetchStart, "redirectEnd <= fetchStart"); >- assert_less_than_equal(actual.fetchStart, actual.domainLookupStart, "fetchStart <= domainLookupStart"); >- assert_less_than_equal(actual.domainLookupStart, actual.domainLookupEnd, "domainLookupStart <= domainLookupEnd"); >- assert_less_than_equal(actual.domainLookupEnd, actual.connectStart, "domainLookupEnd <= connectStart"); >- >- // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >- // "This attribute is optional. User agents that don't have this attribute available MUST set it >- // as undefined. [...] If the secureConnectionStart attribute is available but HTTPS is not used, >- // this attribute MUST return zero." >- assert_true(actual.secureConnectionStart == undefined || >- actual.secureConnectionStart == 0 || >- actual.secureConnectionStart >= actual.connectEnd, "secureConnectionStart time"); >- >- // connectStart <= connectEnd <= requestStart <= responseStart <= responseEnd >- assert_less_than_equal(actual.connectStart, actual.connectEnd, "connectStart <= connectEnd"); >- assert_less_than_equal(actual.connectEnd, actual.requestStart, "connectEnd <= requestStart"); >- assert_less_than_equal(actual.requestStart, actual.responseStart, "requestStart <= responseStart"); >- assert_less_than_equal(actual.responseStart, actual.responseEnd, "responseStart <= responseEnd"); >- } >- >- /** Helper function to resolve a relative URL */ >- function canonicalize(url) { >- var div = document.createElement('div'); >- div.innerHTML = "<a></a>"; >- div.firstChild.href = url; >- div.innerHTML = div.innerHTML; >- return div.firstChild.href; >- } >- >- /** Generates a unique string, used by getSyntheticUrl() to avoid hitting the cache. */ >- function createUniqueQueryArgument() { >- var result = >- "ignored_" >- + Date.now() >- + "-" >- + ((Math.random() * 0xFFFFFFFF) >>> 0) >- + "-" >- + syntheticRequestCount; >- >- return result; >- } >- >- /** Count of the calls to getSyntheticUrl(). Used by createUniqueQueryArgument() to generate unique strings. */ >- var syntheticRequestCount = 0; >- >- /** Return a URL to a server that will synthesize an HTTP response using the given >- commands. (See SyntheticResponse.aspx). */ >- function getSyntheticUrl(commands, allowCache) { >- syntheticRequestCount++; >- >- var url = >- canonicalize("./SyntheticResponse.py") // ASP.NET page that will synthesize the response. >- + "?" + commands; // Commands that will be used. >- >- if (allowCache !== true) { // If caching is disallowed, append a unique argument >- url += "&" + createUniqueQueryArgument(); // to the URL's query string. >- } >- >- return url; >- } >- >- /** Given an 'initiatorType' (e.g., "img") , it triggers the appropriate type of fetch for the specified >- url and invokes 'onloadCallback' when the fetch completes. If the fetch caused an entry to be created >- on the resource timeline, the entry is passed to the callback. */ >- function initiateFetch(test, initiatorType, url, onloadCallback) { >- assertInvariants( >- test, >- function () { >- log("--- Begin: " + url); >- >- switch (initiatorType) { >- case "script": >- case "img": >- case "iframe": { >- var element = document.createElement(initiatorType); >- document.body.appendChild(element); >- element.onload = createOnloadCallbackFn(test, element, url, onloadCallback); >- element.src = url; >- break; >- } >- case "link": { >- var element = document.createElement(initiatorType); >- element.rel = "stylesheet"; >- document.body.appendChild(element); >- element.onload = createOnloadCallbackFn(test, element, url, onloadCallback); >- element.href = url; >- break; >- } >- case "xmlhttprequest": { >- var xhr = new XMLHttpRequest(); >- xhr.open('GET', url, true); >- xhr.onreadystatechange = createOnloadCallbackFn(test, xhr, url, onloadCallback); >- xhr.send(); >- break; >- } >- default: >- assert_unreached("Unsupported initiatorType '" + initiatorType + "'."); >- break; >- }}); >- } >- >- /** Used by 'initiateFetch' to register a test step for the asynchronous callback, vet invariants, >- find the matching resource timeline entry (if any), and pass it to the given 'onloadCallback' >- when invoked. */ >- function createOnloadCallbackFn(test, initiator, url, onloadCallback) { >- // Remember the number of entries on the timeline prior to initiating the fetch: >- var beforeEntryCount = performance.getEntries().length; >- >- return test.step_func( >- function() { >- // If the fetch was initiated by XHR, we're subscribed to the 'onreadystatechange' event. >- // Ignore intermediate callbacks and wait for the XHR to complete. >- if (Object.getPrototypeOf(initiator) === XMLHttpRequest.prototype) { >- if (initiator.readyState != 4) { >- return; >- } >- } >- >- var entries = performance.getEntries(); >- var candidateEntry = entries[entries.length - 1]; >- >- switch (entries.length - beforeEntryCount) >- { >- case 0: >- candidateEntry = undefined; >- break; >- case 1: >- // Per https://w3c.github.io/resource-timing/#performanceresourcetiming: >- // "This attribute MUST return the resolved URL of the requested resource. This attribute >- // MUST NOT change even if the fetch redirected to a different URL." >- assert_equals(candidateEntry.name, url, "'name' did not match expected 'url'."); >- logResourceEntry(candidateEntry); >- break; >- default: >- assert_unreached("At most, 1 entry should be added to the performance timeline during a fetch."); >- break; >- } >- >- assertInvariants( >- test, >- function () { >- onloadCallback(initiator, candidateEntry); >- }); >- }); >- } >- >- /** Log the given text to the document element with id='output' */ >- function log(text) { >- var output = document.getElementById("output"); >- output.textContent += text + "\r\n"; >- } >- >- add_completion_callback(function () { >- var output = document.getElementById("output"); >- var button = document.createElement('button'); >- output.parentNode.insertBefore(button, output); >- button.onclick = function () { >- var showButton = output.style.display == 'none'; >- output.style.display = showButton ? null : 'none'; >- button.textContent = showButton ? 'Hide details' : 'Show details'; >- } >- button.onclick(); >- var iframes = document.querySelectorAll('iframe'); >- for (var i = 0; i < iframes.length; i++) >- iframes[i].parentNode.removeChild(iframes[i]); >- }); >- >- /** pretty print a resource timeline entry. */ >- function logResourceEntry(entry) { >- log("[" + entry.entryType + "] " + entry.name); >- >- ["startTime", "redirectStart", "redirectEnd", "fetchStart", "domainLookupStart", "domainLookupEnd", "connectStart", "secureConnectionStart", "connectEnd", "requestStart", "responseStart", "responseEnd"] >- .forEach( >- function (property, index, array) { >- var value = entry[property]; >- log(property + ":\t" + value); >- }); >- >- log("\r\n"); >- } >- }; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.html >index d2bcab912ed79a58ff48c5f01287423e1a1b1638..74c7c10821e899fc8cfcb4d6b958281966557b4f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.html >@@ -41,6 +41,10 @@ function onload_test() { > const entry = entries[1]; > test_equals(entry.fetchStart, entry.connectStart, 'connectStart and fetchStart should be the same'); > test_equals(entry.fetchStart, entry.connectEnd, 'connectEnd and fetchStart should be the same'); >+ test_equals(entry.fetchStart, entry.secureConnectionStart, 'secureConnectStart and fetchStart should be the same'); >+ test_equals(entry.fetchStart, entry.domainLookupStart, 'domainLookupStart and fetchStart should be the same') >+ test_equals(entry.fetchStart, entry.domainLookupEnd, 'domainLookupEnd and fetchStart should be the same') >+ > } > > done(); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.js >index 92687f0f7b62b92e414d0e8a900faac570735c9d..dafd2e9af602ed535acc84fb7088b70a23c64608 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.js >@@ -59,6 +59,6 @@ async_test(t => { > .then(() => { > t.done(); > }); >-}, "Performance Resouce Entries in workers"); >+}, "Performance Resource Entries in workers"); > > done(); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries-expected.txt >deleted file mode 100644 >index 63b25cf06793b484f46c8c61d2cd87e4b8fdc60d..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries-expected.txt >+++ /dev/null >@@ -1,4 +0,0 @@ >- >-PASS There should only be |bufferSize| resource entries. >-PASS onresourcetimingbufferfull should have been invoked once buffer is full. >- >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries.html >deleted file mode 100644 >index 3e62b199a32b1cb7ff5eafc7fc690b379409b660..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries.html >+++ /dev/null >@@ -1,41 +0,0 @@ >-<!DOCTYPE HTML> >-<html> >-<head> >-<meta charset="utf-8" /> >-<link rel="author" title="Intel" href="http://www.intel.com/" /> >-<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >-<title>This test validates the functionality of onresourcetimingbufferfull in resource timing.</title> >-<script src="/resources/testharness.js"></script> >-<script src="/resources/testharnessreport.js"></script> >-<script src="resources/webperftestharness.js"></script> >-<script src="resources/webperftestharnessextension.js"></script> >-</head> >-<body onload=onload_test()> >-<script> >- const context = new PerformanceContext(performance); >- const bufferSize = 5; >- context.setResourceTimingBufferSize(bufferSize); >- let bufferFullCount = 0; >- function buffer_full_callback() { >- bufferFullCount++; >- } >- context.registerResourceTimingBufferFullCallback(buffer_full_callback); >- // Scripts appended in JS to ensure setResourceTimingBufferSize is called before. >- function appendScript(src) { >- const script = document.createElement('script'); >- script.type = 'text/javascript'; >- script.src = src; >- document.body.appendChild(script); >- } >- appendScript('resources/empty.js'); >- appendScript('resources/empty_script.js'); >- appendScript('resources/resource_timing_test0.js'); >- setup({ explicit_done: true }); >- function onload_test() { >- test_equals(context.getEntriesByType('resource').length, bufferSize, 'There should only be |bufferSize| resource entries.'); >- test_equals(bufferFullCount, 1, 'onresourcetimingbufferfull should have been invoked once buffer is full.'); >- done(); >- } >-</script> >-</body> >-</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback-expected.txt >deleted file mode 100644 >index 5d7ca6278e0d8000ff23cb8ba973c8e51e926437..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback-expected.txt >+++ /dev/null >@@ -1,11 +0,0 @@ >- >-FAIL No entry should be stored in resource timing buffer since its cleared once an item arrived. assert_equals: No entry should be stored in resource timing buffer since its cleared once an item arrived. expected 0 but got 1 >-PASS 6 resource timing entries should be moved to global buffer. >-FAIL http://localhost:8800/resource-timing/resources/empty.js is not expected to be in the Resource Timing buffer assert_unreached: Reached unreachable code >-PASS http://localhost:8800/resource-timing/resources/empty_script.js is expected to have initiatorType script >-PASS http://localhost:8800/resource-timing/resources/webperftestharness.js is expected to have initiatorType script >-PASS http://localhost:8800/resource-timing/resources/webperftestharnessextension.js is expected to have initiatorType script >-PASS http://localhost:8800/resources/testharness.js is expected to have initiatorType script >-PASS http://localhost:8800/resources/testharnessreport.js is expected to have initiatorType script >-FAIL http://localhost:8800/resource-timing/resources/resource_timing_test0.js is expected to be in the Resource Timing buffer assert_unreached: Reached unreachable code >- >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html >deleted file mode 100644 >index 218fc0c2bcd5f987c2aee511bb66fd338476215f..0000000000000000000000000000000000000000 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html >+++ /dev/null >@@ -1,56 +0,0 @@ >-<!DOCTYPE HTML> >-<html> >-<head onload> >-<meta charset="utf-8" /> >-<title>This test validates the behavior of read and clear operation in onresourcetimingbufferfull callback of resource timing.</title> >-<link rel="author" title="Intel" href="http://www.intel.com/" /> >-<link rel="help" href="http://www.w3.org/TR/resource-timing/#performanceresourcetiming"/> >-<script src="/resources/testharness.js"></script> >-<script src="/resources/testharnessreport.js"></script> >-<script src="resources/webperftestharness.js"></script> >-<script src="resources/webperftestharnessextension.js"></script> >-</head> >-<body onload=onload_test()> >-<script> >- const context = new PerformanceContext(performance); >- const resource_timing_buffer_size = 1; >- let global_buffer = []; >- function store_and_clear() { >- const entryList = context.getEntriesByType('resource'); >- entryList.forEach(function (entry) { >- global_buffer.push(entry); >- }); >- context.clearResourceTimings(); >- } >- context.registerResourceTimingBufferFullCallback(store_and_clear); >- context.setResourceTimingBufferSize(resource_timing_buffer_size); >- // Scripts appended in JS to ensure setResourceTimingBufferSize is called before. >- function appendScript(src) { >- const script = document.createElement('script'); >- script.type = 'text/javascript'; >- script.src = src; >- document.body.appendChild(script); >- } >- appendScript('resources/empty.js'); >- appendScript('resources/empty_script.js'); >- appendScript('resources/resource_timing_test0.js'); >- setup({ explicit_done: true }); >- function onload_test() { >- test_equals(context.getEntriesByType('resource').length, 0, 'No entry should be stored in resource timing buffer since its cleared once an item arrived.'); >- // The entry for empty.js must not be in the global buffer, but all others should be. >- test_equals(global_buffer.length, 6, '6 resource timing entries should be moved to global buffer.'); >- const index = window.location.pathname.lastIndexOf('resource-timing'); >- const pathname = window.location.pathname.substring(0, index); >- let expected_entries = {}; >- expected_entries[pathname + 'resources/testharness.js'] = 'script'; >- expected_entries[pathname + 'resources/testharnessreport.js'] = 'script'; >- expected_entries[pathname + 'resource-timing/resources/webperftestharness.js'] = 'script'; >- expected_entries[pathname + 'resource-timing/resources/webperftestharnessextension.js'] = 'script'; >- expected_entries[pathname + 'resource-timing/resources/empty_script.js'] = 'script'; >- expected_entries[pathname + 'resource-timing/resources/resource_timing_test0.js'] = 'script'; >- test_resource_entries(global_buffer, expected_entries); >- done(); >- } >-</script> >-</body> >-</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b143da7b325f0ad24a2f9ad67db7ba31d0aa912c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js >@@ -0,0 +1,58 @@ >+let appendScript = (src, resolve) => { >+ const script = document.createElement('script'); >+ script.type = 'text/javascript'; >+ script.src = src; >+ script.onload = resolve; >+ document.body.appendChild(script); >+} >+ >+let xhrScript = src => { >+ var xhr = new XMLHttpRequest(); >+ xhr.open("GET", src, false); >+ xhr.send(null); >+} >+ >+let waitForNextTask = () => { >+ return new Promise(resolve => { >+ step_timeout(resolve, 0); >+ }); >+}; >+ >+let waitForEventToFire = () => { >+ return new Promise(resolve => { >+ let waitForIt = function() { >+ if (eventFired) { >+ eventFired = false; >+ resolve(); >+ } else { >+ step_timeout(waitForIt, 0); >+ } >+ } >+ step_timeout(waitForIt, 0); >+ }); >+}; >+ >+let clearBufferAndSetSize = size => { >+ performance.clearResourceTimings(); >+ performance.setResourceTimingBufferSize(size); >+} >+ >+let fillUpTheBufferWithSingleResource = src => { >+ return new Promise(resolve => { >+ // This resource gets buffered in the resource timing entry buffer. >+ appendScript(src, resolve); >+ }); >+}; >+ >+let loadResource = src => { >+ return new Promise(resolve => { >+ appendScript(src, resolve); >+ }); >+}; >+ >+let fillUpTheBufferWithTwoResources = async src => { >+ // These resources get buffered in the resource timing entry buffer. >+ await loadResource(src); >+ await loadResource(src + '?second'); >+}; >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.sub.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.sub.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fbd7bc3b6e21ee39478c8a63780bb673dafe96a4 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.sub.html >@@ -0,0 +1,33 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<meta charset="utf-8"> >+<iframe id="frame" src="//{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/iframe-setdomain.sub.html"></iframe> >+<script> >+ let opener = window.opener; >+ window.addEventListener("load", () => { >+ try { >+ let frameDoc = document.getElementById("frame").contentWindow.document; >+ opener.postMessage("FAIL - iframe document.domain was not set", "*"); >+ return; >+ } catch(error) { >+ if (error.name != "SecurityError") { >+ opener.postMessage("FAIL - error is " + error.name, "*"); >+ return; >+ } >+ let entry = performance.getEntriesByName(window.location.protocol + "//{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/iframe-setdomain.sub.html"); >+ // To verify that setting 'document.domain' did not change the results of the timing allow check, >+ // verify that the following non-zero properties return their value. >+ ["domainLookupStart", "domainLookupEnd", "connectStart", "connectEnd"].forEach(property => { >+ if (entry[property] == 0) { >+ opener.postMessage("FAIL - " + property + " is 0 but timing allow check should ignore document.domain", "*"); >+ } >+ }); >+ opener.postMessage("PASS", "*"); >+ } >+ opener.postMessage("FAIL - unknown", "*"); >+ }); >+</script> >+ >+ >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-setdomain.sub.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-setdomain.sub.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4a2f609aa469f14d7efe64baaeb739efdb2fdc75 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-setdomain.sub.html >@@ -0,0 +1,14 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <title>domain: {{domains[]}}</title> >+</head> >+<body> >+ <script> >+ // The purpose of this IFrame is to change the 'document.domain' >+ document.domain = "{{domains[]}}"; >+ </script> >+ The resource-timings-level1.sub.html test loads this document into an IFrame to vet that setting >+ 'document.domain' does not effect the timing allowed. >+</body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/w3c-import.log >index ff0de309987ec094c4132d88f062cf9d8ea4949e..4d67ebb9513f2e0b93947fac6561eca47d8ce800 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/w3c-import.log >@@ -18,6 +18,8 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/all_resource_types.htm > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/blank_page_green.htm > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/blue.png >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/buffer-full-utilities.js >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/document-domain-no-impact.sub.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/empty.js > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/empty.py > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/empty_script.js >@@ -26,6 +28,7 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/fake_responses.py > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/green_frame.htm > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/gzip_xml.py >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe-setdomain.sub.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe_TAO_match_origin.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe_TAO_match_wildcard.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/iframe_TAO_multi.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js >index 98b2954bad3765c94d6c7c3faf1128b47bf032b4..203eb0d16b4f3ad8d22877ff7afc7064fe252892 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharness.js >@@ -1,4 +1,8 @@ >-// >+/* >+author: W3C http://www.w3.org/ >+help: http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute >+*/ >+// > // Helper Functions for NavigationTiming W3C tests > // > >@@ -45,7 +49,8 @@ function wp_test(func, msg, properties) > if (performanceNamespace === undefined || performanceNamespace == null) > { > // show a single error that window.performance is undefined >- test(function() { assert_true(performanceNamespace !== undefined && performanceNamespace != null, "window.performance is defined and not null"); }, "window.performance is defined and not null.", {author:"W3C http://www.w3.org/",help:"http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute",assert:"The window.performance attribute provides a hosting area for performance related attributes. "}); >+ // The window.performance attribute provides a hosting area for performance related attributes. >+ test(function() { assert_true(performanceNamespace !== undefined && performanceNamespace != null, "window.performance is defined and not null"); }, "window.performance is defined and not null."); > } > } > >@@ -56,12 +61,14 @@ function test_namespace(child_name, skip_root) > { > if (skip_root === undefined) { > var msg = 'window.performance is defined'; >- wp_test(function () { assert_true(performanceNamespace !== undefined, msg); }, msg,{author:"W3C http://www.w3.org/",help:"http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute",assert:"The window.performance attribute provides a hosting area for performance related attributes. "}); >+ // The window.performance attribute provides a hosting area for performance related attributes. >+ wp_test(function () { assert_true(performanceNamespace !== undefined, msg); }, msg); > } > > if (child_name !== undefined) { > var msg2 = 'window.performance.' + child_name + ' is defined'; >- wp_test(function() { assert_true(performanceNamespace[child_name] !== undefined, msg2); }, msg2,{author:"W3C http://www.w3.org/",help:"http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute",assert:"The window.performance attribute provides a hosting area for performance related attributes. "}); >+ // The window.performance attribute provides a hosting area for performance related attributes. >+ wp_test(function() { assert_true(performanceNamespace[child_name] !== undefined, msg2); }, msg2); > } > } > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js >index 230f2ac6769d745a7647b16b13d8c6e96fc982b1..901cb1db8284a967e87e93afb9da8752fa7a2a7f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resources/webperftestharnessextension.js >@@ -49,45 +49,48 @@ function test_fail(msg, properties) > > function test_resource_entries(entries, expected_entries) > { >- // This is slightly convoluted so that we can sort the output. >- var actual_entries = {}; >- var origin = window.location.protocol + "//" + window.location.host; >- >- for (var i = 0; i < entries.length; ++i) { >- var entry = entries[i]; >- var found = false; >- for (var expected_entry in expected_entries) { >- if (entry.name == origin + expected_entry) { >- found = true; >- if (expected_entry in actual_entries) { >- test_fail(expected_entry + ' is not expected to have duplicate entries'); >+ test(function() { >+ // This is slightly convoluted so that we can sort the output. >+ var actual_entries = {}; >+ var origin = window.location.protocol + "//" + window.location.host; >+ >+ for (var i = 0; i < entries.length; ++i) { >+ var entry = entries[i]; >+ var found = false; >+ for (var expected_entry in expected_entries) { >+ if (entry.name == origin + expected_entry) { >+ found = true; >+ if (expected_entry in actual_entries) { >+ assert_unreached(expected_entry + ' is not expected to have duplicate entries'); >+ } >+ actual_entries[expected_entry] = entry; >+ break; > } >- actual_entries[expected_entry] = entry; >- break; >+ } >+ if (!found) { >+ assert_unreached(entries[i].name + ' is not expected to be in the Resource Timing buffer'); > } > } >- if (!found) { >- test_fail(entries[i].name + ' is not expected to be in the Resource Timing buffer'); >- } >- } > >- sorted_urls = []; >- for (var i in actual_entries) { >- sorted_urls.push(i); >- } >- sorted_urls.sort(); >- for (var i in sorted_urls) { >- var url = sorted_urls[i]; >- test_equals(actual_entries[url].initiatorType, >- expected_entries[url], >- origin + url + ' is expected to have initiatorType ' + expected_entries[url]); >- } >- for (var j in expected_entries) { >- if (!(j in actual_entries)) { >- test_fail(origin + j + ' is expected to be in the Resource Timing buffer'); >+ sorted_urls = []; >+ for (var i in actual_entries) { >+ sorted_urls.push(i); > } >- } >+ sorted_urls.sort(); >+ for (var i in sorted_urls) { >+ var url = sorted_urls[i]; >+ assert_equals(actual_entries[url].initiatorType, >+ expected_entries[url], >+ origin + url + ' is expected to have initiatorType ' + expected_entries[url]); >+ } >+ for (var j in expected_entries) { >+ if (!(j in actual_entries)) { >+ assert_unreached(origin + j + ' is expected to be in the Resource Timing buffer'); >+ } >+ } >+ }, "Testing resource entries"); > } >+ > function performance_entrylist_checker(type) > { > var entryType = type; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html >index 39d7d5b256616d6b1d8a93c2c188412746791355..1f8f4005e42c61ebb0dc0cae549429b29c68bd97 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html >@@ -13,6 +13,11 @@ > function (entryList, obs) { > var entries = entryList.getEntriesByType("resource"); > for (var i = 0; i < entries.length; ++i) { >+ // Ignore any entries for the test harness files if present. >+ if (/testharness(report)?\.js/.test(entries[i].name)) { >+ continue; >+ } >+ > ++observed; > if (entries[i].name.indexOf(img_url) != -1) > ++img_entries; >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..df46af53fd74b6b04b86738bc2107b5265991ac6 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any-expected.txt >@@ -0,0 +1,3 @@ >+ >+FAIL supportedEntryTypes contains 'resource'. assert_unreached: supportedEntryTypes is not supported. Reached unreachable code >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6096ad714904fdd5c0085b33b4240301cdb952fb >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js >@@ -0,0 +1,6 @@ >+test(() => { >+ if (typeof PerformanceObserver.supportedEntryTypes === "undefined") >+ assert_unreached("supportedEntryTypes is not supported."); >+ assert_true(PerformanceObserver.supportedEntryTypes.includes("resource"), >+ "There should be an entry 'resource' in PerformanceObserver.supportedEntryTypes"); >+}, "supportedEntryTypes contains 'resource'."); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..df46af53fd74b6b04b86738bc2107b5265991ac6 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt >@@ -0,0 +1,3 @@ >+ >+FAIL supportedEntryTypes contains 'resource'. assert_unreached: supportedEntryTypes is not supported. Reached unreachable code >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2382913528e693b3a5d56c660a45060980b548c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.worker.html >@@ -0,0 +1 @@ >+<!-- This file is required for WebKit test infrastructure to run the templated test --> >\ No newline at end of file >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a0e5d7a92f97cab0f338ba47a339eb814ec126c1 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt >@@ -0,0 +1,34 @@ >+Description >+ >+NOTE: Due to caching behavior in the browser, it is possible that when revisiting this page, some resources may not have to be fetched from the network. As a result, the performance timeline will not contain entries for these resources. This test will fail if any entries are missing to ensure that all resources are fetched from the network and entries for these resources exist in the Performance Timeline. If revisiting this page, please either perform a full reload of the page or clear the cache between visits. >+ >+ >+PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (iframe) >+PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (iframe) >+PASS PerformanceEntry has correct order of timing attributes (iframe) >+FAIL PerformanceEntry has correct network transfer attributes (iframe) assert_equals: encodedBodySize size expected (number) 215 but got (undefined) undefined >+PASS PerformanceEntry has correct protocol attribute (iframe) >+PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (img) >+PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (img) >+PASS PerformanceEntry has correct order of timing attributes (img) >+FAIL PerformanceEntry has correct network transfer attributes (img) assert_equals: encodedBodySize size expected (number) 249 but got (undefined) undefined >+PASS PerformanceEntry has correct protocol attribute (img) >+PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (link) >+PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (link) >+PASS PerformanceEntry has correct order of timing attributes (link) >+FAIL PerformanceEntry has correct network transfer attributes (link) assert_equals: encodedBodySize size expected (number) 44 but got (undefined) undefined >+PASS PerformanceEntry has correct protocol attribute (link) >+PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (script) >+PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (script) >+PASS PerformanceEntry has correct order of timing attributes (script) >+FAIL PerformanceEntry has correct network transfer attributes (script) assert_equals: encodedBodySize size expected (number) 133 but got (undefined) undefined >+PASS PerformanceEntry has correct protocol attribute (script) >+PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (xmlhttprequest) >+PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest) >+PASS PerformanceEntry has correct order of timing attributes (xmlhttprequest) >+FAIL PerformanceEntry has correct network transfer attributes (xmlhttprequest) assert_equals: encodedBodySize size expected (number) 112 but got (undefined) undefined >+PASS PerformanceEntry has correct protocol attribute (xmlhttprequest) >+PASS window.performance Resource Timing Entries exist >+PASS window.performance Resource Timing Entries exist 1 >+PASS window.performance Resource Timing Entries exist 2 >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https.html b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f4e851abb203aca49194aef51646be673507078f >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https.html >@@ -0,0 +1,24 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <meta charset="UTF-8" /> >+ <title>window.performance Resource Timing Entries exist</title> >+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> >+ <link rel="help" href="https://w3c.github.io/web-performance/specs/ResourceTiming/Overview.html"/> >+ <script src="/resources/testharness.js"></script> >+ <script src="/resources/testharnessreport.js"></script> >+ <script src="test_resource_timing.js"></script> >+ </head> >+ <body> >+ <h1>Description</h1> >+ <p> >+ NOTE: Due to caching behavior in the browser, it is possible that when revisiting this page, some resources >+ may not have to be fetched from the network. As a result, the performance timeline will not contain entries >+ for these resources. This test will fail if any entries are missing to ensure that all resources are fetched >+ from the network and entries for these resources exist in the Performance Timeline. If revisiting this page, >+ please either perform a full reload of the page or clear the cache between visits. >+ </p> >+ >+ <div id="log"></div> >+ </body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.js b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.js >index 8e729e013567a123f9c4a71ab7ea30435b7e2b47..598a727bf88e7f47556d509f6929a86b64b0506c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.js >@@ -186,22 +186,21 @@ function resource_load(expected) > const entries = window.performance.getEntriesByName(expected.name); > assert_equals(entries.length, 1, 'There should be a single matching entry'); > const actual = entries[0]; >- >- // Debugging bug 1263428 >- // Feel free to remove/overwrite this piece of code >- if (actual.connectStart < actual.domainLookupEnd) { >- assert_true(false, "actual: "+JSON.stringify(actual)); >+ if (window.location.protocol == "http:") { >+ assert_equals(actual.secureConnectionStart, 0, 'secureConnectionStart should be 0 in http'); >+ } else { >+ assert_greater_than(actual.secureConnectionStart, 0, 'secureConnectionStart should not be 0 in https'); > } > > assert_equals(actual.redirectStart, 0, 'redirectStart should be 0'); > assert_equals(actual.redirectEnd, 0, 'redirectEnd should be 0'); >- assert_true(actual.secureConnectionStart == undefined || >- actual.secureConnectionStart == 0, 'secureConnectionStart should be 0 or undefined'); > assert_equals(actual.fetchStart, actual.startTime, 'fetchStart is equal to startTime'); > assert_greater_than_equal(actual.domainLookupStart, actual.fetchStart, 'domainLookupStart after fetchStart'); > assert_greater_than_equal(actual.domainLookupEnd, actual.domainLookupStart, 'domainLookupEnd after domainLookupStart'); > assert_greater_than_equal(actual.connectStart, actual.domainLookupEnd, 'connectStart after domainLookupEnd'); > assert_greater_than_equal(actual.connectEnd, actual.connectStart, 'connectEnd after connectStart'); >+ assert_true(actual.secureConnectionStart == 0 || actual.secureConnectionStart <= actual.requestStart, >+ "secureConnectionStart should be either 0 or smaller than/equals to requestStart") > assert_greater_than_equal(actual.requestStart, actual.connectEnd, 'requestStart after connectEnd'); > assert_greater_than_equal(actual.responseStart, actual.requestStart, 'responseStart after requestStart'); > assert_greater_than_equal(actual.responseEnd, actual.responseStart, 'responseEnd after responseStart'); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/w3c-import.log >index 749aa8324028960db37447b6e6632438b5ddfaae..6396325501c83a62e9fc5c0adbb56957c934d36e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/w3c-import.log >@@ -16,12 +16,24 @@ None > List of files: > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/META.yml > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/SyntheticResponse.py >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-decrease-buffer-during-callback.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-increase-buffer-during-callback.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-inspect-buffer-during-callback.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-set-to-current-buffer.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-store-and-clear-during-callback.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-when-populate-entries.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/clear_resource_timing_functionality.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/document-domain-no-impact-loader.sub.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any.js >-/LayoutTests/imported/w3c/web-platform-tests/resource-timing/iframe-setdomain.sub.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.js >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-tojson.html >-/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.html >-/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing.js > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_cross_origin_redirect_chain.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_match_origin.htm > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_match_wildcard.htm >@@ -48,12 +60,12 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.js > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_TAO_cross_origin_redirect.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_eventually.html >-/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_populate_entries.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_buffer_full_when_shrink_buffer_size.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect_chain.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_same_origin_redirect.html >-/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_timing_store_and_clear_during_callback.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.any.js > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.html >+/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https.html > /LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.js >diff --git a/LayoutTests/tests-options.json b/LayoutTests/tests-options.json >index cb726902d94d2facf787defb77e25eb77ba38890..5e2440628b613e57a9383b2594b7a8f468fbbf97 100644 >--- a/LayoutTests/tests-options.json >+++ b/LayoutTests/tests-options.json >@@ -1526,6 +1526,9 @@ > "imported/w3c/web-platform-tests/quirks/hashless-hex-color.html": [ > "slow" > ], >+ "imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub.html": [ >+ "slow" >+ ], > "imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html": [ > "slow" > ],
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193302
:
358749
|
358750
|
358752
|
358757
|
358764
|
358768
|
358773
|
358817
|
358824
|
358826
|
358832
|
358836
|
358923
|
358931
|
358938
|
358944
|
358956
|
359049
|
359052
|
359059
|
359063
|
359067
|
359076