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

Unified Diff: chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc

Issue 592893002: Rename ScreelockBridge to SigninScreenBridge Base URL: https://chromium.googlesource.com/chromium/src.git@easy_signin_auth_handler
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
index 1e5d3b5b8d60d76b2b998b786df27fe69d5286a8..cf13c4611dad8835af387de8c52fd4409e1631d9 100644
--- a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
+++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
@@ -10,7 +10,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h"
#include "chrome/browser/signin/easy_unlock_service.h"
-#include "chrome/browser/signin/screenlock_bridge.h"
+#include "chrome/browser/signin/signin_screen_bridge.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
@@ -40,7 +40,7 @@ bool StringHasPlaceholders(const base::string16& input) {
}
// Fake lock handler to be used in these tests.
-class TestLockHandler : public ScreenlockBridge::LockHandler {
+class TestLockHandler : public SigninScreenBridge::LockHandler {
public:
explicit TestLockHandler(const std::string& user_email)
: user_email_(user_email),
@@ -49,14 +49,14 @@ class TestLockHandler : public ScreenlockBridge::LockHandler {
}
virtual ~TestLockHandler() {}
- // ScreenlockBridge::LockHandler implementation:
+ // SigninScreenBridge::LockHandler implementation:
virtual void ShowBannerMessage(const base::string16& message) OVERRIDE {
ASSERT_FALSE(true) << "Should not be reached.";
}
virtual void ShowUserPodCustomIcon(
const std::string& user_email,
- const ScreenlockBridge::UserPodCustomIconOptions& icon) OVERRIDE {
+ const SigninScreenBridge::UserPodCustomIconOptions& icon) OVERRIDE {
ASSERT_EQ(user_email_, user_email);
++show_icon_count_;
last_custom_icon_ = icon.ToDictionaryValue().Pass();
@@ -242,18 +242,18 @@ class EasyUnlockScreenlockStateHandlerTest : public testing::Test {
// Create and inject fake lock handler to the screenlock bridge.
lock_handler_.reset(new TestLockHandler(user_email_));
- ScreenlockBridge* screenlock_bridge = ScreenlockBridge::Get();
- screenlock_bridge->SetLockHandler(lock_handler_.get());
+ SigninScreenBridge* signin_screen_bridge = SigninScreenBridge::Get();
+ signin_screen_bridge->SetLockHandler(lock_handler_.get());
// Create the screenlock state handler object that will be tested.
state_handler_.reset(
new EasyUnlockScreenlockStateHandler(user_email_,
pref_service_.get(),
- screenlock_bridge));
+ signin_screen_bridge));
}
virtual void TearDown() OVERRIDE {
- ScreenlockBridge::Get()->SetLockHandler(NULL);
+ SigninScreenBridge::Get()->SetLockHandler(NULL);
lock_handler_.reset();
state_handler_.reset();
}
@@ -265,7 +265,7 @@ class EasyUnlockScreenlockStateHandlerTest : public testing::Test {
// The user associated with |state_handler_|.
const std::string user_email_;
- // Faked lock handler given to ScreenlockBridge during the test. Abstracts
+ // Faked lock handler given to SigninScreenBridge during the test. Abstracts
// the screen lock UI.
scoped_ptr<TestLockHandler> lock_handler_;
@@ -278,7 +278,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, AuthenticatedInitialRun) {
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
@@ -303,7 +303,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, AuthenticatedNotInitialRun) {
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
@@ -321,7 +321,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, BluetoothConnecting) {
EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::OFFLINE_PASSWORD,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::OFFLINE_PASSWORD,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
@@ -354,7 +354,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, StatesWithLockedIcon) {
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount())
<< "State: " << states[i];
- EXPECT_EQ(ScreenlockBridge::LockHandler::OFFLINE_PASSWORD,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::OFFLINE_PASSWORD,
lock_handler_->GetAuthType(user_email_))
<< "State: " << states[i];
@@ -385,7 +385,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest,
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
@@ -393,7 +393,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest,
state_handler_.reset();
EXPECT_EQ(0u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::OFFLINE_PASSWORD,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::OFFLINE_PASSWORD,
lock_handler_->GetAuthType(user_email_));
ASSERT_FALSE(lock_handler_->HasCustomIcon());
@@ -404,17 +404,17 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, StatePreservedWhenScreenUnlocks) {
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
- ScreenlockBridge::Get()->SetLockHandler(NULL);
+ SigninScreenBridge::Get()->SetLockHandler(NULL);
lock_handler_.reset(new TestLockHandler(user_email_));
EXPECT_EQ(0u, lock_handler_->GetAndResetShowIconCount());
- ScreenlockBridge::Get()->SetLockHandler(lock_handler_.get());
+ SigninScreenBridge::Get()->SetLockHandler(lock_handler_.get());
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
}
@@ -424,21 +424,21 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, StateChangeWhileScreenUnlocked) {
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
- ScreenlockBridge::Get()->SetLockHandler(NULL);
+ SigninScreenBridge::Get()->SetLockHandler(NULL);
lock_handler_.reset(new TestLockHandler(user_email_));
EXPECT_EQ(0u, lock_handler_->GetAndResetShowIconCount());
state_handler_->ChangeState(
EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING);
- ScreenlockBridge::Get()->SetLockHandler(lock_handler_.get());
+ SigninScreenBridge::Get()->SetLockHandler(lock_handler_.get());
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
- EXPECT_EQ(ScreenlockBridge::LockHandler::OFFLINE_PASSWORD,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::OFFLINE_PASSWORD,
lock_handler_->GetAuthType(user_email_));
ASSERT_TRUE(lock_handler_->HasCustomIcon());
EXPECT_TRUE(lock_handler_->IsCustomIconAnimated());
@@ -466,9 +466,9 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest,
<< "State: " << states[i];
}
- ScreenlockBridge::Get()->SetLockHandler(NULL);
+ SigninScreenBridge::Get()->SetLockHandler(NULL);
lock_handler_.reset(new TestLockHandler(user_email_));
- ScreenlockBridge::Get()->SetLockHandler(lock_handler_.get());
+ SigninScreenBridge::Get()->SetLockHandler(lock_handler_.get());
for (size_t i = 0; i < states.size(); ++i) {
state_handler_->ChangeState(states[i]);
@@ -534,7 +534,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, StateChangesIgnoredIfHardlocked) {
lock_handler_->SetAuthType(
user_email_,
- ScreenlockBridge::LockHandler::FORCE_OFFLINE_PASSWORD,
+ SigninScreenBridge::LockHandler::FORCE_OFFLINE_PASSWORD,
base::string16());
lock_handler_->HideUserPodCustomIcon(user_email_);
@@ -545,7 +545,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, StateChangesIgnoredIfHardlocked) {
state_handler_->ChangeState(
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_FALSE(lock_handler_->HasCustomIcon());
- EXPECT_EQ(ScreenlockBridge::LockHandler::FORCE_OFFLINE_PASSWORD,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::FORCE_OFFLINE_PASSWORD,
lock_handler_->GetAuthType(user_email_));
}
@@ -556,7 +556,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest,
lock_handler_->SetAuthType(
user_email_,
- ScreenlockBridge::LockHandler::FORCE_OFFLINE_PASSWORD,
+ SigninScreenBridge::LockHandler::FORCE_OFFLINE_PASSWORD,
base::string16());
lock_handler_->HideUserPodCustomIcon(user_email_);
@@ -564,21 +564,21 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest,
EasyUnlockScreenlockStateHandler::STATE_NO_PHONE);
EXPECT_FALSE(lock_handler_->HasCustomIcon());
- ScreenlockBridge::Get()->SetLockHandler(NULL);
+ SigninScreenBridge::Get()->SetLockHandler(NULL);
lock_handler_.reset(new TestLockHandler(user_email_));
EXPECT_EQ(0u, lock_handler_->GetAndResetShowIconCount());
- ScreenlockBridge::Get()->SetLockHandler(lock_handler_.get());
+ SigninScreenBridge::Get()->SetLockHandler(lock_handler_.get());
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
EXPECT_TRUE(lock_handler_->HasCustomIcon());
- EXPECT_EQ(ScreenlockBridge::LockHandler::OFFLINE_PASSWORD,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::OFFLINE_PASSWORD,
lock_handler_->GetAuthType(user_email_));
state_handler_->ChangeState(
EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED);
EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount());
EXPECT_TRUE(lock_handler_->HasCustomIcon());
- EXPECT_EQ(ScreenlockBridge::LockHandler::USER_CLICK,
+ EXPECT_EQ(SigninScreenBridge::LockHandler::USER_CLICK,
lock_handler_->GetAuthType(user_email_));
EXPECT_TRUE(lock_handler_->CustomIconHardlocksOnClick());
}
« 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