summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/performance-timeline
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-25 01:03:57 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-25 01:03:57 +0000
commitceadffab6b357723981a429e11222daf6cd6dcfb (patch)
tree5603053048d6a460f79b22bdf165fb74d32d39b0 /testing/web-platform/tests/performance-timeline
parent14fb2f966e9b54598c451e3cb35b4aa0480dafed (diff)
parentad5a13bd501e379517da1a944c104a11d951a3f5 (diff)
downloadUXP-RC_20210225.tar
UXP-RC_20210225.tar.gz
UXP-RC_20210225.tar.lz
UXP-RC_20210225.tar.xz
UXP-RC_20210225.zip
Merge branch 'master' into releaseRC_20210225
Diffstat (limited to 'testing/web-platform/tests/performance-timeline')
-rw-r--r--testing/web-platform/tests/performance-timeline/OWNERS3
-rw-r--r--testing/web-platform/tests/performance-timeline/case-sensitivity.html39
-rw-r--r--testing/web-platform/tests/performance-timeline/idlharness.html85
-rw-r--r--testing/web-platform/tests/performance-timeline/performanceobservers.js21
-rw-r--r--testing/web-platform/tests/performance-timeline/po-disconnect.html44
-rw-r--r--testing/web-platform/tests/performance-timeline/po-getentries.html50
-rw-r--r--testing/web-platform/tests/performance-timeline/po-mark-measure.html72
-rw-r--r--testing/web-platform/tests/performance-timeline/po-navigation.html28
-rw-r--r--testing/web-platform/tests/performance-timeline/po-observe.html58
-rw-r--r--testing/web-platform/tests/performance-timeline/po-resource.html48
-rw-r--r--testing/web-platform/tests/performance-timeline/resources/square.pngbin249 -> 0 bytes
11 files changed, 0 insertions, 448 deletions
diff --git a/testing/web-platform/tests/performance-timeline/OWNERS b/testing/web-platform/tests/performance-timeline/OWNERS
deleted file mode 100644
index 56997198b..000000000
--- a/testing/web-platform/tests/performance-timeline/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-@plehegar
-@igrigorik
-@toddreifsteck
diff --git a/testing/web-platform/tests/performance-timeline/case-sensitivity.html b/testing/web-platform/tests/performance-timeline/case-sensitivity.html
deleted file mode 100644
index 99ef66cce..000000000
--- a/testing/web-platform/tests/performance-timeline/case-sensitivity.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceTimeline: case sensitivity</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<h1>PerformanceTimeline: case sensitivity</h1>
-<div id="log"></div>
-<script>
- test(function () {
- assert_equals(typeof window.performance, "object");
- assert_equals(typeof window.performance.getEntriesByType, "function");
- var lowerList = window.performance.getEntriesByType("resource");
- var upperList = window.performance.getEntriesByType("RESOURCE");
- var mixedList = window.performance.getEntriesByType("ReSoUrCe");
-
- assert_not_equals(lowerList.length, 0, "Resource entries exist");
- assert_equals(upperList.length, 0, "getEntriesByType('RESOURCE').length");
- assert_equals(mixedList.length, 0, "getEntriesByType('ReSoUrCe').length");
-
- }, "getEntriesByType values are case sensitive");
-
- test(function () {
- assert_equals(typeof window.performance, "object");
- assert_equals(typeof window.performance.getEntriesByName, "function");
- var origin = window.location.protocol + "//" + window.location.host;
- var location1 = origin.toUpperCase() + "/resources/testharness.js";
- var location2 = window.location.protocol + "//"
- + window.location.host.toUpperCase() + "/resources/testharness.js";
- var lowerList = window.performance.getEntriesByName(origin + "/resources/testharness.js");
- var upperList = window.performance.getEntriesByName(location1);
- var mixedList = window.performance.getEntriesByName(location2);
-
- assert_equals(lowerList.length, 1, "Resource entry exist");
- assert_equals(upperList.length, 0, "getEntriesByName('" + location1 + "').length");
- assert_equals(mixedList.length, 0, "getEntriesByName('" + location2 + "').length");
-
- }, "getEntriesByName values are case sensitive");
-
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/idlharness.html b/testing/web-platform/tests/performance-timeline/idlharness.html
deleted file mode 100644
index 0500b3eee..000000000
--- a/testing/web-platform/tests/performance-timeline/idlharness.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>Performance Timeline IDL tests</title>
-<link rel="author" title="W3C" href="http://www.w3.org/" />
-<link rel="help" href="http://www.w3.org/TR/performance-timeline/#performanceentry"/>
-<link rel="help" href="http://www.w3.org/TR/performance-timeline/#performance"/>
-<link rel="help" href="http://www.w3.org/TR/performance-timeline/#performanceentrylist"/>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-</head>
-<body>
-<h1>Performance Timeline IDL tests</h1>
-<div id="log"></div>
-
-<pre id='untested_idl' style='display:none'>
-interface Performance {
-};
-</pre>
-
-<pre id='idl'>
-[Exposed=(Window,Worker)]
-interface PerformanceEntry {
- readonly attribute DOMString name;
- readonly attribute DOMString entryType;
- readonly attribute DOMHighResTimeStamp startTime;
- readonly attribute DOMHighResTimeStamp duration;
- serializer = {attribute};
-};
-
-dictionary PerformanceEntryFilterOptions {
- DOMString name;
- DOMString entryType;
- DOMString initiatorType;
-};
-
-partial interface Performance {
- PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter);
- PerformanceEntryList getEntriesByType(DOMString type);
- PerformanceEntryList getEntriesByName(DOMString name,
- optional DOMString type);
-};
-
-typedef sequence &lt;PerformanceEntry> PerformanceEntryList;
-
-dictionary PerformanceObserverInit {
- required sequence&lt;DOMString> entryTypes;
-};
-
-[Exposed=(Window,Worker)]
-interface PerformanceObserverEntryList {
- PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter);
- PerformanceEntryList getEntriesByType(DOMString type);
- PerformanceEntryList getEntriesByName(DOMString name,
- optional DOMString type);
-};
-
-callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries,
- PerformanceObserver observer);
-
-[Constructor(PerformanceObserverCallback callback),
- Exposed=(Window,Worker)]
-interface PerformanceObserver {
- void observe(PerformanceObserverInit options);
- void disconnect();
-};
-</pre>
-
-<script>
-var idl_array;
-setup(function() {
- idl_array = new IdlArray();
- idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
- idl_array.add_idls(document.getElementById("idl").textContent);
- idl_array.add_objects({
- Performance: ["window.performance"]
- });
-});
-idl_array.test();
-</script>
-</body>
-</html>
diff --git a/testing/web-platform/tests/performance-timeline/performanceobservers.js b/testing/web-platform/tests/performance-timeline/performanceobservers.js
deleted file mode 100644
index 08587694e..000000000
--- a/testing/web-platform/tests/performance-timeline/performanceobservers.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Compares a performance entry to a predefined one
-// perfEntriesToCheck is an array of performance entries from the user agent
-// expectedEntries is an array of performance entries minted by the test
-function checkEntries(perfEntriesToCheck, expectedEntries) {
- function findMatch(pe) {
- // we match based on entryType and name
- for (var i = expectedEntries.length - 1; i >= 0; i--) {
- var ex = expectedEntries[i];
- if (ex.entryType === pe.entryType && ex.name === pe.name) {
- return ex;
- }
- }
- return null;
- }
-
- assert_equals(perfEntriesToCheck.length, expectedEntries.length, "performance entries must match");
-
- perfEntriesToCheck.forEach(function (pe1) {
- assert_not_equals(findMatch(pe1), null, "Entry matches");
- });
-}
diff --git a/testing/web-platform/tests/performance-timeline/po-disconnect.html b/testing/web-platform/tests/performance-timeline/po-disconnect.html
deleted file mode 100644
index dff39cfaa..000000000
--- a/testing/web-platform/tests/performance-timeline/po-disconnect.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceObservers: disconnect</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="performanceobservers.js"></script>
-<h1>PerformanceObservers: disconnect</h1>
-<div id="log"></div>
-<script>
- async_test(function (t) {
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- assert_unreached("This callback must not be invoked");
- })
- );
- observer.observe({entryTypes: ["mark", "measure", "navigation"]});
- observer.disconnect();
- performance.mark("mark1");
- performance.measure("measure1");
- t.step_timeout(function () {
- t.done();
- }, 2000);
- }, "disconnected callbacks must not be invoked");
-
- test(function () {
- var obs = new PerformanceObserver(function () { return true; });
- obs.disconnect();
- obs.disconnect();
- }, "disconnecting an unconnected observer is a no-op");
-
- async_test(function (t) {
- var observer = new PerformanceObserver(
- t.step_func(function(entryList, obs) {
- checkEntries(entryList.getEntries(),
- [{ entryType: "mark", name: "mark1"}]);
- t.done();
- })
- );
- observer.observe({entryTypes: ["mark"]});
- performance.mark("mark1");
- observer.disconnect();
- performance.mark("mark2");
- }, "An observer disconnected after a mark must receive the mark");
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/po-getentries.html b/testing/web-platform/tests/performance-timeline/po-getentries.html
deleted file mode 100644
index 556209df6..000000000
--- a/testing/web-platform/tests/performance-timeline/po-getentries.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceObservers: getEntries*</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="performanceobservers.js"></script>
-<h1>PerformanceObservers: getEntries*</h1>
-<p>
-getEntries, getEntriesByType and getEntriesByName work
-</p>
-<div id="log"></div>
-<script>
- async_test(function (t) {
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- checkEntries(entryList.getEntries(),
- [{ entryType: "mark", name: "mark1"}], "getEntries");
-
- checkEntries(entryList.getEntriesByType("mark"),
- [{ entryType: "mark", name: "mark1"}], "getEntriesByType");
- assert_equals(entryList.getEntriesByType("measure").length, 0,
- "getEntriesByType with no expected entry");
- assert_equals(entryList.getEntriesByType("234567").length, 0,
- "getEntriesByType with no expected entry");
-
- checkEntries(entryList.getEntriesByName("mark1"),
- [{ entryType: "mark", name: "mark1"}], "getEntriesByName");
- assert_equals(entryList.getEntriesByName("mark2").length, 0,
- "getEntriesByName with no expected entry");
- assert_equals(entryList.getEntriesByName("234567").length, 0,
- "getEntriesByName with no expected entry");
-
- checkEntries(entryList.getEntriesByName("mark1", "mark"),
- [{ entryType: "mark", name: "mark1"}], "getEntriesByName with a type");
- assert_equals(entryList.getEntriesByName("mark1", "measure").length, 0,
- "getEntriesByName with a type with no expected entry");
- assert_equals(entryList.getEntriesByName("mark2", "measure").length, 0,
- "getEntriesByName with a type with no expected entry");
- assert_equals(entryList.getEntriesByName("mark1", "234567").length, 0,
- "getEntriesByName with a type with no expected entry");
-
- observer.disconnect();
- t.done();
- })
- );
- observer.observe({entryTypes: ["mark"]});
- performance.mark("mark1");
- }, "getEntries, getEntriesByType and getEntriesByName work");
-
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/po-mark-measure.html b/testing/web-platform/tests/performance-timeline/po-mark-measure.html
deleted file mode 100644
index 7455c0e87..000000000
--- a/testing/web-platform/tests/performance-timeline/po-mark-measure.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceObservers: mark and measure</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="performanceobservers.js"></script>
-<h1>PerformanceObservers: mark and measure</h1>
-<p>
-Performance.mark() and Performance.measure() will <a href="https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry">queue a PerformanceEntry</a>.
-</p>
-<div id="log"></div>
-<script>
- async_test(function (t) {
- var stored_entries = [];
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- stored_entries =
- stored_entries.concat(entryList.getEntries());
- if (stored_entries.length >= 4) {
- checkEntries(stored_entries,
- [{ entryType: "mark", name: "mark1"},
- { entryType: "mark", name: "mark2"},
- { entryType: "measure", name: "measure1"},
- { entryType: "measure", name: "measure2"}]);
- observer.disconnect();
- t.done();
- }
- })
- );
- observer.observe({entryTypes: ["mark", "measure"]});
- }, "entries are observable");
-
- async_test(function (t) {
- var mark_entries = [];
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- mark_entries =
- mark_entries.concat(entryList.getEntries());
- if (mark_entries.length >= 2) {
- checkEntries(mark_entries,
- [{ entryType: "mark", name: "mark1"},
- { entryType: "mark", name: "mark2"}]);
- observer.disconnect();
- t.done();
- }
- })
- );
- observer.observe({entryTypes: ["mark"]});
- performance.mark("mark1");
- performance.mark("mark2");
- }, "mark entries are observable");
-
- async_test(function (t) {
- var measure_entries = [];
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- measure_entries =
- measure_entries.concat(entryList.getEntries());
- if (measure_entries.length >= 2) {
- checkEntries(measure_entries,
- [{ entryType: "measure", name: "measure1"},
- { entryType: "measure", name: "measure2"}]);
- observer.disconnect();
- t.done();
- }
- })
- );
- observer.observe({entryTypes: ["measure"]});
- performance.measure("measure1");
- performance.measure("measure2");
- }, "measure entries are observable");
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/po-navigation.html b/testing/web-platform/tests/performance-timeline/po-navigation.html
deleted file mode 100644
index ba3af6495..000000000
--- a/testing/web-platform/tests/performance-timeline/po-navigation.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceObservers: navigation</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="performanceobservers.js"></script>
-<h1>PerformanceObservers: navigation</h1>
-<p>
-Navigation will <a href="https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry">queue a PerformanceEntry</a>.
-</p>
-<div id="log"></div>
-<script>
- async_test(function (t) {
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- checkEntries(entryList.getEntries(),
- [{ entryType: "navigation", name: "document"}]);
- checkEntries(entryList.getEntriesByType("navigation"),
- [{ entryType: "navigation", name: "document"}]);
- checkEntries(entryList.getEntriesByName("document"),
- [{ entryType: "navigation", name: "document"}]);
- observer.disconnect();
- t.done();
- })
- );
- observer.observe({entryTypes: ["navigation"]});
- }, "navigation entry is observable");
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/po-observe.html b/testing/web-platform/tests/performance-timeline/po-observe.html
deleted file mode 100644
index 84edea84e..000000000
--- a/testing/web-platform/tests/performance-timeline/po-observe.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceObservers: observe</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="performanceobservers.js"></script>
-<h1>PerformanceObservers: observe</h1>
-<div id="log"></div>
-<script>
- test(function () {
- var obs = new PerformanceObserver(function () { return true; });
- assert_throws(new TypeError(), function () {
- obs.observe({});
- });
- assert_throws(new TypeError(), function () {
- obs.observe({entryType: []});
- });
- }, "no entryTypes throws a TypeError");
- test(function () {
- var obs = new PerformanceObserver(function () { return true; });
- assert_throws(new TypeError(), function () {
- obs.observe({entryTypes: "mark"});
- });
- assert_throws(new TypeError(), function () {
- obs.observe({entryTypes: []});
- });
- assert_throws(new TypeError(), function () {
- obs.observe({entryTypes: ["this-cannot-match-an-entryType"]});
- });
- assert_throws(new TypeError(), function () {
- obs.observe({entryTypes: ["marks","navigate", "resources"]});
- });
- }, "Empty sequence entryTypes throws a TypeError");
-
- test(function () {
- var obs = new PerformanceObserver(function () { return true; });
- obs.observe({entryTypes: ["mark","this-cannot-match-an-entryType"]});
- obs.observe({entryTypes: ["this-cannot-match-an-entryType","mark"]});
- obs.observe({entryTypes: ["mark"], others: true});
- }, "Filter unsupported entryType entryType names within the entryTypes sequence");
-
- async_test(function (t) {
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- assert_equals(observer, obs, "observer is second parameter");
- checkEntries(entryList.getEntries(),
- [{ entryType: "measure", name: "measure1"}]);
- observer.disconnect();
- t.done();
- })
- );
- performance.clearMarks();
- observer.observe({entryTypes: ["mark"]});
- observer.observe({entryTypes: ["measure"]});
- performance.mark("mark1");
- performance.measure("measure1");
- }, "replace observer if already present");
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/po-resource.html b/testing/web-platform/tests/performance-timeline/po-resource.html
deleted file mode 100644
index 00c173eea..000000000
--- a/testing/web-platform/tests/performance-timeline/po-resource.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML>
-<meta charset=utf-8>
-<title>PerformanceObservers: resource</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="performanceobservers.js"></script>
-<h1>PerformanceObservers: resource</h1>
-<p>
-New resources will <a href="https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry">queue a PerformanceEntry</a>.
-</p>
-<div id="log"></div>
-<script>
- async_test(function (t) {
- function path(pathname) {
- var filename = pathname.substring(pathname.lastIndexOf('/')+1);
- return pathname.substring(0, pathname.length - filename.length);
- }
- var gUniqueCounter = 0;
- function generateUniqueValues() {
- return Date.now() + "-" + (++gUniqueCounter);
- }
- var stored_entries = [];
- var img_location = document.location.origin + path(document.location.pathname)
- + "resources/square.png?random=";
- var img1 = img_location + generateUniqueValues();
- var img2 = img_location + generateUniqueValues();
- var observer = new PerformanceObserver(
- t.step_func(function (entryList, obs) {
- stored_entries =
- stored_entries.concat(entryList.getEntriesByType("resource"));
- if (stored_entries.length >= 2) {
- checkEntries(stored_entries,
- [{ entryType: "resource", name: img1},
- { entryType: "resource", name: img2}]);
- observer.disconnect();
- t.done();
- }
- })
- );
- observer.observe({entryTypes: ["resource"]});
- var img = document.createElement("img");
- img.src = img1;
- document.body.appendChild(img);
- img = document.createElement("img");
- img.src = img2;
- document.body.appendChild(img);
- }, "resource entries are observable");
-</script>
diff --git a/testing/web-platform/tests/performance-timeline/resources/square.png b/testing/web-platform/tests/performance-timeline/resources/square.png
deleted file mode 100644
index be211bc37..000000000
--- a/testing/web-platform/tests/performance-timeline/resources/square.png
+++ /dev/null
Binary files differ