Home | History | Annotate | Download | only in accessibility
      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.
      4 
      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"
      8 
      9 
     10 namespace content {
     11 
     12 TEST(AccessibilityModeHelperTest, TestNoOpRemove) {
     13   EXPECT_EQ(AccessibilityModeComplete,
     14             RemoveAccessibilityModeFrom(AccessibilityModeComplete,
     15                                         AccessibilityModeOff));
     16 }
     17 
     18 TEST(AccessibilityModeHelperTest, TestRemoveSelf) {
     19   AccessibilityMode kBaseMode = GetBaseAccessibilityMode();
     20 
     21   EXPECT_EQ(kBaseMode,
     22             RemoveAccessibilityModeFrom(AccessibilityModeComplete,
     23                                         AccessibilityModeComplete));
     24 
     25   EXPECT_EQ(
     26       kBaseMode,
     27       RemoveAccessibilityModeFrom(AccessibilityModeEditableTextOnly,
     28                                   AccessibilityModeEditableTextOnly));
     29 }
     30 
     31 TEST(AccessibilityModeHelperTest, TestAddMode) {
     32   EXPECT_EQ(
     33       AccessibilityModeComplete,
     34       AddAccessibilityModeTo(AccessibilityModeEditableTextOnly,
     35                              AccessibilityModeComplete));
     36   EXPECT_EQ(
     37       AccessibilityModeComplete,
     38       AddAccessibilityModeTo(AccessibilityModeEditableTextOnly,
     39                              AccessibilityModeTreeOnly));
     40 }
     41 
     42 }  // namespace content
     43