| 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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 // to twice - from iframes.htm and from b.htm). | 901 // to twice - from iframes.htm and from b.htm). |
| 902 int count = 0; | 902 int count = 0; |
| 903 size_t pos = 0; | 903 size_t pos = 0; |
| 904 for (;;) { | 904 for (;;) { |
| 905 pos = mhtml.find("Content-Type: image/png", pos); | 905 pos = mhtml.find("Content-Type: image/png", pos); |
| 906 if (pos == std::string::npos) | 906 if (pos == std::string::npos) |
| 907 break; | 907 break; |
| 908 count++; | 908 count++; |
| 909 pos++; | 909 pos++; |
| 910 } | 910 } |
| 911 // TODO(lukasza): Need to dedupe savable resources (i.e. 1.png) across frames. | 911 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; |
| 912 // This will be fixed by crrev.com/1417323006. | |
| 913 // EXPECT_EQ(1, count) | |
| 914 // << "Verify number of image/png parts in the mhtml output"; | |
| 915 } | 912 } |
| 916 | 913 |
| 917 // Test suite that verifies that the frame tree "looks" the same before | 914 // Test suite that verifies that the frame tree "looks" the same before |
| 918 // and after a save-page-as. | 915 // and after a save-page-as. |
| 919 class SavePageMultiFrameBrowserTest | 916 class SavePageMultiFrameBrowserTest |
| 920 : public SavePageSitePerProcessBrowserTest, | 917 : public SavePageSitePerProcessBrowserTest, |
| 921 public ::testing::WithParamInterface<content::SavePageType> { | 918 public ::testing::WithParamInterface<content::SavePageType> { |
| 922 protected: | 919 protected: |
| 923 void TestMultiFramePage(content::SavePageType save_page_type, | 920 void TestMultiFramePage(content::SavePageType save_page_type, |
| 924 const GURL& url, | 921 const GURL& url, |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 TestMultiFramePage(save_page_type, url, 5, expected_substrings); | 1103 TestMultiFramePage(save_page_type, url, 5, expected_substrings); |
| 1107 } | 1104 } |
| 1108 | 1105 |
| 1109 INSTANTIATE_TEST_CASE_P( | 1106 INSTANTIATE_TEST_CASE_P( |
| 1110 SaveType, | 1107 SaveType, |
| 1111 SavePageMultiFrameBrowserTest, | 1108 SavePageMultiFrameBrowserTest, |
| 1112 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, | 1109 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, |
| 1113 content::SAVE_PAGE_TYPE_AS_MHTML)); | 1110 content::SAVE_PAGE_TYPE_AS_MHTML)); |
| 1114 | 1111 |
| 1115 } // namespace | 1112 } // namespace |
| OLD | NEW |