diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-18 07:43:58 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-18 07:43:58 +0000 |
commit | 67700a92e622aebd70e72b8dbe4cee4efdf9878a (patch) | |
tree | 08a71482682732d688189eda968877b1919bab68 /chrome_frame | |
parent | 154d62610c587dafb521f65e37e6e1d5ef90ba7e (diff) | |
download | chromium_src-67700a92e622aebd70e72b8dbe4cee4efdf9878a.zip chromium_src-67700a92e622aebd70e72b8dbe4cee4efdf9878a.tar.gz chromium_src-67700a92e622aebd70e72b8dbe4cee4efdf9878a.tar.bz2 |
Remove code that enables renderer accessibility based on the SPI_GETSCREENREADER parameter.
Update chrome frame so that its test automation can still use renderer accessibility.
BUG=55902
TEST=none
Review URL: http://codereview.chromium.org/3383010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 5 | ||||
-rw-r--r-- | chrome_frame/chrome_launcher.cc | 1 | ||||
-rw-r--r-- | chrome_frame/test/run_all_unittests.cc | 14 | ||||
-rw-r--r-- | chrome_frame/utils.cc | 9 | ||||
-rw-r--r-- | chrome_frame/utils.h | 5 |
5 files changed, 22 insertions, 12 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 67d9ea8..a97e6d0 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -290,6 +290,11 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params, if (IsHeadlessMode()) command_line->AppendSwitch(switches::kFullMemoryCrashReport); + // In accessible mode automation tests expect renderer accessibility to be + // enabled in chrome. + if (IsAccessibleMode()) + command_line->AppendSwitch(switches::kForceRendererAccessibility); + DLOG(INFO) << "Profile path: " << params->profile_path().value(); command_line->AppendSwitchPath(switches::kUserDataDir, params->profile_path()); diff --git a/chrome_frame/chrome_launcher.cc b/chrome_frame/chrome_launcher.cc index 01cecfc..f040d2b 100644 --- a/chrome_frame/chrome_launcher.cc +++ b/chrome_frame/chrome_launcher.cc @@ -22,6 +22,7 @@ const wchar_t* kAllowedSwitches[] = { L"chrome-frame", L"disable-renderer-accessibility", L"enable-experimental-extension-apis", + L"force-renderer-accessibility", L"no-default-browser-check", L"noerrdialogs", L"no-first-run", diff --git a/chrome_frame/test/run_all_unittests.cc b/chrome_frame/test/run_all_unittests.cc index 4a7ee43..2c90a70 100644 --- a/chrome_frame/test/run_all_unittests.cc +++ b/chrome_frame/test/run_all_unittests.cc @@ -38,18 +38,7 @@ int main(int argc, char **argv) { TestSuite test_suite(argc, argv); SetConfigBool(kChromeFrameHeadlessMode, true); - - // Pretend that a screenreader is in use to cause Chrome to generate the - // accessibility tree during page load. Otherwise, Chrome will send back - // an unpopulated tree for the first request while it fetches the tree - // from the renderer. - BOOL is_screenreader_on = FALSE; - SystemParametersInfo(SPI_SETSCREENREADER, TRUE, NULL, 0); - SystemParametersInfo(SPI_GETSCREENREADER, 0, &is_screenreader_on, 0); - if (!is_screenreader_on) { - LOG(ERROR) << "Could not set screenreader property. Tests depending on " - << "MSAA in CF will likely fail..."; - } + SetConfigBool(kChromeFrameAccessibleMode, true); base::ProcessHandle crash_service = chrome_frame_test::StartCrashService(); int ret = -1; @@ -72,6 +61,7 @@ int main(int argc, char **argv) { } DeleteConfigValue(kChromeFrameHeadlessMode); + DeleteConfigValue(kChromeFrameAccessibleMode); if (crash_service) base::KillProcess(crash_service, 0, false); diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 80095428..2ddc3c9 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -74,6 +74,10 @@ const char kAttachExternalTabPrefix[] = "attach_external_tab"; // are handled by the chrome test crash server. const wchar_t kChromeFrameHeadlessMode[] = L"ChromeFrameHeadlessMode"; +// Indicates that we are running in an environment that expects chrome renderer +// accessibility to be enabled for use in automation tests. +const wchar_t kChromeFrameAccessibleMode[] = L"ChromeFrameAccessibleMode"; + // Indicates that we are running in an environment that wishes to avoid // DLL pinning, such as the perf tests. const wchar_t kChromeFrameUnpinnedMode[] = L"kChromeFrameUnpinnedMode"; @@ -960,6 +964,11 @@ bool IsHeadlessMode() { return headless; } +bool IsAccessibleMode() { + bool accessible = GetConfigBool(false, kChromeFrameAccessibleMode); + return accessible; +} + bool IsUnpinnedMode() { // We only check this value once and then cache it since changing the registry // once we've pinned the DLL won't have any effect. diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h index eadad72..d4781e1 100644 --- a/chrome_frame/utils.h +++ b/chrome_frame/utils.h @@ -28,6 +28,7 @@ extern const wchar_t kChromeContentPrefix[]; extern const char kGCFProtocol[]; extern const wchar_t kChromeProtocolPrefix[]; extern const wchar_t kChromeFrameHeadlessMode[]; +extern const wchar_t kChromeFrameAccessibleMode[]; extern const wchar_t kChromeFrameUnpinnedMode[]; extern const wchar_t kAllowUnsafeURLs[]; extern const wchar_t kEnableBuggyBhoIntercept[]; @@ -239,6 +240,10 @@ bool DeleteConfigValue(const wchar_t* value_name); // gather crash dumps, etc to send them to the crash server. bool IsHeadlessMode(); +// Returns true if we are running in accessible mode in which we need to enable +// renderer accessibility for use in automation. +bool IsAccessibleMode(); + // Returns true if we are running in unpinned mode in which case DLL // eviction should be possible. bool IsUnpinnedMode(); |