OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/common/one_shot_event.h" | 5 #include "extensions/common/one_shot_event.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
9 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
10 #include "base/test/test_simple_task_runner.h" | 11 #include "base/test/test_simple_task_runner.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace extensions { | 14 namespace extensions { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 void Increment(int* i) { ++*i; } | 18 void Increment(int* i) { ++*i; } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 EXPECT_EQ(1U, runner->NumPendingTasks()); | 119 EXPECT_EQ(1U, runner->NumPendingTasks()); |
119 EXPECT_EQ(0, i); | 120 EXPECT_EQ(0, i); |
120 runner->RunPendingTasks(); | 121 runner->RunPendingTasks(); |
121 // Increment has run. | 122 // Increment has run. |
122 EXPECT_EQ(0U, runner->NumPendingTasks()); | 123 EXPECT_EQ(0U, runner->NumPendingTasks()); |
123 EXPECT_EQ(1, i); | 124 EXPECT_EQ(1, i); |
124 } | 125 } |
125 | 126 |
126 } // namespace | 127 } // namespace |
127 } // namespace extensions | 128 } // namespace extensions |
OLD | NEW |