OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/proximity_auth/throttled_bluetooth_connection_finder.h" | 5 #include "components/proximity_auth/throttled_bluetooth_connection_finder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" |
8 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
9 #include "base/time/time.h" | 10 #include "base/time/time.h" |
10 #include "components/proximity_auth/bluetooth_connection_finder.h" | 11 #include "components/proximity_auth/bluetooth_connection_finder.h" |
11 #include "components/proximity_auth/bluetooth_throttler.h" | 12 #include "components/proximity_auth/bluetooth_throttler.h" |
12 #include "components/proximity_auth/fake_connection.h" | 13 #include "components/proximity_auth/fake_connection.h" |
13 #include "components/proximity_auth/remote_device.h" | 14 #include "components/proximity_auth/remote_device.h" |
14 #include "components/proximity_auth/wire_message.h" | 15 #include "components/proximity_auth/wire_message.h" |
15 #include "device/bluetooth/bluetooth_uuid.h" | 16 #include "device/bluetooth/bluetooth_uuid.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ThrottledBluetoothConnectionFinder connection_finder( | 113 ThrottledBluetoothConnectionFinder connection_finder( |
113 make_scoped_ptr(new FakeBluetoothConnectionFinder), task_runner_, | 114 make_scoped_ptr(new FakeBluetoothConnectionFinder), task_runner_, |
114 &throttler_); | 115 &throttler_); |
115 scoped_ptr<Connection> connection; | 116 scoped_ptr<Connection> connection; |
116 EXPECT_CALL(throttler_, OnConnection(_)); | 117 EXPECT_CALL(throttler_, OnConnection(_)); |
117 connection_finder.Find(base::Bind(&SaveConnection, &connection)); | 118 connection_finder.Find(base::Bind(&SaveConnection, &connection)); |
118 EXPECT_TRUE(connection); | 119 EXPECT_TRUE(connection); |
119 } | 120 } |
120 | 121 |
121 } // namespace proximity_auth | 122 } // namespace proximity_auth |
OLD | NEW |