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

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

Issue 1203873004: Retrieve resources from media and supports query rules while serializing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address nits 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 TEST_F(PageSerializerTest, CSS) 282 TEST_F(PageSerializerTest, CSS)
283 { 283 {
284 setBaseFolder("pageserializer/css/"); 284 setBaseFolder("pageserializer/css/");
285 285
286 registerURL("css_test_page.html", "text/html"); 286 registerURL("css_test_page.html", "text/html");
287 registerURL("link_styles.css", "text/css"); 287 registerURL("link_styles.css", "text/css");
288 registerURL("import_style_from_link.css", "text/css"); 288 registerURL("import_style_from_link.css", "text/css");
289 registerURL("import_styles.css", "text/css"); 289 registerURL("import_styles.css", "text/css");
290 registerURL("do_not_serialize.png", "image.png", "image/png");
290 registerURL("red_background.png", "image.png", "image/png"); 291 registerURL("red_background.png", "image.png", "image/png");
291 registerURL("orange_background.png", "image.png", "image/png"); 292 registerURL("orange_background.png", "image.png", "image/png");
292 registerURL("yellow_background.png", "image.png", "image/png"); 293 registerURL("yellow_background.png", "image.png", "image/png");
293 registerURL("green_background.png", "image.png", "image/png"); 294 registerURL("green_background.png", "image.png", "image/png");
294 registerURL("blue_background.png", "image.png", "image/png"); 295 registerURL("blue_background.png", "image.png", "image/png");
295 registerURL("purple_background.png", "image.png", "image/png"); 296 registerURL("purple_background.png", "image.png", "image/png");
297 registerURL("pink_background.png", "image.png", "image/png");
298 registerURL("brown_background.png", "image.png", "image/png");
296 registerURL("ul-dot.png", "image.png", "image/png"); 299 registerURL("ul-dot.png", "image.png", "image/png");
297 registerURL("ol-dot.png", "image.png", "image/png"); 300 registerURL("ol-dot.png", "image.png", "image/png");
298 301
299 serialize("css_test_page.html"); 302 serialize("css_test_page.html");
300 303
301 EXPECT_EQ(12U, getResources().size()); 304 EXPECT_EQ(14U, getResources().size());
305
306 EXPECT_FALSE(isSerialized("do_not_serialize.png", "image/png"));
302 307
303 EXPECT_TRUE(isSerialized("css_test_page.html", "text/html")); 308 EXPECT_TRUE(isSerialized("css_test_page.html", "text/html"));
304 EXPECT_TRUE(isSerialized("link_styles.css", "text/css")); 309 EXPECT_TRUE(isSerialized("link_styles.css", "text/css"));
305 EXPECT_TRUE(isSerialized("import_styles.css", "text/css")); 310 EXPECT_TRUE(isSerialized("import_styles.css", "text/css"));
306 EXPECT_TRUE(isSerialized("import_style_from_link.css", "text/css")); 311 EXPECT_TRUE(isSerialized("import_style_from_link.css", "text/css"));
307 EXPECT_TRUE(isSerialized("red_background.png", "image/png")); 312 EXPECT_TRUE(isSerialized("red_background.png", "image/png"));
308 EXPECT_TRUE(isSerialized("orange_background.png", "image/png")); 313 EXPECT_TRUE(isSerialized("orange_background.png", "image/png"));
309 EXPECT_TRUE(isSerialized("yellow_background.png", "image/png")); 314 EXPECT_TRUE(isSerialized("yellow_background.png", "image/png"));
310 EXPECT_TRUE(isSerialized("green_background.png", "image/png")); 315 EXPECT_TRUE(isSerialized("green_background.png", "image/png"));
311 EXPECT_TRUE(isSerialized("blue_background.png", "image/png")); 316 EXPECT_TRUE(isSerialized("blue_background.png", "image/png"));
312 EXPECT_TRUE(isSerialized("purple_background.png", "image/png")); 317 EXPECT_TRUE(isSerialized("purple_background.png", "image/png"));
318 EXPECT_TRUE(isSerialized("pink_background.png", "image/png"));
319 EXPECT_TRUE(isSerialized("brown_background.png", "image/png"));
313 EXPECT_TRUE(isSerialized("ul-dot.png", "image/png")); 320 EXPECT_TRUE(isSerialized("ul-dot.png", "image/png"));
314 EXPECT_TRUE(isSerialized("ol-dot.png", "image/png")); 321 EXPECT_TRUE(isSerialized("ol-dot.png", "image/png"));
315 } 322 }
316 323
317 TEST_F(PageSerializerTest, CSSImport) 324 TEST_F(PageSerializerTest, CSSImport)
318 { 325 {
319 setBaseFolder("pageserializer/css/"); 326 setBaseFolder("pageserializer/css/");
320 327
321 registerURL("import.html", "text/html"); 328 registerURL("import.html", "text/html");
322 registerURL("import/base.css", "text/css"); 329 registerURL("import/base.css", "text/css");
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 registerURL("namespace_element.html", "text/html"); 434 registerURL("namespace_element.html", "text/html");
428 435
429 serialize("namespace_element.html"); 436 serialize("namespace_element.html");
430 437
431 EXPECT_EQ(1U, getResources().size()); 438 EXPECT_EQ(1U, getResources().size());
432 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html")); 439 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html"));
433 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(), 0U); 440 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(), 0U);
434 } 441 }
435 442
436 } // namespace blink 443 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/PageSerializer.cpp ('k') | Source/web/tests/data/pageserializer/css/css_test_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698