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

Unified Diff: content/browser/accessibility/dump_accessibility_tree_helper_win.cc

Issue 9617019: Improve formatting of accessibility tests that dump the tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux build error, tolerate different line endings Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/dump_accessibility_tree_helper_win.cc
diff --git a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
index 33dac19aacf697a79a3ea6a203b96803f678eeb7..05fc874166b8aa72caa415b84de20b921e085bcc 100644
--- a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
+++ b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
@@ -155,7 +155,8 @@ void DumpAccessibilityTreeHelper::Initialize() {
// STATE_MAP(IA2_STATE_VERTICAL) // Untested.
}
-string16 DumpAccessibilityTreeHelper::ToString(BrowserAccessibility* node) {
+string16 DumpAccessibilityTreeHelper::ToString(
+ BrowserAccessibility* node, char* prefix) {
if (role_string_map.empty())
Initialize();
@@ -164,11 +165,16 @@ string16 DumpAccessibilityTreeHelper::ToString(BrowserAccessibility* node) {
std::map<int32, string16>::iterator it;
for (it = state_string_map.begin(); it != state_string_map.end(); ++it) {
- if (it->first & acc_obj->ia2_state())
- state += it->second + L"|";
+ if (it->first & acc_obj->ia2_state()) {
+ if (!state.empty())
+ state += L",";
+ state += it->second;
+ }
}
- return acc_obj->name() + L"|" + role_string_map[acc_obj->ia2_role()] + L"|" +
- state;
+ return UTF8ToUTF16(prefix) +
+ role_string_map[acc_obj->ia2_role()] +
+ L" name='" + acc_obj->name() +
+ L"' state=" + state + L"\n";
}
const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix()
@@ -180,7 +186,3 @@ const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix()
const {
return FILE_PATH_LITERAL("-expected-win.txt");
}
-
-const string16 DumpAccessibilityTreeHelper::GetLineEnding() const {
- return L"\r\n";
-}

Powered by Google App Engine
This is Rietveld 408576698