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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 fake_server_invalidation_services_.resize(num_clients_); | 390 fake_server_invalidation_services_.resize(num_clients_); |
391 for (int i = 0; i < num_clients_; ++i) { | 391 for (int i = 0; i < num_clients_; ++i) { |
392 InitializeInstance(i); | 392 InitializeInstance(i); |
393 } | 393 } |
394 | 394 |
395 // Create the verifier profile. | 395 // Create the verifier profile. |
396 verifier_ = MakeProfile(FILE_PATH_LITERAL("Verifier")); | 396 verifier_ = MakeProfile(FILE_PATH_LITERAL("Verifier")); |
397 bookmarks::test::WaitForBookmarkModelToLoad( | 397 bookmarks::test::WaitForBookmarkModelToLoad( |
398 BookmarkModelFactory::GetForProfile(verifier())); | 398 BookmarkModelFactory::GetForProfile(verifier())); |
399 ui_test_utils::WaitForHistoryToLoad(HistoryServiceFactory::GetForProfile( | 399 ui_test_utils::WaitForHistoryToLoad(HistoryServiceFactory::GetForProfile( |
400 verifier(), Profile::EXPLICIT_ACCESS)); | 400 verifier(), ServiceAccessType::EXPLICIT_ACCESS)); |
401 ui_test_utils::WaitForTemplateURLServiceToLoad( | 401 ui_test_utils::WaitForTemplateURLServiceToLoad( |
402 TemplateURLServiceFactory::GetForProfile(verifier())); | 402 TemplateURLServiceFactory::GetForProfile(verifier())); |
403 return (verifier_ != NULL); | 403 return (verifier_ != NULL); |
404 } | 404 } |
405 | 405 |
406 void SyncTest::InitializeInstance(int index) { | 406 void SyncTest::InitializeInstance(int index) { |
407 base::FilePath::StringType profile_name = | 407 base::FilePath::StringType profile_name = |
408 base::StringPrintf(FILE_PATH_LITERAL("Profile%d"), index); | 408 base::StringPrintf(FILE_PATH_LITERAL("Profile%d"), index); |
409 // If running against an EXTERNAL_LIVE_SERVER, we need to signin profiles | 409 // If running against an EXTERNAL_LIVE_SERVER, we need to signin profiles |
410 // using real GAIA server. This requires creating profiles with no test hooks. | 410 // using real GAIA server. This requires creating profiles with no test hooks. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 username_, | 450 username_, |
451 password_, | 451 password_, |
452 singin_type); | 452 singin_type); |
453 EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " | 453 EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " |
454 << index << "."; | 454 << index << "."; |
455 InitializeInvalidations(index); | 455 InitializeInvalidations(index); |
456 | 456 |
457 bookmarks::test::WaitForBookmarkModelToLoad( | 457 bookmarks::test::WaitForBookmarkModelToLoad( |
458 BookmarkModelFactory::GetForProfile(GetProfile(index))); | 458 BookmarkModelFactory::GetForProfile(GetProfile(index))); |
459 ui_test_utils::WaitForHistoryToLoad(HistoryServiceFactory::GetForProfile( | 459 ui_test_utils::WaitForHistoryToLoad(HistoryServiceFactory::GetForProfile( |
460 GetProfile(index), Profile::EXPLICIT_ACCESS)); | 460 GetProfile(index), ServiceAccessType::EXPLICIT_ACCESS)); |
461 ui_test_utils::WaitForTemplateURLServiceToLoad( | 461 ui_test_utils::WaitForTemplateURLServiceToLoad( |
462 TemplateURLServiceFactory::GetForProfile(GetProfile(index))); | 462 TemplateURLServiceFactory::GetForProfile(GetProfile(index))); |
463 } | 463 } |
464 | 464 |
465 void SyncTest::InitializeInvalidations(int index) { | 465 void SyncTest::InitializeInvalidations(int index) { |
466 if (server_type_ == IN_PROCESS_FAKE_SERVER) { | 466 if (server_type_ == IN_PROCESS_FAKE_SERVER) { |
467 CHECK(fake_server_.get()); | 467 CHECK(fake_server_.get()); |
468 fake_server::FakeServerInvalidationService* invalidation_service = | 468 fake_server::FakeServerInvalidationService* invalidation_service = |
469 static_cast<fake_server::FakeServerInvalidationService*>( | 469 static_cast<fake_server::FakeServerInvalidationService*>( |
470 static_cast<invalidation::ProfileInvalidationProvider*>( | 470 static_cast<invalidation::ProfileInvalidationProvider*>( |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 BrowserThread::PostTask( | 984 BrowserThread::PostTask( |
985 BrowserThread::IO, FROM_HERE, | 985 BrowserThread::IO, FROM_HERE, |
986 base::Bind(&SetupNetworkCallback, &done, | 986 base::Bind(&SetupNetworkCallback, &done, |
987 make_scoped_refptr(context_getter))); | 987 make_scoped_refptr(context_getter))); |
988 done.Wait(); | 988 done.Wait(); |
989 } | 989 } |
990 | 990 |
991 fake_server::FakeServer* SyncTest::GetFakeServer() const { | 991 fake_server::FakeServer* SyncTest::GetFakeServer() const { |
992 return fake_server_.get(); | 992 return fake_server_.get(); |
993 } | 993 } |
OLD | NEW |