Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: chrome/browser/download/download_item_model_unittest.cc

Issue 351863002: Added SERVER_UNAUTHORIZED download interrupt reason. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixup for history_unittest Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, 155 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST,
156 "Failed - Network error" }, 156 "Failed - Network error" },
157 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, 157 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED,
158 "Failed - Server problem" }, 158 "Failed - Server problem" },
159 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, 159 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE,
160 "Failed - Download error" }, 160 "Failed - Download error" },
161 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, 161 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION,
162 "Failed - Download error" }, 162 "Failed - Download error" },
163 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, 163 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT,
164 "Failed - No file" }, 164 "Failed - No file" },
165 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED,
166 "Failed - Needs authorization" },
167 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM,
168 "Failed - Bad certificate" },
165 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, 169 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED,
166 "Cancelled" }, 170 "Cancelled" },
167 { content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN, 171 { content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN,
168 "Failed - Shutdown" }, 172 "Failed - Shutdown" },
169 { content::DOWNLOAD_INTERRUPT_REASON_CRASH, 173 { content::DOWNLOAD_INTERRUPT_REASON_CRASH,
170 "Failed - Crash" }, 174 "Failed - Crash" },
171 }; 175 };
172 COMPILE_ASSERT(kInterruptReasonCount == ARRAYSIZE_UNSAFE(kTestCases), 176 COMPILE_ASSERT(kInterruptReasonCount == ARRAYSIZE_UNSAFE(kTestCases),
173 interrupt_reason_mismatch); 177 interrupt_reason_mismatch);
174 178
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, 231 { content::DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST,
228 "foo.bar\nNetwork error" }, 232 "foo.bar\nNetwork error" },
229 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, 233 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED,
230 "foo.bar\nServer problem" }, 234 "foo.bar\nServer problem" },
231 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE, 235 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE,
232 "foo.bar\nDownload error" }, 236 "foo.bar\nDownload error" },
233 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION, 237 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION,
234 "foo.bar\nDownload error" }, 238 "foo.bar\nDownload error" },
235 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT, 239 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT,
236 "foo.bar\nNo file" }, 240 "foo.bar\nNo file" },
241 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED,
242 "foo.bar\nNeeds authorization" },
243 { content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM,
244 "foo.bar\nBad certificate" },
237 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED, 245 { content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED,
238 "foo.bar" }, 246 "foo.bar" },
239 { content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN, 247 { content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN,
240 "foo.bar\nShutdown" }, 248 "foo.bar\nShutdown" },
241 { content::DOWNLOAD_INTERRUPT_REASON_CRASH, 249 { content::DOWNLOAD_INTERRUPT_REASON_CRASH,
242 "foo.bar\nCrash" }, 250 "foo.bar\nCrash" },
243 }; 251 };
244 COMPILE_ASSERT(kInterruptReasonCount == ARRAYSIZE_UNSAFE(kTestCases), 252 COMPILE_ASSERT(kInterruptReasonCount == ARRAYSIZE_UNSAFE(kTestCases),
245 interrupt_reason_mismatch); 253 interrupt_reason_mismatch);
246 254
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 EXPECT_CALL(item(), GetAutoOpened()) 420 EXPECT_CALL(item(), GetAutoOpened())
413 .WillRepeatedly(Return(test_case.auto_opened)); 421 .WillRepeatedly(Return(test_case.auto_opened));
414 422
415 EXPECT_EQ(test_case.expected_result, 423 EXPECT_EQ(test_case.expected_result,
416 model().ShouldRemoveFromShelfWhenComplete()) 424 model().ShouldRemoveFromShelfWhenComplete())
417 << "Test case: " << i; 425 << "Test case: " << i;
418 Mock::VerifyAndClearExpectations(&item()); 426 Mock::VerifyAndClearExpectations(&item());
419 Mock::VerifyAndClearExpectations(&model()); 427 Mock::VerifyAndClearExpectations(&model());
420 } 428 }
421 } 429 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698