| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/live_sync/live_sync_test.h" | 5 #include "chrome/test/live_sync/live_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/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/task.h" | 14 #include "base/task.h" |
| 15 #include "base/test/test_timeouts.h" | 15 #include "base/test/test_timeouts.h" |
| 16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "base/synchronization/waitable_event.h" | 18 #include "base/synchronization/waitable_event.h" |
| 19 #include "chrome/browser/browser_thread.h" | 19 #include "chrome/browser/browser_thread.h" |
| 20 #include "chrome/browser/password_manager/encryptor.h" | 20 #include "chrome/browser/password_manager/encryptor.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
| 23 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 23 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/net/url_fetcher.h" | 26 #include "chrome/common/net/url_fetcher.h" |
| 26 #include "chrome/common/net/url_request_context_getter.h" | 27 #include "chrome/common/net/url_request_context_getter.h" |
| 28 #include "chrome/common/net/test_url_fetcher_factory.h" |
| 27 #include "chrome/test/testing_browser_process.h" | 29 #include "chrome/test/testing_browser_process.h" |
| 28 #include "chrome/test/ui_test_utils.h" | 30 #include "chrome/test/ui_test_utils.h" |
| 29 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
| 30 #include "net/base/escape.h" | 32 #include "net/base/escape.h" |
| 31 #include "net/base/network_change_notifier.h" | 33 #include "net/base/network_change_notifier.h" |
| 32 #include "net/test/test_server.h" | 34 #include "net/test/test_server.h" |
| 33 #include "net/proxy/proxy_config.h" | 35 #include "net/proxy/proxy_config.h" |
| 34 #include "net/proxy/proxy_config_service_fixed.h" | 36 #include "net/proxy/proxy_config_service_fixed.h" |
| 35 #include "net/proxy/proxy_service.h" | 37 #include "net/proxy/proxy_service.h" |
| 36 #include "net/url_request/url_request_context.h" | 38 #include "net/url_request/url_request_context.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 num_clients_ = 3; | 121 num_clients_ = 3; |
| 120 break; | 122 break; |
| 121 } | 123 } |
| 122 case MANY_CLIENT: { | 124 case MANY_CLIENT: { |
| 123 num_clients_ = 10; | 125 num_clients_ = 10; |
| 124 break; | 126 break; |
| 125 } | 127 } |
| 126 } | 128 } |
| 127 } | 129 } |
| 128 | 130 |
| 131 LiveSyncTest::~LiveSyncTest() {} |
| 132 |
| 129 void LiveSyncTest::SetUp() { | 133 void LiveSyncTest::SetUp() { |
| 130 CommandLine* cl = CommandLine::ForCurrentProcess(); | 134 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 131 if (cl->HasSwitch(switches::kPasswordFileForTest)) { | 135 if (cl->HasSwitch(switches::kPasswordFileForTest)) { |
| 132 ReadPasswordFile(); | 136 ReadPasswordFile(); |
| 133 } else if (cl->HasSwitch(switches::kSyncUserForTest) && | 137 } else if (cl->HasSwitch(switches::kSyncUserForTest) && |
| 134 cl->HasSwitch(switches::kSyncPasswordForTest)) { | 138 cl->HasSwitch(switches::kSyncPasswordForTest)) { |
| 135 username_ = cl->GetSwitchValueASCII(switches::kSyncUserForTest); | 139 username_ = cl->GetSwitchValueASCII(switches::kSyncUserForTest); |
| 136 password_ = cl->GetSwitchValueASCII(switches::kSyncPasswordForTest); | 140 password_ = cl->GetSwitchValueASCII(switches::kSyncPasswordForTest); |
| 137 } else { | 141 } else { |
| 138 SetupMockGaiaResponses(); | 142 SetupMockGaiaResponses(); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 const net::ProxyConfig& proxy_config) { | 463 const net::ProxyConfig& proxy_config) { |
| 460 base::WaitableEvent done(false, false); | 464 base::WaitableEvent done(false, false); |
| 461 BrowserThread::PostTask( | 465 BrowserThread::PostTask( |
| 462 BrowserThread::IO, | 466 BrowserThread::IO, |
| 463 FROM_HERE, | 467 FROM_HERE, |
| 464 new SetProxyConfigTask(&done, | 468 new SetProxyConfigTask(&done, |
| 465 context_getter, | 469 context_getter, |
| 466 proxy_config)); | 470 proxy_config)); |
| 467 done.Wait(); | 471 done.Wait(); |
| 468 } | 472 } |
| OLD | NEW |