Index: chrome/test/base/in_process_browser_test.h |
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h |
index 07710d2743a09f7e4cd643ef36e46d2969a5358a..e4727cb6ae7260d5c8d6a90ab3023069073f7551 100644 |
--- a/chrome/test/base/in_process_browser_test.h |
+++ b/chrome/test/base/in_process_browser_test.h |
@@ -148,6 +148,16 @@ class InProcessBrowserTest : public content::BrowserTestBase { |
// the navigation to complete, and show the browser's window. |
void AddBlankTabAndShow(Browser* browser); |
+ // Disables running of accessibility tests for a particular test case. This is |
Paweł Hajdan Jr.
2015/01/29 13:01:19
Do we really need this somewhat elaborate from API
hcarmona
2015/01/30 22:19:47
This is based on the a11y audit from js: src/chrom
|
+ // only meaningful when called from IN_PROC_BROWSER_TEST_F to override the |
+ // value of run_accessibility_checks_. |
+ void DisableAccessibilityChecks(); |
+ |
+ // Enables running of accessibility tests for a particular test case. This is |
+ // only meaningful when called from IN_PROC_BROWSER_TEST_F to override the |
+ // value of run_accessibility_checks_. |
+ void EnableAccessibilityChecks(); |
+ |
#if !defined OS_MACOSX |
// Return a CommandLine object that is used to relaunch the browser_test |
// binary as a browser process. This function is deliberately not defined on |
@@ -178,6 +188,12 @@ class InProcessBrowserTest : public content::BrowserTestBase { |
multi_desktop_test_ = multi_desktop_test; |
} |
+ // This should be called in a sub-class constructor to enable/disable |
+ // accessibility testing for all test cases. |
+ void set_run_accessibility_checks(bool run_accessibility_checks) { |
+ run_accessibility_checks_ = run_accessibility_checks; |
+ } |
+ |
private: |
// Creates a user data directory for the test if one is needed. Returns true |
// if successful. |
@@ -190,6 +206,9 @@ class InProcessBrowserTest : public content::BrowserTestBase { |
// with an in-process test. |
void PrepareTestCommandLine(base::CommandLine* command_line); |
+ // Will run accessibility checks and fail the test if there are any issues. |
+ void RunAccessibilityChecks(); |
+ |
// Browser created from CreateBrowser. |
Browser* browser_; |
@@ -207,6 +226,13 @@ class InProcessBrowserTest : public content::BrowserTestBase { |
// not ensure that Browsers are only created on the tested desktop). |
bool multi_desktop_test_; |
+ // True if the accessibility tests should be run. |
+ bool run_accessibility_checks_; |
+ |
+ // True if the accessibility test should run for a particular test case. |
+ // This is reset for every test case. |
+ bool run_accessibility_checks_for_test_case_; |
+ |
#if defined(OS_MACOSX) |
base::mac::ScopedNSAutoreleasePool* autorelease_pool_; |
#endif // OS_MACOSX |