| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 EXPECT_EQ(cursor1_bounds.x() - cursor2_bounds.x(), | 167 EXPECT_EQ(cursor1_bounds.x() - cursor2_bounds.x(), |
| 168 mi1_bounds.x() - mi2_bounds.x()); | 168 mi1_bounds.x() - mi2_bounds.x()); |
| 169 EXPECT_EQ(cursor1_bounds.y() - cursor2_bounds.y(), | 169 EXPECT_EQ(cursor1_bounds.y() - cursor2_bounds.y(), |
| 170 mi1_bounds.y() - mi2_bounds.y()); | 170 mi1_bounds.y() - mi2_bounds.y()); |
| 171 EXPECT_EQ(mi1_bounds.width(), mi2_bounds.width()); | 171 EXPECT_EQ(mi1_bounds.width(), mi2_bounds.width()); |
| 172 EXPECT_EQ(mi1_bounds.height(), mi2_bounds.height()); | 172 EXPECT_EQ(mi1_bounds.height(), mi2_bounds.height()); |
| 173 | 173 |
| 174 const gfx::Rect screen_bounds = | 174 const gfx::Rect screen_bounds = |
| 175 ash::Shell::GetScreen()->GetDisplayMatching(cursor1_bounds).work_area(); | 175 gfx::Screen::GetScreen()->GetDisplayMatching(cursor1_bounds).work_area(); |
| 176 | 176 |
| 177 // Check if the location of the mode indicator is concidered with | 177 // Check if the location of the mode indicator is concidered with |
| 178 // the screen size. | 178 // the screen size. |
| 179 const gfx::Rect cursor3_bounds(100, screen_bounds.bottom() - 25, 1, 20); | 179 const gfx::Rect cursor3_bounds(100, screen_bounds.bottom() - 25, 1, 20); |
| 180 gfx::Rect mi3_bounds; | 180 gfx::Rect mi3_bounds; |
| 181 { | 181 { |
| 182 ScopedModeIndicatorObserverForTesting observer; | 182 ScopedModeIndicatorObserverForTesting observer; |
| 183 candidate_window->SetCursorBounds(cursor3_bounds, cursor3_bounds); | 183 candidate_window->SetCursorBounds(cursor3_bounds, cursor3_bounds); |
| 184 imm->GetActiveIMEState()->SwitchToNextInputMethod(); | 184 imm->GetActiveIMEState()->SwitchToNextInputMethod(); |
| 185 mi3_bounds = observer.last_bounds(); | 185 mi3_bounds = observer.last_bounds(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // When a new mode indicator is displayed, the previous one should be | 220 // When a new mode indicator is displayed, the previous one should be |
| 221 // closed. | 221 // closed. |
| 222 content::RunAllPendingInMessageLoop(); | 222 content::RunAllPendingInMessageLoop(); |
| 223 EXPECT_EQ(1UL, observer.widget_list_size()); | 223 EXPECT_EQ(1UL, observer.widget_list_size()); |
| 224 const views::Widget* widget2 = observer.widget_list()[0]; | 224 const views::Widget* widget2 = observer.widget_list()[0]; |
| 225 EXPECT_NE(widget1, widget2); | 225 EXPECT_NE(widget1, widget2); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 } // namespace input_method | 228 } // namespace input_method |
| 229 } // namespace chromeos | 229 } // namespace chromeos |
| OLD | NEW |