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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 for (;;) { | 876 for (;;) { |
877 pos = mhtml.find("Content-Type: image/png", pos); | 877 pos = mhtml.find("Content-Type: image/png", pos); |
878 if (pos == std::string::npos) | 878 if (pos == std::string::npos) |
879 break; | 879 break; |
880 count++; | 880 count++; |
881 pos++; | 881 pos++; |
882 } | 882 } |
883 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; | 883 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; |
884 } | 884 } |
885 | 885 |
| 886 // This is a test for the crash from crbug.com/550289. |
| 887 IN_PROC_BROWSER_TEST_F(SavePageSitePerProcessBrowserTest, |
| 888 ReferrerPolicyOrigin) { |
| 889 GURL url(embedded_test_server()->GetURL( |
| 890 "a.com", "/save_page/b_with_referrer_policy_origin.htm")); |
| 891 ui_test_utils::NavigateToURL(browser(), url); |
| 892 |
| 893 base::FilePath full_file_name, dir; |
| 894 SaveCurrentTab(url, content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, "referrer", 3, |
| 895 &dir, &full_file_name); |
| 896 ASSERT_FALSE(HasFailure()); |
| 897 |
| 898 EXPECT_TRUE(base::PathExists(full_file_name)); |
| 899 EXPECT_TRUE(base::PathExists(dir)); |
| 900 EXPECT_TRUE(base::PathExists(dir.AppendASCII("1.css"))); |
| 901 EXPECT_TRUE(base::PathExists(dir.AppendASCII("1.png"))); |
| 902 } |
| 903 |
886 } // namespace | 904 } // namespace |
OLD | NEW |