| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 username_.clear(); | 113 username_.clear(); |
| 114 password_.clear(); | 114 password_.clear(); |
| 115 captcha_.clear(); | 115 captcha_.clear(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 std::string username_; | 118 std::string username_; |
| 119 std::string password_; | 119 std::string password_; |
| 120 std::string captcha_; | 120 std::string captcha_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 static ProfileKeyedBase* BuildSigninManagerMock(Profile* profile) { | 123 static ProfileKeyedService* BuildSigninManagerMock(Profile* profile) { |
| 124 return new SigninManagerMock(); | 124 return new SigninManagerMock(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 class SyncSetupHandlerTest : public testing::Test { | 127 class SyncSetupHandlerTest : public testing::Test { |
| 128 public: | 128 public: |
| 129 SyncSetupHandlerTest() {} | 129 SyncSetupHandlerTest() {} |
| 130 virtual void SetUp() OVERRIDE { | 130 virtual void SetUp() OVERRIDE { |
| 131 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile()); | 131 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile()); |
| 132 mock_pss_ = static_cast<ProfileSyncServiceMock*>( | 132 mock_pss_ = static_cast<ProfileSyncServiceMock*>( |
| 133 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 133 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 std::string page; | 378 std::string page; |
| 379 ASSERT_TRUE(data.arg1->GetAsString(&page)); | 379 ASSERT_TRUE(data.arg1->GetAsString(&page)); |
| 380 EXPECT_EQ(page, "login"); | 380 EXPECT_EQ(page, "login"); |
| 381 // Now make sure that the appropriate params are being passed. | 381 // Now make sure that the appropriate params are being passed. |
| 382 DictionaryValue* dictionary; | 382 DictionaryValue* dictionary; |
| 383 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); | 383 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); |
| 384 CheckShowSyncSetupArgs( | 384 CheckShowSyncSetupArgs( |
| 385 dictionary, "", false, GoogleServiceAuthError::SERVICE_UNAVAILABLE, | 385 dictionary, "", false, GoogleServiceAuthError::SERVICE_UNAVAILABLE, |
| 386 kTestUser, true, ""); | 386 kTestUser, true, ""); |
| 387 } | 387 } |
| OLD | NEW |