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

Side by Side Diff: content/browser/loader/async_resource_handler_unittest.cc

Issue 1970693002: Use mojo for Chrome Loading, Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 | « content/browser/loader/DEPS ('k') | content/browser/loader/mojo_async_resource_handler.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/loader/async_resource_handler.h" 5 #include "content/browser/loader/async_resource_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 }; 137 };
138 138
139 class AsyncResourceHandlerTest : public ::testing::Test, 139 class AsyncResourceHandlerTest : public ::testing::Test,
140 public ResourceLoaderDelegate { 140 public ResourceLoaderDelegate {
141 protected: 141 protected:
142 AsyncResourceHandlerTest() 142 AsyncResourceHandlerTest()
143 : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), context_(true) {} 143 : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), context_(true) {}
144 144
145 void TearDown() override { 145 void TearDown() override {
146 // Prevent memory leaks. 146 // Prevent memory leaks.
147 filter_ = nullptr;
147 rdh_.Shutdown(); 148 rdh_.Shutdown();
148 base::RunLoop().RunUntilIdle(); 149 base::RunLoop().RunUntilIdle();
149 } 150 }
150 151
151 void CreateRequestWithResponseDataSize(size_t response_data_size) { 152 void CreateRequestWithResponseDataSize(size_t response_data_size) {
152 test_job_factory_.SetProtocolHandler( 153 test_job_factory_.SetProtocolHandler(
153 "test", base::MakeUnique<TestProtocolHandler>(response_data_size)); 154 "test", base::MakeUnique<TestProtocolHandler>(response_data_size));
154 context_.set_job_factory(&test_job_factory_); 155 context_.set_job_factory(&test_job_factory_);
155 context_.Init(); 156 context_.Init();
156 std::unique_ptr<net::URLRequest> request = context_.CreateRequest( 157 std::unique_ptr<net::URLRequest> request = context_.CreateRequest(
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 302
302 encoded_data_length = std::get<3>(params); 303 encoded_data_length = std::get<3>(params);
303 EXPECT_EQ(32768, encoded_data_length); 304 EXPECT_EQ(32768, encoded_data_length);
304 encoded_body_length = std::get<4>(params); 305 encoded_body_length = std::get<4>(params);
305 EXPECT_EQ(32768, encoded_body_length); 306 EXPECT_EQ(32768, encoded_body_length);
306 } 307 }
307 308
308 } // namespace 309 } // namespace
309 310
310 } // namespace content 311 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/DEPS ('k') | content/browser/loader/mojo_async_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698