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

Unified Diff: content/browser/accessibility/dump_accessibility_tree_helper.h

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.h
diff --git a/content/browser/accessibility/dump_accessibility_tree_helper.h b/content/browser/accessibility/dump_accessibility_tree_helper.h
index 90332068ef97168ff1d4dc2721aaa9b1b22d5c8e..314ef7419256d5234d2e7af2ab379be3959e3f4a 100644
--- a/content/browser/accessibility/dump_accessibility_tree_helper.h
+++ b/content/browser/accessibility/dump_accessibility_tree_helper.h
@@ -11,15 +11,13 @@
#include "content/browser/accessibility/browser_accessibility.h"
// A utility class for retrieving platform specific accessibility information.
+// This is extended by a subclass for each platform where accessibility is
+// implemented.
class DumpAccessibilityTreeHelper {
public:
// Dumps a BrowserAccessibility tree into a string.
void DumpAccessibilityTree(BrowserAccessibility* node,
- string16* contents) {
- *contents += ToString(node) + GetLineEnding();
- for (size_t i = 0; i < node->children().size(); ++i)
- DumpAccessibilityTree(node->children()[i], contents);
- }
+ string16* contents);
// Suffix of the expectation file corresponding to html file.
// Example:
@@ -29,12 +27,15 @@ class DumpAccessibilityTreeHelper {
const FilePath::StringType GetActualFileSuffix() const;
const FilePath::StringType GetExpectedFileSuffix() const;
- // Line ending to use in our dump.
- const string16 GetLineEnding() const;
-
protected:
+ void RecursiveDumpAccessibilityTree(BrowserAccessibility* node,
+ string16* contents,
+ int indent);
+
// Returns a platform specific representation of a BrowserAccessibility.
- string16 ToString(BrowserAccessibility* node);
+ // Should be zero or more complete lines, each with |prefix| prepended
+ // (to indent each line).
+ string16 ToString(BrowserAccessibility* node, char* prefix);
void Initialize();
};

Powered by Google App Engine
This is Rietveld 408576698