| 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 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h" | 38 #include "chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h" |
| 39 #include "chrome/browser/sync/test/integration/p2p_sync_refresher.h" | 39 #include "chrome/browser/sync/test/integration/p2p_sync_refresher.h" |
| 40 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 40 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 41 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" | 41 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" |
| 42 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 42 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| 43 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 43 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
| 44 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
| 45 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
| 46 #include "chrome/browser/ui/host_desktop.h" | 46 #include "chrome/browser/ui/host_desktop.h" |
| 47 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 47 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 48 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 48 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 49 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 49 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 50 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 50 #include "chrome/common/chrome_constants.h" | 51 #include "chrome/common/chrome_constants.h" |
| 51 #include "chrome/common/chrome_paths.h" | 52 #include "chrome/common/chrome_paths.h" |
| 52 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
| 53 #include "chrome/test/base/testing_browser_process.h" | 54 #include "chrome/test/base/testing_browser_process.h" |
| 54 #include "chrome/test/base/ui_test_utils.h" | 55 #include "chrome/test/base/ui_test_utils.h" |
| 55 #include "components/bookmarks/test/bookmark_test_helpers.h" | 56 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 56 #include "components/google/core/browser/google_url_tracker.h" | 57 #include "components/google/core/browser/google_url_tracker.h" |
| 57 #include "components/invalidation/impl/invalidation_switches.h" | 58 #include "components/invalidation/impl/invalidation_switches.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 608 |
| 608 // OneClickSigninSyncStarter observer is created with a real user sign in. | 609 // OneClickSigninSyncStarter observer is created with a real user sign in. |
| 609 // It is deleted on certain conditions which are not satisfied by our tests, | 610 // It is deleted on certain conditions which are not satisfied by our tests, |
| 610 // and this causes the SigninTracker observer to stay hanging at shutdown. | 611 // and this causes the SigninTracker observer to stay hanging at shutdown. |
| 611 // Calling LoginUIService::SyncConfirmationUIClosed forces the observer to | 612 // Calling LoginUIService::SyncConfirmationUIClosed forces the observer to |
| 612 // be removed. http://crbug.com/484388 | 613 // be removed. http://crbug.com/484388 |
| 613 for (int i = 0; i < num_clients_; ++i) { | 614 for (int i = 0; i < num_clients_; ++i) { |
| 614 LoginUIServiceFactory::GetForProfile(GetProfile(i))-> | 615 LoginUIServiceFactory::GetForProfile(GetProfile(i))-> |
| 615 SyncConfirmationUIClosed(false /* configure_sync_first */); | 616 SyncConfirmationUIClosed(false /* configure_sync_first */); |
| 616 } | 617 } |
| 618 |
| 619 // With external servers, profile paths are created outside user_data_dir. |
| 620 // This causes the ProfileManager to show an avatar bubble without an anchor |
| 621 // view. The bubble is then not destroyed at shutdown, crbug.com/527505. |
| 622 // This is a fix to explicitly close the bubble early on. |
| 623 // ProfileChooserView is available on few platforms including Linux which is |
| 624 // the only supported platform for ExternalServers. |
| 625 #if defined(OS_LINUX) |
| 626 // TODO(shadi): Remove this hack once crbug.com/527505 is fixed. |
| 627 ProfileChooserView::Hide(); |
| 628 #endif // defined(OS_LINUX) |
| 617 } | 629 } |
| 618 | 630 |
| 619 return true; | 631 return true; |
| 620 } | 632 } |
| 621 | 633 |
| 622 void SyncTest::TearDownOnMainThread() { | 634 void SyncTest::TearDownOnMainThread() { |
| 623 for (size_t i = 0; i < clients_.size(); ++i) { | 635 for (size_t i = 0; i < clients_.size(); ++i) { |
| 624 clients_[i]->service()->RequestStop(ProfileSyncService::CLEAR_DATA); | 636 clients_[i]->service()->RequestStop(ProfileSyncService::CLEAR_DATA); |
| 625 } | 637 } |
| 626 | 638 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 content::NotificationService::current()->Notify( | 1111 content::NotificationService::current()->Notify( |
| 1100 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, | 1112 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, |
| 1101 content::Source<Profile>(GetProfile(index)), | 1113 content::Source<Profile>(GetProfile(index)), |
| 1102 content::Details<const syncer::ModelTypeSet>(&model_types)); | 1114 content::Details<const syncer::ModelTypeSet>(&model_types)); |
| 1103 } | 1115 } |
| 1104 | 1116 |
| 1105 void SyncTest::SetPreexistingPreferencesFileContents( | 1117 void SyncTest::SetPreexistingPreferencesFileContents( |
| 1106 const std::string& contents) { | 1118 const std::string& contents) { |
| 1107 preexisting_preferences_file_contents_ = contents; | 1119 preexisting_preferences_file_contents_ = contents; |
| 1108 } | 1120 } |
| OLD | NEW |