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 #ifndef CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
6 #define CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 // Structure to make it possible to match more than 10 arguments on | 30 // Structure to make it possible to match more than 10 arguments on |
31 // CreateDownloadItem. | 31 // CreateDownloadItem. |
32 struct CreateDownloadItemAdapter { | 32 struct CreateDownloadItemAdapter { |
33 std::string guid; | 33 std::string guid; |
34 uint32_t id; | 34 uint32_t id; |
35 base::FilePath current_path; | 35 base::FilePath current_path; |
36 base::FilePath target_path; | 36 base::FilePath target_path; |
37 std::vector<GURL> url_chain; | 37 std::vector<GURL> url_chain; |
38 GURL referrer_url; | 38 GURL referrer_url; |
| 39 GURL site_url; |
39 GURL tab_url; | 40 GURL tab_url; |
40 GURL tab_referrer_url; | 41 GURL tab_referrer_url; |
41 std::string mime_type; | 42 std::string mime_type; |
42 std::string original_mime_type; | 43 std::string original_mime_type; |
43 base::Time start_time; | 44 base::Time start_time; |
44 base::Time end_time; | 45 base::Time end_time; |
45 std::string etag; | 46 std::string etag; |
46 std::string last_modified; | 47 std::string last_modified; |
47 int64_t received_bytes; | 48 int64_t received_bytes; |
48 int64_t total_bytes; | 49 int64_t total_bytes; |
49 std::string hash; | 50 std::string hash; |
50 DownloadItem::DownloadState state; | 51 DownloadItem::DownloadState state; |
51 DownloadDangerType danger_type; | 52 DownloadDangerType danger_type; |
52 DownloadInterruptReason interrupt_reason; | 53 DownloadInterruptReason interrupt_reason; |
53 bool opened; | 54 bool opened; |
54 | 55 |
55 CreateDownloadItemAdapter(const std::string& guid, | 56 CreateDownloadItemAdapter(const std::string& guid, |
56 uint32_t id, | 57 uint32_t id, |
57 const base::FilePath& current_path, | 58 const base::FilePath& current_path, |
58 const base::FilePath& target_path, | 59 const base::FilePath& target_path, |
59 const std::vector<GURL>& url_chain, | 60 const std::vector<GURL>& url_chain, |
60 const GURL& referrer_url, | 61 const GURL& referrer_url, |
| 62 const GURL& site_url, |
61 const GURL& tab_url, | 63 const GURL& tab_url, |
62 const GURL& tab_refererr_url, | 64 const GURL& tab_refererr_url, |
63 const std::string& mime_type, | 65 const std::string& mime_type, |
64 const std::string& original_mime_type, | 66 const std::string& original_mime_type, |
65 const base::Time& start_time, | 67 const base::Time& start_time, |
66 const base::Time& end_time, | 68 const base::Time& end_time, |
67 const std::string& etag, | 69 const std::string& etag, |
68 const std::string& last_modified, | 70 const std::string& last_modified, |
69 int64_t received_bytes, | 71 int64_t received_bytes, |
70 int64_t total_bytes, | 72 int64_t total_bytes, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 MOCK_METHOD1(AddObserver, void(Observer* observer)); | 112 MOCK_METHOD1(AddObserver, void(Observer* observer)); |
111 MOCK_METHOD1(RemoveObserver, void(Observer* observer)); | 113 MOCK_METHOD1(RemoveObserver, void(Observer* observer)); |
112 | 114 |
113 // Redirects to mock method to get around gmock 10 argument limit. | 115 // Redirects to mock method to get around gmock 10 argument limit. |
114 DownloadItem* CreateDownloadItem(const std::string& guid, | 116 DownloadItem* CreateDownloadItem(const std::string& guid, |
115 uint32_t id, | 117 uint32_t id, |
116 const base::FilePath& current_path, | 118 const base::FilePath& current_path, |
117 const base::FilePath& target_path, | 119 const base::FilePath& target_path, |
118 const std::vector<GURL>& url_chain, | 120 const std::vector<GURL>& url_chain, |
119 const GURL& referrer_url, | 121 const GURL& referrer_url, |
| 122 const GURL& site_url, |
120 const GURL& tab_url, | 123 const GURL& tab_url, |
121 const GURL& tab_refererr_url, | 124 const GURL& tab_refererr_url, |
122 const std::string& mime_type, | 125 const std::string& mime_type, |
123 const std::string& original_mime_type, | 126 const std::string& original_mime_type, |
124 const base::Time& start_time, | 127 const base::Time& start_time, |
125 const base::Time& end_time, | 128 const base::Time& end_time, |
126 const std::string& etag, | 129 const std::string& etag, |
127 const std::string& last_modified, | 130 const std::string& last_modified, |
128 int64_t received_bytes, | 131 int64_t received_bytes, |
129 int64_t total_bytes, | 132 int64_t total_bytes, |
(...skipping 10 matching lines...) Expand all Loading... |
140 MOCK_CONST_METHOD0(NonMaliciousInProgressCount, int()); | 143 MOCK_CONST_METHOD0(NonMaliciousInProgressCount, int()); |
141 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); | 144 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); |
142 MOCK_METHOD0(CheckForHistoryFilesRemoval, void()); | 145 MOCK_METHOD0(CheckForHistoryFilesRemoval, void()); |
143 MOCK_METHOD1(GetDownload, DownloadItem*(uint32_t id)); | 146 MOCK_METHOD1(GetDownload, DownloadItem*(uint32_t id)); |
144 MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); | 147 MOCK_METHOD1(GetDownloadByGuid, DownloadItem*(const std::string&)); |
145 }; | 148 }; |
146 | 149 |
147 } // namespace content | 150 } // namespace content |
148 | 151 |
149 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ | 152 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_MANAGER_H_ |
OLD | NEW |