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

Side by Side Diff: ui/chromeos/ime/candidate_view_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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/base/x/x11_util.cc ('k') | ui/chromeos/ime/candidate_window_view.cc » ('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 "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
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
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
OLDNEW
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/chromeos/ime/candidate_window_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698