OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/status/accessibility_menu_button.h" | 5 #include "chrome/browser/chromeos/status/accessibility_menu_button.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/accessibility_util.h" | 7 #include "chrome/browser/chromeos/accessibility_util.h" |
8 #include "chrome/browser/chromeos/frame/browser_view.h" | 8 #include "chrome/browser/chromeos/frame/browser_view.h" |
9 #include "chrome/browser/chromeos/status/status_area_view.h" | |
10 #include "chrome/browser/chromeos/view_ids.h" | 9 #include "chrome/browser/chromeos/view_ids.h" |
11 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
12 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
14 | 13 |
15 namespace chromeos { | 14 namespace chromeos { |
16 | 15 |
17 class AccessibilityMenuButtonTest : public InProcessBrowserTest { | 16 class AccessibilityMenuButtonTest : public InProcessBrowserTest { |
18 protected: | 17 protected: |
19 AccessibilityMenuButtonTest() : InProcessBrowserTest() { | 18 AccessibilityMenuButtonTest() : InProcessBrowserTest() { |
20 } | 19 } |
21 | 20 |
22 AccessibilityMenuButton* GetAccessibilityMenuButton() { | 21 AccessibilityMenuButton* GetAccessibilityMenuButton() { |
23 BrowserView* view = static_cast<BrowserView*>(browser()->window()); | 22 BrowserView* view = static_cast<BrowserView*>(browser()->window()); |
24 return static_cast<StatusAreaView*>(view-> | 23 return static_cast<AccessibilityMenuButton*>(view->GetViewByID( |
25 GetViewByID(VIEW_ID_STATUS_AREA))->accessibility_view(); | 24 VIEW_ID_STATUS_BUTTON_ACCESSIBILITY)); |
26 } | 25 } |
27 }; | 26 }; |
28 | 27 |
29 IN_PROC_BROWSER_TEST_F(AccessibilityMenuButtonTest, | 28 IN_PROC_BROWSER_TEST_F(AccessibilityMenuButtonTest, |
30 VisibilityIsSyncedWithPreference) { | 29 VisibilityIsSyncedWithPreference) { |
31 AccessibilityMenuButton* button = GetAccessibilityMenuButton(); | 30 AccessibilityMenuButton* button = GetAccessibilityMenuButton(); |
32 ASSERT_TRUE(button != NULL); | 31 ASSERT_TRUE(button != NULL); |
33 | 32 |
34 accessibility::EnableAccessibility(true, NULL); | 33 accessibility::EnableAccessibility(true, NULL); |
35 EXPECT_TRUE(button->IsVisible()); | 34 EXPECT_TRUE(button->IsVisible()); |
36 | 35 |
37 accessibility::EnableAccessibility(false, NULL); | 36 accessibility::EnableAccessibility(false, NULL); |
38 EXPECT_FALSE(button->IsVisible()); | 37 EXPECT_FALSE(button->IsVisible()); |
39 } | 38 } |
40 | 39 |
41 } // namespace chromeos | 40 } // namespace chromeos |
OLD | NEW |