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

Side by Side Diff: content/browser/blob_storage/blob_url_unittest.cc

Issue 2954853002: Use Independent URLLoader
Patch Set: . Created 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 if (GetParam()) { 274 if (GetParam()) {
275 GetHandleFromBuilder(); // To add to StorageContext. 275 GetHandleFromBuilder(); // To add to StorageContext.
276 const_cast<storage::BlobStorageRegistry&>(blob_context_.registry()) 276 const_cast<storage::BlobStorageRegistry&>(blob_context_.registry())
277 .CreateUrlMapping(url, blob_data_->uuid()); 277 .CreateUrlMapping(url, blob_data_->uuid());
278 ResourceRequest request; 278 ResourceRequest request;
279 request.url = url; 279 request.url = url;
280 request.method = method; 280 request.method = method;
281 if (!extra_headers.IsEmpty()) 281 if (!extra_headers.IsEmpty())
282 request.headers = extra_headers.ToString(); 282 request.headers = extra_headers.ToString();
283 283
284 mojom::URLLoaderAssociatedPtr url_loader; 284 mojom::URLLoaderPtr url_loader;
285 TestURLLoaderClient url_loader_client; 285 TestURLLoaderClient url_loader_client;
286 scoped_refptr<BlobURLLoaderFactory> factory = new BlobURLLoaderFactory( 286 scoped_refptr<BlobURLLoaderFactory> factory = new BlobURLLoaderFactory(
287 base::Bind(&BlobURLRequestJobTest::GetStorageContext, 287 base::Bind(&BlobURLRequestJobTest::GetStorageContext,
288 base::Unretained(this)), 288 base::Unretained(this)),
289 file_system_context_); 289 file_system_context_);
290 base::RunLoop().RunUntilIdle(); 290 base::RunLoop().RunUntilIdle();
291 factory->CreateLoaderAndStart(mojo::MakeRequest(&url_loader), 0, 0, 291 factory->CreateLoaderAndStart(mojo::MakeRequest(&url_loader), 0, 0,
292 mojom::kURLLoadOptionNone, request, 292 mojom::kURLLoadOptionNone, request,
293 url_loader_client.CreateInterfacePtr(), 293 url_loader_client.CreateInterfacePtr(),
294 net::MutableNetworkTrafficAnnotationTag( 294 net::MutableNetworkTrafficAnnotationTag(
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 "uuid", "", "", storage::BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS); 658 "uuid", "", "", storage::BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS);
659 TestErrorRequest(500); 659 TestErrorRequest(500);
660 } 660 }
661 661
662 // The parameter's value determines whether BlobURLLoaderFactory is used. 662 // The parameter's value determines whether BlobURLLoaderFactory is used.
663 INSTANTIATE_TEST_CASE_P(BlobURLRequestJobTest, 663 INSTANTIATE_TEST_CASE_P(BlobURLRequestJobTest,
664 BlobURLRequestJobTest, 664 BlobURLRequestJobTest,
665 ::testing::Bool()); 665 ::testing::Bool());
666 666
667 } // namespace content 667 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/blob_storage/blob_url_loader_factory.cc ('k') | content/browser/loader/mojo_async_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698