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

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

Issue 2013573007: Catch CSP violations in InProcessBrowserTest Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: whitelist more Created 4 years, 7 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 ae3d8e9c57a5ef4c1daaf139ca6b89195d17e558..468ac520a6d65de0d32e0dba346a2705382c9ed9 100644
--- a/chrome/test/base/in_process_browser_test.h
+++ b/chrome/test/base/in_process_browser_test.h
@@ -158,6 +158,10 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// successful.
virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT;
+ // In TearDown(), it is asserted CSP error messages never show up during
+ // the test. If you are sure these errors can be ignored, override this.
+ virtual void SetIgnoreCSPErrorMessages(bool ignore);
Tom Sepez 2016/05/31 16:21:38 Instead, how about SetExpectCSPErrorMessages(bool)
wychen 2016/06/08 05:41:57 Done.
+
// BrowserTestBase:
void RunTestOnMainThreadLoop() override;
@@ -247,6 +251,9 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// True if the about:blank tab should be opened when the browser is launched.
bool open_about_blank_on_browser_launch_;
+
mdjones 2016/06/08 16:57:04 nit: extra line.
+ // True if CSP error messages can be ignored. Otherwise fail the test.
+ bool ignore_csp_messages_;
// 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_;

Powered by Google App Engine
This is Rietveld 408576698