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

Side by Side Diff: third_party/WebKit/Source/platform/wtf/text/WTFStringTest.cpp

Issue 2821633002: Remove WTF::String::DeprecatedUpper() (Closed)
Patch Set: Created 3 years, 8 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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 EXPECT_STREQ("link", String("LINK").DeprecatedLower().Ascii().Data()); 436 EXPECT_STREQ("link", String("LINK").DeprecatedLower().Ascii().Data());
437 EXPECT_STREQ("link", String("lInk").DeprecatedLower().Ascii().Data()); 437 EXPECT_STREQ("link", String("lInk").DeprecatedLower().Ascii().Data());
438 EXPECT_STREQ("lin\xE1k", 438 EXPECT_STREQ("lin\xE1k",
439 String("lIn\xC1k").DeprecatedLower().Latin1().Data()); 439 String("lIn\xC1k").DeprecatedLower().Latin1().Data());
440 // U+212A -> k 440 // U+212A -> k
441 EXPECT_STREQ( 441 EXPECT_STREQ(
442 "link", 442 "link",
443 String::FromUTF8("LIN\xE2\x84\xAA").DeprecatedLower().Utf8().Data()); 443 String::FromUTF8("LIN\xE2\x84\xAA").DeprecatedLower().Utf8().Data());
444 } 444 }
445 445
446 TEST(StringTest, DeprecatedUpper) {
447 EXPECT_STREQ("CROSS", String("cross").DeprecatedUpper().Utf8().Data());
448 // U+017F -> S
449 EXPECT_STREQ(
450 "CROSS",
451 String::FromUTF8("cro\xC5\xBFs").DeprecatedUpper().Utf8().Data());
452 }
453
454 TEST(StringTest, Ensure16Bit) { 446 TEST(StringTest, Ensure16Bit) {
455 String string8("8bit"); 447 String string8("8bit");
456 EXPECT_TRUE(string8.Is8Bit()); 448 EXPECT_TRUE(string8.Is8Bit());
457 string8.Ensure16Bit(); 449 string8.Ensure16Bit();
458 EXPECT_FALSE(string8.Is8Bit()); 450 EXPECT_FALSE(string8.Is8Bit());
459 EXPECT_EQ("8bit", string8); 451 EXPECT_EQ("8bit", string8);
460 452
461 String string16(reinterpret_cast<const UChar*>(u"16bit")); 453 String string16(reinterpret_cast<const UChar*>(u"16bit"));
462 EXPECT_FALSE(string16.Is8Bit()); 454 EXPECT_FALSE(string16.Is8Bit());
463 string16.Ensure16Bit(); 455 string16.Ensure16Bit();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 EXPECT_EQ(CString("<null>"), ToCStringThroughPrinter(String())); 504 EXPECT_EQ(CString("<null>"), ToCStringThroughPrinter(String()));
513 505
514 static const UChar kUnicodeSample[] = {0x30C6, 0x30B9, 506 static const UChar kUnicodeSample[] = {0x30C6, 0x30B9,
515 0x30C8}; // "Test" in Japanese. 507 0x30C8}; // "Test" in Japanese.
516 EXPECT_EQ(CString("\"\\u30C6\\u30B9\\u30C8\""), 508 EXPECT_EQ(CString("\"\\u30C6\\u30B9\\u30C8\""),
517 ToCStringThroughPrinter( 509 ToCStringThroughPrinter(
518 String(kUnicodeSample, WTF_ARRAY_LENGTH(kUnicodeSample)))); 510 String(kUnicodeSample, WTF_ARRAY_LENGTH(kUnicodeSample))));
519 } 511 }
520 512
521 } // namespace WTF 513 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/wtf/text/WTFString.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698