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

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

Issue 1502563004: Save-Page-As-Complete-Html: Each frame links to a distinct local file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-url-deduping-for-frame-and-adding-save-item-id
Patch Set: Method signature changes: rewriteFrameSource + s/const WebFrame&/WebFrame*/ Created 4 years, 11 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 <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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 std::string arr[] = { 1107 std::string arr[] = {
1108 "frames-runtime-changes.htm: 4388232f-8d45-4d2e-9807-721b381be153", 1108 "frames-runtime-changes.htm: 4388232f-8d45-4d2e-9807-721b381be153",
1109 "subframe1: 21595339-61fc-4854-b6df-0668328ea263", 1109 "subframe1: 21595339-61fc-4854-b6df-0668328ea263",
1110 "subframe2: adf55719-15e7-45be-9eda-d12fe782a1bd", 1110 "subframe2: adf55719-15e7-45be-9eda-d12fe782a1bd",
1111 "subframe3: 50e294bf-3a5b-499d-8772-651ead26952f", 1111 "subframe3: 50e294bf-3a5b-499d-8772-651ead26952f",
1112 "subframe4: e0ea9289-7467-4d32-ba5c-c604e8d84cb7", 1112 "subframe4: e0ea9289-7467-4d32-ba5c-c604e8d84cb7",
1113 }; 1113 };
1114 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr)); 1114 std::vector<std::string> expected_substrings(std::begin(arr), std::end(arr));
1115 1115
1116 if (save_page_type == content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML) { 1116 if (save_page_type == content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML) {
1117 // TODO(lukasza): crbug.com/106364: Expand complete-html test beyond just 1117 // TODO(lukasza): crbug.com/106364: Expand complete-html test to cover all
1118 // being a crash test. In particular, the |complete_html_arr| below should 1118 // test frames. In particular, the |complete_html_arr| below should be the
Randy Smith (Not in Mondays) 2016/01/22 15:28:39 I don't understand what is missing from this CL to
Łukasz Anforowicz 2016/01/22 17:39:40 This CL almost gets us there - the missing thing i
1119 // be the same as the |arr| above (and at this point the special-casing of 1119 // same as the |arr| above (and at this point the special-casing of
1120 // complete-html can be removed). 1120 // complete-html can be removed).
1121 // Draft CLs with fix proposals that should accomplish this: 1121 // Draft CLs with fix proposals that should accomplish this:
1122 // - crrev.com/1502563004 1122 // - crrev.com/1502563004
1123 // - crrev.com/1500103002 1123 // - crrev.com/1500103002
1124 std::string complete_html_arr[] = { 1124 std::string complete_html_arr[] = {
1125 "frames-runtime-changes.htm: 4388232f-8d45-4d2e-9807-721b381be153", 1125 "frames-runtime-changes.htm: 4388232f-8d45-4d2e-9807-721b381be153",
1126 "subframe1: 21595339-61fc-4854-b6df-0668328ea263",
1127 "subframe2: adf55719-15e7-45be-9eda-d12fe782a1bd",
1126 }; 1128 };
1127 expected_substrings = std::vector<std::string>( 1129 expected_substrings = std::vector<std::string>(
1128 std::begin(complete_html_arr), std::end(complete_html_arr)); 1130 std::begin(complete_html_arr), std::end(complete_html_arr));
1129 } 1131 }
1130 1132
1131 GURL url(embedded_test_server()->GetURL( 1133 GURL url(embedded_test_server()->GetURL(
1132 "a.com", "/save_page/frames-runtime-changes.htm?do_runtime_changes=1")); 1134 "a.com", "/save_page/frames-runtime-changes.htm?do_runtime_changes=1"));
Randy Smith (Not in Mondays) 2016/01/22 15:28:39 nit, not this CL: This usage implies that do_runti
Łukasz Anforowicz 2016/01/22 17:39:39 Oh, right. Yes - I am not quite happy with how th
Łukasz Anforowicz 2016/01/25 19:04:05 Done (tweaked the test html / javascript so that d
1133 1135
1134 TestMultiFramePage(save_page_type, url, 5, expected_substrings); 1136 TestMultiFramePage(save_page_type, url, 5, expected_substrings);
1135 } 1137 }
1136 1138
1137 // Test for saving frames with various encodings: 1139 // Test for saving frames with various encodings:
1138 // - iso-8859-2: encoding declared via <meta> element 1140 // - iso-8859-2: encoding declared via <meta> element
1139 // - utf16-le-bom.htm, utf16-be-bom.htm: encoding detected via BOM 1141 // - utf16-le-bom.htm, utf16-be-bom.htm: encoding detected via BOM
1140 // - utf16-le-nobom.htm, utf16-le-nobom.htm, utf32.htm - encoding declared via 1142 // - utf16-le-nobom.htm, utf16-le-nobom.htm, utf32.htm - encoding declared via
1141 // mocked http headers 1143 // mocked http headers
1142 IN_PROC_BROWSER_TEST_P(SavePageMultiFrameBrowserTest, Encoding) { 1144 IN_PROC_BROWSER_TEST_P(SavePageMultiFrameBrowserTest, Encoding) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 TestMultiFramePage(save_page_type, url, 6, expected_substrings); 1191 TestMultiFramePage(save_page_type, url, 6, expected_substrings);
1190 } 1192 }
1191 1193
1192 INSTANTIATE_TEST_CASE_P( 1194 INSTANTIATE_TEST_CASE_P(
1193 SaveType, 1195 SaveType,
1194 SavePageMultiFrameBrowserTest, 1196 SavePageMultiFrameBrowserTest,
1195 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, 1197 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML,
1196 content::SAVE_PAGE_TYPE_AS_MHTML)); 1198 content::SAVE_PAGE_TYPE_AS_MHTML));
1197 1199
1198 } // namespace 1200 } // namespace
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/save_item.h » ('j') | content/browser/download/save_package.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698