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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ 5 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_
6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ 6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // it should override this method. 151 // it should override this method.
152 virtual void SetUpDefaultCommandLine(base::CommandLine* command_line); 152 virtual void SetUpDefaultCommandLine(base::CommandLine* command_line);
153 153
154 // Initializes the contents of the user data directory. Called by SetUp() 154 // Initializes the contents of the user data directory. Called by SetUp()
155 // after creating the user data directory, but before any browser is launched. 155 // after creating the user data directory, but before any browser is launched.
156 // If a test wishes to set up some initial non-empty state in the user data 156 // If a test wishes to set up some initial non-empty state in the user data
157 // directory before the browser starts up, it can do so here. Returns true if 157 // directory before the browser starts up, it can do so here. Returns true if
158 // successful. 158 // successful.
159 virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT; 159 virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT;
160 160
161 // In TearDown(), it is asserted CSP error messages never show up during
162 // the test. If you are sure these errors can be ignored, override this.
163 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.
164
161 // BrowserTestBase: 165 // BrowserTestBase:
162 void RunTestOnMainThreadLoop() override; 166 void RunTestOnMainThreadLoop() override;
163 167
164 // Ensures that no devtools are open, and then opens the devtools. 168 // Ensures that no devtools are open, and then opens the devtools.
165 void OpenDevToolsWindow(content::WebContents* web_contents); 169 void OpenDevToolsWindow(content::WebContents* web_contents);
166 170
167 // Opens |url| in an incognito browser window with the incognito profile of 171 // Opens |url| in an incognito browser window with the incognito profile of
168 // |profile|, blocking until the navigation finishes. This will create a new 172 // |profile|, blocking until the navigation finishes. This will create a new
169 // browser if a browser with the incognito profile does not exist. Returns the 173 // browser if a browser with the incognito profile does not exist. Returns the
170 // incognito window Browser. 174 // incognito window Browser.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Temporary user data directory. Used only when a user data directory is not 244 // Temporary user data directory. Used only when a user data directory is not
241 // specified in the command line. 245 // specified in the command line.
242 base::ScopedTempDir temp_user_data_dir_; 246 base::ScopedTempDir temp_user_data_dir_;
243 247
244 // True if we should exit the tests after the last browser instance closes. 248 // True if we should exit the tests after the last browser instance closes.
245 bool exit_when_last_browser_closes_; 249 bool exit_when_last_browser_closes_;
246 250
247 // True if the about:blank tab should be opened when the browser is launched. 251 // True if the about:blank tab should be opened when the browser is launched.
248 bool open_about_blank_on_browser_launch_; 252 bool open_about_blank_on_browser_launch_;
249 253
254
mdjones 2016/06/08 16:57:04 nit: extra line.
255 // True if CSP error messages can be ignored. Otherwise fail the test.
256 bool ignore_csp_messages_;
250 // True if the accessibility test should run for a particular test case. 257 // True if the accessibility test should run for a particular test case.
251 // This is reset for every test case. 258 // This is reset for every test case.
252 bool run_accessibility_checks_for_test_case_; 259 bool run_accessibility_checks_for_test_case_;
253 260
254 #if defined(OS_MACOSX) 261 #if defined(OS_MACOSX)
255 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; 262 base::mac::ScopedNSAutoreleasePool* autorelease_pool_;
256 std::unique_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; 263 std::unique_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_;
257 #endif // OS_MACOSX 264 #endif // OS_MACOSX
258 265
259 #if defined(OS_WIN) 266 #if defined(OS_WIN)
260 std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_; 267 std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_;
261 #endif 268 #endif
262 }; 269 };
263 270
264 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ 271 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698