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

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

Issue 1162833007: Merge page serializers [2/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
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 setBaseFolder("pageserializer/font/"); 213 setBaseFolder("pageserializer/font/");
214 214
215 registerURL("font.html", "text/html"); 215 registerURL("font.html", "text/html");
216 registerURL("font.ttf", "application/octet-stream"); 216 registerURL("font.ttf", "application/octet-stream");
217 217
218 serialize("font.html"); 218 serialize("font.html");
219 219
220 EXPECT_TRUE(isSerialized("font.ttf", "application/octet-stream")); 220 EXPECT_TRUE(isSerialized("font.ttf", "application/octet-stream"));
221 } 221 }
222 222
223 TEST_F(PageSerializerTest, DataURI)
224 {
225 setBaseFolder("pageserializer/datauri/");
226
227 registerURL("page_with_data.html", "text/html");
228
229 serialize("page_with_data.html");
230
231 EXPECT_EQ(1U, getResources().size());
232 EXPECT_TRUE(isSerialized("page_with_data.html", "text/html"));
233 }
234
235 TEST_F(PageSerializerTest, DataURIMorphing)
236 {
237 setBaseFolder("pageserializer/datauri/");
238
239 registerURL("page_with_morphing_data.html", "text/html");
240
241 serialize("page_with_morphing_data.html");
242
243 EXPECT_EQ(2U, getResources().size());
244 EXPECT_TRUE(isSerialized("page_with_morphing_data.html", "text/html"));
245 }
246
223 TEST_F(PageSerializerTest, DontIncludeErrorImage) 247 TEST_F(PageSerializerTest, DontIncludeErrorImage)
224 { 248 {
225 setBaseFolder("pageserializer/image/"); 249 setBaseFolder("pageserializer/image/");
226 250
227 registerURL("page_with_img_error.html", "text/html"); 251 registerURL("page_with_img_error.html", "text/html");
228 registerURL("error_image.png", "image/png"); 252 registerURL("error_image.png", "image/png");
229 253
230 serialize("page_with_img_error.html"); 254 serialize("page_with_img_error.html");
231 255
232 EXPECT_EQ(1U, getResources().size()); 256 EXPECT_EQ(1U, getResources().size());
233 EXPECT_TRUE(isSerialized("page_with_img_error.html", "text/html")); 257 EXPECT_TRUE(isSerialized("page_with_img_error.html", "text/html"));
234 EXPECT_FALSE(isSerialized("error_image.png", "image/png")); 258 EXPECT_FALSE(isSerialized("error_image.png", "image/png"));
235 } 259 }
236 260
237 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698