| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 Profile* profile_; | 253 Profile* profile_; |
| 254 DISALLOW_COPY_AND_ASSIGN(TestingSyncSetupHandler); | 254 DISALLOW_COPY_AND_ASSIGN(TestingSyncSetupHandler); |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 // The boolean parameter indicates whether the test is run with ClientOAuth | 257 // The boolean parameter indicates whether the test is run with ClientOAuth |
| 258 // or not. The test parameter is a bool: whether or not to test with/ | 258 // or not. The test parameter is a bool: whether or not to test with/ |
| 259 // /ClientLogin enabled or not. | 259 // /ClientLogin enabled or not. |
| 260 class SyncSetupHandlerTest : public testing::Test { | 260 class SyncSetupHandlerTest : public testing::Test { |
| 261 public: | 261 public: |
| 262 SyncSetupHandlerTest() : error_(GoogleServiceAuthError::NONE) {} | 262 SyncSetupHandlerTest() : error_(GoogleServiceAuthError::NONE) {} |
| 263 virtual void SetUp() override { | 263 void SetUp() override { |
| 264 error_ = GoogleServiceAuthError::AuthErrorNone(); | 264 error_ = GoogleServiceAuthError::AuthErrorNone(); |
| 265 | 265 |
| 266 TestingProfile::Builder builder; | 266 TestingProfile::Builder builder; |
| 267 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), | 267 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), |
| 268 FakeSigninManagerBase::Build); | 268 FakeSigninManagerBase::Build); |
| 269 profile_ = builder.Build(); | 269 profile_ = builder.Build(); |
| 270 | 270 |
| 271 // Sign in the user. | 271 // Sign in the user. |
| 272 mock_signin_ = static_cast<SigninManagerBase*>( | 272 mock_signin_ = static_cast<SigninManagerBase*>( |
| 273 SigninManagerFactory::GetForProfile(profile_.get())); | 273 SigninManagerFactory::GetForProfile(profile_.get())); |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 WillRepeatedly(Return(false)); | 1083 WillRepeatedly(Return(false)); |
| 1084 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); | 1084 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); |
| 1085 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); | 1085 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); |
| 1086 handler_->HandleConfigure(&list_args); | 1086 handler_->HandleConfigure(&list_args); |
| 1087 | 1087 |
| 1088 // Ensure that we navigated to the "done" state since we don't need a | 1088 // Ensure that we navigated to the "done" state since we don't need a |
| 1089 // passphrase. | 1089 // passphrase. |
| 1090 ExpectDone(); | 1090 ExpectDone(); |
| 1091 } | 1091 } |
| 1092 | 1092 |
| OLD | NEW |