Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: Source/web/tests/PageSerializerTest.cpp

Issue 1167313002: Merge page serializers [3/12] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 setBaseFolder("pageserializer/datauri/"); 237 setBaseFolder("pageserializer/datauri/");
238 238
239 registerURL("page_with_morphing_data.html", "text/html"); 239 registerURL("page_with_morphing_data.html", "text/html");
240 240
241 serialize("page_with_morphing_data.html"); 241 serialize("page_with_morphing_data.html");
242 242
243 EXPECT_EQ(2U, getResources().size()); 243 EXPECT_EQ(2U, getResources().size());
244 EXPECT_TRUE(isSerialized("page_with_morphing_data.html", "text/html")); 244 EXPECT_TRUE(isSerialized("page_with_morphing_data.html", "text/html"));
245 } 245 }
246 246
247 // Test that we don't regress https://bugs.webkit.org/show_bug.cgi?id=99105
248 TEST_F(PageSerializerTest, SVGImageDontCrash)
249 {
250 setBaseFolder("pageserializer/svg/");
251
252 registerURL("page_with_svg_image.html", "text/html");
253 registerURL("green_rectangle.svg", "image/svg+xml");
254
255 serialize("page_with_svg_image.html");
256
257 EXPECT_EQ(2U, getResources().size());
258
259 EXPECT_TRUE(isSerialized("green_rectangle.svg", "image/svg+xml"));
260 EXPECT_GT(getSerializedData("green_rectangle.svg", "image/svg+xml").length() , 250U);
261 }
262
247 TEST_F(PageSerializerTest, DontIncludeErrorImage) 263 TEST_F(PageSerializerTest, DontIncludeErrorImage)
248 { 264 {
249 setBaseFolder("pageserializer/image/"); 265 setBaseFolder("pageserializer/image/");
250 266
251 registerURL("page_with_img_error.html", "text/html"); 267 registerURL("page_with_img_error.html", "text/html");
252 registerURL("error_image.png", "image/png"); 268 registerURL("error_image.png", "image/png");
253 269
254 serialize("page_with_img_error.html"); 270 serialize("page_with_img_error.html");
255 271
256 EXPECT_EQ(1U, getResources().size()); 272 EXPECT_EQ(1U, getResources().size());
257 EXPECT_TRUE(isSerialized("page_with_img_error.html", "text/html")); 273 EXPECT_TRUE(isSerialized("page_with_img_error.html", "text/html"));
258 EXPECT_FALSE(isSerialized("error_image.png", "image/png")); 274 EXPECT_FALSE(isSerialized("error_image.png", "image/png"));
259 } 275 }
260 276
277 TEST_F(PageSerializerTest, NamespaceElementsDontCrash)
278 {
279 setBaseFolder("pageserializer/namespace/");
280
281 registerURL("namespace_element.html", "text/html");
282
283 serialize("namespace_element.html");
284
285 EXPECT_EQ(1U, getResources().size());
286 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html"));
287 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(), 0U);
261 } 288 }
289
290 }
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698