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

Unified Diff: ui/views/touchui/touch_selection_controller_impl_unittest.cc

Issue 297733002: Deactivate omnibox touch editing on command execution (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed VIEWS_EXPORT from test api Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/touchui/touch_selection_controller_impl_unittest.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index 07d78c43240af25274a77d17abf2366d8749c063..83ff9cdb80289e8515d59c26836bf25477d28de8 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -16,6 +16,7 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/render_text.h"
#include "ui/views/controls/textfield/textfield.h"
+#include "ui/views/controls/textfield/textfield_test_api.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/touchui/touch_selection_controller_impl.h"
#include "ui/views/views_touch_selection_controller_factory.h"
@@ -97,6 +98,8 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
textfield_widget_->Show();
textfield_->RequestFocus();
+
+ textfield_test_api_.reset(new TextfieldTestApi(textfield_));
}
void CreateWidget() {
@@ -116,7 +119,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
}
gfx::Rect GetCursorRect(const gfx::SelectionModel& sel) {
- return textfield_->GetRenderText()->GetCursorBounds(sel, true);
+ return textfield_test_api_->GetRenderText()->GetCursorBounds(sel, true);
}
gfx::Point GetCursorPosition(const gfx::SelectionModel& sel) {
@@ -126,15 +129,15 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
TouchSelectionControllerImpl* GetSelectionController() {
return static_cast<TouchSelectionControllerImpl*>(
- textfield_->touch_selection_controller_.get());
+ textfield_test_api_->touch_selection_controller());
}
void StartTouchEditing() {
- textfield_->CreateTouchSelectionControllerAndNotifyIt();
+ textfield_test_api_->CreateTouchSelectionControllerAndNotifyIt();
}
void EndTouchEditing() {
- textfield_->touch_selection_controller_.reset();
+ textfield_test_api_->ResetTouchSelectionController();
}
void SimulateSelectionHandleDrag(gfx::Point p, int selection_handle) {
@@ -183,7 +186,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
}
gfx::RenderText* GetRenderText() {
- return textfield_->GetRenderText();
+ return textfield_test_api_->GetRenderText();
}
gfx::Point GetCursorHandleDragPoint() {
@@ -199,6 +202,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
Widget* widget_;
Textfield* textfield_;
+ scoped_ptr<TextfieldTestApi> textfield_test_api_;
scoped_ptr<ViewsTouchSelectionControllerFactory> views_tsc_factory_;
private:
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698