Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: components/scheduler/base/task_queue_manager_unittest.cc

Issue 2189573002: Fix TimeDomain::MigrateQueue with incoming immediate tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/scheduler/base/time_domain.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/task_queue_manager_unittest.cc
diff --git a/components/scheduler/base/task_queue_manager_unittest.cc b/components/scheduler/base/task_queue_manager_unittest.cc
index caf00b9b79e5ef10042e249866c5f024fd07a7ea..8f37a1f0cd31db788a8b75d9a5674f8ad7f6a876 100644
--- a/components/scheduler/base/task_queue_manager_unittest.cc
+++ b/components/scheduler/base/task_queue_manager_unittest.cc
@@ -1627,6 +1627,31 @@ TEST_F(TaskQueueManagerTest, TimeDomainMigration) {
manager_->UnregisterTimeDomain(domain_b.get());
}
+TEST_F(TaskQueueManagerTest, TimeDomainMigrationWithIncomingImmediateTasks) {
+ Initialize(1u);
+
+ base::TimeTicks start_time = manager_->delegate()->NowTicks();
+ std::unique_ptr<VirtualTimeDomain> domain_a(
+ new VirtualTimeDomain(nullptr, start_time));
+ std::unique_ptr<VirtualTimeDomain> domain_b(
+ new VirtualTimeDomain(nullptr, start_time));
+ manager_->RegisterTimeDomain(domain_a.get());
+ manager_->RegisterTimeDomain(domain_b.get());
+
+ runners_[0]->SetTimeDomain(domain_a.get());
+ std::vector<EnqueueOrder> run_order;
+ runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order));
+ runners_[0]->SetTimeDomain(domain_b.get());
+
+ test_task_runner_->RunUntilIdle();
+ EXPECT_THAT(run_order, ElementsAre(1));
+
+ runners_[0]->UnregisterTaskQueue();
+
+ manager_->UnregisterTimeDomain(domain_a.get());
+ manager_->UnregisterTimeDomain(domain_b.get());
+}
+
namespace {
void ChromiumRunloopInspectionTask(
scoped_refptr<cc::OrderedSimpleTaskRunner> test_task_runner) {
« no previous file with comments | « no previous file | components/scheduler/base/time_domain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698