OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/test/test_pending_task.h" | |
10 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
11 #include "device/bluetooth/bluetooth_init_win.h" | 10 #include "device/bluetooth/bluetooth_init_win.h" |
12 #include "device/bluetooth/bluetooth_task_manager_win.h" | 11 #include "device/bluetooth/bluetooth_task_manager_win.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
14 | 13 |
15 namespace { | 14 namespace { |
16 | 15 |
17 class BluetoothTaskObserver : public device::BluetoothTaskManagerWin::Observer { | 16 class BluetoothTaskObserver : public device::BluetoothTaskManagerWin::Observer { |
18 public: | 17 public: |
19 BluetoothTaskObserver() | 18 BluetoothTaskObserver() |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 bluetooth_task_runner_->RunPendingTasks(); | 128 bluetooth_task_runner_->RunPendingTasks(); |
130 ui_task_runner_->RunPendingTasks(); | 129 ui_task_runner_->RunPendingTasks(); |
131 EXPECT_EQ(1, observer_.num_discovery_started()); | 130 EXPECT_EQ(1, observer_.num_discovery_started()); |
132 task_manager_->PostStopDiscoveryTask(); | 131 task_manager_->PostStopDiscoveryTask(); |
133 bluetooth_task_runner_->RunPendingTasks(); | 132 bluetooth_task_runner_->RunPendingTasks(); |
134 ui_task_runner_->RunPendingTasks(); | 133 ui_task_runner_->RunPendingTasks(); |
135 EXPECT_EQ(1, observer_.num_discovery_stopped()); | 134 EXPECT_EQ(1, observer_.num_discovery_stopped()); |
136 } | 135 } |
137 | 136 |
138 } // namespace device | 137 } // namespace device |
OLD | NEW |