| 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/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h" | 37 #include "chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h" |
| 38 #include "chrome/browser/sync/test/integration/p2p_sync_refresher.h" | 38 #include "chrome/browser/sync/test/integration/p2p_sync_refresher.h" |
| 39 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 39 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 40 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" | 40 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" |
| 41 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 41 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 42 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 42 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
| 43 #include "chrome/browser/ui/browser.h" | 43 #include "chrome/browser/ui/browser.h" |
| 44 #include "chrome/browser/ui/browser_finder.h" | 44 #include "chrome/browser/ui/browser_finder.h" |
| 45 #include "chrome/browser/ui/host_desktop.h" | 45 #include "chrome/browser/ui/host_desktop.h" |
| 46 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 46 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 47 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 47 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 48 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 48 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 49 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 49 #include "chrome/common/chrome_constants.h" | 50 #include "chrome/common/chrome_constants.h" |
| 50 #include "chrome/common/chrome_paths.h" | 51 #include "chrome/common/chrome_paths.h" |
| 51 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
| 52 #include "chrome/test/base/testing_browser_process.h" | 53 #include "chrome/test/base/testing_browser_process.h" |
| 53 #include "chrome/test/base/ui_test_utils.h" | 54 #include "chrome/test/base/ui_test_utils.h" |
| 54 #include "components/bookmarks/test/bookmark_test_helpers.h" | 55 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 55 #include "components/google/core/browser/google_url_tracker.h" | 56 #include "components/google/core/browser/google_url_tracker.h" |
| 56 #include "components/invalidation/impl/invalidation_switches.h" | 57 #include "components/invalidation/impl/invalidation_switches.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 570 |
| 570 // OneClickSigninSyncStarter observer is created with a real user sign in. | 571 // OneClickSigninSyncStarter observer is created with a real user sign in. |
| 571 // It is deleted on certain conditions which are not satisfied by our tests, | 572 // It is deleted on certain conditions which are not satisfied by our tests, |
| 572 // and this causes the SigninTracker observer to stay hanging at shutdown. | 573 // and this causes the SigninTracker observer to stay hanging at shutdown. |
| 573 // Calling LoginUIService::SyncConfirmationUIClosed forces the observer to | 574 // Calling LoginUIService::SyncConfirmationUIClosed forces the observer to |
| 574 // be removed. http://crbug.com/484388 | 575 // be removed. http://crbug.com/484388 |
| 575 for (int i = 0; i < num_clients_; ++i) { | 576 for (int i = 0; i < num_clients_; ++i) { |
| 576 LoginUIServiceFactory::GetForProfile(GetProfile(i))-> | 577 LoginUIServiceFactory::GetForProfile(GetProfile(i))-> |
| 577 SyncConfirmationUIClosed(false /* configure_sync_first */); | 578 SyncConfirmationUIClosed(false /* configure_sync_first */); |
| 578 } | 579 } |
| 580 |
| 581 // Upon multiple profiles sign in, the profile chooser widget stays open and |
| 582 // causes problems at test shutdown. This is a harmless command to close |
| 583 // the widget in case it was showing. |
| 584 ProfileChooserView::Hide(); |
| 579 } | 585 } |
| 580 | 586 |
| 581 return true; | 587 return true; |
| 582 } | 588 } |
| 583 | 589 |
| 584 void SyncTest::TearDownOnMainThread() { | 590 void SyncTest::TearDownOnMainThread() { |
| 585 for (size_t i = 0; i < clients_.size(); ++i) { | 591 for (size_t i = 0; i < clients_.size(); ++i) { |
| 586 clients_[i]->service()->RequestStop(ProfileSyncService::CLEAR_DATA); | 592 clients_[i]->service()->RequestStop(ProfileSyncService::CLEAR_DATA); |
| 587 } | 593 } |
| 588 | 594 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 content::NotificationService::current()->Notify( | 1067 content::NotificationService::current()->Notify( |
| 1062 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, | 1068 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, |
| 1063 content::Source<Profile>(GetProfile(index)), | 1069 content::Source<Profile>(GetProfile(index)), |
| 1064 content::Details<const syncer::ModelTypeSet>(&model_types)); | 1070 content::Details<const syncer::ModelTypeSet>(&model_types)); |
| 1065 } | 1071 } |
| 1066 | 1072 |
| 1067 void SyncTest::SetPreexistingPreferencesFileContents( | 1073 void SyncTest::SetPreexistingPreferencesFileContents( |
| 1068 const std::string& contents) { | 1074 const std::string& contents) { |
| 1069 preexisting_preferences_file_contents_ = contents; | 1075 preexisting_preferences_file_contents_ = contents; |
| 1070 } | 1076 } |
| OLD | NEW |