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

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: Applied Feedback 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
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..0e190bbeae888cc7ab98aa33e54c809f3e0d64ce 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;
}
+ // Will run accessibility checks and set an error message if it fails.
Jay Civelli 2015/02/07 01:11:12 Nit: Will run -> Runs
hcarmona 2015/02/07 02:22:12 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698