Commit 77b028cf authored by karandeepb's avatar karandeepb Committed by Commit bot

Cleanup render text tests to use RenderTextTestApi.

Currently, the RenderText classes provide access to their private/protected
members for tests using FRIEND_TEST_ALL_PREFIXES. This CL removes the need for
these macros by adding helpers to RenderTextTestApi and the test fixture
classes- RenderTextHarfBuzzTest and RenderTextMacTest.

BUG=none

Review-Url: https://codereview.chromium.org/2346733002
Cr-Commit-Position: refs/heads/master@{#419083}
parent 063214b8
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/gtest_prod_util.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
...@@ -650,40 +649,6 @@ class GFX_EXPORT RenderText { ...@@ -650,40 +649,6 @@ class GFX_EXPORT RenderText {
private: private:
friend class test::RenderTextTestApi; friend class test::RenderTextTestApi;
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, DefaultStyles);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SetStyles);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, ApplyStyles);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, AppendTextKeepsStyles);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, ObscuredText);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, RevealObscuredText);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, ElidedText);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, ElidedObscuredText);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, TruncatedText);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, TruncatedObscuredText);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GraphemePositions);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, MinLineHeight);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, EdgeSelectionModels);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GetTextOffset);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GetTextOffsetHorizontalDefaultInRTL);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_MinWidth);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_NormalWidth);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_SufficientWidth);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_Newline);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_WordWrapBehavior);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
Multiline_LineBreakerBehavior);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
Multiline_SurrogatePairsOrCombiningChars);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_ZeroWidthChars);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, NewlineWithoutMultilineFlag);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, GlyphBounds);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest,
MoveCursorLeftRight_MeiryoUILigatures);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth);
// Set the cursor to |position|, with the caret trailing the previous // Set the cursor to |position|, with the caret trailing the previous
// grapheme, or if there is no previous grapheme, leading the cursor position. // grapheme, or if there is no previous grapheme, leading the cursor position.
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <memory> #include <memory>
#include "base/gtest_prod_util.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_vector.h" #include "base/memory/scoped_vector.h"
#include "third_party/harfbuzz-ng/src/hb.h" #include "third_party/harfbuzz-ng/src/hb.h"
...@@ -178,30 +177,7 @@ class GFX_EXPORT RenderTextHarfBuzz : public RenderText { ...@@ -178,30 +177,7 @@ class GFX_EXPORT RenderTextHarfBuzz : public RenderText {
private: private:
friend class test::RenderTextTestApi; friend class test::RenderTextTestApi;
friend class RenderTextHarfBuzzTest;
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
Multiline_HorizontalAlignment);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_NormalWidth);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_WordWrapBehavior);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, HarfBuzz_RunDirection);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
HarfBuzz_HorizontalPositions);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
HarfBuzz_BreakRunsByUnicodeBlocks);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, HarfBuzz_BreakRunsByEmoji);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, HarfBuzz_BreakRunsByAscii);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
HarfBuzz_SubglyphGraphemeCases);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
HarfBuzz_SubglyphGraphemePartition);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, HarfBuzz_NonExistentFont);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, HarfBuzz_UniscribeFallback);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, HarfBuzz_UnicodeFallback);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
Multiline_LineBreakerBehavior);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest,
Multiline_SurrogatePairsOrCombiningChars);
FRIEND_TEST_ALL_PREFIXES(RenderTextHarfBuzzTest, Multiline_ZeroWidthChars);
// Specify the width of a glyph for test. The width of glyphs is very // Specify the width of a glyph for test. The width of glyphs is very
// platform-dependent and environment-dependent. Otherwise multiline test // platform-dependent and environment-dependent. Otherwise multiline test
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/gtest_prod_util.h"
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
#include "base/macros.h" #include "base/macros.h"
#include "ui/gfx/gfx_export.h" #include "ui/gfx/gfx_export.h"
...@@ -60,7 +59,7 @@ class GFX_EXPORT RenderTextMac : public RenderText { ...@@ -60,7 +59,7 @@ class GFX_EXPORT RenderTextMac : public RenderText {
void DrawVisualText(internal::SkiaTextRenderer* renderer) override; void DrawVisualText(internal::SkiaTextRenderer* renderer) override;
private: private:
FRIEND_TEST_ALL_PREFIXES(RenderTextMacTest, Mac_ElidedText); friend class RenderTextMacTest;
struct TextRun { struct TextRun {
CTRunRef ct_run; CTRunRef ct_run;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment