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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 11778016: net: Stop using base::WorkerPool from UploadFileElementReader (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix CF Created 7 years, 11 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
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 5 #include <map>
6 #include <queue> 6 #include <queue>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 net::URLRequest request(request_url, &delegate_, context_.get()); 488 net::URLRequest request(request_url, &delegate_, context_.get());
489 request.set_method(method); 489 request.set_method(method);
490 if (content_type != NULL) 490 if (content_type != NULL)
491 request.SetExtraRequestHeaderByName(net::HttpRequestHeaders::kContentType, 491 request.SetExtraRequestHeaderByName(net::HttpRequestHeaders::kContentType,
492 content_type, 492 content_type,
493 true /* overwrite */); 493 true /* overwrite */);
494 ScopedVector<net::UploadElementReader> element_readers; 494 ScopedVector<net::UploadElementReader> element_readers;
495 element_readers.push_back(new net::UploadBytesElementReader( 495 element_readers.push_back(new net::UploadBytesElementReader(
496 &(bytes_1[0]), bytes_1.size())); 496 &(bytes_1[0]), bytes_1.size()));
497 element_readers.push_back(new net::UploadFileElementReader( 497 element_readers.push_back(new net::UploadFileElementReader(
498 ::FilePath(), 0, 0, base::Time())); 498 base::MessageLoopProxy::current(), ::FilePath(), 0, 0, base::Time()));
499 element_readers.push_back(new net::UploadBytesElementReader( 499 element_readers.push_back(new net::UploadBytesElementReader(
500 &(bytes_2[0]), bytes_2.size())); 500 &(bytes_2[0]), bytes_2.size()));
501 request.set_upload(make_scoped_ptr( 501 request.set_upload(make_scoped_ptr(
502 new net::UploadDataStream(&element_readers, 0))); 502 new net::UploadDataStream(&element_readers, 0)));
503 ipc_sender_.PushTask(base::Bind(&base::DoNothing)); 503 ipc_sender_.PushTask(base::Bind(&base::DoNothing));
504 request.Start(); 504 request.Start();
505 } 505 }
506 506
507 TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { 507 TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) {
508 // We verify that URLRequest body is accessible to OnBeforeRequest listeners. 508 // We verify that URLRequest body is accessible to OnBeforeRequest listeners.
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 EXPECT_TRUE(credentials_set); 2146 EXPECT_TRUE(credentials_set);
2147 EXPECT_FALSE(auth3.Empty()); 2147 EXPECT_FALSE(auth3.Empty());
2148 EXPECT_EQ(username, auth1.username()); 2148 EXPECT_EQ(username, auth1.username());
2149 EXPECT_EQ(password, auth1.password()); 2149 EXPECT_EQ(password, auth1.password());
2150 EXPECT_EQ(1u, warning_set.size()); 2150 EXPECT_EQ(1u, warning_set.size());
2151 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2151 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2152 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2152 EXPECT_EQ(3u, capturing_net_log.GetSize());
2153 } 2153 }
2154 2154
2155 } // namespace extensions 2155 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698