diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 1004e847898d..6387f1075d1b 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -287571,6 +287571,11 @@ {} ] ], + "interfaces/navigation-timing.idl": [ + [ + {} + ] + ], "interfaces/netinfo.idl": [ [ {} @@ -355037,9 +355042,9 @@ {} ] ], - "navigation-timing/idlharness.html": [ + "navigation-timing/idlharness.window.js": [ [ - "/navigation-timing/idlharness.html", + "/navigation-timing/idlharness.window.html", {} ] ], @@ -591004,6 +591009,10 @@ "378af7beb3cf20086cec84840286f5e2a33f850c", "support" ], + "interfaces/navigation-timing.idl": [ + "c12830eb9f5f18eef60557f5a93ea68812f78193", + "support" + ], "interfaces/netinfo.idl": [ "357a99c1a5cb73265ee63d1ab1a0e413c6ced458", "support" @@ -594364,8 +594373,8 @@ "c238360f8496b546e525941b994bb3022be0c7ae", "support" ], - "navigation-timing/idlharness.html": [ - "7b09fdf79c4166eaf21bcf2f92973c80b2864f32", + "navigation-timing/idlharness.window.js": [ + "ec4f468da89e8339cfb9c3261bcef577bc2fc094", "testharness" ], "navigation-timing/nav2_data_uri.html": [ diff --git a/testing/web-platform/tests/interfaces/navigation-timing.idl b/testing/web-platform/tests/interfaces/navigation-timing.idl new file mode 100644 index 000000000000..59f29fbdcf91 --- /dev/null +++ b/testing/web-platform/tests/interfaces/navigation-timing.idl @@ -0,0 +1,67 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the +// "Navigation Timing Level 2" spec. +// See: https://w3c.github.io/navigation-timing/ + +[Exposed=Window] +interface PerformanceNavigationTiming : PerformanceResourceTiming { + readonly attribute DOMHighResTimeStamp unloadEventStart; + readonly attribute DOMHighResTimeStamp unloadEventEnd; + readonly attribute DOMHighResTimeStamp domInteractive; + readonly attribute DOMHighResTimeStamp domContentLoadedEventStart; + readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd; + readonly attribute DOMHighResTimeStamp domComplete; + readonly attribute DOMHighResTimeStamp loadEventStart; + readonly attribute DOMHighResTimeStamp loadEventEnd; + readonly attribute NavigationType type; + readonly attribute unsigned short redirectCount; + [Default] object toJSON(); +}; +enum NavigationType { + "navigate", + "reload", + "back_forward", + "prerender" +}; +[Exposed=Window] +interface PerformanceTiming { + readonly attribute unsigned long long navigationStart; + readonly attribute unsigned long long unloadEventStart; + readonly attribute unsigned long long unloadEventEnd; + readonly attribute unsigned long long redirectStart; + readonly attribute unsigned long long redirectEnd; + readonly attribute unsigned long long fetchStart; + readonly attribute unsigned long long domainLookupStart; + readonly attribute unsigned long long domainLookupEnd; + readonly attribute unsigned long long connectStart; + readonly attribute unsigned long long connectEnd; + readonly attribute unsigned long long secureConnectionStart; + readonly attribute unsigned long long requestStart; + readonly attribute unsigned long long responseStart; + readonly attribute unsigned long long responseEnd; + readonly attribute unsigned long long domLoading; + readonly attribute unsigned long long domInteractive; + readonly attribute unsigned long long domContentLoadedEventStart; + readonly attribute unsigned long long domContentLoadedEventEnd; + readonly attribute unsigned long long domComplete; + readonly attribute unsigned long long loadEventStart; + readonly attribute unsigned long long loadEventEnd; + [Default] object toJSON(); +}; +[Exposed=Window] +interface PerformanceNavigation { + const unsigned short TYPE_NAVIGATE = 0; + const unsigned short TYPE_RELOAD = 1; + const unsigned short TYPE_BACK_FORWARD = 2; + const unsigned short TYPE_RESERVED = 255; + readonly attribute unsigned short type; + readonly attribute unsigned short redirectCount; + [Default] object toJSON(); +}; +[Exposed=Window] +partial interface Performance { + [SameObject] + readonly attribute PerformanceTiming timing; + [SameObject] + readonly attribute PerformanceNavigation navigation; +}; diff --git a/testing/web-platform/tests/navigation-timing/idlharness.html b/testing/web-platform/tests/navigation-timing/idlharness.html deleted file mode 100644 index 6c2d488ddc0a..000000000000 --- a/testing/web-platform/tests/navigation-timing/idlharness.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - -Navigation Timing IDL tests - - - - - - - - - - -

Navigation Timing IDL tests

-
- - - -
-
-[Exposed=Window]
-interface PerformanceNavigationTiming : PerformanceResourceTiming {
-        readonly        attribute DOMHighResTimeStamp unloadEventStart;
-        readonly        attribute DOMHighResTimeStamp unloadEventEnd;
-        readonly        attribute DOMHighResTimeStamp domInteractive;
-        readonly        attribute DOMHighResTimeStamp domContentLoadedEventStart;
-        readonly        attribute DOMHighResTimeStamp domContentLoadedEventEnd;
-        readonly        attribute DOMHighResTimeStamp domComplete;
-        readonly        attribute DOMHighResTimeStamp loadEventStart;
-        readonly        attribute DOMHighResTimeStamp loadEventEnd;
-        readonly        attribute NavigationType      type;
-        readonly        attribute unsigned short      redirectCount;
-        [Default] object toJSON();
-};
-
-enum NavigationType {
-  "navigate",
-  "reload",
-  "back_forward",
-  "prerender"
-};
-
-
-[Exposed=Window]
-interface PerformanceTiming {
-  readonly attribute unsigned long long navigationStart;
-  readonly attribute unsigned long long unloadEventStart;
-  readonly attribute unsigned long long unloadEventEnd;
-  readonly attribute unsigned long long redirectStart;
-  readonly attribute unsigned long long redirectEnd;
-  readonly attribute unsigned long long fetchStart;
-  readonly attribute unsigned long long domainLookupStart;
-  readonly attribute unsigned long long domainLookupEnd;
-  readonly attribute unsigned long long connectStart;
-  readonly attribute unsigned long long connectEnd;
-  readonly attribute unsigned long long secureConnectionStart;
-  readonly attribute unsigned long long requestStart;
-  readonly attribute unsigned long long responseStart;
-  readonly attribute unsigned long long responseEnd;
-  readonly attribute unsigned long long domLoading;
-  readonly attribute unsigned long long domInteractive;
-  readonly attribute unsigned long long domContentLoadedEventStart;
-  readonly attribute unsigned long long domContentLoadedEventEnd;
-  readonly attribute unsigned long long domComplete;
-  readonly attribute unsigned long long loadEventStart;
-  readonly attribute unsigned long long loadEventEnd;
-  [Default] object toJSON();
-};
-
-
-[Exposed=Window]
-interface PerformanceNavigation {
-  const unsigned short TYPE_NAVIGATE = 0;
-  const unsigned short TYPE_RELOAD = 1;
-  const unsigned short TYPE_BACK_FORWARD = 2;
-  const unsigned short TYPE_RESERVED = 255;
-  readonly attribute unsigned short type;
-  readonly attribute unsigned short redirectCount;
-  [Default] object toJSON();
-};
-
-
-// [Exposed=Window]
-partial interface Performance {
-  [SameObject]
-  readonly attribute PerformanceTiming timing;
-  [SameObject]
-  readonly attribute PerformanceNavigation navigation;
-};
-
- - - - diff --git a/testing/web-platform/tests/navigation-timing/idlharness.window.js b/testing/web-platform/tests/navigation-timing/idlharness.window.js new file mode 100644 index 000000000000..a782773e59f3 --- /dev/null +++ b/testing/web-platform/tests/navigation-timing/idlharness.window.js @@ -0,0 +1,22 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +'use strict'; + +// http://www.w3.org/TR/navigation-timing/ + +idl_test( + ['navigation-timing'], + ['resource-timing', 'performance-timeline', 'hr-time', 'dom'], + idl_array => { + idl_array.add_objects({ + Performance: ['performance'], + PerformanceNavigation: ['performance.navigation'], + PerformanceTiming: ['performance.timing'], + PerformanceNavigationTiming: [ + 'performance.getEntriesByType("navigation")[0]' + ] + }); + }, + 'navigation-timing interfaces' +);