| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "platform/text/BidiResolver.h" | 32 #include "platform/text/BidiResolver.h" |
| 33 | 33 |
| 34 #include "platform/text/BidiTestHarness.h" | 34 #include "platform/text/BidiTestHarness.h" |
| 35 #include "platform/text/TextRunIterator.h" | 35 #include "platform/text/TextRunIterator.h" |
| 36 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
| 37 #include <fstream> | 37 #include <fstream> |
| 38 #include <gtest/gtest.h> | 38 #include <gtest/gtest.h> |
| 39 | 39 |
| 40 namespace { | 40 namespace blink { |
| 41 | |
| 42 using namespace WTF; | |
| 43 using namespace blink; | |
| 44 | 41 |
| 45 TEST(BidiResolver, Basic) | 42 TEST(BidiResolver, Basic) |
| 46 { | 43 { |
| 47 bool hasStrongDirectionality; | 44 bool hasStrongDirectionality; |
| 48 String value("foo"); | 45 String value("foo"); |
| 49 TextRun run(value); | 46 TextRun run(value); |
| 50 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; | 47 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; |
| 51 bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()
)); | 48 bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()
)); |
| 52 bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0)); | 49 bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0)); |
| 53 TextDirection direction = bidiResolver.determineParagraphDirectionality(&has
StrongDirectionality); | 50 TextDirection direction = bidiResolver.determineParagraphDirectionality(&has
StrongDirectionality); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 281 |
| 285 // The unittest harness only pays attention to GTest output, so we verify | 282 // The unittest harness only pays attention to GTest output, so we verify |
| 286 // that the tests behaved as expected: | 283 // that the tests behaved as expected: |
| 287 EXPECT_EQ(352098u, runner.m_testsRun); | 284 EXPECT_EQ(352098u, runner.m_testsRun); |
| 288 EXPECT_EQ(418143u, runner.m_testsSkipped); | 285 EXPECT_EQ(418143u, runner.m_testsSkipped); |
| 289 EXPECT_EQ(0u, runner.m_ignoredCharFailures); | 286 EXPECT_EQ(0u, runner.m_ignoredCharFailures); |
| 290 EXPECT_EQ(44882u, runner.m_levelFailures); | 287 EXPECT_EQ(44882u, runner.m_levelFailures); |
| 291 EXPECT_EQ(19151u, runner.m_orderFailures); | 288 EXPECT_EQ(19151u, runner.m_orderFailures); |
| 292 } | 289 } |
| 293 | 290 |
| 294 } | 291 } // namespace blink |
| OLD | NEW |