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

Unified Diff: components/proximity_auth/bluetooth_throttler_impl_unittest.cc

Issue 1351473003: Refactor fake Connection subclasses in proximity_auth/ tests to a single file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client_rename
Patch Set: rebase Created 5 years, 3 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: components/proximity_auth/bluetooth_throttler_impl_unittest.cc
diff --git a/components/proximity_auth/bluetooth_throttler_impl_unittest.cc b/components/proximity_auth/bluetooth_throttler_impl_unittest.cc
index 8b439419f5a1b342a6fe260f9f36c88b5fd13701..5daacc90218dc359e337b3ff9c6baccb1522a0cb 100644
--- a/components/proximity_auth/bluetooth_throttler_impl_unittest.cc
+++ b/components/proximity_auth/bluetooth_throttler_impl_unittest.cc
@@ -6,25 +6,13 @@
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
+#include "components/proximity_auth/fake_connection.h"
#include "components/proximity_auth/wire_message.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace proximity_auth {
namespace {
-class StubConnection : public Connection {
- public:
- StubConnection() : Connection(RemoteDevice()) {}
- ~StubConnection() override {}
-
- void Connect() override {}
- void Disconnect() override {}
- void SendMessageImpl(scoped_ptr<WireMessage> message) override {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(StubConnection);
-};
-
class TestBluetoothThrottler : public BluetoothThrottlerImpl {
public:
explicit TestBluetoothThrottler(scoped_ptr<base::TickClock> clock)
@@ -52,7 +40,7 @@ class ProximityAuthBluetoothThrottlerImplTest : public testing::Test {
void PerformConnectionStateTransition(Connection::Status old_status,
Connection::Status new_status) {
- StubConnection connection;
+ FakeConnection connection((RemoteDevice()));
throttler_.OnConnection(&connection);
static_cast<ConnectionObserver*>(&throttler_)
->OnConnectionStatusChanged(&connection, old_status, new_status);

Powered by Google App Engine
This is Rietveld 408576698