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

Unified Diff: chrome/test/base/in_process_browser_test.h

Issue 582493002: Enable accessibility testing for the bookmark browser test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 5 years, 10 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
« no previous file with comments | « chrome/browser/ui/webui/bookmarks_ui_browsertest.cc ('k') | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c6eb60acfef10fc61f1b9ea4133897939ff6171c 100644
--- a/chrome/test/base/in_process_browser_test.h
+++ b/chrome/test/base/in_process_browser_test.h
@@ -9,6 +9,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_base.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -148,6 +149,13 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// the navigation to complete, and show the browser's window.
void AddBlankTabAndShow(Browser* browser);
+ // Enables running of accessibility audit for a particular test case.
+ // - Call in test body to enable/disable for one test case.
+ // - Call in SetUpOnMainThread to enable for all test cases.
+ void EnableAccessibilityChecksForTestCase(bool enabled) {
+ run_accessibility_checks_for_test_case_ = enabled;
+ }
+
#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 +186,9 @@ class InProcessBrowserTest : public content::BrowserTestBase {
multi_desktop_test_ = multi_desktop_test;
}
+ // Runs accessibility checks and sets |error_message| if it fails.
+ bool RunAccessibilityChecks(std::string* error_message);
+
private:
// Creates a user data directory for the test if one is needed. Returns true
// if successful.
@@ -207,6 +218,10 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// not ensure that Browsers are only created on the tested desktop).
bool multi_desktop_test_;
+ // 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
« no previous file with comments | « chrome/browser/ui/webui/bookmarks_ui_browsertest.cc ('k') | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698