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

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

Issue 1424503006: Page Serializer: Specify encoding for serialized CSS files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nfc-css
Patch Set: Review feedback Created 5 years, 1 month 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 | « third_party/WebKit/Source/core/page/PageSerializer.cpp ('k') | no next file » | 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 EXPECT_TRUE(isSerialized("orange_background.png", "image/png")); 340 EXPECT_TRUE(isSerialized("orange_background.png", "image/png"));
341 EXPECT_TRUE(isSerialized("yellow_background.png", "image/png")); 341 EXPECT_TRUE(isSerialized("yellow_background.png", "image/png"));
342 EXPECT_TRUE(isSerialized("green_background.png", "image/png")); 342 EXPECT_TRUE(isSerialized("green_background.png", "image/png"));
343 EXPECT_TRUE(isSerialized("blue_background.png", "image/png")); 343 EXPECT_TRUE(isSerialized("blue_background.png", "image/png"));
344 EXPECT_TRUE(isSerialized("purple_background.png", "image/png")); 344 EXPECT_TRUE(isSerialized("purple_background.png", "image/png"));
345 EXPECT_TRUE(isSerialized("pink_background.png", "image/png")); 345 EXPECT_TRUE(isSerialized("pink_background.png", "image/png"));
346 EXPECT_TRUE(isSerialized("brown_background.png", "image/png")); 346 EXPECT_TRUE(isSerialized("brown_background.png", "image/png"));
347 EXPECT_TRUE(isSerialized("ul-dot.png", "image/png")); 347 EXPECT_TRUE(isSerialized("ul-dot.png", "image/png"));
348 EXPECT_TRUE(isSerialized("ol-dot.png", "image/png")); 348 EXPECT_TRUE(isSerialized("ol-dot.png", "image/png"));
349 349
350 // Ensure encodings are specified.
351 EXPECT_TRUE(getSerializedData("link_styles.css", "text/css").startsWith("@ch arset"));
352 EXPECT_TRUE(getSerializedData("import_styles.css", "text/css").startsWith("@ charset"));
353 EXPECT_TRUE(getSerializedData("import_style_from_link.css", "text/css").star tsWith("@charset"));
354 EXPECT_TRUE(getSerializedData("encoding.css", "text/css").startsWith("@chars et \"euc-kr\";"));
355
350 // Ensure that stylesheet contents are not NFC-normalized before encoding. 356 // Ensure that stylesheet contents are not NFC-normalized before encoding.
351 EXPECT_TRUE(getSerializedData("encoding.css", "text/css").contains("\xE4\xC5 \xD1\xE2")); 357 EXPECT_TRUE(getSerializedData("encoding.css", "text/css").contains("\xE4\xC5 \xD1\xE2"));
352 EXPECT_FALSE(getSerializedData("encoding.css", "text/css").contains("\xE4\xC 5\xE4\xC5")); 358 EXPECT_FALSE(getSerializedData("encoding.css", "text/css").contains("\xE4\xC 5\xE4\xC5"));
353 } 359 }
354 360
355 TEST_F(PageSerializerTest, CSSImport) 361 TEST_F(PageSerializerTest, CSSImport)
356 { 362 {
357 setBaseFolder("pageserializer/css/"); 363 setBaseFolder("pageserializer/css/");
358 364
359 registerURL("import.html", "text/html"); 365 registerURL("import.html", "text/html");
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 EXPECT_EQ("saved from url=(0015)http://foo.com/", PageSerializer::markOfTheW ebDeclaration(KURL(ParsedURLString, "http://foo.com"))); 521 EXPECT_EQ("saved from url=(0015)http://foo.com/", PageSerializer::markOfTheW ebDeclaration(KURL(ParsedURLString, "http://foo.com")));
516 EXPECT_EQ("saved from url=(0015)http://f-o.com/", PageSerializer::markOfTheW ebDeclaration(KURL(ParsedURLString, "http://f-o.com"))); 522 EXPECT_EQ("saved from url=(0015)http://f-o.com/", PageSerializer::markOfTheW ebDeclaration(KURL(ParsedURLString, "http://f-o.com")));
517 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", PageSerializer::markOf TheWebDeclaration(KURL(ParsedURLString, "http://foo.com--"))); 523 EXPECT_EQ("saved from url=(0019)http://foo.com-%2D/", PageSerializer::markOf TheWebDeclaration(KURL(ParsedURLString, "http://foo.com--")));
518 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", PageSerializer::m arkOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->"))); 524 EXPECT_EQ("saved from url=(0024)http://f-%2D.com-%2D%3E/", PageSerializer::m arkOfTheWebDeclaration(KURL(ParsedURLString, "http://f--.com-->")));
519 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", PageSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--"))); 525 EXPECT_EQ("saved from url=(0020)http://foo.com/?-%2D", PageSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com?--")));
520 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", PageSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--"))); 526 EXPECT_EQ("saved from url=(0020)http://foo.com/#-%2D", PageSerializer::markO fTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#--")));
521 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", PageSerializer: :markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz"))); 527 EXPECT_EQ("saved from url=(0026)http://foo.com/#bar-%2Dbaz", PageSerializer: :markOfTheWebDeclaration(KURL(ParsedURLString, "http://foo.com#bar--baz")));
522 } 528 }
523 529
524 } // namespace blink 530 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/PageSerializer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698