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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, | 133 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, |
134 "Failed - Path too long" }, | 134 "Failed - Path too long" }, |
135 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, | 135 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, |
136 "Failed - File too large" }, | 136 "Failed - File too large" }, |
137 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, | 137 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, |
138 "Failed - Virus detected" }, | 138 "Failed - Virus detected" }, |
139 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, | 139 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, |
140 "Failed - Blocked" }, | 140 "Failed - Blocked" }, |
141 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, | 141 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, |
142 "Failed - Virus scan failed" }, | 142 "Failed - Virus scan failed" }, |
| 143 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT, |
| 144 "Failed - File truncated" }, |
143 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, | 145 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, |
144 "Failed - System busy" }, | 146 "Failed - System busy" }, |
145 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, | 147 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, |
146 "Failed - Network error" }, | 148 "Failed - Network error" }, |
147 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, | 149 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, |
148 "Failed - Network timeout" }, | 150 "Failed - Network timeout" }, |
149 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 151 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
150 "Failed - Network disconnected" }, | 152 "Failed - Network disconnected" }, |
151 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 153 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
152 "Failed - Server unavailable" }, | 154 "Failed - Server unavailable" }, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, | 203 { content::DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG, |
202 "foo.bar\nPath too long" }, | 204 "foo.bar\nPath too long" }, |
203 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, | 205 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE, |
204 "foo.bar\nFile too large" }, | 206 "foo.bar\nFile too large" }, |
205 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, | 207 { content::DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED, |
206 "foo.bar\nVirus detected" }, | 208 "foo.bar\nVirus detected" }, |
207 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, | 209 { content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, |
208 "foo.bar\nBlocked" }, | 210 "foo.bar\nBlocked" }, |
209 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, | 211 { content::DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED, |
210 "foo.bar\nVirus scan failed" }, | 212 "foo.bar\nVirus scan failed" }, |
| 213 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT, |
| 214 "foo.bar\nFile truncated" }, |
211 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, | 215 { content::DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, |
212 "foo.bar\nSystem busy" }, | 216 "foo.bar\nSystem busy" }, |
213 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, | 217 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, |
214 "foo.bar\nNetwork error" }, | 218 "foo.bar\nNetwork error" }, |
215 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, | 219 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, |
216 "foo.bar\nNetwork timeout" }, | 220 "foo.bar\nNetwork timeout" }, |
217 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, | 221 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED, |
218 "foo.bar\nNetwork disconnected" }, | 222 "foo.bar\nNetwork disconnected" }, |
219 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, | 223 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN, |
220 "foo.bar\nServer unavailable" }, | 224 "foo.bar\nServer unavailable" }, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // By default the download item should be displayable on the shelf. | 350 // By default the download item should be displayable on the shelf. |
347 EXPECT_TRUE(model().ShouldShowInShelf()); | 351 EXPECT_TRUE(model().ShouldShowInShelf()); |
348 | 352 |
349 // Once explicitly set, ShouldShowInShelf() should return the explicit value. | 353 // Once explicitly set, ShouldShowInShelf() should return the explicit value. |
350 model().SetShouldShowInShelf(false); | 354 model().SetShouldShowInShelf(false); |
351 EXPECT_FALSE(model().ShouldShowInShelf()); | 355 EXPECT_FALSE(model().ShouldShowInShelf()); |
352 | 356 |
353 model().SetShouldShowInShelf(true); | 357 model().SetShouldShowInShelf(true); |
354 EXPECT_TRUE(model().ShouldShowInShelf()); | 358 EXPECT_TRUE(model().ShouldShowInShelf()); |
355 } | 359 } |
OLD | NEW |