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

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

Issue 148133007: [Downloads] Always call DM::StartDownload() for explicit downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typos Created 4 years, 10 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 | Annotate | Revision Log
OLDNEW
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/mime_type_resource_handler.h" 5 #include "content/browser/loader/mime_type_resource_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 explicit TestResourceDispatcherHost(bool stream_has_handler) 84 explicit TestResourceDispatcherHost(bool stream_has_handler)
85 : stream_has_handler_(stream_has_handler), 85 : stream_has_handler_(stream_has_handler),
86 intercepted_as_stream_(false), 86 intercepted_as_stream_(false),
87 intercepted_as_stream_count_(0) {} 87 intercepted_as_stream_count_(0) {}
88 88
89 bool intercepted_as_stream() const { return intercepted_as_stream_; } 89 bool intercepted_as_stream() const { return intercepted_as_stream_; }
90 90
91 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( 91 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload(
92 net::URLRequest* request, 92 net::URLRequest* request,
93 bool is_content_initiated, 93 bool is_content_initiated,
94 bool must_download, 94 bool must_download) override {
95 uint32_t id,
96 scoped_ptr<DownloadSaveInfo> save_info,
97 const DownloadUrlParameters::OnStartedCallback& started_cb) override {
98 return scoped_ptr<ResourceHandler>(new TestResourceHandler); 95 return scoped_ptr<ResourceHandler>(new TestResourceHandler);
99 } 96 }
100 97
101 scoped_ptr<ResourceHandler> MaybeInterceptAsStream( 98 scoped_ptr<ResourceHandler> MaybeInterceptAsStream(
102 const base::FilePath& plugin_path, 99 const base::FilePath& plugin_path,
103 net::URLRequest* request, 100 net::URLRequest* request,
104 ResourceResponse* response, 101 ResourceResponse* response,
105 std::string* payload) override { 102 std::string* payload) override {
106 intercepted_as_stream_count_++; 103 intercepted_as_stream_count_++;
107 if (stream_has_handler_) { 104 if (stream_has_handler_) {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 must_download = false; 365 must_download = false;
369 resource_type = RESOURCE_TYPE_OBJECT; 366 resource_type = RESOURCE_TYPE_OBJECT;
370 EXPECT_TRUE( 367 EXPECT_TRUE(
371 TestStreamIsIntercepted(allow_download, must_download, resource_type)); 368 TestStreamIsIntercepted(allow_download, must_download, resource_type));
372 } 369 }
373 #endif 370 #endif
374 371
375 } // namespace 372 } // namespace
376 373
377 } // namespace content 374 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/mime_type_resource_handler.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698