| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 HAS_1_TEMPLATE_PARAMS(int, k), | 63 HAS_1_TEMPLATE_PARAMS(int, k), |
| 64 AND_1_VALUE_PARAMS(p0)) { | 64 AND_1_VALUE_PARAMS(p0)) { |
| 65 return ::std::tr1::get<k>(args).Run(p0); | 65 return ::std::tr1::get<k>(args).Run(p0); |
| 66 } | 66 } |
| 67 | 67 |
| 68 namespace content { | 68 namespace content { |
| 69 class ByteStreamReader; | 69 class ByteStreamReader; |
| 70 | 70 |
| 71 namespace { | 71 namespace { |
| 72 | 72 |
| 73 // Matches a DownloadCreateInfo* that points to the same object as |info| and | |
| 74 // has a |default_download_directory| that matches |download_directory|. | |
| 75 MATCHER_P2(DownloadCreateInfoWithDefaultPath, info, download_directory, "") { | |
| 76 return arg == info && | |
| 77 arg->default_download_directory == download_directory; | |
| 78 } | |
| 79 | |
| 80 class MockDownloadManagerDelegate : public DownloadManagerDelegate { | 73 class MockDownloadManagerDelegate : public DownloadManagerDelegate { |
| 81 public: | 74 public: |
| 82 MockDownloadManagerDelegate(); | 75 MockDownloadManagerDelegate(); |
| 83 virtual ~MockDownloadManagerDelegate(); | 76 virtual ~MockDownloadManagerDelegate(); |
| 84 | 77 |
| 85 MOCK_METHOD0(Shutdown, void()); | 78 MOCK_METHOD0(Shutdown, void()); |
| 86 MOCK_METHOD1(GetNextId, void(const DownloadIdCallback&)); | 79 MOCK_METHOD1(GetNextId, void(const DownloadIdCallback&)); |
| 87 MOCK_METHOD2(DetermineDownloadTarget, | 80 MOCK_METHOD2(DetermineDownloadTarget, |
| 88 bool(DownloadItem* item, | 81 bool(DownloadItem* item, |
| 89 const DownloadTargetCallback&)); | 82 const DownloadTargetCallback&)); |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); | 641 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); |
| 649 | 642 |
| 650 base::Callback<bool(const GURL&)> url_filter = | 643 base::Callback<bool(const GURL&)> url_filter = |
| 651 GetSingleURLFilter(download_urls_[0]); | 644 GetSingleURLFilter(download_urls_[0]); |
| 652 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( | 645 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( |
| 653 url_filter, base::Time(), base::Time::Max()); | 646 url_filter, base::Time(), base::Time::Max()); |
| 654 EXPECT_EQ(remove_count, 1); | 647 EXPECT_EQ(remove_count, 1); |
| 655 } | 648 } |
| 656 | 649 |
| 657 } // namespace content | 650 } // namespace content |
| OLD | NEW |