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 "content/browser/download/download_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 HAS_1_TEMPLATE_PARAMS(int, k), | 66 HAS_1_TEMPLATE_PARAMS(int, k), |
67 AND_1_VALUE_PARAMS(p0)) { | 67 AND_1_VALUE_PARAMS(p0)) { |
68 return ::std::tr1::get<k>(args).Run(p0); | 68 return ::std::tr1::get<k>(args).Run(p0); |
69 } | 69 } |
70 | 70 |
71 namespace content { | 71 namespace content { |
72 class ByteStreamReader; | 72 class ByteStreamReader; |
73 | 73 |
74 namespace { | 74 namespace { |
75 | 75 |
| 76 // Matches a DownloadCreateInfo* that points to the same object as |info| and |
| 77 // has a |default_download_directory| that matches |download_directory|. |
| 78 MATCHER_P2(DownloadCreateInfoWithDefaultPath, info, download_directory, "") { |
| 79 return arg == info && arg->default_download_directory == download_directory; |
| 80 } |
| 81 |
76 class MockDownloadManagerDelegate : public DownloadManagerDelegate { | 82 class MockDownloadManagerDelegate : public DownloadManagerDelegate { |
77 public: | 83 public: |
78 MockDownloadManagerDelegate(); | 84 MockDownloadManagerDelegate(); |
79 virtual ~MockDownloadManagerDelegate(); | 85 virtual ~MockDownloadManagerDelegate(); |
80 | 86 |
81 MOCK_METHOD0(Shutdown, void()); | 87 MOCK_METHOD0(Shutdown, void()); |
82 MOCK_METHOD1(GetNextId, void(const DownloadIdCallback&)); | 88 MOCK_METHOD1(GetNextId, void(const DownloadIdCallback&)); |
83 MOCK_METHOD2(DetermineDownloadTarget, | 89 MOCK_METHOD2(DetermineDownloadTarget, |
84 bool(DownloadItem* item, | 90 bool(DownloadItem* item, |
85 const DownloadTargetCallback&)); | 91 const DownloadTargetCallback&)); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); | 656 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); |
651 | 657 |
652 base::Callback<bool(const GURL&)> url_filter = | 658 base::Callback<bool(const GURL&)> url_filter = |
653 GetSingleURLFilter(download_urls_[0]); | 659 GetSingleURLFilter(download_urls_[0]); |
654 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( | 660 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( |
655 url_filter, base::Time(), base::Time::Max()); | 661 url_filter, base::Time(), base::Time::Max()); |
656 EXPECT_EQ(remove_count, 1); | 662 EXPECT_EQ(remove_count, 1); |
657 } | 663 } |
658 | 664 |
659 } // namespace content | 665 } // namespace content |
OLD | NEW |