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 "chrome/browser/download/download_item_model.h" | 5 #include "chrome/browser/download/download_item_model.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, | 145 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, |
146 "Failed - System busy" }, | 146 "Failed - System busy" }, |
147 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, | 147 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, |
148 "Failed - Network error" }, | 148 "Failed - Network error" }, |
149 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, | 149 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, |
150 "Failed - Network timeout" }, | 150 "Failed - Network timeout" }, |
151 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 151 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
152 "Failed - Network disconnected" }, | 152 "Failed - Network disconnected" }, |
153 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 153 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
154 "Failed - Server unavailable" }, | 154 "Failed - Server unavailable" }, |
| 155 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, |
| 156 "Failed - Network error" }, |
155 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, | 157 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, |
156 "Failed - Server problem" }, | 158 "Failed - Server problem" }, |
157 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, | 159 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, |
158 "Failed - Download error" }, | 160 "Failed - Download error" }, |
159 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, | 161 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, |
160 "Failed - Download error" }, | 162 "Failed - Download error" }, |
161 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, | 163 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, |
162 "Failed - No file" }, | 164 "Failed - No file" }, |
163 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, | 165 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, |
164 "Cancelled" }, | 166 "Cancelled" }, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, | 217 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, |
216 "foo.bar\nSystem busy" }, | 218 "foo.bar\nSystem busy" }, |
217 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, | 219 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, |
218 "foo.bar\nNetwork error" }, | 220 "foo.bar\nNetwork error" }, |
219 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, | 221 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, |
220 "foo.bar\nNetwork timeout" }, | 222 "foo.bar\nNetwork timeout" }, |
221 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 223 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
222 "foo.bar\nNetwork disconnected" }, | 224 "foo.bar\nNetwork disconnected" }, |
223 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 225 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
224 "foo.bar\nServer unavailable" }, | 226 "foo.bar\nServer unavailable" }, |
| 227 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, |
| 228 "foo.bar\nNetwork error" }, |
225 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, | 229 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, |
226 "foo.bar\nServer problem" }, | 230 "foo.bar\nServer problem" }, |
227 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, | 231 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, |
228 "foo.bar\nDownload error" }, | 232 "foo.bar\nDownload error" }, |
229 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, | 233 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, |
230 "foo.bar\nDownload error" }, | 234 "foo.bar\nDownload error" }, |
231 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, | 235 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, |
232 "foo.bar\nNo file" }, | 236 "foo.bar\nNo file" }, |
233 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, | 237 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, |
234 "foo.bar" }, | 238 "foo.bar" }, |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 EXPECT_CALL(item(), GetAutoOpened()) | 412 EXPECT_CALL(item(), GetAutoOpened()) |
409 .WillRepeatedly(Return(test_case.auto_opened)); | 413 .WillRepeatedly(Return(test_case.auto_opened)); |
410 | 414 |
411 EXPECT_EQ(test_case.expected_result, | 415 EXPECT_EQ(test_case.expected_result, |
412 model().ShouldRemoveFromShelfWhenComplete()) | 416 model().ShouldRemoveFromShelfWhenComplete()) |
413 << "Test case: " << i; | 417 << "Test case: " << i; |
414 Mock::VerifyAndClearExpectations(&item()); | 418 Mock::VerifyAndClearExpectations(&item()); |
415 Mock::VerifyAndClearExpectations(&model()); | 419 Mock::VerifyAndClearExpectations(&model()); |
416 } | 420 } |
417 } | 421 } |
OLD | NEW |