Commit e0d92f60 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Convert dfg-arguments-alias-activation.html to utilize w3c test harness

This patch changes "dfg-arguments-alias-activation.html" to utilize w3c test
harnes for ease of maintenance and avoid timeout for dumping result.

This patch is a preparation of the patch[1].

[1] http://crrev.com/c/1337224 Utilize NGInlineNode::GetOffsetMapping() in
Element#innerText

Change-Id: I5fcd46f0dd31eb8869917af288d7ad385626612c
Reviewed-on: https://chromium-review.googlesource.com/c/1345752Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609955}
parent e9323dba
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
<p>This tests verifies access to captured arguments via an optimized-away arguments object. <p>This tests verifies access to captured arguments via an optimized-away arguments object.
</p> </p>
<pre id="console"></pre>
<script> <script>
function log(s)
{
document.getElementById("console").appendChild(document.createTextNode(s + "\r\n"));
}
function shouldBe(a, aDescription, b)
{
if (a == b) {
log("PASS: " + aDescription + " should be " + b + " and is.");
return;
}
log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".");
}
if (window.testRunner) {
testRunner.dumpAsText();
}
// In-bounds of declared and passed arguments, no activation, before tear-off. // In-bounds of declared and passed arguments, no activation, before tear-off.
function f0(x) { function f0(x) {
return arguments[0] || function() { return x; }; return arguments[0] || function() { return x; };
...@@ -61,14 +43,16 @@ function f7(x) { ...@@ -61,14 +43,16 @@ function f7(x) {
return function() { return x; } && arguments; return function() { return x; } && arguments;
} }
for (var i = 0; i < 200; ++i) { test(() => {
shouldBe(f0(1), "f0(1)", 1); for (let i = 0; i < 200; ++i) {
shouldBe(f1(2, 3), "f1(2, 3)", 3); assert_equals(f0(1), 1, "f0(1)");
shouldBe(f2(4), "f2(4)", 4); assert_equals(f1(2, 3), 3, "f1(2, 3)");
shouldBe(f3(5, 6), "f3(5, 6)", 6); assert_equals(f2(4), 4, "f2(4)");
shouldBe(f4(7)[0], "f4(7)", 7); assert_equals(f3(5, 6), 6, "f3(5, 6)");
shouldBe(f5(8, 9)[1], "f5(8, 9)", 9); assert_equals(f4(7)[0], 7, "f4(7)");
shouldBe(f6(10)[0], "f6(10)", 10); assert_equals(f5(8, 9)[1], 9, "f5(8, 9)");
shouldBe(f7(11, 12)[1], "f7(11, 12)", 12); assert_equals(f6(10)[0], 10, "f6(10)");
} assert_equals(f7(11, 12)[1], 12, "f7(11, 12)");
}
});
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment