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

Unified Diff: ui/views/controls/textfield/textfield_unittest.cc

Issue 205253003: [master] x11: Move X event handling out of the message-pump. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix-merge Created 6 years, 9 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/menu/menu_message_pump_dispatcher_win.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/controls/textfield/textfield_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 861b24dd5ecda4361fbeecc6b36df7b7be915ebe..fa76e2640033ceefdb7cea2409ea93cf63d44a47 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -28,6 +28,7 @@
#include "ui/base/ui_base_switches_util.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
+#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/render_text.h"
#include "ui/views/controls/textfield/textfield_controller.h"
#include "ui/views/controls/textfield/textfield_model.h"
@@ -654,6 +655,8 @@ TEST_F(TextfieldTest, FocusTraversalTest) {
}
TEST_F(TextfieldTest, ContextMenuDisplayTest) {
+ scoped_ptr<ui::PlatformEventSource> event_source =
+ ui::PlatformEventSource::CreateDefault();
InitTextfield();
EXPECT_TRUE(textfield_->context_menu_controller());
textfield_->SetText(ASCIIToUTF16("hello world"));
@@ -744,8 +747,25 @@ TEST_F(TextfieldTest, DragToSelect) {
EXPECT_EQ(textfield_->text(), textfield_->GetSelectedText());
}
+class TextfieldDragAndDropTest : public TextfieldTest {
+ public:
+ TextfieldDragAndDropTest() {}
+ virtual ~TextfieldDragAndDropTest() {}
+
+ // TextfieldTest:
+ virtual void SetUp() OVERRIDE {
+ event_source_ = ui::PlatformEventSource::CreateDefault();
+ TextfieldTest::SetUp();
+ }
+
+ private:
+ scoped_ptr<ui::PlatformEventSource> event_source_;
+
+ DISALLOW_COPY_AND_ASSIGN(TextfieldDragAndDropTest);
+};
+
#if defined(OS_WIN)
-TEST_F(TextfieldTest, DragAndDrop_AcceptDrop) {
+TEST_F(TextfieldDragAndDropTest, DragAndDrop_AcceptDrop) {
InitTextfield();
textfield_->SetText(ASCIIToUTF16("hello world"));
@@ -797,7 +817,7 @@ TEST_F(TextfieldTest, DragAndDrop_AcceptDrop) {
}
#endif
-TEST_F(TextfieldTest, DragAndDrop_InitiateDrag) {
+TEST_F(TextfieldDragAndDropTest, DragAndDrop_InitiateDrag) {
InitTextfield();
textfield_->SetText(ASCIIToUTF16("hello string world"));
@@ -844,7 +864,7 @@ TEST_F(TextfieldTest, DragAndDrop_InitiateDrag) {
textfield_->GetDragOperationsForView(textfield_, kStringPoint));
}
-TEST_F(TextfieldTest, DragAndDrop_ToTheRight) {
+TEST_F(TextfieldDragAndDropTest, DragAndDrop_ToTheRight) {
InitTextfield();
textfield_->SetText(ASCIIToUTF16("hello world"));
@@ -897,7 +917,7 @@ TEST_F(TextfieldTest, DragAndDrop_ToTheRight) {
EXPECT_STR_EQ("h welloorld", textfield_->text());
}
-TEST_F(TextfieldTest, DragAndDrop_ToTheLeft) {
+TEST_F(TextfieldDragAndDropTest, DragAndDrop_ToTheLeft) {
InitTextfield();
textfield_->SetText(ASCIIToUTF16("hello world"));
@@ -950,7 +970,7 @@ TEST_F(TextfieldTest, DragAndDrop_ToTheLeft) {
EXPECT_STR_EQ("h worlellod", textfield_->text());
}
-TEST_F(TextfieldTest, DragAndDrop_Canceled) {
+TEST_F(TextfieldDragAndDropTest, DragAndDrop_Canceled) {
InitTextfield();
textfield_->SetText(ASCIIToUTF16("hello world"));
« no previous file with comments | « ui/views/controls/menu/menu_message_pump_dispatcher_win.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698