| OLD | NEW |
| 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 "content/browser/loader/buffered_resource_handler.h" | 5 #include "content/browser/loader/buffered_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 TestBrowserThreadBundle thread_bundle_; | 170 TestBrowserThreadBundle thread_bundle_; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 bool BufferedResourceHandlerTest::TestStreamIsIntercepted( | 173 bool BufferedResourceHandlerTest::TestStreamIsIntercepted( |
| 174 bool allow_download, | 174 bool allow_download, |
| 175 bool must_download, | 175 bool must_download, |
| 176 ResourceType request_resource_type) { | 176 ResourceType request_resource_type) { |
| 177 net::URLRequestContext context; | 177 net::URLRequestContext context; |
| 178 scoped_ptr<net::URLRequest> request(context.CreateRequest( | 178 scoped_ptr<net::URLRequest> request(context.CreateRequest( |
| 179 GURL("http://www.google.com"), net::DEFAULT_PRIORITY, nullptr, nullptr)); | 179 GURL("http://www.google.com"), net::DEFAULT_PRIORITY, nullptr)); |
| 180 bool is_main_frame = request_resource_type == RESOURCE_TYPE_MAIN_FRAME; | 180 bool is_main_frame = request_resource_type == RESOURCE_TYPE_MAIN_FRAME; |
| 181 ResourceRequestInfo::AllocateForTesting( | 181 ResourceRequestInfo::AllocateForTesting( |
| 182 request.get(), | 182 request.get(), |
| 183 request_resource_type, | 183 request_resource_type, |
| 184 nullptr, // context | 184 nullptr, // context |
| 185 0, // render_process_id | 185 0, // render_process_id |
| 186 0, // render_view_id | 186 0, // render_view_id |
| 187 0, // render_frame_id | 187 0, // render_frame_id |
| 188 is_main_frame, // is_main_frame | 188 is_main_frame, // is_main_frame |
| 189 false, // parent_is_main_frame | 189 false, // parent_is_main_frame |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 allow_download = true; | 277 allow_download = true; |
| 278 must_download = false; | 278 must_download = false; |
| 279 resource_type = RESOURCE_TYPE_MAIN_FRAME; | 279 resource_type = RESOURCE_TYPE_MAIN_FRAME; |
| 280 EXPECT_FALSE( | 280 EXPECT_FALSE( |
| 281 TestStreamIsIntercepted(allow_download, must_download, resource_type)); | 281 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace | 284 } // namespace |
| 285 | 285 |
| 286 } // namespace content | 286 } // namespace content |
| OLD | NEW |