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

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

Issue 981723007: Remove workaround for to disable EasyUnlock in ephemeral mode for tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
diff --git a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
index b7ff70259969f367f5c70504ecf7415f5de21c59..6651564343c9d53e9e6d86c3f34ec6a4ec8ff165 100644
--- a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
+++ b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
@@ -189,7 +189,7 @@ KeyedService* CreateEasyUnlockServiceForTest(content::BrowserContext* context) {
class EasyUnlockServiceTest : public testing::Test {
public:
EasyUnlockServiceTest()
- : mock_user_manager_(new chromeos::MockUserManager()),
+ : mock_user_manager_(new testing::NiceMock<chromeos::MockUserManager>()),
scoped_user_manager_(mock_user_manager_),
is_bluetooth_adapter_present_(true) {}
@@ -210,9 +210,11 @@ class EasyUnlockServiceTest : public testing::Test {
dbus_setter->SetPowerManagerClient(
scoped_ptr<PowerManagerClient>(power_manager_client_));
- EXPECT_CALL(*mock_user_manager_, Shutdown()).Times(AnyNumber());
- EXPECT_CALL(*mock_user_manager_, IsLoggedInAsUserWithGaiaAccount())
- .WillRepeatedly(Return(true));
+ ON_CALL(*mock_user_manager_, Shutdown()).WillByDefault(Return());
+ ON_CALL(*mock_user_manager_, IsLoggedInAsUserWithGaiaAccount())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_user_manager_, IsCurrentUserNonCryptohomeDataEphemeral())
+ .WillByDefault(Return(false));
SetUpProfile(&profile_, kTestUserPrimary);
}
@@ -284,11 +286,11 @@ class EasyUnlockServiceTest : public testing::Test {
protected:
scoped_ptr<TestingProfile> profile_;
scoped_ptr<TestingProfile> secondary_profile_;
+ chromeos::MockUserManager* mock_user_manager_;
private:
content::TestBrowserThreadBundle thread_bundle_;
- chromeos::MockUserManager* mock_user_manager_;
chromeos::ScopedUserManagerEnabler scoped_user_manager_;
FakePowerManagerClient* power_manager_client_;
@@ -355,4 +357,14 @@ TEST_F(EasyUnlockServiceTest, NotAllowedForSecondaryProfile) {
TestAppManager::STATE_NOT_LOADED));
}
+TEST_F(EasyUnlockServiceTest, NotAllowedForEphemeralAccounts) {
+ ON_CALL(*mock_user_manager_, IsCurrentUserNonCryptohomeDataEphemeral())
+ .WillByDefault(Return(true));
+
+ SetAppManagerReady(profile_.get());
+ EXPECT_FALSE(EasyUnlockService::Get(profile_.get())->IsAllowed());
+ EXPECT_TRUE(
+ EasyUnlockAppInState(profile_.get(), TestAppManager::STATE_NOT_LOADED));
+}
+
} // namespace
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698