| 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/options/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include <string> | 8 #include <string> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/signin/fake_signin_manager_builder.h" | 17 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
| 18 #include "chrome/browser/signin/signin_error_controller_factory.h" | 18 #include "chrome/browser/signin/signin_error_controller_factory.h" |
| 19 #include "chrome/browser/signin/signin_manager_factory.h" | 19 #include "chrome/browser/signin/signin_manager_factory.h" |
| 20 #include "chrome/browser/sync/profile_sync_service_factory.h" | 20 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 21 #include "chrome/browser/sync/profile_sync_test_util.h" | 21 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 22 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 22 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 23 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 23 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 void NotifySyncListeners() { | 283 void NotifySyncListeners() { |
| 284 if (handler_->sync_startup_tracker_) | 284 if (handler_->sync_startup_tracker_) |
| 285 handler_->sync_startup_tracker_->OnStateChanged(); | 285 handler_->sync_startup_tracker_->OnStateChanged(); |
| 286 } | 286 } |
| 287 | 287 |
| 288 virtual std::string GetTestUser() { | 288 virtual std::string GetTestUser() { |
| 289 return std::string(kTestUser); | 289 return std::string(kTestUser); |
| 290 } | 290 } |
| 291 | 291 |
| 292 content::TestBrowserThreadBundle thread_bundle_; | 292 content::TestBrowserThreadBundle thread_bundle_; |
| 293 scoped_ptr<Profile> profile_; | 293 std::unique_ptr<Profile> profile_; |
| 294 ProfileSyncServiceMock* mock_pss_; | 294 ProfileSyncServiceMock* mock_pss_; |
| 295 GoogleServiceAuthError error_; | 295 GoogleServiceAuthError error_; |
| 296 SigninManagerBase* mock_signin_; | 296 SigninManagerBase* mock_signin_; |
| 297 content::TestWebUI web_ui_; | 297 content::TestWebUI web_ui_; |
| 298 scoped_ptr<TestingSyncSetupHandler> handler_; | 298 std::unique_ptr<TestingSyncSetupHandler> handler_; |
| 299 }; | 299 }; |
| 300 | 300 |
| 301 class SyncSetupHandlerFirstSigninTest : public SyncSetupHandlerTest { | 301 class SyncSetupHandlerFirstSigninTest : public SyncSetupHandlerTest { |
| 302 std::string GetTestUser() override { return std::string(); } | 302 std::string GetTestUser() override { return std::string(); } |
| 303 }; | 303 }; |
| 304 | 304 |
| 305 TEST_F(SyncSetupHandlerTest, Basic) { | 305 TEST_F(SyncSetupHandlerTest, Basic) { |
| 306 } | 306 } |
| 307 | 307 |
| 308 #if !defined(OS_CHROMEOS) | 308 #if !defined(OS_CHROMEOS) |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) | 963 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) |
| 964 .WillRepeatedly(Return(false)); | 964 .WillRepeatedly(Return(false)); |
| 965 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); | 965 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); |
| 966 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); | 966 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); |
| 967 handler_->HandleConfigure(&list_args); | 967 handler_->HandleConfigure(&list_args); |
| 968 | 968 |
| 969 // Ensure that we navigated to the "done" state since we don't need a | 969 // Ensure that we navigated to the "done" state since we don't need a |
| 970 // passphrase. | 970 // passphrase. |
| 971 ExpectDone(); | 971 ExpectDone(); |
| 972 } | 972 } |
| OLD | NEW |