Commit c065ff54 authored by Wanming Lin's avatar Wanming Lin Committed by Chromium LUCI CQ

Not clamp up setTimeout(..., 0) to 1ms for single_shot

setTimeout(..., 0) is clamping up to 1ms for historical reasons:
crbug.com/402694, and the issue has been open for years which was
blocked by the challenge of updating all test expectations accordingly.

Chrome doesn't need the clamp for anything in particular and no 1ms
clamp in the spec, moreover, we found Speedometer2 performance can boost
~1% on Windows without it based on Pinpoint perf.

Most failure tests failed with this change had been fixed in separated
CLs.

Bug: 402694
Change-Id: I46196584b887513ca520221be68099116931d4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578703Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Wanming Lin <wanming.lin@intel.com>
Cr-Commit-Position: refs/heads/master@{#844459}
parent 18eda9b2
......@@ -108,13 +108,13 @@ DOMTimer::DOMTimer(ExecutionContext* context,
}
MoveToNewTaskRunner(context->GetTaskRunner(task_type));
// Clamping up to 1ms for historical reasons crbug.com/402694.
timeout = std::max(timeout, base::TimeDelta::FromMilliseconds(1));
if (single_shot)
if (single_shot) {
StartOneShot(timeout, FROM_HERE);
else
} else {
// TODO(crbug.com/402694): Don't clamp interval timers to 1ms here
timeout = std::max(timeout, base::TimeDelta::FromMilliseconds(1));
StartRepeating(timeout, FROM_HERE);
}
TRACE_EVENT_INSTANT1("devtools.timeline", "TimerInstall",
TRACE_EVENT_SCOPE_THREAD, "data",
......
......@@ -195,13 +195,7 @@ TEST_F(BackgroundPageThrottlingTest, NestedSetTimeoutZero) {
console_message.Utf8().c_str()));
GetDocument().GetPage()->GetPageScheduler()->SetPageVisible(false);
platform_->RunForPeriod(base::TimeDelta::FromMilliseconds(1));
EXPECT_THAT(FilteredConsoleMessages(), Vector<String>(1, console_message));
platform_->RunForPeriod(base::TimeDelta::FromMilliseconds(1));
EXPECT_THAT(FilteredConsoleMessages(), Vector<String>(2, console_message));
platform_->RunForPeriod(base::TimeDelta::FromMilliseconds(1));
EXPECT_THAT(FilteredConsoleMessages(), Vector<String>(3, console_message));
platform_->RunForPeriod(base::TimeDelta::FromMilliseconds(1));
platform_->RunForPeriod(base::TimeDelta::FromMilliseconds(4));
EXPECT_THAT(FilteredConsoleMessages(), Vector<String>(4, console_message));
platform_->RunForPeriod(base::TimeDelta::FromMilliseconds(995));
EXPECT_THAT(FilteredConsoleMessages(), Vector<String>(4, console_message));
......
This is a testharness.js-based test.
FAIL Ordering of steps in "Update the Rendering" - child document requestAnimationFrame order assert_array_equals: expected order of notifications lengths differ, expected array ["parent_raf", "first_child_raf", "second_child_raf"] length 3, got ["parent_raf", "second_child_raf", "first_child_raf", "parent_raf", "second_child_raf", "first_child_raf"] length 6
FAIL Ordering of steps in "Update the Rendering" - child document requestAnimationFrame order assert_array_equals: expected order of notifications expected property 1 to be "first_child_raf" but got "second_child_raf" (expected array ["parent_raf", "first_child_raf", "second_child_raf"] got ["parent_raf", "second_child_raf", "first_child_raf"])
Harness: the test ran to completion.
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