Index: chrome/browser/chromeos/status/input_method_menu_button_browsertest.cc |
diff --git a/chrome/browser/chromeos/status/input_method_menu_button_browsertest.cc b/chrome/browser/chromeos/status/input_method_menu_button_browsertest.cc |
index daacb0c382eaedf266dc214a184d8c6fa73a3d5a..e5a35ab0f19271eab9f9ce414446138c6ca65822 100644 |
--- a/chrome/browser/chromeos/status/input_method_menu_button_browsertest.cc |
+++ b/chrome/browser/chromeos/status/input_method_menu_button_browsertest.cc |
@@ -12,6 +12,10 @@ |
#include "chrome/browser/ui/browser_window.h" |
#include "grit/theme_resources.h" |
+#if defined(USE_AURA) |
+#include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" |
+#endif |
+ |
namespace chromeos { |
class InputMethodMenuButtonTest : public CrosInProcessBrowserTest { |
@@ -25,15 +29,20 @@ class InputMethodMenuButtonTest : public CrosInProcessBrowserTest { |
cros_mock_->SetStatusAreaMocksExpectations(); |
} |
- InputMethodMenuButton* GetInputMethodMenuButton() { |
- BrowserView* view = static_cast<BrowserView*>(browser()->window()); |
- return static_cast<InputMethodMenuButton*>(view->GetViewByID( |
- VIEW_ID_STATUS_BUTTON_INPUT_METHOD)); |
+ const InputMethodMenuButton* GetInputMethodMenuButton() { |
+ const views::View* view = |
+#if defined(USE_AURA) |
+ ChromeShellDelegate::instance()->GetStatusAreaForTest(); |
+#else |
+ static_cast<BrowserView*>(browser()->window()); |
+#endif |
+ return static_cast<const InputMethodMenuButton*>( |
+ view->GetViewByID(VIEW_ID_STATUS_BUTTON_INPUT_METHOD)); |
} |
}; |
IN_PROC_BROWSER_TEST_F(InputMethodMenuButtonTest, InitialIndicatorTest) { |
- InputMethodMenuButton* input_method = GetInputMethodMenuButton(); |
+ const InputMethodMenuButton* input_method = GetInputMethodMenuButton(); |
ASSERT_TRUE(input_method != NULL); |
// By default, show the indicator of the hardware keyboard, which is set |