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

Side by Side Diff: ui/views/event_monitor_unittest.cc

Issue 2010083002: views/mus: Run some more tests from views_unittests in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/macros.h" 5 #include "base/macros.h"
6 #include "ui/events/test/event_generator.h" 6 #include "ui/events/test/event_generator.h"
7 #include "ui/events/test/test_event_handler.h" 7 #include "ui/events/test/test_event_handler.h"
8 #include "ui/views/event_monitor.h" 8 #include "ui/views/event_monitor.h"
9 #include "ui/views/test/widget_test.h" 9 #include "ui/views/test/widget_test.h"
10 10
11 namespace views { 11 namespace views {
12 namespace test { 12 namespace test {
13 13
14 class EventMonitorTest : public WidgetTest { 14 class EventMonitorTest : public WidgetTest {
15 public: 15 public:
16 EventMonitorTest() : widget_(nullptr) {} 16 EventMonitorTest() : widget_(nullptr) {}
17 17
18 // testing::Test: 18 // testing::Test:
19 void SetUp() override { 19 void SetUp() override {
20 WidgetTest::SetUp(); 20 WidgetTest::SetUp();
21 widget_ = CreateTopLevelNativeWidget(); 21 widget_ = CreateTopLevelNativeWidget();
22 widget_->SetSize(gfx::Size(100, 100)); 22 widget_->SetSize(gfx::Size(100, 100));
23 widget_->Show(); 23 widget_->Show();
24 generator_.reset( 24 if (IsMus()) {
25 new ui::test::EventGenerator(GetContext(), widget_->GetNativeWindow())); 25 generator_.reset(
26 new ui::test::EventGenerator(widget_->GetNativeWindow()));
27 } else {
28 generator_.reset(new ui::test::EventGenerator(
29 GetContext(), widget_->GetNativeWindow()));
30 }
26 generator_->set_targeting_application(true); 31 generator_->set_targeting_application(true);
27 } 32 }
28 void TearDown() override { 33 void TearDown() override {
29 widget_->CloseNow(); 34 widget_->CloseNow();
30 WidgetTest::TearDown(); 35 WidgetTest::TearDown();
31 } 36 }
32 37
33 protected: 38 protected:
34 Widget* widget_; 39 Widget* widget_;
35 std::unique_ptr<ui::test::EventGenerator> generator_; 40 std::unique_ptr<ui::test::EventGenerator> generator_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 75
71 generator_->ClickLeftButton(); 76 generator_->ClickLeftButton();
72 EXPECT_EQ(0, handler_.num_mouse_events()); 77 EXPECT_EQ(0, handler_.num_mouse_events());
73 78
74 monitor.reset(); 79 monitor.reset();
75 widget2->CloseNow(); 80 widget2->CloseNow();
76 } 81 }
77 82
78 } // namespace test 83 } // namespace test
79 } // namespace views 84 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698