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

Unified Diff: components/scheduler/renderer/renderer_scheduler_impl_unittest.cc

Issue 2017763003: Suspend more task queues for background renderers (experimental) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 4 years, 6 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 | « components/scheduler/renderer/renderer_scheduler_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/renderer/renderer_scheduler_impl_unittest.cc
diff --git a/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc
index db17ea5323f30f487f45d325eb9ebe3854ede3b6..11e810cb2a4ece99077ce32578aeecc96afa64c7 100644
--- a/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc
+++ b/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc
@@ -2165,22 +2165,26 @@ TEST_F(RendererSchedulerImplTest, MultipleSuspendsNeedMultipleResumes) {
testing::ElementsAre(std::string("T1"), std::string("T2")));
}
-TEST_F(RendererSchedulerImplTest, SuspendRendererWhenBackgrounded) {
+TEST_F(RendererSchedulerImplTest, SuspendRenderer) {
// Assume that the renderer is backgrounded.
scheduler_->OnRendererBackgrounded();
- // Tasks don't fire when the renderer is suspended.
+ // Tasks in some queues don't fire when the renderer is suspended.
std::vector<std::string> run_order;
- PostTestTasks(&run_order, "T1 T2");
+ PostTestTasks(&run_order, "D1 C1 L1 I1 T1");
scheduler_->SuspendRenderer();
+ EnableIdleTasks();
RunUntilIdle();
- EXPECT_TRUE(run_order.empty());
+ EXPECT_THAT(run_order,
+ testing::ElementsAre(std::string("D1"), std::string("C1"),
+ std::string("I1")));
- // The queued tasks fire when the tab goes foregrounded.
+ // The rest queued tasks fire when the tab goes foregrounded.
+ run_order.clear();
scheduler_->OnRendererForegrounded();
RunUntilIdle();
EXPECT_THAT(run_order,
- testing::ElementsAre(std::string("T1"), std::string("T2")));
+ testing::ElementsAre(std::string("L1"), std::string("T1")));
}
TEST_F(RendererSchedulerImplTest, UseCaseToString) {
« no previous file with comments | « components/scheduler/renderer/renderer_scheduler_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698