| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/gcm_driver/gcm_delayed_task_controller.h" | 5 #include "components/gcm_driver/gcm_delayed_task_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace gcm { | 10 namespace gcm { |
| 11 | 11 |
| 12 class GCMDelayedTaskControllerTest : public testing::Test { | 12 class GCMDelayedTaskControllerTest : public testing::Test { |
| 13 public: | 13 public: |
| 14 GCMDelayedTaskControllerTest(); | 14 GCMDelayedTaskControllerTest(); |
| 15 virtual ~GCMDelayedTaskControllerTest(); | 15 ~GCMDelayedTaskControllerTest() override; |
| 16 | 16 |
| 17 void TestTask(); | 17 void TestTask(); |
| 18 | 18 |
| 19 GCMDelayedTaskController* controller() { return controller_.get(); } | 19 GCMDelayedTaskController* controller() { return controller_.get(); } |
| 20 | 20 |
| 21 int number_of_triggered_tasks() const { return number_of_triggered_tasks_; } | 21 int number_of_triggered_tasks() const { return number_of_triggered_tasks_; } |
| 22 | 22 |
| 23 private: | 23 private: |
| 24 scoped_ptr<GCMDelayedTaskController> controller_; | 24 scoped_ptr<GCMDelayedTaskController> controller_; |
| 25 int number_of_triggered_tasks_; | 25 int number_of_triggered_tasks_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 controller()->AddTask(base::Bind(&GCMDelayedTaskControllerTest::TestTask, | 52 controller()->AddTask(base::Bind(&GCMDelayedTaskControllerTest::TestTask, |
| 53 base::Unretained(this))); | 53 base::Unretained(this))); |
| 54 controller()->AddTask(base::Bind(&GCMDelayedTaskControllerTest::TestTask, | 54 controller()->AddTask(base::Bind(&GCMDelayedTaskControllerTest::TestTask, |
| 55 base::Unretained(this))); | 55 base::Unretained(this))); |
| 56 | 56 |
| 57 controller()->SetReady(); | 57 controller()->SetReady(); |
| 58 EXPECT_EQ(2, number_of_triggered_tasks()); | 58 EXPECT_EQ(2, number_of_triggered_tasks()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace gcm | 61 } // namespace gcm |
| OLD | NEW |