| 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/stringprintf.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 15 #include "base/task.h" | 16 #include "base/task.h" |
| 16 #include "base/test/test_timeouts.h" | 17 #include "base/test/test_timeouts.h" |
| 17 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
| 18 #include "base/values.h" | 19 #include "base/values.h" |
| 19 #include "chrome/browser/password_manager/encryptor.h" | 20 #include "chrome/browser/password_manager/encryptor.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
| 22 #include "chrome/browser/sync/profile_sync_service_harness.h" | 23 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 LOG(FATAL) << "num_clients_ incorrectly initialized."; | 259 LOG(FATAL) << "num_clients_ incorrectly initialized."; |
| 259 if (!profiles_.empty() || !clients_.empty()) | 260 if (!profiles_.empty() || !clients_.empty()) |
| 260 LOG(FATAL) << "SetupClients() has already been called."; | 261 LOG(FATAL) << "SetupClients() has already been called."; |
| 261 | 262 |
| 262 // Start up a sync test server if one is needed. | 263 // Start up a sync test server if one is needed. |
| 263 SetUpTestServerIfRequired(); | 264 SetUpTestServerIfRequired(); |
| 264 | 265 |
| 265 // Create the required number of sync profiles and clients. | 266 // Create the required number of sync profiles and clients. |
| 266 for (int i = 0; i < num_clients_; ++i) { | 267 for (int i = 0; i < num_clients_; ++i) { |
| 267 profiles_.push_back(MakeProfile( | 268 profiles_.push_back(MakeProfile( |
| 268 StringPrintf(FILE_PATH_LITERAL("Profile%d"), i))); | 269 base::StringPrintf(FILE_PATH_LITERAL("Profile%d"), i))); |
| 269 EXPECT_FALSE(GetProfile(i) == NULL) << "GetProfile(" << i << ") failed."; | 270 EXPECT_FALSE(GetProfile(i) == NULL) << "GetProfile(" << i << ") failed."; |
| 270 clients_.push_back( | 271 clients_.push_back( |
| 271 new ProfileSyncServiceHarness(GetProfile(i), username_, password_, i)); | 272 new ProfileSyncServiceHarness(GetProfile(i), username_, password_, i)); |
| 272 EXPECT_FALSE(GetClient(i) == NULL) << "GetClient(" << i << ") failed."; | 273 EXPECT_FALSE(GetClient(i) == NULL) << "GetClient(" << i << ") failed."; |
| 273 } | 274 } |
| 274 | 275 |
| 275 // Create the verifier profile. | 276 // Create the verifier profile. |
| 276 verifier_.reset(MakeProfile(FILE_PATH_LITERAL("Verifier"))); | 277 verifier_.reset(MakeProfile(FILE_PATH_LITERAL("Verifier"))); |
| 277 return (verifier_.get() != NULL); | 278 return (verifier_.get() != NULL); |
| 278 } | 279 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 const net::ProxyConfig& proxy_config) { | 520 const net::ProxyConfig& proxy_config) { |
| 520 base::WaitableEvent done(false, false); | 521 base::WaitableEvent done(false, false); |
| 521 BrowserThread::PostTask( | 522 BrowserThread::PostTask( |
| 522 BrowserThread::IO, | 523 BrowserThread::IO, |
| 523 FROM_HERE, | 524 FROM_HERE, |
| 524 new SetProxyConfigTask(&done, | 525 new SetProxyConfigTask(&done, |
| 525 context_getter, | 526 context_getter, |
| 526 proxy_config)); | 527 proxy_config)); |
| 527 done.Wait(); | 528 done.Wait(); |
| 528 } | 529 } |
| OLD | NEW |