Commit 956d2e18 authored by Alexander Timin's avatar Alexander Timin Committed by Commit Bot

[scheduler] Run tasks after frame detach

Stop deleting tasks in task queues upon frame detach.

R=dcheng@chromium.org,hajimehoshi@chromium.org,alexclarke@chromium.org
BUG=770736

Change-Id: I8c0a7f6da2bd383bddf32789a1c14d1a64d2b959
Reviewed-on: https://chromium-review.googlesource.com/800943Reviewed-by: default avatarHajime Hoshi <hajimehoshi@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520908}
parent d1abc31d
......@@ -114,9 +114,10 @@ namespace {
void CleanUpQueue(MainThreadTaskQueue* queue) {
if (!queue)
return;
queue->ShutdownTaskQueue();
queue->DetachFromRendererScheduler();
queue->SetFrameScheduler(nullptr);
queue->SetBlameContext(nullptr);
queue->SetQueuePriority(TaskQueue::QueuePriority::kLowPriority);
}
} // namespace
......
......@@ -483,15 +483,14 @@ TEST_F(WebViewSchedulerImplTest, DeleteThrottledQueue_InTask) {
BLINK_FROM_HERE, MakeRepeatingTask(timer_task_queue, &run_count),
TimeDelta::FromMilliseconds(1));
// Note this will run at time t = 10s since we start at time t = 5000us, and
// it will prevent further tasks from running (i.e. the RepeatingTask) by
// deleting the WebFrameScheduler.
// Note this will run at time t = 10s since we start at time t = 5000us.
// However, we still should run all tasks after frame scheduler deletion.
timer_task_queue->PostDelayedTask(BLINK_FROM_HERE,
MakeDeletionTask(web_frame_scheduler),
TimeDelta::FromMilliseconds(9990));
mock_task_runner_->RunForPeriod(base::TimeDelta::FromSeconds(100));
EXPECT_EQ(10, run_count);
EXPECT_EQ(90015, run_count);
}
TEST_F(WebViewSchedulerImplTest, VirtualTimePauseCount_DETERMINISTIC_LOADING) {
......
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