| 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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 EXPECT_NE(0, actual_file_size) << "Is " << file_path.value() | 860 EXPECT_NE(0, actual_file_size) << "Is " << file_path.value() |
| 861 << " non-empty?"; | 861 << " non-empty?"; |
| 862 } | 862 } |
| 863 | 863 |
| 864 // Verify that local links got correctly replaced with local paths | 864 // Verify that local links got correctly replaced with local paths |
| 865 // (most importantly for iframe elements, which are only exercised | 865 // (most importantly for iframe elements, which are only exercised |
| 866 // by this particular test). | 866 // by this particular test). |
| 867 std::string main_contents; | 867 std::string main_contents; |
| 868 ASSERT_TRUE(base::ReadFileToString(full_file_name, &main_contents)); | 868 ASSERT_TRUE(base::ReadFileToString(full_file_name, &main_contents)); |
| 869 EXPECT_THAT(main_contents, | 869 EXPECT_THAT(main_contents, |
| 870 HasSubstr("<iframe src=\"./iframes_files/a.html\"></iframe>")); | 870 HasSubstr("<iframe src=\"iframes_files/a.html\"></iframe>")); |
| 871 EXPECT_THAT(main_contents, | |
| 872 HasSubstr("<iframe src=\"./iframes_files/b.html\"></iframe>")); | |
| 873 EXPECT_THAT(main_contents, | 871 EXPECT_THAT(main_contents, |
| 874 HasSubstr("<img src=\"./iframes_files/1.png\">")); | 872 HasSubstr("<img src=\"./iframes_files/1.png\">")); |
| 875 | 873 |
| 876 // Verification of html contents. | 874 // Verification of html contents. |
| 877 EXPECT_THAT(main_contents, HasSubstr("896fd88d-a77a-4f46-afd8-24db7d5af9c2")) | 875 EXPECT_THAT(main_contents, HasSubstr("896fd88d-a77a-4f46-afd8-24db7d5af9c2")) |
| 878 << "Verifing if content from iframes.htm is present"; | 876 << "Verifing if content from iframes.htm is present"; |
| 879 std::string a_contents; | 877 std::string a_contents; |
| 880 ASSERT_TRUE(base::ReadFileToString(dir.AppendASCII("a.html"), &a_contents)); | 878 ASSERT_TRUE(base::ReadFileToString(dir.AppendASCII("a.html"), &a_contents)); |
| 881 EXPECT_THAT(a_contents, HasSubstr("1b8aae2b-e164-462f-bd5b-98aa366205f2")) | 879 EXPECT_THAT(a_contents, HasSubstr("1b8aae2b-e164-462f-bd5b-98aa366205f2")) |
| 882 << "Verifing if content from a.htm is present"; | 880 << "Verifing if content from a.htm is present"; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 pos = mhtml.find("Content-Type: image/png", pos); | 927 pos = mhtml.find("Content-Type: image/png", pos); |
| 930 if (pos == std::string::npos) | 928 if (pos == std::string::npos) |
| 931 break; | 929 break; |
| 932 count++; | 930 count++; |
| 933 pos++; | 931 pos++; |
| 934 } | 932 } |
| 935 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; | 933 EXPECT_EQ(1, count) << "Verify number of image/png parts in the mhtml output"; |
| 936 } | 934 } |
| 937 | 935 |
| 938 } // namespace | 936 } // namespace |
| OLD | NEW |