Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 296743005: sync: Implement fake server reflection blocking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split enable and disable methods Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/fake_server_invalidation_service.cc ('k') | sync/test/fake_server/fake_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698