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/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 private: | 152 private: |
153 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardAppWindowTest); | 153 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardAppWindowTest); |
154 }; | 154 }; |
155 | 155 |
156 // Tests that ime window won't overscroll. See crbug.com/529880. | 156 // Tests that ime window won't overscroll. See crbug.com/529880. |
157 IN_PROC_BROWSER_TEST_F(VirtualKeyboardAppWindowTest, | 157 IN_PROC_BROWSER_TEST_F(VirtualKeyboardAppWindowTest, |
158 DisableOverscrollForImeWindow) { | 158 DisableOverscrollForImeWindow) { |
159 scoped_refptr<extensions::Extension> extension = | 159 scoped_refptr<extensions::Extension> extension = |
160 extensions::ExtensionBuilder() | 160 extensions::ExtensionBuilder() |
161 .SetManifest(std::move(extensions::DictionaryBuilder() | 161 .SetManifest(extensions::DictionaryBuilder() |
162 .Set("name", "test extension") | 162 .Set("name", "test extension") |
163 .Set("version", "1") | 163 .Set("version", "1") |
164 .Set("manifest_version", 2))) | 164 .Set("manifest_version", 2) |
| 165 .Build()) |
165 .Build(); | 166 .Build(); |
166 | 167 |
167 extensions::AppWindow::CreateParams non_ime_params; | 168 extensions::AppWindow::CreateParams non_ime_params; |
168 non_ime_params.frame = extensions::AppWindow::FRAME_NONE; | 169 non_ime_params.frame = extensions::AppWindow::FRAME_NONE; |
169 extensions::AppWindow* non_ime_app_window = | 170 extensions::AppWindow* non_ime_app_window = |
170 CreateAppWindowFromParams(extension.get(), non_ime_params); | 171 CreateAppWindowFromParams(extension.get(), non_ime_params); |
171 int non_ime_window_visible_height = non_ime_app_window->web_contents() | 172 int non_ime_window_visible_height = non_ime_app_window->web_contents() |
172 ->GetRenderWidgetHostView() | 173 ->GetRenderWidgetHostView() |
173 ->GetVisibleViewportSize() | 174 ->GetVisibleViewportSize() |
174 .height(); | 175 .height(); |
(...skipping 28 matching lines...) Expand all Loading... |
203 ->GetVisibleViewportSize() | 204 ->GetVisibleViewportSize() |
204 .height(), | 205 .height(), |
205 non_ime_window_visible_height); | 206 non_ime_window_visible_height); |
206 // Ime window should have not be affected by virtual keyboard. | 207 // Ime window should have not be affected by virtual keyboard. |
207 EXPECT_EQ(ime_app_window->web_contents() | 208 EXPECT_EQ(ime_app_window->web_contents() |
208 ->GetRenderWidgetHostView() | 209 ->GetRenderWidgetHostView() |
209 ->GetVisibleViewportSize() | 210 ->GetVisibleViewportSize() |
210 .height(), | 211 .height(), |
211 ime_window_visible_height); | 212 ime_window_visible_height); |
212 } | 213 } |
OLD | NEW |