OLD | NEW |
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 "ui/chromeos/ime/candidate_view.h" | 5 #include "ui/chromeos/ime/candidate_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 ui::test::EventGenerator* event_generator() { return event_generator_.get(); } | 103 ui::test::EventGenerator* event_generator() { return event_generator_.get(); } |
104 | 104 |
105 private: | 105 private: |
106 void ButtonPressed(views::Button* sender, const ui::Event& event) override { | 106 void ButtonPressed(views::Button* sender, const ui::Event& event) override { |
107 last_pressed_ = sender; | 107 last_pressed_ = sender; |
108 } | 108 } |
109 | 109 |
110 views::Widget* widget_; | 110 views::Widget* widget_; |
111 views::View* container_; | 111 views::View* container_; |
112 scoped_ptr<ui::test::EventGenerator> event_generator_; | 112 std::unique_ptr<ui::test::EventGenerator> event_generator_; |
113 views::View* last_pressed_; | 113 views::View* last_pressed_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(CandidateViewTest); | 115 DISALLOW_COPY_AND_ASSIGN(CandidateViewTest); |
116 }; | 116 }; |
117 | 117 |
118 TEST_F(CandidateViewTest, MouseHovers) { | 118 TEST_F(CandidateViewTest, MouseHovers) { |
119 GetCandidateAt(0)->SetHighlighted(true); | 119 GetCandidateAt(0)->SetHighlighted(true); |
120 | 120 |
121 int highlighted_count = 0; | 121 int highlighted_count = 0; |
122 EXPECT_EQ(0, GetHighlightedIndex(&highlighted_count)); | 122 EXPECT_EQ(0, GetHighlightedIndex(&highlighted_count)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 GetCandidateAt(1)->GetBoundsInScreen().CenterPoint()); | 176 GetCandidateAt(1)->GetBoundsInScreen().CenterPoint()); |
177 EXPECT_EQ(1, GetHighlightedIndex(&highlighted_count)); | 177 EXPECT_EQ(1, GetHighlightedIndex(&highlighted_count)); |
178 EXPECT_EQ(1, highlighted_count); | 178 EXPECT_EQ(1, highlighted_count); |
179 | 179 |
180 event_generator()->ReleaseLeftButton(); | 180 event_generator()->ReleaseLeftButton(); |
181 EXPECT_EQ(1, GetLastPressedIndexAndReset()); | 181 EXPECT_EQ(1, GetLastPressedIndexAndReset()); |
182 } | 182 } |
183 | 183 |
184 } // namespace ime | 184 } // namespace ime |
185 } // namespace ui | 185 } // namespace ui |
OLD | NEW |