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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 #if !defined(OS_CHROMEOS) | 398 #if !defined(OS_CHROMEOS) |
399 TEST_F(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin) { | 399 TEST_F(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin) { |
400 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 400 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) |
401 .WillRepeatedly(Return(false)); | 401 .WillRepeatedly(Return(false)); |
402 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) | 402 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) |
403 .WillRepeatedly(Return(false)); | 403 .WillRepeatedly(Return(false)); |
404 EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted()) | 404 EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted()) |
405 .WillRepeatedly(Return(false)); | 405 .WillRepeatedly(Return(false)); |
406 // Ensure that the user is not signed in before calling |HandleStartSignin()|. | 406 // Ensure that the user is not signed in before calling |HandleStartSignin()|. |
407 SigninManager* manager = static_cast<SigninManager*>(mock_signin_); | 407 SigninManager* manager = static_cast<SigninManager*>(mock_signin_); |
408 manager->SignOut(); | 408 manager->SignOut(signin_metrics::SIGNOUT_TEST); |
409 handler_->HandleStartSignin(NULL); | 409 handler_->HandleStartSignin(NULL); |
410 | 410 |
411 // Sync setup hands off control to the gaia login tab. | 411 // Sync setup hands off control to the gaia login tab. |
412 EXPECT_EQ(NULL, | 412 EXPECT_EQ(NULL, |
413 LoginUIServiceFactory::GetForProfile( | 413 LoginUIServiceFactory::GetForProfile( |
414 profile_.get())->current_login_ui()); | 414 profile_.get())->current_login_ui()); |
415 | 415 |
416 ASSERT_FALSE(handler_->is_configuring_sync()); | 416 ASSERT_FALSE(handler_->is_configuring_sync()); |
417 | 417 |
418 handler_->CloseSyncSetup(); | 418 handler_->CloseSyncSetup(); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 | 1053 |
1054 // This should display the sync setup dialog (not login). | 1054 // This should display the sync setup dialog (not login). |
1055 handler_->OpenSyncSetup(); | 1055 handler_->OpenSyncSetup(); |
1056 | 1056 |
1057 ExpectConfig(); | 1057 ExpectConfig(); |
1058 const TestWebUI::CallData& data = web_ui_.call_data()[0]; | 1058 const TestWebUI::CallData& data = web_ui_.call_data()[0]; |
1059 base::DictionaryValue* dictionary; | 1059 base::DictionaryValue* dictionary; |
1060 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); | 1060 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); |
1061 CheckBool(dictionary, "encryptAllData", true); | 1061 CheckBool(dictionary, "encryptAllData", true); |
1062 } | 1062 } |
OLD | NEW |