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

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: Rebase 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
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ae03bdb67031e131b855cad7616af9fbcb19d833..20aa733df5c3bd20b8d45ca981536019873403d4 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"
@@ -379,7 +380,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));
@@ -448,7 +449,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));
@@ -471,7 +472,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));
@@ -494,7 +495,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));
@@ -524,7 +525,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));
@@ -584,7 +585,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));
@@ -615,7 +616,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));
@@ -657,7 +658,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));
@@ -674,7 +675,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));
@@ -688,7 +689,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));
@@ -937,7 +938,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));
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698