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

Side by Side Diff: chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address final comments Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/location.h" 5 #include "base/location.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "chrome/browser/signin/account_tracker_service_factory.h" 9 #include "chrome/browser/signin/account_tracker_service_factory.h"
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" 10 #include "chrome/browser/signin/chrome_signin_client_factory.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 &BuildAutoIssuingFakeProfileOAuth2TokenService); 61 &BuildAutoIssuingFakeProfileOAuth2TokenService);
62 builder.AddTestingFactory(AccountTrackerServiceFactory::GetInstance(), 62 builder.AddTestingFactory(AccountTrackerServiceFactory::GetInstance(),
63 FakeAccountTrackerService::Build); 63 FakeAccountTrackerService::Build);
64 builder.AddTestingFactory(ChromeSigninClientFactory::GetInstance(), 64 builder.AddTestingFactory(ChromeSigninClientFactory::GetInstance(),
65 signin::BuildTestSigninClient); 65 signin::BuildTestSigninClient);
66 profile_ = builder.Build(); 66 profile_ = builder.Build();
67 67
68 FakeProfileOAuth2TokenService* token_service = 68 FakeProfileOAuth2TokenService* token_service =
69 (FakeProfileOAuth2TokenService*) 69 (FakeProfileOAuth2TokenService*)
70 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get()); 70 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get());
71 token_service->IssueRefreshTokenForUser("", "fake_refresh_token"); 71 token_service->UpdateCredentials("", "fake_refresh_token");
72 gcm_driver_.reset(new CustomFakeGCMDriver()); 72 gcm_driver_.reset(new CustomFakeGCMDriver());
73 73
74 identity_provider_.reset(new FakeIdentityProvider(token_service)); 74 identity_provider_.reset(new FakeIdentityProvider(token_service));
75 bridge_.reset(new GCMInvalidationBridge(gcm_driver_.get(), 75 bridge_.reset(new GCMInvalidationBridge(gcm_driver_.get(),
76 identity_provider_.get())); 76 identity_provider_.get()));
77 77
78 delegate_ = bridge_->CreateDelegate(); 78 delegate_ = bridge_->CreateDelegate();
79 delegate_->Initialize( 79 delegate_->Initialize(
80 base::Bind(&GCMInvalidationBridgeTest::ConnectionStateChanged, 80 base::Bind(&GCMInvalidationBridgeTest::ConnectionStateChanged,
81 base::Unretained(this))); 81 base::Unretained(this)));
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 bridge_->OnConnected(net::IPEndPoint()); 164 bridge_->OnConnected(net::IPEndPoint());
165 RunLoop(); 165 RunLoop();
166 EXPECT_TRUE(connection_online_); 166 EXPECT_TRUE(connection_online_);
167 bridge_->OnDisconnected(); 167 bridge_->OnDisconnected();
168 RunLoop(); 168 RunLoop();
169 EXPECT_FALSE(connection_online_); 169 EXPECT_FALSE(connection_online_);
170 } 170 }
171 171
172 } // namespace 172 } // namespace
173 } // namespace invalidation 173 } // namespace invalidation
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_apitest.cc ('k') | chrome/browser/local_discovery/gcd_api_flow_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698