summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-17 23:45:41 +0000
committerdtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-17 23:45:41 +0000
commitca8de581137b34eb04ca8b68186f143d4bea98e8 (patch)
tree6ccd68b53d242a40ec43809e3cf2d0eb56f4ef55 /content
parent603fc5a9f26803a699409db44cfd2e8bd42c8204 (diff)
downloadchromium_src-ca8de581137b34eb04ca8b68186f143d4bea98e8.zip
chromium_src-ca8de581137b34eb04ca8b68186f143d4bea98e8.tar.gz
chromium_src-ca8de581137b34eb04ca8b68186f143d4bea98e8.tar.bz2
Revert 122617 - Adds dump accessibility tree support in Windows.
This largely adds human readable strings for IAccessible2 roles and states. This is in part to make it possible to hand-edit the expected files we generate. Sidenote: switch to string16 usage from std::string as much as possible (despite the incompatibility with API's provided by FilePath). Review URL: https://chromiumcodereview.appspot.com/9295031 TBR=dtseng@chromium.org Review URL: https://chromiumcodereview.appspot.com/9425021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/accessibility/browser_accessibility.h4
-rw-r--r--content/browser/accessibility/browser_accessibility_mac.mm12
-rw-r--r--content/browser/accessibility/browser_accessibility_win.cc5
-rw-r--r--content/browser/accessibility/browser_accessibility_win.h11
-rw-r--r--content/browser/accessibility/dump_accessibility_tree_browsertest.cc128
-rw-r--r--content/browser/accessibility/dump_accessibility_tree_helper.h39
-rw-r--r--content/browser/accessibility/dump_accessibility_tree_helper_mac.mm36
-rw-r--r--content/browser/accessibility/dump_accessibility_tree_helper_win.cc182
8 files changed, 21 insertions, 396 deletions
diff --git a/content/browser/accessibility/browser_accessibility.h b/content/browser/accessibility/browser_accessibility.h
index 0fbb3eb..452deb9 100644
--- a/content/browser/accessibility/browser_accessibility.h
+++ b/content/browser/accessibility/browser_accessibility.h
@@ -193,6 +193,10 @@ class CONTENT_EXPORT BrowserAccessibility {
BrowserAccessibilityWin* toBrowserAccessibilityWin();
#endif
+ // A string representation of this node.
+ // TODO(dtseng): Move to test only library.
+ std::string ToString();
+
// Retrieve the value of a bool attribute from the bool attribute
// map and returns true if found.
bool GetBoolAttribute(WebAccessibility::BoolAttribute attr, bool* value)
diff --git a/content/browser/accessibility/browser_accessibility_mac.mm b/content/browser/accessibility/browser_accessibility_mac.mm
index 6a209d8..798bfbf 100644
--- a/content/browser/accessibility/browser_accessibility_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_mac.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -57,3 +57,13 @@ BrowserAccessibilityCocoa* BrowserAccessibility::toBrowserAccessibilityCocoa() {
return static_cast<BrowserAccessibilityMac*>(this)->
native_view();
}
+
+std::string BrowserAccessibility::ToString() {
+ BrowserAccessibilityCocoa* cocoa_node = this->toBrowserAccessibilityCocoa();
+ NSString* dump = [NSString stringWithFormat:@"%@|%@|%@|%@",
+ [cocoa_node role],
+ [cocoa_node subrole],
+ [cocoa_node title],
+ [cocoa_node value]];
+ return [dump cStringUsingEncoding:NSUTF8StringEncoding];
+}
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 21ad75b..0f3fc74 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -175,6 +175,11 @@ BrowserAccessibilityWin* BrowserAccessibility::toBrowserAccessibilityWin() {
return static_cast<BrowserAccessibilityWin*>(this);
}
+std::string BrowserAccessibility::ToString() {
+ // TODO(dtseng): Implement this and human readable role strings.
+ return "";
+}
+
BrowserAccessibilityWin::BrowserAccessibilityWin()
: ia_role_(0),
ia_state_(0),
diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h
index 90c9c44..a481160 100644
--- a/content/browser/accessibility/browser_accessibility_win.h
+++ b/content/browser/accessibility/browser_accessibility_win.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -79,11 +79,6 @@ BrowserAccessibilityWin
// position where a non-static text child object appears.
CONTENT_EXPORT static const char16 kEmbeddedCharacter[];
- // Mappings from roles and states to human readable strings. Initialize
- // with |InitializeStringMaps|.
- static std::map<int32, string16> role_string_map;
- static std::map<int32, string16> state_string_map;
-
CONTENT_EXPORT BrowserAccessibilityWin();
CONTENT_EXPORT virtual ~BrowserAccessibilityWin();
@@ -701,10 +696,6 @@ CONTENT_EXPORT virtual void PostInitialize();
REFIID iid,
void** object);
- // Accessors to IA2 role and state.
- int32 ia2_role() { return ia2_role_; }
- int32 ia2_state() { return ia2_state_; }
-
private:
// Add one to the reference count and return the same object. Always
// use this method when returning a BrowserAccessibilityWin object as
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
deleted file mode 100644
index 75ee368..0000000
--- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <string>
-
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "base/string_util.h"
-#include "base/string16.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/common/chrome_paths.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/browser/accessibility/browser_accessibility.h"
-#include "content/browser/accessibility/browser_accessibility_manager.h"
-#include "content/browser/accessibility/dump_accessibility_tree_helper.h"
-#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/renderer_host/render_widget_host.h"
-#include "content/browser/renderer_host/render_widget_host_view.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_types.h"
-#include "content/public/browser/web_contents.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/resource/resource_bundle.h"
-
-using content::OpenURLParams;
-using content::Referrer;
-
-namespace {
-// Required to enter html content into a url.
- static const std::string kUrlPreamble = "data:text/html,\n<!doctype html>";
-} // namespace
-
-// This test takes a snapshot of the platform BrowserAccessibility tree and
-// tests it against an expected baseline.
-//
-// The flow of the test is as outlined below.
-// 1. Load an html file from chrome/test/data/accessibility.
-// 2. Read the expectation.
-// 3. Browse to the page and serialize the platform specific tree into a human
-// readable string.
-// 4. Perform a comparison between actual and expected and fail if they do not
-// exactly match.
-class DumpAccessibilityTreeTest : public InProcessBrowserTest {
- public:
- virtual void SetUpInProcessBrowserTestFixture() {
- FilePath resources_pack_path;
- EXPECT_TRUE(PathService::Get(chrome::FILE_RESOURCES_PACK,
- &resources_pack_path));
- ResourceBundle::AddDataPackToSharedInstance(resources_pack_path);
- }
-
- DumpAccessibilityTreeHelper helper_;
-};
-
-IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
- PlatformTreeDifferenceTest) {
- RenderWidgetHostView* host_view =
- browser()->GetSelectedWebContents()->GetRenderWidgetHostView();
- RenderWidgetHost* host = host_view->GetRenderWidgetHost();
- RenderViewHost* view_host = static_cast<RenderViewHost*>(host);
- view_host->set_save_accessibility_tree_for_testing(true);
- view_host->EnableRendererAccessibility();
-
- // Setup test paths.
- FilePath dir_test_data;
- EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data));
- FilePath test_path(dir_test_data.Append(FILE_PATH_LITERAL("accessibility")));
- EXPECT_TRUE(file_util::PathExists(test_path))
- << test_path.LossyDisplayName();
-
- // Grab all HTML files.
- file_util::FileEnumerator file_enumerator(test_path,
- false,
- file_util::FileEnumerator::FILES,
- FILE_PATH_LITERAL("*.html"));
-
- // TODO(dtseng): Make each of these a gtest with script.
- FilePath html_file;
- while (!(html_file = file_enumerator.Next()).empty()) {
- std::string html_contents;
- file_util::ReadFileToString(html_file, &html_contents);
-
- std::string expected_contents;
- FilePath expected_file =
- FilePath(html_file.RemoveExtension().value() +
- helper_.GetExpectedFileSuffix());
- file_util::ReadFileToString(
- expected_file,
- &expected_contents);
-
- // Load the page.
- ui_test_utils::WindowedNotificationObserver tree_updated_observer(
- content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
- content::NotificationService::AllSources());
- string16 html_contents16;
- html_contents16 = UTF8ToUTF16(html_contents);
- GURL url(UTF8ToUTF16(kUrlPreamble) + html_contents16);
- browser()->OpenURL(OpenURLParams(
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
-
- // Wait for the tree.
- tree_updated_observer.Wait();
-
- // Perform a diff (or write the initial baseline).
- string16 actual_contents;
- helper_.DumpAccessibilityTree(
- host_view->GetBrowserAccessibilityManager()->GetRoot(),
- &actual_contents);
- std::string actual_contents8 = UTF16ToUTF8(actual_contents);
- EXPECT_EQ(expected_contents, actual_contents8);
-
- if (!file_util::PathExists(expected_file)) {
- FilePath actual_file =
- FilePath(html_file.RemoveExtension().value() +
- helper_.GetActualFileSuffix());
-
- EXPECT_TRUE(file_util::WriteFile(
- actual_file, actual_contents8.c_str(), actual_contents8.size()));
-
- ADD_FAILURE() << "No expectation found. Create it by doing:\n"
- << "mv " << actual_file.LossyDisplayName() << " "
- << expected_file.LossyDisplayName();
- }
- }
-}
diff --git a/content/browser/accessibility/dump_accessibility_tree_helper.h b/content/browser/accessibility/dump_accessibility_tree_helper.h
deleted file mode 100644
index 02c6e22..0000000
--- a/content/browser/accessibility/dump_accessibility_tree_helper.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_ACCESSIBILITY_DUMP_ACCESSIBILITY_TREE_HELPER_H_
-#define CHROME_BROWSER_ACCESSIBILITY_DUMP_ACCESSIBILITY_TREE_HELPER_H_
-
-#include "base/file_path.h"
-#include "base/string16.h"
-#include "base/utf_string_conversions.h"
-#include "content/browser/accessibility/browser_accessibility.h"
-
-// A utility class for retrieving platform specific accessibility information.
-class DumpAccessibilityTreeHelper {
- public:
- // Dumps a BrowserAccessibility tree into a string.
- void DumpAccessibilityTree(BrowserAccessibility* node,
- string16* contents) {
- *contents += ToString(node) + UTF8ToUTF16("\n");
- for (size_t i = 0; i < node->children().size(); ++i)
- DumpAccessibilityTree(node->children()[i], contents);
- }
-
- // Suffix of the expectation file corresponding to html file.
- // Example:
- // HTML test: test-file.html
- // Expected: test-file-expected-mac.txt.
- // Auto-generated: test-file-actual-mac.txt
- const FilePath::StringType GetActualFileSuffix() const;
- const FilePath::StringType GetExpectedFileSuffix() const;
-
- protected:
- // Returns a platform specific representation of a BrowserAccessibility.
- string16 ToString(BrowserAccessibility* node);
-
- void Initialize();
-};
-
-#endif // CHROME_BROWSER_ACCESSIBILITY_DUMP_ACCESSIBILITY_TREE_HELPER_H_
diff --git a/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm b/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm
deleted file mode 100644
index bf48e9c..0000000
--- a/content/browser/accessibility/dump_accessibility_tree_helper_mac.mm
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/accessibility/dump_accessibility_tree_helper.h"
-
-#import <Cocoa/Cocoa.h>
-
-#include "base/file_path.h"
-#include "base/utf_string_conversions.h"
-#include "content/browser/accessibility/browser_accessibility_cocoa.h"
-#include "content/browser/accessibility/browser_accessibility_mac.h"
-
-void DumpAccessibilityTreeHelper::Initialize() {}
-
-string16 DumpAccessibilityTreeHelper::ToString(BrowserAccessibility* node) {
- BrowserAccessibilityCocoa* cocoa_node = node->toBrowserAccessibilityCocoa();
- NSString* dump = [NSString stringWithFormat:@"%@|%@|%@|%@",
- [cocoa_node role],
- [cocoa_node subrole],
- [cocoa_node title],
- [cocoa_node value]];
- std::string tempVal = [dump cStringUsingEncoding:NSUTF8StringEncoding];
-
- return UTF8ToUTF16(tempVal);
-}
-
-const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix()
- const {
- return FILE_PATH_LITERAL("-actual-mac.txt");
-}
-
-const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix()
- const {
- return FILE_PATH_LITERAL("-expected-mac.txt");
-}
diff --git a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
deleted file mode 100644
index 1955771..0000000
--- a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/accessibility/dump_accessibility_tree_helper.h"
-
-#include <oleacc.h>
-
-#include <map>
-#include <string>
-
-#include "base/file_path.h"
-#include "base/string_util.h"
-#include "content/browser/accessibility/browser_accessibility_win.h"
-#include "third_party/iaccessible2/ia2_api_all.h"
-
-namespace {
-std::map<int32, string16> role_string_map;
-std::map<int32, string16> state_string_map;
-} // namespace
-
-// Convenience macros for generating readable strings.
-#define ROLE_MAP(x) role_string_map[x] = L#x;
-#define STATE_MAP(x) state_string_map[x] = L#x;
-
-void DumpAccessibilityTreeHelper::Initialize() {
- ROLE_MAP(IA2_ROLE_UNKNOWN)
- ROLE_MAP(IA2_ROLE_CANVAS)
- ROLE_MAP(IA2_ROLE_CAPTION)
- ROLE_MAP(IA2_ROLE_CHECK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MAP(ROLE_SYSTEM_IPADDRESS)
- ROLE_MAP(ROLE_SYSTEM_OUTLINEBUTTON)
-
- STATE_MAP(IA2_STATE_ACTIVE)
- STATE_MAP(IA2_STATE_ARMED)
- STATE_MAP(IA2_STATE_DEFUNCT)
- STATE_MAP(IA2_STATE_EDITABLE)
- STATE_MAP(IA2_STATE_HORIZONTAL)
- STATE_MAP(IA2_STATE_ICONIFIED)
- STATE_MAP(IA2_STATE_INVALID_ENTRY)
- STATE_MAP(IA2_STATE_MANAGES_DESCENDANTS)
- STATE_MAP(IA2_STATE_MODAL)
- STATE_MAP(IA2_STATE_MULTI_LINE)
- STATE_MAP(IA2_STATE_OPAQUE)
- STATE_MAP(IA2_STATE_REQUIRED)
- STATE_MAP(IA2_STATE_SELECTABLE_TEXT)
- STATE_MAP(IA2_STATE_SINGLE_LINE)
- STATE_MAP(IA2_STATE_STALE)
- STATE_MAP(IA2_STATE_SUPPORTS_AUTOCOMPLETION)
- STATE_MAP(IA2_STATE_TRANSIENT)
- STATE_MAP(IA2_STATE_VERTICAL)
-}
-
-string16 DumpAccessibilityTreeHelper::ToString(BrowserAccessibility* node) {
- if (role_string_map.empty())
- Initialize();
-
- BrowserAccessibilityWin* acc_obj = node->toBrowserAccessibilityWin();
- string16 state;
- 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 += L"|" + state_string_map[it->first];
- }
- return acc_obj->name() + L"|" + role_string_map[acc_obj->ia2_role()] + L"|" +
- state;
-}
-
-const FilePath::StringType DumpAccessibilityTreeHelper::GetActualFileSuffix()
- const {
- return FILE_PATH_LITERAL("-actual-win.txt");
-}
-
-const FilePath::StringType DumpAccessibilityTreeHelper::GetExpectedFileSuffix()
- const {
- return FILE_PATH_LITERAL("-expected-win.txt");
-}