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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 2556083002: Don't subtract border from max size for display rect. (Closed)
Patch Set: RenderTextTestApi Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/render_text_unittest.cc
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index 5091fcacd3d871eee9fa0d9b21d1095453e3d7dd..3039b21f90125fce6ae2199951f00110a74dcb64 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -36,6 +36,7 @@
#include "ui/gfx/range/range.h"
#include "ui/gfx/range/range_f.h"
#include "ui/gfx/render_text_harfbuzz.h"
+#include "ui/gfx/test/render_text_test_api.h"
#include "ui/gfx/text_utils.h"
#if defined(OS_WIN)
@@ -55,73 +56,6 @@ using base::WideToUTF16;
using base::WideToUTF8;
namespace gfx {
-namespace test {
-
-class RenderTextTestApi {
- public:
- RenderTextTestApi(RenderText* render_text) : render_text_(render_text) {}
-
- static SkPaint& GetRendererPaint(internal::SkiaTextRenderer* renderer) {
- return renderer->paint_;
- }
-
- // Callers should ensure that the associated RenderText object is a
- // RenderTextHarfBuzz instance.
- internal::TextRunList* GetHarfBuzzRunList() {
- RenderTextHarfBuzz* render_text =
- static_cast<RenderTextHarfBuzz*>(render_text_);
- return render_text->GetRunList();
- }
-
- void DrawVisualText(internal::SkiaTextRenderer* renderer) {
- render_text_->EnsureLayout();
- render_text_->DrawVisualText(renderer);
- }
-
- const BreakList<SkColor>& colors() const { return render_text_->colors(); }
-
- const BreakList<BaselineStyle>& baselines() const {
- return render_text_->baselines();
- }
-
- const BreakList<Font::Weight>& weights() const {
- return render_text_->weights();
- }
-
- const std::vector<BreakList<bool>>& styles() const {
- return render_text_->styles();
- }
-
- const std::vector<internal::Line>& lines() const {
- return render_text_->lines();
- }
-
- SelectionModel EdgeSelectionModel(VisualCursorDirection direction) {
- return render_text_->EdgeSelectionModel(direction);
- }
-
- size_t TextIndexToDisplayIndex(size_t index) {
- return render_text_->TextIndexToDisplayIndex(index);
- }
-
- size_t DisplayIndexToTextIndex(size_t index) {
- return render_text_->DisplayIndexToTextIndex(index);
- }
-
- void EnsureLayout() { render_text_->EnsureLayout(); }
-
- Vector2d GetAlignmentOffset(size_t line_number) {
- return render_text_->GetAlignmentOffset(line_number);
- }
-
- private:
- RenderText* render_text_;
-
- DISALLOW_COPY_AND_ASSIGN(RenderTextTestApi);
-};
-
-} // namespace test
-
namespace {
// An enum specifying the different RenderText implementations to be tested.

Powered by Google App Engine
This is Rietveld 408576698