Skip to content

Commit

Permalink
Split jssp wpt tests into single test files
Browse files Browse the repository at this point in the history
Runtimes on linux-rel ranges from 4s to 12s rendering the test
flaky on default timeouts.
Due to the nature of the tests busy waiting to ensure a sample
is captured, breaking JSSP wpt tests into single test files should help.

Bug: chromium:1226936
Change-Id: Ib113f85510a4c9b0bcdcdc10c540565a41d300f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3406580
Auto-Submit: Corentin Pescheloche <[email protected]>
Reviewed-by: Nicolás Peña <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#962169}
  • Loading branch information
cnpsc authored and chromium-wpt-export-bot committed Jan 22, 2022
1 parent f8925dd commit 45db93f
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 84 deletions.
30 changes: 30 additions & 0 deletions js-self-profiling/class-getter-names.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script src="resources/profile-utils.js"></script>
</head>

<body>
<script>
// Getter methods should use `get ${label}` as the function/frame name. Source:
// https://www.ecma-international.org/ecma-262/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation
promise_test(t => ProfileUtils.testFunction(sample => {
class SomeClass {
get someValue() {
sample();
}
}
let instance = new SomeClass();
instance.someValue;
}, {
name: 'get someValue',
}
), 'class getter names are logged correctly');
</script>
</body>

</html>
30 changes: 30 additions & 0 deletions js-self-profiling/class-names.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script src="resources/profile-utils.js"></script>
</head>

<body>
<script>
// Methods should use their label as the function/frame name. Source:
// https://www.ecma-international.org/ecma-262/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation
promise_test(async t => {
class SomeClass {
method(sample) {
sample();
}
}
let instance = new SomeClass();

await ProfileUtils.testFunction(instance.method.bind(instance), {
name: 'method',
});
}, 'class method names are logged correctly');
</script>
</body>

</html>
30 changes: 30 additions & 0 deletions js-self-profiling/class-setter-names.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script src="resources/profile-utils.js"></script>
</head>

<body>
<script>
// Setter methods should use `set ${label}` as the function/frame name. Source:
// https://www.ecma-international.org/ecma-262/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation
promise_test(t => ProfileUtils.testFunction(sample => {
class SomeClass {
set someValue(_) {
sample();
}
}
let instance = new SomeClass();
instance.someValue = 5;
}, {
name: 'set someValue',
}
), 'class setter names are logged correctly');
</script>
</body>

</html>
24 changes: 24 additions & 0 deletions js-self-profiling/function-anonymous-names.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script src="resources/profile-utils.js"></script>
</head>

<body>
<script>
promise_test(async t => {
const f = function (sample) {
sample();
};
await ProfileUtils.testFunction(f, {
name: '',
});
}, 'anonymous function expression names are logged correctly');
</script>
</body>

</html>
24 changes: 24 additions & 0 deletions js-self-profiling/function-declaration-names.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script src="resources/profile-utils.js"></script>
</head>

<body>
<script>
promise_test(async t => {
function namedFunctionDeclaration(sample) {
sample();
};
await ProfileUtils.testFunction(namedFunctionDeclaration, {
name: 'namedFunctionDeclaration',
});
}, 'function declaration names are logged correctly');
</script>
</body>

</html>
24 changes: 24 additions & 0 deletions js-self-profiling/function-expression-names.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>

<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script src="resources/profile-utils.js"></script>
</head>

<body>
<script>
promise_test(async t => {
const f = function namedFunctionExpression(sample) {
sample();
};
await ProfileUtils.testFunction(f, {
name: 'namedFunctionExpression',
});
}, 'function expression names are logged correctly');
</script>
</body>

</html>
84 changes: 0 additions & 84 deletions js-self-profiling/function-names.https.html

This file was deleted.

0 comments on commit 45db93f

Please sign in to comment.