OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "content/browser/accessibility/browser_accessibility.h" | 6 #include "content/browser/accessibility/browser_accessibility.h" |
7 #include "content/browser/accessibility/browser_accessibility_manager.h" | 7 #include "content/browser/accessibility/browser_accessibility_manager.h" |
8 #include "content/browser/accessibility/one_shot_accessibility_tree_search.h" | 8 #include "content/browser/accessibility/one_shot_accessibility_tree_search.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class TestBrowserAccessibilityManager : public BrowserAccessibilityManager { | 15 class TestBrowserAccessibilityManager : public BrowserAccessibilityManager { |
16 public: | 16 public: |
17 TestBrowserAccessibilityManager( | 17 TestBrowserAccessibilityManager( |
18 const SimpleAXTreeUpdate& initial_tree) | 18 const ui::AXTreeUpdate& initial_tree) |
19 : BrowserAccessibilityManager(initial_tree, | 19 : BrowserAccessibilityManager(initial_tree, |
20 nullptr, | 20 nullptr, |
21 new BrowserAccessibilityFactory()) {} | 21 new BrowserAccessibilityFactory()) {} |
22 }; | 22 }; |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 // These tests prevent other tests from being run. crbug.com/514632 | 26 // These tests prevent other tests from being run. crbug.com/514632 |
27 #if defined(ANDROID) && defined(ADDRESS_SANITIZER) | 27 #if defined(ANDROID) && defined(ADDRESS_SANITIZER) |
28 #define MAYBE_OneShotAccessibilityTreeSearchTest DISABLED_OneShotAccessibilityTr
eeSearchTets | 28 #define MAYBE_OneShotAccessibilityTreeSearchTest DISABLED_OneShotAccessibilityTr
eeSearchTets |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 search.AddPredicate([](BrowserAccessibility* start, | 172 search.AddPredicate([](BrowserAccessibility* start, |
173 BrowserAccessibility* current) { | 173 BrowserAccessibility* current) { |
174 return (current->GetId() % 2 == 1); | 174 return (current->GetId() % 2 == 1); |
175 }); | 175 }); |
176 ASSERT_EQ(2U, search.CountMatches()); | 176 ASSERT_EQ(2U, search.CountMatches()); |
177 EXPECT_EQ(3, search.GetMatchAtIndex(0)->GetId()); | 177 EXPECT_EQ(3, search.GetMatchAtIndex(0)->GetId()); |
178 EXPECT_EQ(5, search.GetMatchAtIndex(1)->GetId()); | 178 EXPECT_EQ(5, search.GetMatchAtIndex(1)->GetId()); |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |