| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, | 134 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, |
| 135 "Failed - Path too long" }, | 135 "Failed - Path too long" }, |
| 136 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, | 136 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, |
| 137 "Failed - File too large" }, | 137 "Failed - File too large" }, |
| 138 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, | 138 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, |
| 139 "Failed - Virus detected" }, | 139 "Failed - Virus detected" }, |
| 140 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, | 140 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, |
| 141 "Failed - Blocked" }, | 141 "Failed - Blocked" }, |
| 142 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, | 142 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, |
| 143 "Failed - Virus scan failed" }, | 143 "Failed - Virus scan failed" }, |
| 144 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT, |
| 145 "Failed - File truncated" }, |
| 144 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, | 146 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, |
| 145 "Failed - System busy" }, | 147 "Failed - System busy" }, |
| 146 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, | 148 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, |
| 147 "Failed - Network error" }, | 149 "Failed - Network error" }, |
| 148 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, | 150 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, |
| 149 "Failed - Network timeout" }, | 151 "Failed - Network timeout" }, |
| 150 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 152 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
| 151 "Failed - Network disconnected" }, | 153 "Failed - Network disconnected" }, |
| 152 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 154 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
| 153 "Failed - Server unavailable" }, | 155 "Failed - Server unavailable" }, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, | 204 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, |
| 203 "foo.bar\nPath too long" }, | 205 "foo.bar\nPath too long" }, |
| 204 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, | 206 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, |
| 205 "foo.bar\nFile too large" }, | 207 "foo.bar\nFile too large" }, |
| 206 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, | 208 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, |
| 207 "foo.bar\nVirus detected" }, | 209 "foo.bar\nVirus detected" }, |
| 208 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, | 210 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, |
| 209 "foo.bar\nBlocked" }, | 211 "foo.bar\nBlocked" }, |
| 210 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, | 212 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, |
| 211 "foo.bar\nVirus scan failed" }, | 213 "foo.bar\nVirus scan failed" }, |
| 214 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT, |
| 215 "foo.bar\nFile truncated" }, |
| 212 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, | 216 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, |
| 213 "foo.bar\nSystem busy" }, | 217 "foo.bar\nSystem busy" }, |
| 214 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, | 218 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, |
| 215 "foo.bar\nNetwork error" }, | 219 "foo.bar\nNetwork error" }, |
| 216 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, | 220 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, |
| 217 "foo.bar\nNetwork timeout" }, | 221 "foo.bar\nNetwork timeout" }, |
| 218 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 222 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
| 219 "foo.bar\nNetwork disconnected" }, | 223 "foo.bar\nNetwork disconnected" }, |
| 220 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 224 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
| 221 "foo.bar\nServer unavailable" }, | 225 "foo.bar\nServer unavailable" }, |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 EXPECT_CALL(item(), GetSafetyState()) | 407 EXPECT_CALL(item(), GetSafetyState()) |
| 404 .WillRepeatedly(Return(test_case.is_dangerous ? DownloadItem::DANGEROUS | 408 .WillRepeatedly(Return(test_case.is_dangerous ? DownloadItem::DANGEROUS |
| 405 : DownloadItem::SAFE)); | 409 : DownloadItem::SAFE)); |
| 406 | 410 |
| 407 EXPECT_EQ(test_case.expected_result, | 411 EXPECT_EQ(test_case.expected_result, |
| 408 model().ShouldRemoveFromShelfWhenComplete()); | 412 model().ShouldRemoveFromShelfWhenComplete()); |
| 409 Mock::VerifyAndClearExpectations(&item()); | 413 Mock::VerifyAndClearExpectations(&item()); |
| 410 Mock::VerifyAndClearExpectations(&model()); | 414 Mock::VerifyAndClearExpectations(&model()); |
| 411 } | 415 } |
| 412 } | 416 } |
| OLD | NEW |