Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: content/test/accessibility_browser_test_utils.cc

Issue 940753002: accessibility: Simpler AXTree root accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/test/accessibility_browser_test_utils.h" 5 #include "content/test/accessibility_browser_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 event_to_wait_for_ == event_type)) { 85 event_to_wait_for_ == event_type)) {
86 event_target_id_ = event_target_id; 86 event_target_id_ = event_target_id;
87 loop_runner_->Quit(); 87 loop_runner_->Quit();
88 } 88 }
89 } 89 }
90 90
91 bool AccessibilityNotificationWaiter::IsAboutBlank() { 91 bool AccessibilityNotificationWaiter::IsAboutBlank() {
92 // Skip any accessibility notifications related to "about:blank", 92 // Skip any accessibility notifications related to "about:blank",
93 // to avoid a possible race condition between the test beginning 93 // to avoid a possible race condition between the test beginning
94 // listening for accessibility events and "about:blank" loading. 94 // listening for accessibility events and "about:blank" loading.
95 const ui::AXNodeData& root = GetAXTree().GetRoot()->data(); 95 const ui::AXNodeData& root = GetAXTree().root()->data();
96 for (size_t i = 0; i < root.string_attributes.size(); ++i) { 96 for (size_t i = 0; i < root.string_attributes.size(); ++i) {
97 if (root.string_attributes[i].first != ui::AX_ATTR_DOC_URL) 97 if (root.string_attributes[i].first != ui::AX_ATTR_DOC_URL)
98 continue; 98 continue;
99 const std::string& doc_url = root.string_attributes[i].second; 99 const std::string& doc_url = root.string_attributes[i].second;
100 return doc_url == url::kAboutBlankURL; 100 return doc_url == url::kAboutBlankURL;
101 } 101 }
102 return false; 102 return false;
103 } 103 }
104 104
105 } // namespace content 105 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698