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

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

Issue 21269002: Make AccessibilityNodeData more compact. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback, compile fixes Created 7 years, 4 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 | Annotate | Revision Log
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 AccessibilityNotification notification) { 50 AccessibilityNotification notification) {
51 if (!IsAboutBlank() && notification_to_wait_for_ == notification) 51 if (!IsAboutBlank() && notification_to_wait_for_ == notification)
52 loop_runner_->Quit(); 52 loop_runner_->Quit();
53 } 53 }
54 54
55 bool AccessibilityNotificationWaiter::IsAboutBlank() { 55 bool AccessibilityNotificationWaiter::IsAboutBlank() {
56 // Skip any accessibility notifications related to "about:blank", 56 // Skip any accessibility notifications related to "about:blank",
57 // to avoid a possible race condition between the test beginning 57 // to avoid a possible race condition between the test beginning
58 // listening for accessibility events and "about:blank" loading. 58 // listening for accessibility events and "about:blank" loading.
59 const AccessibilityNodeDataTreeNode& root = GetAccessibilityNodeDataTree(); 59 const AccessibilityNodeDataTreeNode& root = GetAccessibilityNodeDataTree();
60 typedef AccessibilityNodeData::StringAttribute StringAttribute; 60 for (size_t i = 0; i < root.string_attributes.size(); ++i) {
61 std::map<StringAttribute, string16>::const_iterator iter; 61 if (root.string_attributes[i].first != AccessibilityNodeData::ATTR_DOC_URL)
62 iter = root.string_attributes.find(AccessibilityNodeData::ATTR_DOC_URL); 62 continue;
63 if (iter != root.string_attributes.end()) { 63 const std::string& doc_url = root.string_attributes[i].second;
64 string16 doc_url = iter->second; 64 return doc_url == kAboutBlankURL;
65 if (doc_url == ASCIIToUTF16(kAboutBlankURL))
66 return true;
67 } 65 }
68 return false; 66 return false;
69 } 67 }
70 68
71 } // namespace content 69 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698