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

Side by Side Diff: components/proximity_auth/unlock_manager_unittest.cc

Issue 1372283002: Hook up ProximityAuthSystem in EasyUnlockService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth_connection
Patch Set: Created 5 years, 2 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/unlock_manager.h" 5 #include "components/proximity_auth/unlock_manager.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ON_CALL(*this, IsInRssiRange()).WillByDefault(Return(false)); 82 ON_CALL(*this, IsInRssiRange()).WillByDefault(Return(false));
83 } 83 }
84 ~MockProximityMonitor() override {} 84 ~MockProximityMonitor() override {}
85 85
86 MOCK_METHOD0(Start, void()); 86 MOCK_METHOD0(Start, void());
87 MOCK_METHOD0(Stop, void()); 87 MOCK_METHOD0(Stop, void());
88 MOCK_CONST_METHOD0(GetStrategy, Strategy()); 88 MOCK_CONST_METHOD0(GetStrategy, Strategy());
89 MOCK_CONST_METHOD0(IsUnlockAllowed, bool()); 89 MOCK_CONST_METHOD0(IsUnlockAllowed, bool());
90 MOCK_CONST_METHOD0(IsInRssiRange, bool()); 90 MOCK_CONST_METHOD0(IsInRssiRange, bool());
91 MOCK_METHOD0(RecordProximityMetricsOnAuthSuccess, void()); 91 MOCK_METHOD0(RecordProximityMetricsOnAuthSuccess, void());
92 MOCK_METHOD1(AddObserver, void(ProximityMonitorObserver*));
93 MOCK_METHOD1(RemoveObserver, void(ProximityMonitorObserver*));
92 94
93 private: 95 private:
94 DISALLOW_COPY_AND_ASSIGN(MockProximityMonitor); 96 DISALLOW_COPY_AND_ASSIGN(MockProximityMonitor);
95 }; 97 };
96 98
97 class FakeLockHandler : public ScreenlockBridge::LockHandler { 99 class FakeLockHandler : public ScreenlockBridge::LockHandler {
98 public: 100 public:
99 FakeLockHandler() {} 101 FakeLockHandler() {}
100 ~FakeLockHandler() override {} 102 ~FakeLockHandler() override {}
101 103
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 SimulateUserPresentState(); 821 SimulateUserPresentState();
820 822
821 EXPECT_CALL(messenger_, DispatchUnlockEvent()); 823 EXPECT_CALL(messenger_, DispatchUnlockEvent());
822 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); 824 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK);
823 825
824 EXPECT_CALL(proximity_auth_client_, FinalizeUnlock(true)); 826 EXPECT_CALL(proximity_auth_client_, FinalizeUnlock(true));
825 unlock_manager_->OnUnlockEventSent(true); 827 unlock_manager_->OnUnlockEventSent(true);
826 } 828 }
827 829
828 } // namespace proximity_auth 830 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698