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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/message_loop.h" | |
12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/browser/signin/signin_manager_factory.h" | 16 #include "chrome/browser/signin/signin_manager_factory.h" |
16 #include "chrome/browser/signin/signin_manager_fake.h" | 17 #include "chrome/browser/signin/signin_manager_fake.h" |
17 #include "chrome/browser/sync/profile_sync_service_factory.h" | 18 #include "chrome/browser/sync/profile_sync_service_factory.h" |
18 #include "chrome/browser/sync/profile_sync_service_mock.h" | 19 #include "chrome/browser/sync/profile_sync_service_mock.h" |
19 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 20 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
20 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 21 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
21 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 22 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 const TestWebUI::CallData& data = web_ui_.call_data()[0]; | 415 const TestWebUI::CallData& data = web_ui_.call_data()[0]; |
415 EXPECT_EQ("SyncSetupOverlay.showSyncSetupPage", data.function_name); | 416 EXPECT_EQ("SyncSetupOverlay.showSyncSetupPage", data.function_name); |
416 std::string page; | 417 std::string page; |
417 ASSERT_TRUE(data.arg1->GetAsString(&page)); | 418 ASSERT_TRUE(data.arg1->GetAsString(&page)); |
418 EXPECT_EQ(page, "done"); | 419 EXPECT_EQ(page, "done"); |
419 } | 420 } |
420 | 421 |
421 scoped_ptr<Profile> profile_; | 422 scoped_ptr<Profile> profile_; |
422 ProfileSyncServiceMock* mock_pss_; | 423 ProfileSyncServiceMock* mock_pss_; |
423 GoogleServiceAuthError error_; | 424 GoogleServiceAuthError error_; |
425 MessageLoop message_loop_; | |
kochi
2012/07/27 05:13:53
Could you elaborate why this fixes the test?
Pleas
peria
2012/07/27 05:32:02
Done.
| |
424 SigninManagerMock* mock_signin_; | 426 SigninManagerMock* mock_signin_; |
425 TestWebUI web_ui_; | 427 TestWebUI web_ui_; |
426 scoped_ptr<TestingSyncSetupHandler> handler_; | 428 scoped_ptr<TestingSyncSetupHandler> handler_; |
427 }; | 429 }; |
428 | 430 |
429 TEST_P(SyncSetupHandlerTest, Basic) { | 431 TEST_P(SyncSetupHandlerTest, Basic) { |
430 } | 432 } |
431 | 433 |
432 TEST_P(SyncSetupHandlerTest, DisplayBasicLogin) { | 434 TEST_P(SyncSetupHandlerTest, DisplayBasicLogin) { |
433 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 435 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1150 CheckShowSyncSetupArgs( | 1152 CheckShowSyncSetupArgs( |
1151 dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); | 1153 dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); |
1152 handler_->CloseSyncSetup(); | 1154 handler_->CloseSyncSetup(); |
1153 EXPECT_EQ(NULL, | 1155 EXPECT_EQ(NULL, |
1154 LoginUIServiceFactory::GetForProfile( | 1156 LoginUIServiceFactory::GetForProfile( |
1155 profile_.get())->current_login_ui()); | 1157 profile_.get())->current_login_ui()); |
1156 } | 1158 } |
1157 | 1159 |
1158 INSTANTIATE_TEST_CASE_P(SyncSetupHandlerTest, SyncSetupHandlerTest, | 1160 INSTANTIATE_TEST_CASE_P(SyncSetupHandlerTest, SyncSetupHandlerTest, |
1159 Values(true, false)); | 1161 Values(true, false)); |
OLD | NEW |