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

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

Issue 2893233002: Network traffic annotation added to URLLoaderImpl. (Closed)
Patch Set: Comment addressed, Merged. Created 3 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
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 mojom::URLLoaderAssociatedPtr url_loader; 287 mojom::URLLoaderAssociatedPtr url_loader;
288 TestURLLoaderClient url_loader_client; 288 TestURLLoaderClient url_loader_client;
289 scoped_refptr<BlobURLLoaderFactory> factory = new BlobURLLoaderFactory( 289 scoped_refptr<BlobURLLoaderFactory> factory = new BlobURLLoaderFactory(
290 base::Bind(&BlobURLRequestJobTest::GetStorageContext, 290 base::Bind(&BlobURLRequestJobTest::GetStorageContext,
291 base::Unretained(this)), 291 base::Unretained(this)),
292 file_system_context_); 292 file_system_context_);
293 base::RunLoop().RunUntilIdle(); 293 base::RunLoop().RunUntilIdle();
294 factory->CreateLoaderAndStart(mojo::MakeRequest(&url_loader), 0, 0, 294 factory->CreateLoaderAndStart(mojo::MakeRequest(&url_loader), 0, 0,
295 mojom::kURLLoadOptionNone, request, 295 mojom::kURLLoadOptionNone, request,
296 url_loader_client.CreateInterfacePtr()); 296 url_loader_client.CreateInterfacePtr(),
297 net::MutableNetworkTrafficAnnotationTag(
298 TRAFFIC_ANNOTATION_FOR_TESTS));
297 url_loader_client.RunUntilComplete(); 299 url_loader_client.RunUntilComplete();
298 300
299 if (url_loader_client.response_body().is_valid()) { 301 if (url_loader_client.response_body().is_valid()) {
300 EXPECT_TRUE(mojo::common::BlockingCopyToString( 302 EXPECT_TRUE(mojo::common::BlockingCopyToString(
301 url_loader_client.response_body_release(), &response_)); 303 url_loader_client.response_body_release(), &response_));
302 } 304 }
303 response_headers_ = url_loader_client.response_head().headers; 305 response_headers_ = url_loader_client.response_head().headers;
304 response_metadata_ = url_loader_client.cached_metadata(); 306 response_metadata_ = url_loader_client.cached_metadata();
305 response_error_code_ = url_loader_client.completion_status().error_code; 307 response_error_code_ = url_loader_client.completion_status().error_code;
306 } else { 308 } else {
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 EXPECT_TRUE(response_metadata_.empty()); 656 EXPECT_TRUE(response_metadata_.empty());
655 } 657 }
656 658
657 TEST_F(BlobURLRequestJobTest, BrokenBlob) { 659 TEST_F(BlobURLRequestJobTest, BrokenBlob) {
658 blob_handle_ = blob_context_.AddBrokenBlob( 660 blob_handle_ = blob_context_.AddBrokenBlob(
659 "uuid", "", "", storage::BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS); 661 "uuid", "", "", storage::BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS);
660 TestErrorRequest(500); 662 TestErrorRequest(500);
661 } 663 }
662 664
663 } // namespace content 665 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698