Chromium Code Reviews| Index: Source/web/tests/PageSerializerTest.cpp |
| diff --git a/Source/web/tests/PageSerializerTest.cpp b/Source/web/tests/PageSerializerTest.cpp |
| index fd40e165186ce49b73c6b7a36af71b3476cacfa3..a7e2fcde7ddc6467e592d35c23bb803b8a3f7f00 100644 |
| --- a/Source/web/tests/PageSerializerTest.cpp |
| +++ b/Source/web/tests/PageSerializerTest.cpp |
| @@ -29,11 +29,11 @@ |
| */ |
| #include "config.h" |
| +#include "core/page/PageSerializer.h" |
| #include "bindings/core/v8/V8Binding.h" |
| #include "bindings/core/v8/V8BindingForTesting.h" |
| #include "core/page/Page.h" |
| -#include "core/page/PageSerializer.h" |
| #include "platform/SerializedResource.h" |
| #include "platform/testing/URLTestHelpers.h" |
| #include "public/platform/Platform.h" |
| @@ -139,6 +139,16 @@ protected: |
| return String(); |
| } |
| + // For debugging |
| + void printResources() |
|
philipj_slow
2015/06/05 11:59:16
I don't know, I'd probably leave this out. If you
Tiger (Sony Mobile)
2015/06/05 13:47:50
Agreed, it is not that important.
|
| + { |
| + printf("Printing resources (%zu resources in total)\n", m_resources.size()); |
| + for (size_t i = 0; i < m_resources.size(); ++i) { |
| + printf("%zu. '%s', '%s'\n", i, m_resources[i].url.string().utf8().data(), |
| + m_resources[i].mimeType.utf8().data()); |
| + } |
| + } |
| + |
| private: |
| static void configureSettings(WebSettings* settings) |
| { |
| @@ -220,4 +230,18 @@ TEST_F(PageSerializerTest, Font) |
| EXPECT_TRUE(isSerialized("font.ttf", "application/octet-stream")); |
| } |
| +TEST_F(PageSerializerTest, DontIncludeErrorImage) |
| +{ |
| + setBaseFolder("pageserializer/image/"); |
| + |
| + registerURL("page_with_img_error.html", "text/html"); |
| + registerURL("error_image.png", "image/png"); |
| + |
| + serialize("page_with_img_error.html"); |
| + |
| + EXPECT_EQ(1U, getResources().size()); |
| + EXPECT_TRUE(isSerialized("page_with_img_error.html", "text/html")); |
| + EXPECT_FALSE(isSerialized("error_image.png", "image/png")); |
| +} |
| + |
| } |