| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 // to twice - from iframes.htm and from b.htm). | 897 // to twice - from iframes.htm and from b.htm). |
| 898 int count = 0; | 898 int count = 0; |
| 899 size_t pos = 0; | 899 size_t pos = 0; |
| 900 for (;;) { | 900 for (;;) { |
| 901 pos = mhtml.find("Content-Type: image/png", pos); | 901 pos = mhtml.find("Content-Type: image/png", pos); |
| 902 if (pos == std::string::npos) | 902 if (pos == std::string::npos) |
| 903 break; | 903 break; |
| 904 count++; | 904 count++; |
| 905 pos++; | 905 pos++; |
| 906 } | 906 } |
| 907 // TODO(lukasza): Need to dedupe savable resources (i.e. 1.png) across frames. | 907 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; |
| 908 // This will be fixed by crrev.com/1417323006. | |
| 909 // EXPECT_EQ(1, count) | |
| 910 // << "Verify number of image/png parts in the mhtml output"; | |
| 911 } | 908 } |
| 912 | 909 |
| 913 // Test suite that verifies that the frame tree "looks" the same before | 910 // Test suite that verifies that the frame tree "looks" the same before |
| 914 // and after a save-page-as. | 911 // and after a save-page-as. |
| 915 class SavePageMultiFrameBrowserTest | 912 class SavePageMultiFrameBrowserTest |
| 916 : public SavePageSitePerProcessBrowserTest, | 913 : public SavePageSitePerProcessBrowserTest, |
| 917 public ::testing::WithParamInterface<content::SavePageType> { | 914 public ::testing::WithParamInterface<content::SavePageType> { |
| 918 protected: | 915 protected: |
| 919 void TestMultiFramePage(content::SavePageType save_page_type, | 916 void TestMultiFramePage(content::SavePageType save_page_type, |
| 920 const GURL& url, | 917 const GURL& url, |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 TestMultiFramePage(save_page_type, url, 7, expected_substrings); | 1170 TestMultiFramePage(save_page_type, url, 7, expected_substrings); |
| 1174 } | 1171 } |
| 1175 | 1172 |
| 1176 INSTANTIATE_TEST_CASE_P( | 1173 INSTANTIATE_TEST_CASE_P( |
| 1177 SaveType, | 1174 SaveType, |
| 1178 SavePageMultiFrameBrowserTest, | 1175 SavePageMultiFrameBrowserTest, |
| 1179 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, | 1176 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, |
| 1180 content::SAVE_PAGE_TYPE_AS_MHTML)); | 1177 content::SAVE_PAGE_TYPE_AS_MHTML)); |
| 1181 | 1178 |
| 1182 } // namespace | 1179 } // namespace |
| OLD | NEW |