OLD | NEW |
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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 class MockBrowserContext : public BrowserContext { | 386 class MockBrowserContext : public BrowserContext { |
387 public: | 387 public: |
388 MockBrowserContext() {} | 388 MockBrowserContext() {} |
389 ~MockBrowserContext() {} | 389 ~MockBrowserContext() {} |
390 | 390 |
391 MOCK_METHOD0(GetPath, base::FilePath()); | 391 MOCK_METHOD0(GetPath, base::FilePath()); |
392 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); | 392 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); |
393 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); | 393 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); |
394 MOCK_METHOD1(GetRequestContextForRenderProcess, | 394 MOCK_METHOD1(GetRequestContextForRenderProcess, |
395 net::URLRequestContextGetter*(int renderer_child_id)); | 395 net::URLRequestContextGetter*(int renderer_child_id)); |
396 MOCK_METHOD2(GetRequestContextForStoragePartition, | |
397 net::URLRequestContextGetter*( | |
398 const base::FilePath& partition_path, bool in_memory)); | |
399 MOCK_METHOD0(GetMediaRequestContext, | 396 MOCK_METHOD0(GetMediaRequestContext, |
400 net::URLRequestContextGetter*()); | 397 net::URLRequestContextGetter*()); |
401 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, | 398 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, |
402 net::URLRequestContextGetter*(int renderer_child_id)); | 399 net::URLRequestContextGetter*(int renderer_child_id)); |
403 MOCK_METHOD2(GetMediaRequestContextForStoragePartition, | 400 MOCK_METHOD2(GetMediaRequestContextForStoragePartition, |
404 net::URLRequestContextGetter*( | 401 net::URLRequestContextGetter*( |
405 const base::FilePath& partition_path, bool in_memory)); | 402 const base::FilePath& partition_path, bool in_memory)); |
406 MOCK_METHOD0(GetResourceContext, ResourceContext*()); | 403 MOCK_METHOD0(GetResourceContext, ResourceContext*()); |
407 MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*()); | 404 MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*()); |
408 MOCK_METHOD0(GetGeolocationPermissionContext, | 405 MOCK_METHOD0(GetGeolocationPermissionContext, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 callback_called_ = false; | 647 callback_called_ = false; |
651 DetermineDownloadTarget(&item); | 648 DetermineDownloadTarget(&item); |
652 EXPECT_TRUE(callback_called_); | 649 EXPECT_TRUE(callback_called_); |
653 EXPECT_EQ(path, target_path_); | 650 EXPECT_EQ(path, target_path_); |
654 EXPECT_EQ(DownloadItem::TARGET_DISPOSITION_OVERWRITE, target_disposition_); | 651 EXPECT_EQ(DownloadItem::TARGET_DISPOSITION_OVERWRITE, target_disposition_); |
655 EXPECT_EQ(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, danger_type_); | 652 EXPECT_EQ(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, danger_type_); |
656 EXPECT_EQ(path, intermediate_path_); | 653 EXPECT_EQ(path, intermediate_path_); |
657 } | 654 } |
658 | 655 |
659 } // namespace content | 656 } // namespace content |
OLD | NEW |