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

Side by Side Diff: content/browser/download/download_manager_impl_unittest.cc

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get ShellBrowserContext working Created 8 years 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 (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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 }; 379 };
380 380
381 class MockBrowserContext : public BrowserContext { 381 class MockBrowserContext : public BrowserContext {
382 public: 382 public:
383 MockBrowserContext() {} 383 MockBrowserContext() {}
384 ~MockBrowserContext() {} 384 ~MockBrowserContext() {}
385 385
386 MOCK_METHOD0(GetPath, FilePath()); 386 MOCK_METHOD0(GetPath, FilePath());
387 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); 387 MOCK_CONST_METHOD0(IsOffTheRecord, bool());
388 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); 388 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*());
389 virtual net::URLRequestContextGetter* CreateRequestContext(
390 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
391 blob_protocol_handler,
392 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
393 file_system_protocol_handler,
394 scoped_ptr<net::URLRequestJobFactory::Interceptor>
395 developer_protocol_handler) {
396 return NULL;
397 }
389 MOCK_METHOD1(GetRequestContextForRenderProcess, 398 MOCK_METHOD1(GetRequestContextForRenderProcess,
390 net::URLRequestContextGetter*(int renderer_child_id)); 399 net::URLRequestContextGetter*(int renderer_child_id));
391 MOCK_METHOD2(GetRequestContextForStoragePartition, 400 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
392 net::URLRequestContextGetter*( 401 const FilePath& partition_path,
393 const FilePath& partition_path, bool in_memory)); 402 bool in_memory,
403 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
404 blob_protocol_handler,
405 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
406 file_system_protocol_handler,
407 scoped_ptr<net::URLRequestJobFactory::Interceptor>
408 developer_protocol_handler) {
409 return NULL;
410 }
394 MOCK_METHOD0(GetMediaRequestContext, 411 MOCK_METHOD0(GetMediaRequestContext,
395 net::URLRequestContextGetter*()); 412 net::URLRequestContextGetter*());
396 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, 413 MOCK_METHOD1(GetMediaRequestContextForRenderProcess,
397 net::URLRequestContextGetter*(int renderer_child_id)); 414 net::URLRequestContextGetter*(int renderer_child_id));
398 MOCK_METHOD2(GetMediaRequestContextForStoragePartition, 415 MOCK_METHOD2(GetMediaRequestContextForStoragePartition,
399 net::URLRequestContextGetter*( 416 net::URLRequestContextGetter*(
400 const FilePath& partition_path, bool in_memory)); 417 const FilePath& partition_path, bool in_memory));
401 MOCK_METHOD0(GetResourceContext, ResourceContext*()); 418 MOCK_METHOD0(GetResourceContext, ResourceContext*());
402 MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*()); 419 MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*());
403 MOCK_METHOD0(GetGeolocationPermissionContext, 420 MOCK_METHOD0(GetGeolocationPermissionContext,
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 callback_called_ = false; 661 callback_called_ = false;
645 DetermineDownloadTarget(&item); 662 DetermineDownloadTarget(&item);
646 EXPECT_TRUE(callback_called_); 663 EXPECT_TRUE(callback_called_);
647 EXPECT_EQ(path, target_path_); 664 EXPECT_EQ(path, target_path_);
648 EXPECT_EQ(DownloadItem::TARGET_DISPOSITION_OVERWRITE, target_disposition_); 665 EXPECT_EQ(DownloadItem::TARGET_DISPOSITION_OVERWRITE, target_disposition_);
649 EXPECT_EQ(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, danger_type_); 666 EXPECT_EQ(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, danger_type_);
650 EXPECT_EQ(path, intermediate_path_); 667 EXPECT_EQ(path, intermediate_path_);
651 } 668 }
652 669
653 } // namespace content 670 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698