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

Unified Diff: ui/views/widget/widget_interactive_uitest.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/views.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget_interactive_uitest.cc
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc
index 59f966ba05fadfe495ea54279edec654cdf1ec2f..45026a9eb1e79064bc024dcb5279e2ab30850b83 100644
--- a/ui/views/widget/widget_interactive_uitest.cc
+++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -21,6 +21,7 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gl_surface.h"
#include "ui/views/controls/textfield/textfield.h"
+#include "ui/views/controls/textfield/textfield_test_api.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/touchui/touch_selection_controller_impl.h"
#include "ui/views/widget/widget.h"
@@ -170,24 +171,17 @@ class WidgetTestInteractive : public WidgetTest {
}
protected:
- void ShowTouchSelectionQuickMenuImmediately(Textfield* textfield) {
- DCHECK(textfield);
- DCHECK(textfield->touch_selection_controller_);
- TouchSelectionControllerImpl* controller =
- static_cast<TouchSelectionControllerImpl*>(
- textfield->touch_selection_controller_.get());
+ static void ShowQuickMenuImmediately(
+ TouchSelectionControllerImpl* controller) {
+ DCHECK(controller);
if (controller->context_menu_timer_.IsRunning()) {
controller->context_menu_timer_.Stop();
controller->ContextMenuTimerFired();
}
}
- bool TouchSelectionQuickMenuIsVisible(Textfield* textfield) {
- DCHECK(textfield);
- DCHECK(textfield->touch_selection_controller_);
- TouchSelectionControllerImpl* controller =
- static_cast<TouchSelectionControllerImpl*>(
- textfield->touch_selection_controller_.get());
+ static bool IsQuickMenuVisible(TouchSelectionControllerImpl* controller) {
+ DCHECK(controller);
return controller->context_menu_ && controller->context_menu_->visible();
}
};
@@ -768,16 +762,19 @@ TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) {
widget.Show();
textfield->RequestFocus();
textfield->SelectAll(true);
+ TextfieldTestApi textfield_test_api(textfield);
RunPendingMessages();
aura::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow());
generator.GestureTapAt(gfx::Point(10, 10));
- ShowTouchSelectionQuickMenuImmediately(textfield);
+ ShowQuickMenuImmediately(static_cast<TouchSelectionControllerImpl*>(
+ textfield_test_api.touch_selection_controller()));
EXPECT_TRUE(textfield->HasFocus());
EXPECT_TRUE(widget.IsActive());
- EXPECT_TRUE(TouchSelectionQuickMenuIsVisible(textfield));
+ EXPECT_TRUE(IsQuickMenuVisible(static_cast<TouchSelectionControllerImpl*>(
+ textfield_test_api.touch_selection_controller())));
}
namespace {
« no previous file with comments | « ui/views/views.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698