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

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

Issue 1441553002: Generating CIDs in Blink during MHTML serialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-per-frame-page-serializer-only
Patch Set: Using references for out parameters in Blink. Created 5 years 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 "frames-nested2.htm: 6d23dc47-f283-4977-96ec-66bcf72301a4", 1056 "frames-nested2.htm: 6d23dc47-f283-4977-96ec-66bcf72301a4",
1057 "b.htm: 3a35f7fa-96a9-4487-9f18-4470263907fa", 1057 "b.htm: 3a35f7fa-96a9-4487-9f18-4470263907fa",
1058 }; 1058 };
1059 1059
1060 GURL url( 1060 GURL url(
1061 embedded_test_server()->GetURL("a.com", "/save_page/frames-nested.htm")); 1061 embedded_test_server()->GetURL("a.com", "/save_page/frames-nested.htm"));
1062 1062
1063 TestMultiFramePage(save_page_type, url, 3, expected_substrings); 1063 TestMultiFramePage(save_page_type, url, 3, expected_substrings);
1064 } 1064 }
1065 1065
1066 // Test for crbug.com/106364 and crbug.com/538188.
1067 // Test frames have the same uri ...
1068 // subframe1 and subframe2 - both have src=b.htm
1069 // subframe3 and subframe4 - about:blank (no src, only srcdoc attribute).
1070 // ... but different content (generated by main frame's javascript).
1071 IN_PROC_BROWSER_TEST_P(SavePageMultiFrameBrowserTest, RuntimeChanges) {
1072 content::SavePageType save_page_type = GetParam();
1073
1074 std::vector<std::string> expected_substrings{
1075 "frames-runtime-changes.htm: 4388232f-8d45-4d2e-9807-721b381be153",
1076 "subframe1: 21595339-61fc-4854-b6df-0668328ea263",
1077 "subframe2: adf55719-15e7-45be-9eda-d12fe782a1bd",
1078 "subframe3: 50e294bf-3a5b-499d-8772-651ead26952f",
1079 "subframe4: e0ea9289-7467-4d32-ba5c-c604e8d84cb7",
1080 };
1081
1082 // TODO(lukasza): crbug.com/106364: Fix complete-html mode as well.
1083 if (save_page_type == content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML)
1084 return;
1085
1086 GURL url(embedded_test_server()->GetURL(
1087 "a.com", "/save_page/frames-runtime-changes.htm?do_runtime_changes=1"));
1088
1089 TestMultiFramePage(save_page_type, url, 5, expected_substrings);
1090 }
1091
1066 INSTANTIATE_TEST_CASE_P( 1092 INSTANTIATE_TEST_CASE_P(
1067 , 1093 SaveType,
1068 SavePageMultiFrameBrowserTest, 1094 SavePageMultiFrameBrowserTest,
1069 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, 1095 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML,
1070 content::SAVE_PAGE_TYPE_AS_MHTML)); 1096 content::SAVE_PAGE_TYPE_AS_MHTML));
1071 1097
1072 } // namespace 1098 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698