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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp

Issue 2967013002: Be explicit about namespace testing to not mix it with blink::testing (Closed)
Patch Set: Dropped mojo parts that need another review. Created 3 years, 5 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/fonts/ScriptRunIterator.h" 5 #include "platform/fonts/ScriptRunIterator.h"
6 6
7 #include <string> 7 #include <string>
8 #include "platform/wtf/Assertions.h" 8 #include "platform/wtf/Assertions.h"
9 #include "platform/wtf/Threading.h" 9 #include "platform/wtf/Threading.h"
10 #include "platform/wtf/text/WTFString.h" 10 #include "platform/wtf/text/WTFString.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 kGreek2 + kLatin, 277 kGreek2 + kLatin,
278 kGreek2 + kHan, 278 kGreek2 + kHan,
279 kLatin3 + kHan2 + kGreek, 279 kLatin3 + kHan2 + kGreek,
280 kLatin3 + kGreek2 + kHan, 280 kLatin3 + kGreek2 + kHan,
281 kHan3 + kLatin2 + kGreek, 281 kHan3 + kLatin2 + kGreek,
282 kHan3 + kGreek2 + kLatin, 282 kHan3 + kGreek2 + kLatin,
283 kGreek3 + kLatin2 + kHan, 283 kGreek3 + kLatin2 + kHan,
284 kGreek3 + kHan2 + kLatin, 284 kGreek3 + kHan2 + kLatin,
285 }; 285 };
286 286
287 class ScriptRunIteratorTest : public testing::Test { 287 class ScriptRunIteratorTest : public ::testing::Test {
288 protected: 288 protected:
289 void CheckRuns(const Vector<TestRun>& runs) { 289 void CheckRuns(const Vector<TestRun>& runs) {
290 String text(g_empty_string16_bit); 290 String text(g_empty_string16_bit);
291 Vector<ExpectedRun> expect; 291 Vector<ExpectedRun> expect;
292 for (auto& run : runs) { 292 for (auto& run : runs) {
293 text.append(String::FromUTF8(run.text.c_str())); 293 text.append(String::FromUTF8(run.text.c_str()));
294 expect.push_back(ExpectedRun(text.length(), run.code)); 294 expect.push_back(ExpectedRun(text.length(), run.code));
295 } 295 }
296 ScriptRunIterator script_run_iterator(text.Characters16(), text.length()); 296 ScriptRunIterator script_run_iterator(text.Characters16(), text.length());
297 VerifyRuns(&script_run_iterator, expect); 297 VerifyRuns(&script_run_iterator, expect);
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 } 607 }
608 608
609 TEST_F(ScriptRunIteratorTest, OddLatinString) { 609 TEST_F(ScriptRunIteratorTest, OddLatinString) {
610 CHECK_RUNS({{"ç̈", USCRIPT_LATIN}}); 610 CHECK_RUNS({{"ç̈", USCRIPT_LATIN}});
611 } 611 }
612 612
613 TEST_F(ScriptRunIteratorTest, CommonMalayalam) { 613 TEST_F(ScriptRunIteratorTest, CommonMalayalam) {
614 CHECK_RUNS({{"100-ാം", USCRIPT_MALAYALAM}}); 614 CHECK_RUNS({{"100-ാം", USCRIPT_MALAYALAM}});
615 } 615 }
616 616
617 class ScriptRunIteratorICUDataTest : public testing::Test { 617 class ScriptRunIteratorICUDataTest : public ::testing::Test {
618 public: 618 public:
619 ScriptRunIteratorICUDataTest() 619 ScriptRunIteratorICUDataTest()
620 : max_extensions_(0), max_extensions_codepoint_(0xffff) { 620 : max_extensions_(0), max_extensions_codepoint_(0xffff) {
621 int max_extensions = 0; 621 int max_extensions = 0;
622 UChar32 max_extensionscp = 0; 622 UChar32 max_extensionscp = 0;
623 for (UChar32 cp = 0; cp < 0x11000; ++cp) { 623 for (UChar32 cp = 0; cp < 0x11000; ++cp) {
624 UErrorCode status = U_ZERO_ERROR; 624 UErrorCode status = U_ZERO_ERROR;
625 int count = uscript_getScriptExtensions(cp, 0, 0, &status); 625 int count = uscript_getScriptExtensions(cp, 0, 0, &status);
626 if (count > max_extensions) { 626 if (count > max_extensions) {
627 max_extensions = count; 627 max_extensions = count;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 } 678 }
679 } 679 }
680 } 680 }
681 681
682 // ZWJ is \u200D Cf (Format, other) and its script is inherited. I'm going to 682 // ZWJ is \u200D Cf (Format, other) and its script is inherited. I'm going to
683 // ignore this for now, as I think it shouldn't matter which run it ends up 683 // ignore this for now, as I think it shouldn't matter which run it ends up
684 // in. HarfBuzz needs to be able to use it as context and shape each 684 // in. HarfBuzz needs to be able to use it as context and shape each
685 // neighboring character appropriately no matter what run it got assigned to. 685 // neighboring character appropriately no matter what run it got assigned to.
686 686
687 } // namespace blink 687 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698