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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Mock window.resizeTo that is expected to be called after navigate to a | 72 // Mock window.resizeTo that is expected to be called after navigate to a |
73 // new virtual keyboard. | 73 // new virtual keyboard. |
74 ui()->GetKeyboardWindow()->SetBounds(init_bounds); | 74 ui()->GetKeyboardWindow()->SetBounds(init_bounds); |
75 } | 75 } |
76 | 76 |
77 bool IsKeyboardVisible() const { | 77 bool IsKeyboardVisible() const { |
78 return keyboard::KeyboardController::GetInstance()->keyboard_visible(); | 78 return keyboard::KeyboardController::GetInstance()->keyboard_visible(); |
79 } | 79 } |
80 | 80 |
81 private: | 81 private: |
82 scoped_ptr<ui::DummyTextInputClient> client; | 82 std::unique_ptr<ui::DummyTextInputClient> client; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWebContentTest); | 84 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWebContentTest); |
85 }; | 85 }; |
86 | 86 |
87 // Test for crbug.com/404340. After enabling an IME in a different extension, | 87 // Test for crbug.com/404340. After enabling an IME in a different extension, |
88 // its virtual keyboard should not become visible if previous one is not. | 88 // its virtual keyboard should not become visible if previous one is not. |
89 IN_PROC_BROWSER_TEST_F(VirtualKeyboardWebContentTest, | 89 IN_PROC_BROWSER_TEST_F(VirtualKeyboardWebContentTest, |
90 EnableIMEInDifferentExtension) { | 90 EnableIMEInDifferentExtension) { |
91 gfx::Rect test_bounds(0, 0, 0, kKeyboardHeightForTest); | 91 gfx::Rect test_bounds(0, 0, 0, kKeyboardHeightForTest); |
92 FocusEditableNodeAndShowKeyboard(test_bounds); | 92 FocusEditableNodeAndShowKeyboard(test_bounds); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 ->GetVisibleViewportSize() | 212 ->GetVisibleViewportSize() |
213 .height(), | 213 .height(), |
214 non_ime_window_visible_height); | 214 non_ime_window_visible_height); |
215 // Ime window should have not be affected by virtual keyboard. | 215 // Ime window should have not be affected by virtual keyboard. |
216 EXPECT_EQ(ime_app_window->web_contents() | 216 EXPECT_EQ(ime_app_window->web_contents() |
217 ->GetRenderWidgetHostView() | 217 ->GetRenderWidgetHostView() |
218 ->GetVisibleViewportSize() | 218 ->GetVisibleViewportSize() |
219 .height(), | 219 .height(), |
220 ime_window_visible_height); | 220 ime_window_visible_height); |
221 } | 221 } |
OLD | NEW |