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

Side by Side Diff: components/proximity_auth/ble/proximity_auth_ble_system_unittest.cc

Issue 1209193003: [Proximity Auth] Create one ProximityAuthClient per profile, rather than one global one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable tests on non-ChromeOS, since there's nothing left to test on the other platforms Created 5 years, 5 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 unified diff | Download patch
OLDNEW
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/ble/proximity_auth_ble_system.h" 5 #include "components/proximity_auth/ble/proximity_auth_ble_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/proximity_auth/connection_finder.h" 9 #include "components/proximity_auth/connection_finder.h"
10 #include "components/proximity_auth/proximity_auth_client.h" 10 #include "components/proximity_auth/proximity_auth_client.h"
(...skipping 20 matching lines...) Expand all
31 class ProximityAuthBleSystemTestable : public ProximityAuthBleSystem { 31 class ProximityAuthBleSystemTestable : public ProximityAuthBleSystem {
32 public: 32 public:
33 class MockScreenlockBridgeAdapter 33 class MockScreenlockBridgeAdapter
34 : public ProximityAuthBleSystem::ScreenlockBridgeAdapter { 34 : public ProximityAuthBleSystem::ScreenlockBridgeAdapter {
35 public: 35 public:
36 MockScreenlockBridgeAdapter() {} 36 MockScreenlockBridgeAdapter() {}
37 ~MockScreenlockBridgeAdapter() {} 37 ~MockScreenlockBridgeAdapter() {}
38 38
39 MOCK_METHOD1(AddObserver, void(ScreenlockBridge::Observer*)); 39 MOCK_METHOD1(AddObserver, void(ScreenlockBridge::Observer*));
40 MOCK_METHOD1(RemoveObserver, void(ScreenlockBridge::Observer*)); 40 MOCK_METHOD1(RemoveObserver, void(ScreenlockBridge::Observer*));
41 MOCK_METHOD1(Unlock, void(content::BrowserContext*)); 41 MOCK_METHOD1(Unlock, void(ProximityAuthClient*));
42 }; 42 };
43 43
44 ProximityAuthBleSystemTestable(ScreenlockBridgeAdapter* screenlock_bridge) 44 ProximityAuthBleSystemTestable(ScreenlockBridgeAdapter* screenlock_bridge)
45 : ProximityAuthBleSystem(screenlock_bridge, nullptr) {} 45 : ProximityAuthBleSystem(make_scoped_ptr(screenlock_bridge), nullptr) {}
46 46
47 ConnectionFinder* CreateConnectionFinder() override { 47 ConnectionFinder* CreateConnectionFinder() override {
48 return new NiceMock<MockConnectionFinder>(); 48 return new NiceMock<MockConnectionFinder>();
49 } 49 }
50 }; 50 };
51 51
52 class ProximityAuthBleSystemTest : public testing::Test { 52 class ProximityAuthBleSystemTest : public testing::Test {
53 protected: 53 protected:
54 ProximityAuthBleSystemTest() 54 ProximityAuthBleSystemTest()
55 : screenlock_bridge_(new NiceMock< 55 : screenlock_bridge_(new NiceMock<
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SetExpectations(); 97 SetExpectations();
98 98
99 ProximityAuthBleSystemTestable proximity_auth_system(screenlock_bridge_); 99 ProximityAuthBleSystemTestable proximity_auth_system(screenlock_bridge_);
100 proximity_auth_system.OnScreenDidLock( 100 proximity_auth_system.OnScreenDidLock(
101 ScreenlockBridge::LockHandler::OTHER_SCREEN); 101 ScreenlockBridge::LockHandler::OTHER_SCREEN);
102 proximity_auth_system.OnScreenDidUnlock( 102 proximity_auth_system.OnScreenDidUnlock(
103 ScreenlockBridge::LockHandler::OTHER_SCREEN); 103 ScreenlockBridge::LockHandler::OTHER_SCREEN);
104 } 104 }
105 105
106 } // namespace proximity_auth 106 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/ble/proximity_auth_ble_system.cc ('k') | components/proximity_auth/proximity_auth_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698