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 // History unit tests come in two flavors: | 5 // History unit tests come in two flavors: |
6 // | 6 // |
7 // 1. The more complicated style is that the unit test creates a full history | 7 // 1. The more complicated style is that the unit test creates a full history |
8 // service. This spawns a background thread for the history backend, and | 8 // service. This spawns a background thread for the history backend, and |
9 // all communication is asynchronous. This is useful for testing more | 9 // all communication is asynchronous. This is useful for testing more |
10 // complicated things or end-to-end behavior. | 10 // complicated things or end-to-end behavior. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 {"NETWORK_SERVER_DOWN", 23}, | 69 {"NETWORK_SERVER_DOWN", 23}, |
70 {"NETWORK_INVALID_REQUEST", 24}, | 70 {"NETWORK_INVALID_REQUEST", 24}, |
71 {"SERVER_FAILED", 30}, | 71 {"SERVER_FAILED", 30}, |
72 {"SERVER_NO_RANGE", 31}, | 72 {"SERVER_NO_RANGE", 31}, |
73 {"SERVER_PRECONDITION", 32}, | 73 {"SERVER_PRECONDITION", 32}, |
74 {"SERVER_BAD_CONTENT", 33}, | 74 {"SERVER_BAD_CONTENT", 33}, |
75 {"SERVER_UNAUTHORIZED", 34}, | 75 {"SERVER_UNAUTHORIZED", 34}, |
76 {"SERVER_CERT_PROBLEM", 35}, | 76 {"SERVER_CERT_PROBLEM", 35}, |
77 {"SERVER_FORBIDDEN", 36}, | 77 {"SERVER_FORBIDDEN", 36}, |
78 {"SERVER_UNREACHABLE", 37}, | 78 {"SERVER_UNREACHABLE", 37}, |
| 79 {"SERVER_CONTENT_LENGTH_MISMATCH", 38}, |
79 {"USER_CANCELED", 40}, | 80 {"USER_CANCELED", 40}, |
80 {"USER_SHUTDOWN", 41}, | 81 {"USER_SHUTDOWN", 41}, |
81 {"CRASH", 50}, | 82 {"CRASH", 50}, |
82 }; | 83 }; |
83 | 84 |
84 // Make sure no one has changed a DownloadInterruptReason we've previously | 85 // Make sure no one has changed a DownloadInterruptReason we've previously |
85 // persisted. | 86 // persisted. |
86 TEST_F(ContentHistoryBackendDBTest, | 87 TEST_F(ContentHistoryBackendDBTest, |
87 ConfirmDownloadInterruptReasonBackwardsCompatible) { | 88 ConfirmDownloadInterruptReasonBackwardsCompatible) { |
88 // Are there any cases in which a historical number has been repurposed | 89 // Are there any cases in which a historical number has been repurposed |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 126 } |
126 | 127 |
127 EXPECT_TRUE(found) | 128 EXPECT_TRUE(found) |
128 << "Error \"" << cur_reason.name << "\" not found in historical list." | 129 << "Error \"" << cur_reason.name << "\" not found in historical list." |
129 << std::endl | 130 << std::endl |
130 << "Please add it."; | 131 << "Please add it."; |
131 } | 132 } |
132 } | 133 } |
133 } // namespace | 134 } // namespace |
134 } // namespace history | 135 } // namespace history |
OLD | NEW |