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

Unified Diff: chromeos/components/tether/ble_connection_manager_unittest.cc

Issue 2915833003: Tether: Break helper TimerFactory out of BleConnectionManager and HostScanCache. (Closed)
Patch Set: khorimoto@ comments. Created 3 years, 7 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
Index: chromeos/components/tether/ble_connection_manager_unittest.cc
diff --git a/chromeos/components/tether/ble_connection_manager_unittest.cc b/chromeos/components/tether/ble_connection_manager_unittest.cc
index b18e5ef5f6602de0538ef02351761d6bd8a806be..86cb008878856aca303202853c068376c0bcbab1 100644
--- a/chromeos/components/tether/ble_connection_manager_unittest.cc
+++ b/chromeos/components/tether/ble_connection_manager_unittest.cc
@@ -8,6 +8,7 @@
#include "base/timer/mock_timer.h"
#include "chromeos/components/tether/ble_constants.h"
#include "chromeos/components/tether/proto/tether.pb.h"
+#include "chromeos/components/tether/timer_factory.h"
#include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h"
#include "components/cryptauth/bluetooth_throttler.h"
#include "components/cryptauth/connection.h"
@@ -60,6 +61,14 @@ struct ReceivedMessage {
std::string payload;
};
+class MockTimerFactory : public TimerFactory {
+ public:
+ std::unique_ptr<base::Timer> CreateOneShotTimer() override {
+ return base::MakeUnique<base::MockTimer>(false /* retains_user_task */,
+ false /* is_repeating */);
+ }
+};
+
class TestObserver : public BleConnectionManager::Observer {
public:
TestObserver() {}
@@ -229,14 +238,6 @@ class BleConnectionManagerTest : public testing::Test {
std::string expected_device_address_;
};
- class MockTimerFactory : public BleConnectionManager::TimerFactory {
- public:
- std::unique_ptr<base::Timer> CreateTimer() override {
- return base::MakeUnique<base::MockTimer>(false /* retains_user_task */,
- false /* is_repeating */);
- }
- };
-
BleConnectionManagerTest() : test_devices_(CreateTestDevices(4)) {
// These tests assume a maximum of two concurrent advertisers. Some of the
// multi-device tests would need to be re-written if this constant changes.
« no previous file with comments | « chromeos/components/tether/ble_connection_manager.cc ('k') | chromeos/components/tether/fake_ble_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698