Skip to content

Commit

Permalink
[performance-timeline] Reformat tests (#11495)
Browse files Browse the repository at this point in the history
Refactor tests so that they may be consumed by non-browser JavaScript
runtimes which implement the standard (e.g. Node.js [1]). Use WPT's
`.any.js` convention to extend test coverage in browsers by allowing
them to be executed within a Web Worker.

This change is in service of gh-11277 [2]

[1] https://nodejs.org/api/perf_hooks.html
[2] #11277
  • Loading branch information
Jory Burson authored and plehegar committed Jun 19, 2018
1 parent dc2cc22 commit 50f1cee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
<!doctype html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>

test(() => {
performance.mark('markName');
performance.measure('measureName');
Expand All @@ -28,6 +19,3 @@
}
}
}, 'Test toJSON() in PerformanceEntry');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>PerformanceObserver: takeRecords</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="performanceobservers.js"></script>
<script>
async_test(function (t) {
// META: title=PerformanceObserver: takeRecords
// META: script=performanceobservers.js

async_test(function (t) {
const observer = new PerformanceObserver(function (entryList, observer) {
assert_unreached('This callback should not have been called.')
});
Expand Down Expand Up @@ -36,4 +32,3 @@
observer.disconnect();
t.done();
}, "Test PerformanceObserver's takeRecords()");
</script>
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<!DOCTYPE HTML>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
function testTimeResolution(highResTimeFunc, funcString) {
test(() => {
const t0 = highResTimeFunc();
Expand All @@ -30,6 +22,3 @@

testTimeResolution(timeByPerformanceNow, 'performance.now()');
testTimeResolution(timeByUserTiming, 'entry.startTime');
</script>
</body>
</html>

0 comments on commit 50f1cee

Please sign in to comment.