OLD | NEW |
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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 "frames-nested2.htm: 6d23dc47-f283-4977-96ec-66bcf72301a4", | 1050 "frames-nested2.htm: 6d23dc47-f283-4977-96ec-66bcf72301a4", |
1051 "b.htm: 3a35f7fa-96a9-4487-9f18-4470263907fa", | 1051 "b.htm: 3a35f7fa-96a9-4487-9f18-4470263907fa", |
1052 }; | 1052 }; |
1053 | 1053 |
1054 GURL url( | 1054 GURL url( |
1055 embedded_test_server()->GetURL("a.com", "/save_page/frames-nested.htm")); | 1055 embedded_test_server()->GetURL("a.com", "/save_page/frames-nested.htm")); |
1056 | 1056 |
1057 TestMultiFramePage(save_page_type, url, 3, expected_substrings); | 1057 TestMultiFramePage(save_page_type, url, 3, expected_substrings); |
1058 } | 1058 } |
1059 | 1059 |
| 1060 // Test for crbug.com/106364 and crbug.com/538188. |
| 1061 // Test frames have the same uri ... |
| 1062 // subframe1 and subframe2 - both have src=b.htm |
| 1063 // subframe3 and subframe4 - about:blank (no src, only srcdoc attribute). |
| 1064 // ... but different content (generated by main frame's javascript). |
| 1065 IN_PROC_BROWSER_TEST_P(SavePageMultiFrameBrowserTest, RuntimeChanges) { |
| 1066 content::SavePageType save_page_type = GetParam(); |
| 1067 |
| 1068 std::vector<std::string> expected_substrings{ |
| 1069 "frames-runtime-changes.htm: 4388232f-8d45-4d2e-9807-721b381be153", |
| 1070 "subframe1: 21595339-61fc-4854-b6df-0668328ea263", |
| 1071 "subframe2: adf55719-15e7-45be-9eda-d12fe782a1bd", |
| 1072 "subframe3: 50e294bf-3a5b-499d-8772-651ead26952f", |
| 1073 "subframe4: e0ea9289-7467-4d32-ba5c-c604e8d84cb7", |
| 1074 }; |
| 1075 |
| 1076 // TODO(lukasza): crbug.com/106364: Fix complete-html mode as well. |
| 1077 if (save_page_type == content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML) |
| 1078 return; |
| 1079 |
| 1080 GURL url(embedded_test_server()->GetURL( |
| 1081 "a.com", "/save_page/frames-runtime-changes.htm?do_runtime_changes=1")); |
| 1082 |
| 1083 TestMultiFramePage(save_page_type, url, 5, expected_substrings); |
| 1084 } |
| 1085 |
1060 INSTANTIATE_TEST_CASE_P( | 1086 INSTANTIATE_TEST_CASE_P( |
1061 , | 1087 SaveType, |
1062 SavePageMultiFrameBrowserTest, | 1088 SavePageMultiFrameBrowserTest, |
1063 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, | 1089 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, |
1064 content::SAVE_PAGE_TYPE_AS_MHTML)); | 1090 content::SAVE_PAGE_TYPE_AS_MHTML)); |
1065 | 1091 |
1066 } // namespace | 1092 } // namespace |
OLD | NEW |