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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 TestMultiFramePage(save_page_type, url, 6, expected_substrings); | 1185 TestMultiFramePage(save_page_type, url, 6, expected_substrings); |
1189 } | 1186 } |
1190 | 1187 |
1191 INSTANTIATE_TEST_CASE_P( | 1188 INSTANTIATE_TEST_CASE_P( |
1192 SaveType, | 1189 SaveType, |
1193 SavePageMultiFrameBrowserTest, | 1190 SavePageMultiFrameBrowserTest, |
1194 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, | 1191 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, |
1195 content::SAVE_PAGE_TYPE_AS_MHTML)); | 1192 content::SAVE_PAGE_TYPE_AS_MHTML)); |
1196 | 1193 |
1197 } // namespace | 1194 } // namespace |
OLD | NEW |