Index: chrome/browser/chromeos/status/caps_lock_menu_button_browsertest.cc |
diff --git a/chrome/browser/chromeos/status/caps_lock_menu_button_browsertest.cc b/chrome/browser/chromeos/status/caps_lock_menu_button_browsertest.cc |
index 55345f1ea4bd5900252470521e93d09691e45983..593636e8ff315aacd053b095f93bbdc1ca0dd31c 100644 |
--- a/chrome/browser/chromeos/status/caps_lock_menu_button_browsertest.cc |
+++ b/chrome/browser/chromeos/status/caps_lock_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 CapsLockMenuButtonTest : public CrosInProcessBrowserTest { |
@@ -25,15 +29,20 @@ class CapsLockMenuButtonTest : public CrosInProcessBrowserTest { |
cros_mock_->SetStatusAreaMocksExpectations(); |
} |
- CapsLockMenuButton* GetCapsLockMenuButton() { |
- BrowserView* view = static_cast<BrowserView*>(browser()->window()); |
- return static_cast<CapsLockMenuButton*>(view->GetViewByID( |
- VIEW_ID_STATUS_BUTTON_CAPS_LOCK)); |
+ const CapsLockMenuButton* GetCapsLockMenuButton() { |
+ const views::View* view = |
+#if defined(USE_AURA) |
+ ChromeShellDelegate::instance()->GetStatusAreaForTest(); |
+#else |
+ static_cast<BrowserView*>(browser()->window()); |
+#endif |
+ return static_cast<const CapsLockMenuButton*>( |
+ view->GetViewByID(VIEW_ID_STATUS_BUTTON_CAPS_LOCK)); |
} |
}; |
IN_PROC_BROWSER_TEST_F(CapsLockMenuButtonTest, InitialIndicatorTest) { |
- CapsLockMenuButton* caps_lock = GetCapsLockMenuButton(); |
+ const CapsLockMenuButton* caps_lock = GetCapsLockMenuButton(); |
ASSERT_TRUE(caps_lock != NULL); |
// By default, the indicator shouldn't be shown. |