OLD | NEW |
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 event_to_wait_for_ == event_type)) { | 92 event_to_wait_for_ == event_type)) { |
93 event_target_id_ = event_target_id; | 93 event_target_id_ = event_target_id; |
94 loop_runner_->Quit(); | 94 loop_runner_->Quit(); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 bool AccessibilityNotificationWaiter::IsAboutBlank() { | 98 bool AccessibilityNotificationWaiter::IsAboutBlank() { |
99 // Skip any accessibility notifications related to "about:blank", | 99 // Skip any accessibility notifications related to "about:blank", |
100 // to avoid a possible race condition between the test beginning | 100 // to avoid a possible race condition between the test beginning |
101 // listening for accessibility events and "about:blank" loading. | 101 // listening for accessibility events and "about:blank" loading. |
102 const ui::AXNodeData& root = GetAXTree().root()->data(); | 102 return GetAXTree().data().url == url::kAboutBlankURL; |
103 for (size_t i = 0; i < root.string_attributes.size(); ++i) { | |
104 if (root.string_attributes[i].first != ui::AX_ATTR_DOC_URL) | |
105 continue; | |
106 const std::string& doc_url = root.string_attributes[i].second; | |
107 return doc_url == url::kAboutBlankURL; | |
108 } | |
109 return false; | |
110 } | 103 } |
111 | 104 |
112 } // namespace content | 105 } // namespace content |
OLD | NEW |