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

Unified Diff: components/scheduler/child/scheduler_helper_unittest.cc

Issue 1340343003: scheduler: Implement WebFrameScheduler and WebPageScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + fixed gn build. Created 5 years, 3 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/child/scheduler_helper.cc ('k') | components/scheduler/child/task_queue_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/child/scheduler_helper_unittest.cc
diff --git a/components/scheduler/child/scheduler_helper_unittest.cc b/components/scheduler/child/scheduler_helper_unittest.cc
index 2807186a853e3aa176fca7a4c5004b2c02cc19e4..e3b66eb5418a5d0a80710c0e45a893b7fc8c6fb1 100644
--- a/components/scheduler/child/scheduler_helper_unittest.cc
+++ b/components/scheduler/child/scheduler_helper_unittest.cc
@@ -183,4 +183,27 @@ TEST_F(SchedulerHelperTest,
RunUntilIdle();
}
+namespace {
+
+class MockObserver : public SchedulerHelper::Observer {
+ public:
+ MOCK_METHOD1(OnUnregisterTaskQueue,
+ void(const scoped_refptr<TaskQueue>& queue));
+};
+
+} // namespace
+
+TEST_F(SchedulerHelperTest, OnUnregisterTaskQueue) {
+ MockObserver observer;
+ scheduler_helper_->SetObserver(&observer);
+
+ scoped_refptr<TaskQueue> task_queue =
+ scheduler_helper_->NewTaskQueue(TaskQueue::Spec("test_queue"));
+
+ EXPECT_CALL(observer, OnUnregisterTaskQueue(_)).Times(1);
+ task_queue->UnregisterTaskQueue();
+
+ scheduler_helper_->SetObserver(nullptr);
+}
+
} // namespace scheduler
« no previous file with comments | « components/scheduler/child/scheduler_helper.cc ('k') | components/scheduler/child/task_queue_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698