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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler_unittest.cc

Issue 15421011: Use OAuth2 token for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add commandline switch to toggle between OAuth2 and ClientLogin token Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/sync_setup_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
index a2dfed806d14a21826ff850f26c607b9681a3f6a..f0336e0b07ab7fb11de3db4f4ff13847d6007ba9 100644
--- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
@@ -27,6 +27,7 @@
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "content/public/browser/web_ui.h"
+#include "content/public/test/test_browser_thread.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
@@ -380,7 +381,7 @@ class SyncSetupHandlerTest : public testing::Test {
}
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(true));
@@ -441,7 +442,7 @@ TEST_F(SyncSetupHandlerTest, Basic) {
TEST_F(SyncSetupHandlerTest, DisplayBasicLogin) {
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
const GoogleServiceAuthError error(GoogleServiceAuthError::NONE);
EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error));
@@ -464,7 +465,7 @@ TEST_F(SyncSetupHandlerTest, DisplayBasicLogin) {
TEST_F(SyncSetupHandlerTest, ShowSyncSetupWhenNotSignedIn) {
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -487,7 +488,7 @@ TEST_F(SyncSetupHandlerTest, DisplayConfigureWithBackendDisabledAndCancel) {
.WillRepeatedly(Return(true));
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, kTestUser);
mock_signin_->Initialize(profile_.get(), NULL);
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -517,7 +518,7 @@ TEST_F(SyncSetupHandlerTest,
.WillRepeatedly(Return(true));
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, kTestUser);
mock_signin_->Initialize(profile_.get(), NULL);
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -575,7 +576,7 @@ TEST_F(SyncSetupHandlerTest,
.WillRepeatedly(Return(true));
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, kTestUser);
mock_signin_->Initialize(profile_.get(), NULL);
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -606,7 +607,7 @@ TEST_F(SyncSetupHandlerTest,
.WillRepeatedly(Return(true));
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, kTestUser);
mock_signin_->Initialize(profile_.get(), NULL);
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -645,7 +646,7 @@ class SyncSetupHandlerNonCrosTest : public SyncSetupHandlerTest {
TEST_F(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure) {
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasUnrecoverableError())
.WillRepeatedly(Return(false));
@@ -662,7 +663,7 @@ TEST_F(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure) {
TEST_F(SyncSetupHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -676,7 +677,7 @@ TEST_F(SyncSetupHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
TEST_F(SyncSetupHandlerNonCrosTest, GaiaErrorInitializingSync) {
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
.WillRepeatedly(Return(false));
@@ -925,7 +926,7 @@ TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) {
provider.SetAuthError(error_);
EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
.WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsSyncTokenAvailable())
+ EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
.WillRepeatedly(Return(false));

Powered by Google App Engine
This is Rietveld 408576698