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
3 // found in the LICENSE file.
5 #include "content/browser/accessibility/accessibility_mode_helper.h"
6 #include "content/common/view_message_enums.h"
7 #include "testing/gtest/include/gtest/gtest.h"
10 #include "base/win/windows_version.h"
15 TEST(AccessibilityModeHelperTest
, TestNoOpRemove
) {
16 EXPECT_EQ(AccessibilityModeComplete
,
17 RemoveAccessibilityModeFrom(AccessibilityModeComplete
,
18 AccessibilityModeOff
));
21 TEST(AccessibilityModeHelperTest
, TestRemoveSelf
) {
22 AccessibilityMode kOffMode
= AccessibilityModeOff
;
24 // Always preserve AccessibilityModeEditableTextOnly on Windows 8,
25 // see RemoveAccessibilityModeFrom() implementation.
26 // Test won't pass if switches::kDisableRendererAccessibility is set.
27 if (base::win::GetVersion() >= base::win::VERSION_WIN8
) {
28 kOffMode
= AccessibilityModeEditableTextOnly
;
30 #endif // defined(OS_WIN)
33 RemoveAccessibilityModeFrom(AccessibilityModeComplete
,
34 AccessibilityModeComplete
));
38 RemoveAccessibilityModeFrom(AccessibilityModeEditableTextOnly
,
39 AccessibilityModeEditableTextOnly
));
42 TEST(AccessibilityModeHelperTest
, TestAddMode
) {
44 AccessibilityModeComplete
,
45 AddAccessibilityModeTo(AccessibilityModeEditableTextOnly
,
46 AccessibilityModeComplete
));
48 AccessibilityModeComplete
,
49 AddAccessibilityModeTo(AccessibilityModeEditableTextOnly
,
50 AccessibilityModeTreeOnly
));
53 } // namespace content