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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process/launch.h" | 15 #include "base/process/launch.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
20 #include "base/test/test_timeouts.h" | 20 #include "base/test/test_timeouts.h" |
21 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 23 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 24 #include "chrome/browser/chrome_notification_types.h" |
24 #include "chrome/browser/history/history_service_factory.h" | 25 #include "chrome/browser/history/history_service_factory.h" |
25 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 26 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
26 #include "chrome/browser/lifetime/application_lifetime.h" | 27 #include "chrome/browser/lifetime/application_lifetime.h" |
27 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
28 #include "chrome/browser/search_engines/template_url_service_factory.h" | 29 #include "chrome/browser/search_engines/template_url_service_factory.h" |
29 #include "chrome/browser/signin/profile_identity_provider.h" | 30 #include "chrome/browser/signin/profile_identity_provider.h" |
30 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 31 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
31 #include "chrome/browser/signin/signin_manager_factory.h" | 32 #include "chrome/browser/signin/signin_manager_factory.h" |
32 #include "chrome/browser/sync/glue/invalidation_helper.h" | 33 #include "chrome/browser/sync/glue/invalidation_helper.h" |
33 #include "chrome/browser/sync/profile_sync_service.h" | 34 #include "chrome/browser/sync/profile_sync_service.h" |
(...skipping 19 matching lines...) Expand all Loading... |
53 #include "components/google/core/browser/google_url_tracker.h" | 54 #include "components/google/core/browser/google_url_tracker.h" |
54 #include "components/invalidation/invalidation_service.h" | 55 #include "components/invalidation/invalidation_service.h" |
55 #include "components/invalidation/invalidation_switches.h" | 56 #include "components/invalidation/invalidation_switches.h" |
56 #include "components/invalidation/p2p_invalidation_service.h" | 57 #include "components/invalidation/p2p_invalidation_service.h" |
57 #include "components/invalidation/p2p_invalidator.h" | 58 #include "components/invalidation/p2p_invalidator.h" |
58 #include "components/invalidation/profile_invalidation_provider.h" | 59 #include "components/invalidation/profile_invalidation_provider.h" |
59 #include "components/keyed_service/core/keyed_service.h" | 60 #include "components/keyed_service/core/keyed_service.h" |
60 #include "components/os_crypt/os_crypt.h" | 61 #include "components/os_crypt/os_crypt.h" |
61 #include "components/search_engines/template_url_service.h" | 62 #include "components/search_engines/template_url_service.h" |
62 #include "components/signin/core/browser/signin_manager.h" | 63 #include "components/signin/core/browser/signin_manager.h" |
| 64 #include "content/public/browser/notification_service.h" |
63 #include "content/public/browser/web_contents.h" | 65 #include "content/public/browser/web_contents.h" |
64 #include "content/public/test/test_browser_thread.h" | 66 #include "content/public/test/test_browser_thread.h" |
65 #include "google_apis/gaia/gaia_urls.h" | 67 #include "google_apis/gaia/gaia_urls.h" |
66 #include "net/base/escape.h" | 68 #include "net/base/escape.h" |
67 #include "net/base/load_flags.h" | 69 #include "net/base/load_flags.h" |
68 #include "net/base/network_change_notifier.h" | 70 #include "net/base/network_change_notifier.h" |
69 #include "net/cookies/cookie_monster.h" | 71 #include "net/cookies/cookie_monster.h" |
70 #include "net/test/spawned_test_server/spawned_test_server.h" | 72 #include "net/test/spawned_test_server/spawned_test_server.h" |
71 #include "net/url_request/test_url_fetcher_factory.h" | 73 #include "net/url_request/test_url_fetcher_factory.h" |
72 #include "net/url_request/url_fetcher.h" | 74 #include "net/url_request/url_fetcher.h" |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 BrowserThread::IO, FROM_HERE, | 1013 BrowserThread::IO, FROM_HERE, |
1012 base::Bind(&SetupNetworkCallback, &done, | 1014 base::Bind(&SetupNetworkCallback, &done, |
1013 make_scoped_refptr(context_getter))); | 1015 make_scoped_refptr(context_getter))); |
1014 done.Wait(); | 1016 done.Wait(); |
1015 } | 1017 } |
1016 | 1018 |
1017 fake_server::FakeServer* SyncTest::GetFakeServer() const { | 1019 fake_server::FakeServer* SyncTest::GetFakeServer() const { |
1018 return fake_server_.get(); | 1020 return fake_server_.get(); |
1019 } | 1021 } |
1020 | 1022 |
| 1023 void SyncTest::TriggerSyncForModelTypes(int index, |
| 1024 syncer::ModelTypeSet model_types) { |
| 1025 content::NotificationService::current()->Notify( |
| 1026 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, |
| 1027 content::Source<Profile>(GetProfile(index)), |
| 1028 content::Details<const syncer::ModelTypeSet>(&model_types)); |
| 1029 } |
| 1030 |
1021 void SyncTest::SetPreexistingPreferencesFileContents( | 1031 void SyncTest::SetPreexistingPreferencesFileContents( |
1022 const std::string& contents) { | 1032 const std::string& contents) { |
1023 preexisting_preferences_file_contents_ = contents; | 1033 preexisting_preferences_file_contents_ = contents; |
1024 } | 1034 } |
OLD | NEW |