| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 149 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
| 150 "Failed - Network disconnected" }, | 150 "Failed - Network disconnected" }, |
| 151 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 151 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
| 152 "Failed - Server unavailable" }, | 152 "Failed - Server unavailable" }, |
| 153 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, | 153 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, |
| 154 "Failed - Network error" }, | 154 "Failed - Network error" }, |
| 155 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, | 155 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, |
| 156 "Failed - Server problem" }, | 156 "Failed - Server problem" }, |
| 157 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, | 157 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, |
| 158 "Failed - Download error" }, | 158 "Failed - Download error" }, |
| 159 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, | |
| 160 "Failed - Download error" }, | |
| 161 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, | 159 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, |
| 162 "Failed - No file" }, | 160 "Failed - No file" }, |
| 163 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED, | 161 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED, |
| 164 "Failed - Needs authorization" }, | 162 "Failed - Needs authorization" }, |
| 165 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM, | 163 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM, |
| 166 "Failed - Bad certificate" }, | 164 "Failed - Bad certificate" }, |
| 167 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN, | 165 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN, |
| 168 "Failed - Forbidden" }, | 166 "Failed - Forbidden" }, |
| 169 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, | 167 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, |
| 170 "Canceled" }, | 168 "Canceled" }, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 225 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
| 228 "foo.bar\nNetwork disconnected" }, | 226 "foo.bar\nNetwork disconnected" }, |
| 229 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 227 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
| 230 "foo.bar\nServer unavailable" }, | 228 "foo.bar\nServer unavailable" }, |
| 231 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, | 229 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, |
| 232 "foo.bar\nNetwork error" }, | 230 "foo.bar\nNetwork error" }, |
| 233 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, | 231 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, |
| 234 "foo.bar\nServer problem" }, | 232 "foo.bar\nServer problem" }, |
| 235 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, | 233 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, |
| 236 "foo.bar\nDownload error" }, | 234 "foo.bar\nDownload error" }, |
| 237 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, | |
| 238 "foo.bar\nDownload error" }, | |
| 239 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, | 235 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, |
| 240 "foo.bar\nNo file" }, | 236 "foo.bar\nNo file" }, |
| 241 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED, | 237 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED, |
| 242 "foo.bar\nNeeds authorization" }, | 238 "foo.bar\nNeeds authorization" }, |
| 243 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM, | 239 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM, |
| 244 "foo.bar\nBad certificate" }, | 240 "foo.bar\nBad certificate" }, |
| 245 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN, | 241 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN, |
| 246 "foo.bar\nForbidden" }, | 242 "foo.bar\nForbidden" }, |
| 247 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, | 243 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, |
| 248 "foo.bar" }, | 244 "foo.bar" }, |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 EXPECT_CALL(item(), GetAutoOpened()) | 418 EXPECT_CALL(item(), GetAutoOpened()) |
| 423 .WillRepeatedly(Return(test_case.auto_opened)); | 419 .WillRepeatedly(Return(test_case.auto_opened)); |
| 424 | 420 |
| 425 EXPECT_EQ(test_case.expected_result, | 421 EXPECT_EQ(test_case.expected_result, |
| 426 model().ShouldRemoveFromShelfWhenComplete()) | 422 model().ShouldRemoveFromShelfWhenComplete()) |
| 427 << "Test case: " << i; | 423 << "Test case: " << i; |
| 428 Mock::VerifyAndClearExpectations(&item()); | 424 Mock::VerifyAndClearExpectations(&item()); |
| 429 Mock::VerifyAndClearExpectations(&model()); | 425 Mock::VerifyAndClearExpectations(&model()); |
| 430 } | 426 } |
| 431 } | 427 } |
| OLD | NEW |