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

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: double check test is run Created 4 years, 4 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/test/BUILD.gn ('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 ae3d8e9c57a5ef4c1daaf139ca6b89195d17e558..efa5101affdd19590bda0080cffbaa5c0b070c9b 100644
--- a/chrome/test/base/in_process_browser_test.h
+++ b/chrome/test/base/in_process_browser_test.h
@@ -14,6 +14,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_base.h"
+#include "content/public/test/content_browser_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/page_transition_types.h"
@@ -158,6 +159,10 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// successful.
virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT;
+ // After the test, assert whether CSP error messages should've shown up during
+ // the test. Default false. If you expect these errors, set to true.
+ void SetExpectCSPErrorMessages(bool expect);
+
// BrowserTestBase:
void RunTestOnMainThreadLoop() override;
@@ -247,6 +252,11 @@ 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_;
+ // True if CSP error messages are expected. Fail the test if not matching.
+ bool expect_csp_messages_;
+
+ content::ConsoleObserverDelegate* console_delegate_;
+
// 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_;
« no previous file with comments | « chrome/test/BUILD.gn ('k') | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698