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

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

Issue 1820363002: Regression test for handling early failure during network download. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/test/data/save_page/broken-image.htm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 "style.htm: af84c3ca-0fc6-4b0d-bf7a-5ac18a4dab62", 1213 "style.htm: af84c3ca-0fc6-4b0d-bf7a-5ac18a4dab62",
1214 "frameE: c9539ccd-47b0-47cf-a03b-734614865872", 1214 "frameE: c9539ccd-47b0-47cf-a03b-734614865872",
1215 }; 1215 };
1216 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr)); 1216 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr));
1217 1217
1218 GURL url(embedded_test_server()->GetURL("a.com", "/save_page/style.htm")); 1218 GURL url(embedded_test_server()->GetURL("a.com", "/save_page/style.htm"));
1219 1219
1220 TestOriginalVsSavedPage(save_page_type, url, 6, expected_substrings); 1220 TestOriginalVsSavedPage(save_page_type, url, 6, expected_substrings);
1221 } 1221 }
1222 1222
1223 // Test for saving a page with a broken image (see also crbug.com/586680). 1223 // Test for saving a page with broken subresources:
1224 // - Broken, undecodable image (see also https://crbug.com/586680)
1225 // - Broken link, to unresolvable host (see also https://crbug.com/594219)
1224 IN_PROC_BROWSER_TEST_P(SavePageOriginalVsSavedComparisonTest, BrokenImage) { 1226 IN_PROC_BROWSER_TEST_P(SavePageOriginalVsSavedComparisonTest, BrokenImage) {
1227 // Clear resolver rules to make sure that *.no.such.host used in the test html
1228 // doesn't resolve to 127.0.0.1
1229 host_resolver()->ClearRules();
1230
1225 content::SavePageType save_page_type = GetParam(); 1231 content::SavePageType save_page_type = GetParam();
1226 1232
1227 std::string arr[] = { 1233 std::string arr[] = {
1228 "broken-image.htm: 1e846775-b3ed-4d9c-a124-029554a1eb9d", 1234 "broken-image.htm: 1e846775-b3ed-4d9c-a124-029554a1eb9d",
1229 }; 1235 };
1230 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr)); 1236 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr));
1231 1237
1232 GURL url( 1238 GURL url(embedded_test_server()->GetURL("127.0.0.1",
1233 embedded_test_server()->GetURL("a.com", "/save_page/broken-image.htm")); 1239 "/save_page/broken-image.htm"));
1234 1240
1235 TestOriginalVsSavedPage(save_page_type, url, 1, expected_substrings); 1241 TestOriginalVsSavedPage(save_page_type, url, 1, expected_substrings);
1236 } 1242 }
1237 1243
1238 INSTANTIATE_TEST_CASE_P( 1244 INSTANTIATE_TEST_CASE_P(
1239 SaveType, 1245 SaveType,
1240 SavePageOriginalVsSavedComparisonTest, 1246 SavePageOriginalVsSavedComparisonTest,
1241 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, 1247 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML,
1242 content::SAVE_PAGE_TYPE_AS_MHTML)); 1248 content::SAVE_PAGE_TYPE_AS_MHTML));
1243 1249
1244 } // namespace 1250 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/save_page/broken-image.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698