| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); | 654 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); |
| 649 | 655 |
| 650 base::Callback<bool(const GURL&)> url_filter = | 656 base::Callback<bool(const GURL&)> url_filter = |
| 651 GetSingleURLFilter(download_urls_[0]); | 657 GetSingleURLFilter(download_urls_[0]); |
| 652 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( | 658 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( |
| 653 url_filter, base::Time(), base::Time::Max()); | 659 url_filter, base::Time(), base::Time::Max()); |
| 654 EXPECT_EQ(remove_count, 1); | 660 EXPECT_EQ(remove_count, 1); |
| 655 } | 661 } |
| 656 | 662 |
| 657 } // namespace content | 663 } // namespace content |
| OLD | NEW |