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

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: Fix android build 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 b375e50d20a9b2541d71ce289d9d16f3f825601a..e0d5237c15624700b5866137b5c41632d09f93a2 100644
--- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
@@ -28,6 +28,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"
@@ -393,7 +394,7 @@ class SyncSetupHandlerTest : public testing::TestWithParam<bool> {
}
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));
@@ -454,7 +455,7 @@ TEST_P(SyncSetupHandlerTest, Basic) {
TEST_P(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));
@@ -496,7 +497,7 @@ TEST_P(SyncSetupHandlerTest, DisplayBasicLogin) {
TEST_P(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));
@@ -527,7 +528,7 @@ TEST_P(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));
@@ -557,7 +558,7 @@ TEST_P(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));
@@ -615,7 +616,7 @@ TEST_P(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));
@@ -646,7 +647,7 @@ TEST_P(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));
@@ -685,7 +686,7 @@ class SyncSetupHandlerNonCrosTest : public SyncSetupHandlerTest {
TEST_P(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));
@@ -728,7 +729,7 @@ TEST_P(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure) {
TEST_P(SyncSetupHandlerNonCrosTest, HandleCaptcha) {
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));
@@ -772,7 +773,7 @@ TEST_P(SyncSetupHandlerNonCrosTest, HandleCaptcha) {
TEST_P(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));
@@ -822,7 +823,7 @@ TEST_P(SyncSetupHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
TEST_P(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));
@@ -1157,7 +1158,7 @@ TEST_P(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