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

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

Issue 2826533002: Merge to M59: Only skip certain hidden elements at MHTML serialization (Closed)
Patch Set: Created 3 years, 8 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 | third_party/WebKit/Source/web/WebFrameSerializer.cpp » ('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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 content::SavePageType save_page_type = GetParam(); 1297 content::SavePageType save_page_type = GetParam();
1298 1298
1299 std::string arr[] = { 1299 std::string arr[] = {
1300 "style.htm: af84c3ca-0fc6-4b0d-bf7a-5ac18a4dab62", 1300 "style.htm: af84c3ca-0fc6-4b0d-bf7a-5ac18a4dab62",
1301 "frameF: c9539ccd-47b0-47cf-a03b-734614865872", 1301 "frameF: c9539ccd-47b0-47cf-a03b-734614865872",
1302 }; 1302 };
1303 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr)); 1303 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr));
1304 1304
1305 GURL url(embedded_test_server()->GetURL("a.com", "/save_page/style.htm")); 1305 GURL url(embedded_test_server()->GetURL("a.com", "/save_page/style.htm"));
1306 1306
1307 // The original page has 7 iframes. 2 of them are both hidden and affecting 1307 // The original page has 7 iframes. One of them that contains hidden attribute
1308 // no layout. So these two are excluded from the saved page. 1308 // will be excluded from the saved page.
1309 TestOriginalVsSavedPage(save_page_type, url, 7, 5, expected_substrings); 1309 TestOriginalVsSavedPage(save_page_type, url, 7, 6, expected_substrings);
1310 } 1310 }
1311 1311
1312 // Test for saving a page with broken subresources: 1312 // Test for saving a page with broken subresources:
1313 // - Broken, undecodable image (see also https://crbug.com/586680) 1313 // - Broken, undecodable image (see also https://crbug.com/586680)
1314 // - Broken link, to unresolvable host (see also https://crbug.com/594219) 1314 // - Broken link, to unresolvable host (see also https://crbug.com/594219)
1315 IN_PROC_BROWSER_TEST_P(SavePageOriginalVsSavedComparisonTest, BrokenImage) { 1315 IN_PROC_BROWSER_TEST_P(SavePageOriginalVsSavedComparisonTest, BrokenImage) {
1316 // Clear resolver rules to make sure that *.no.such.host used in the test html 1316 // Clear resolver rules to make sure that *.no.such.host used in the test html
1317 // doesn't resolve to 127.0.0.1 1317 // doesn't resolve to 127.0.0.1
1318 host_resolver()->ClearRules(); 1318 host_resolver()->ClearRules();
1319 1319
(...skipping 10 matching lines...) Expand all
1330 TestOriginalVsSavedPage(save_page_type, url, 1, 1, expected_substrings); 1330 TestOriginalVsSavedPage(save_page_type, url, 1, 1, expected_substrings);
1331 } 1331 }
1332 1332
1333 INSTANTIATE_TEST_CASE_P( 1333 INSTANTIATE_TEST_CASE_P(
1334 SaveType, 1334 SaveType,
1335 SavePageOriginalVsSavedComparisonTest, 1335 SavePageOriginalVsSavedComparisonTest,
1336 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, 1336 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML,
1337 content::SAVE_PAGE_TYPE_AS_MHTML)); 1337 content::SAVE_PAGE_TYPE_AS_MHTML));
1338 1338
1339 } // namespace 1339 } // namespace
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebFrameSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698