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

Side by Side Diff: ash/login/lock_screen_controller_unittest.cc

Issue 2903353003: Adding mojo calls for easy unlock service (Closed)
Patch Set: comments and rebase Created 3 years, 6 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 | « ash/login/lock_screen_controller.cc ('k') | ash/login/mock_lock_screen_client.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ash/login/lock_screen_controller.h" 5 #include "ash/login/lock_screen_controller.h"
6 6
7 #include "ash/login/mock_lock_screen_client.h" 7 #include "ash/login/mock_lock_screen_client.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 20 matching lines...) Expand all
31 EXPECT_NE(password, hashed_password); 31 EXPECT_NE(password, hashed_password);
32 32
33 // Verify AuthenticateUser mojo call is run with the same account id, a 33 // Verify AuthenticateUser mojo call is run with the same account id, a
34 // (hashed) password, and the correct PIN state. 34 // (hashed) password, and the correct PIN state.
35 EXPECT_CALL(*client, AuthenticateUser(id, hashed_password, false)); 35 EXPECT_CALL(*client, AuthenticateUser(id, hashed_password, false));
36 controller->AuthenticateUser(id, password, false); 36 controller->AuthenticateUser(id, password, false);
37 37
38 base::RunLoop().RunUntilIdle(); 38 base::RunLoop().RunUntilIdle();
39 } 39 }
40 40
41 TEST_F(LockScreenControllerTest, RequestEasyUnlock) {
42 LockScreenController* controller = Shell::Get()->lock_screen_controller();
43 std::unique_ptr<MockLockScreenClient> client = BindMockLockScreenClient();
44
45 AccountId id = AccountId::FromUserEmail("user1@test.com");
46
47 // Verify AttemptUnlock mojo call is run with the same account id.
48 EXPECT_CALL(*client, AttemptUnlock(id));
49 controller->AttemptUnlock(id);
50 base::RunLoop().RunUntilIdle();
51
52 // Verify HardlockPod mojo call is run with the same account id.
53 EXPECT_CALL(*client, HardlockPod(id));
54 controller->HardlockPod(id);
55 base::RunLoop().RunUntilIdle();
56
57 // Verify RecordClickOnLockIcon mojo call is run with the same account id.
58 EXPECT_CALL(*client, RecordClickOnLockIcon(id));
59 controller->RecordClickOnLockIcon(id);
60 base::RunLoop().RunUntilIdle();
61 }
62
41 } // namespace ash 63 } // namespace ash
OLDNEW
« no previous file with comments | « ash/login/lock_screen_controller.cc ('k') | ash/login/mock_lock_screen_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698