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

Side by Side Diff: chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc

Issue 2898513002: [EasyUnlock] Observe proximity changes and clean up TX power strategy. (Closed)
Patch Set: fix_unittest Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" 5 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 std::vector<ScreenlockState> states; 691 std::vector<ScreenlockState> states;
692 states.push_back(ScreenlockState::NO_BLUETOOTH); 692 states.push_back(ScreenlockState::NO_BLUETOOTH);
693 states.push_back(ScreenlockState::NO_PHONE); 693 states.push_back(ScreenlockState::NO_PHONE);
694 states.push_back(ScreenlockState::PHONE_UNSUPPORTED); 694 states.push_back(ScreenlockState::PHONE_UNSUPPORTED);
695 states.push_back(ScreenlockState::PHONE_NOT_LOCKABLE); 695 states.push_back(ScreenlockState::PHONE_NOT_LOCKABLE);
696 states.push_back(ScreenlockState::PHONE_NOT_AUTHENTICATED); 696 states.push_back(ScreenlockState::PHONE_NOT_AUTHENTICATED);
697 states.push_back(ScreenlockState::PHONE_LOCKED); 697 states.push_back(ScreenlockState::PHONE_LOCKED);
698 states.push_back(ScreenlockState::PHONE_NOT_LOCKABLE); 698 states.push_back(ScreenlockState::PHONE_NOT_LOCKABLE);
699 states.push_back(ScreenlockState::PHONE_UNSUPPORTED); 699 states.push_back(ScreenlockState::PHONE_UNSUPPORTED);
700 states.push_back(ScreenlockState::RSSI_TOO_LOW); 700 states.push_back(ScreenlockState::RSSI_TOO_LOW);
701 states.push_back(ScreenlockState::TX_POWER_TOO_HIGH); 701 states.push_back(ScreenlockState::PHONE_LOCKED_AND_RSSI_TOO_LOW);
702 states.push_back(ScreenlockState::AUTHENTICATED); 702 states.push_back(ScreenlockState::AUTHENTICATED);
703 703
704 for (size_t i = 0; i < states.size(); ++i) { 704 for (size_t i = 0; i < states.size(); ++i) {
705 state_handler_->ChangeState(states[i]); 705 state_handler_->ChangeState(states[i]);
706 EXPECT_EQ(proximity_auth::ScreenlockBridge::LockHandler::ONLINE_SIGN_IN, 706 EXPECT_EQ(proximity_auth::ScreenlockBridge::LockHandler::ONLINE_SIGN_IN,
707 lock_handler_->GetAuthType(account_id_)); 707 lock_handler_->GetAuthType(account_id_));
708 EXPECT_FALSE(lock_handler_->HasCustomIcon()); 708 EXPECT_FALSE(lock_handler_->HasCustomIcon());
709 } 709 }
710 710
711 std::vector<EasyUnlockScreenlockStateHandler::HardlockState> hardlock_states; 711 std::vector<EasyUnlockScreenlockStateHandler::HardlockState> hardlock_states;
(...skipping 28 matching lines...) Expand all
740 state_handler_->RecordClickOnLockIcon(); 740 state_handler_->RecordClickOnLockIcon();
741 histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 4); 741 histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 4);
742 histogram_tester.ExpectBucketCount("EasyUnlock.TrialRun.Events", 742 histogram_tester.ExpectBucketCount("EasyUnlock.TrialRun.Events",
743 EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED, 1); 743 EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED, 1);
744 histogram_tester.ExpectBucketCount( 744 histogram_tester.ExpectBucketCount(
745 "EasyUnlock.TrialRun.Events", 745 "EasyUnlock.TrialRun.Events",
746 EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON, 3); 746 EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON, 3);
747 } 747 }
748 748
749 } // namespace 749 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_screenlock_state_handler.cc ('k') | chrome/browser/signin/easy_unlock_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698