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

Side by Side Diff: sync/internal_api/attachments/attachment_downloader_impl_unittest.cc

Issue 355093002: Consolidate attachment URL construction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move static method declaration and definition. Created 6 years, 6 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 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 "sync/api/attachments/attachment_downloader.h" 5 #include "sync/api/attachments/attachment_downloader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 new net::TestURLRequestContextGetter(message_loop_.message_loop_proxy()); 180 new net::TestURLRequestContextGetter(message_loop_.message_loop_proxy());
181 url_fetcher_factory_.set_remove_fetcher_on_delete(true); 181 url_fetcher_factory_.set_remove_fetcher_on_delete(true);
182 token_service_.reset(new MockOAuth2TokenService()); 182 token_service_.reset(new MockOAuth2TokenService());
183 token_service_->AddAccount(kAccountId); 183 token_service_->AddAccount(kAccountId);
184 scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider> 184 scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider>
185 token_service_provider(new TokenServiceProvider(token_service_.get())); 185 token_service_provider(new TokenServiceProvider(token_service_.get()));
186 186
187 OAuth2TokenService::ScopeSet scopes; 187 OAuth2TokenService::ScopeSet scopes;
188 scopes.insert(GaiaConstants::kChromeSyncOAuth2Scope); 188 scopes.insert(GaiaConstants::kChromeSyncOAuth2Scope);
189 attachment_downloader_ = 189 attachment_downloader_ =
190 AttachmentDownloader::Create(kAttachmentServerUrl, 190 AttachmentDownloader::Create(GURL(kAttachmentServerUrl),
191 url_request_context_getter_, 191 url_request_context_getter_,
192 kAccountId, 192 kAccountId,
193 scopes, 193 scopes,
194 token_service_provider.Pass()); 194 token_service_provider.Pass());
195 } 195 }
196 196
197 void AttachmentDownloaderImplTest::TearDown() { 197 void AttachmentDownloaderImplTest::TearDown() {
198 RunMessageLoop(); 198 RunMessageLoop();
199 } 199 }
200 200
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 GoogleServiceAuthError::AuthErrorNone()); 347 GoogleServiceAuthError::AuthErrorNone());
348 RunMessageLoop(); 348 RunMessageLoop();
349 // Fail URLFetcher. This should trigger download failure. Access token 349 // Fail URLFetcher. This should trigger download failure. Access token
350 // shouldn't be invalidated. 350 // shouldn't be invalidated.
351 CompleteDownload(net::HTTP_SERVICE_UNAVAILABLE); 351 CompleteDownload(net::HTTP_SERVICE_UNAVAILABLE);
352 EXPECT_EQ(0, token_service()->num_invalidate_token()); 352 EXPECT_EQ(0, token_service()->num_invalidate_token());
353 VerifyDownloadResult(id1, AttachmentDownloader::DOWNLOAD_UNSPECIFIED_ERROR); 353 VerifyDownloadResult(id1, AttachmentDownloader::DOWNLOAD_UNSPECIFIED_ERROR);
354 } 354 }
355 355
356 } // namespace syncer 356 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/attachments/attachment_downloader_impl.cc ('k') | sync/internal_api/attachments/attachment_uploader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698