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

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

Issue 1239193005: [Proximity Auth] Port the UnlockManager class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix destruction order in tests on ChromeOS Created 5 years, 4 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
« no previous file with comments | « components/proximity_auth/DEPS ('k') | components/proximity_auth/controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/prefs/testing_pref_service.h" 9 #include "base/prefs/testing_pref_service.h"
10 #include "base/test/test_mock_time_task_runner.h" 10 #include "base/test/test_mock_time_task_runner.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 const char kTestUser[] = "example@gmail.com"; 64 const char kTestUser[] = "example@gmail.com";
65 65
66 class MockProximityAuthClient : public ProximityAuthClient { 66 class MockProximityAuthClient : public ProximityAuthClient {
67 public: 67 public:
68 MockProximityAuthClient() {} 68 MockProximityAuthClient() {}
69 ~MockProximityAuthClient() override {} 69 ~MockProximityAuthClient() override {}
70 70
71 // ProximityAuthClient: 71 // ProximityAuthClient:
72 std::string GetAuthenticatedUsername() const override { return kTestUser; } 72 std::string GetAuthenticatedUsername() const override { return kTestUser; }
73 73
74 MOCK_METHOD1(FinalizeUnlock, void(bool)); 74 MOCK_METHOD1(UpdateScreenlockState,
75 void(proximity_auth::ScreenlockState state));
76 MOCK_METHOD1(FinalizeUnlock, void(bool success));
77 MOCK_METHOD1(FinalizeSignin, void(const std::string& secret));
75 78
76 private: 79 private:
77 DISALLOW_COPY_AND_ASSIGN(MockProximityAuthClient); 80 DISALLOW_COPY_AND_ASSIGN(MockProximityAuthClient);
78 }; 81 };
79 82
80 } // namespace 83 } // namespace
81 84
82 class ProximityAuthBleSystemTestable : public ProximityAuthBleSystem { 85 class ProximityAuthBleSystemTestable : public ProximityAuthBleSystem {
83 public: 86 public:
84 ProximityAuthBleSystemTestable( 87 ProximityAuthBleSystemTestable(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Show the screen. 152 // Show the screen.
150 ON_CALL(lock_handler_, GetScreenType()) 153 ON_CALL(lock_handler_, GetScreenType())
151 .WillByDefault(Return(ScreenlockBridge::LockHandler::OTHER_SCREEN)); 154 .WillByDefault(Return(ScreenlockBridge::LockHandler::OTHER_SCREEN));
152 ScreenlockBridge::Get()->SetLockHandler(&lock_handler_); 155 ScreenlockBridge::Get()->SetLockHandler(&lock_handler_);
153 156
154 // Hide the screen. 157 // Hide the screen.
155 ScreenlockBridge::Get()->SetLockHandler(nullptr); 158 ScreenlockBridge::Get()->SetLockHandler(nullptr);
156 } 159 }
157 160
158 } // namespace proximity_auth 161 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/DEPS ('k') | components/proximity_auth/controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698