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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 void SyncTest::InitializeInvalidations(int index) { | 399 void SyncTest::InitializeInvalidations(int index) { |
400 if (server_type_ == IN_PROCESS_FAKE_SERVER) { | 400 if (server_type_ == IN_PROCESS_FAKE_SERVER) { |
401 CHECK(fake_server_.get()); | 401 CHECK(fake_server_.get()); |
402 fake_server::FakeServerInvalidationService* invalidation_service = | 402 fake_server::FakeServerInvalidationService* invalidation_service = |
403 static_cast<fake_server::FakeServerInvalidationService*>( | 403 static_cast<fake_server::FakeServerInvalidationService*>( |
404 InvalidationServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 404 InvalidationServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
405 GetProfile(index), | 405 GetProfile(index), |
406 fake_server::FakeServerInvalidationService::Build)); | 406 fake_server::FakeServerInvalidationService::Build)); |
407 fake_server_->AddObserver(invalidation_service); | 407 fake_server_->AddObserver(invalidation_service); |
| 408 if (TestUsesSelfNotifications()) { |
| 409 invalidation_service->EnableSelfNotifications(); |
| 410 } else { |
| 411 invalidation_service->DisableSelfNotifications(); |
| 412 } |
408 fake_server_invalidation_services_[index] = invalidation_service; | 413 fake_server_invalidation_services_[index] = invalidation_service; |
409 } else { | 414 } else { |
410 invalidation::P2PInvalidationService* p2p_invalidation_service = | 415 invalidation::P2PInvalidationService* p2p_invalidation_service = |
411 static_cast<invalidation::P2PInvalidationService*>( | 416 static_cast<invalidation::P2PInvalidationService*>( |
412 InvalidationServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 417 InvalidationServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
413 GetProfile(index), | 418 GetProfile(index), |
414 TestUsesSelfNotifications() ? | 419 TestUsesSelfNotifications() ? |
415 BuildSelfNotifyingP2PInvalidationService | 420 BuildSelfNotifyingP2PInvalidationService |
416 : BuildRealisticP2PInvalidationService)); | 421 : BuildRealisticP2PInvalidationService)); |
417 p2p_invalidation_service->UpdateCredentials(username_, password_); | 422 p2p_invalidation_service->UpdateCredentials(username_, password_); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 BrowserThread::PostTask( | 1049 BrowserThread::PostTask( |
1045 BrowserThread::IO, FROM_HERE, | 1050 BrowserThread::IO, FROM_HERE, |
1046 base::Bind(&SetProxyConfigCallback, &done, | 1051 base::Bind(&SetProxyConfigCallback, &done, |
1047 make_scoped_refptr(context_getter), proxy_config)); | 1052 make_scoped_refptr(context_getter), proxy_config)); |
1048 done.Wait(); | 1053 done.Wait(); |
1049 } | 1054 } |
1050 | 1055 |
1051 fake_server::FakeServer* SyncTest::GetFakeServer() const { | 1056 fake_server::FakeServer* SyncTest::GetFakeServer() const { |
1052 return fake_server_.get(); | 1057 return fake_server_.get(); |
1053 } | 1058 } |
OLD | NEW |