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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Matches a DownloadCreateInfo* that points to the same object as |info| and | 57 // Matches a DownloadCreateInfo* that points to the same object as |info| and |
58 // has a |default_download_directory| that matches |download_directory|. | 58 // has a |default_download_directory| that matches |download_directory|. |
59 MATCHER_P2(DownloadCreateInfoWithDefaultPath, info, download_directory, "") { | 59 MATCHER_P2(DownloadCreateInfoWithDefaultPath, info, download_directory, "") { |
60 return arg == info && | 60 return arg == info && |
61 arg->default_download_directory == download_directory; | 61 arg->default_download_directory == download_directory; |
62 } | 62 } |
63 | 63 |
64 class MockDownloadItemImpl : public DownloadItemImpl { | 64 class MockDownloadItemImpl : public DownloadItemImpl { |
65 public: | 65 public: |
66 // Use history constructor for minimal base object. | 66 // Use history constructor for minimal base object. |
67 MockDownloadItemImpl(DownloadItemImplDelegate* delegate) | 67 explicit MockDownloadItemImpl(DownloadItemImplDelegate* delegate) |
68 : DownloadItemImpl( | 68 : DownloadItemImpl( |
69 delegate, | 69 delegate, |
70 content::DownloadId(), | 70 content::DownloadId(), |
71 FilePath(), | 71 FilePath(), |
72 GURL(), | 72 GURL(), |
73 GURL(), | 73 GURL(), |
74 base::Time(), | 74 base::Time(), |
75 base::Time(), | 75 base::Time(), |
76 0, | 76 0, |
77 0, | 77 0, |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 callback_called_ = false; | 644 callback_called_ = false; |
645 DetermineDownloadTarget(&item); | 645 DetermineDownloadTarget(&item); |
646 EXPECT_TRUE(callback_called_); | 646 EXPECT_TRUE(callback_called_); |
647 EXPECT_EQ(path, target_path_); | 647 EXPECT_EQ(path, target_path_); |
648 EXPECT_EQ(DownloadItem::TARGET_DISPOSITION_OVERWRITE, target_disposition_); | 648 EXPECT_EQ(DownloadItem::TARGET_DISPOSITION_OVERWRITE, target_disposition_); |
649 EXPECT_EQ(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, danger_type_); | 649 EXPECT_EQ(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, danger_type_); |
650 EXPECT_EQ(path, intermediate_path_); | 650 EXPECT_EQ(path, intermediate_path_); |
651 } | 651 } |
652 | 652 |
653 } // namespace content | 653 } // namespace content |
OLD | NEW |