estark | b1ee167 | 2015-08-06 01:15:24 | [diff] [blame^] | 1 | // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_SSL_CERT_VERIFIER_BROWSER_TEST_H_ |
| 6 | #define CHROME_BROWSER_SSL_CERT_VERIFIER_BROWSER_TEST_H_ |
| 7 | |
| 8 | #include "base/memory/scoped_ptr.h" |
| 9 | #include "chrome/test/base/in_process_browser_test.h" |
| 10 | |
| 11 | namespace net { |
| 12 | class MockCertVerifier; |
| 13 | } // namespace net |
| 14 | |
| 15 | // CertVerifierBrowserTest allows tests to force certificate |
| 16 | // verification results for requests made with any profile's main |
| 17 | // request context (such as navigations). To do so, tests can use the |
| 18 | // MockCertVerifier exposed via |
| 19 | // CertVerifierBrowserTest::mock_cert_verifier(). |
| 20 | class CertVerifierBrowserTest : public InProcessBrowserTest { |
| 21 | public: |
| 22 | CertVerifierBrowserTest(); |
| 23 | ~CertVerifierBrowserTest() override; |
| 24 | |
| 25 | // InProcessBrowserTest: |
| 26 | void SetUpInProcessBrowserTestFixture() override; |
| 27 | void TearDownInProcessBrowserTestFixture() override; |
| 28 | |
| 29 | // Returns a pointer to the MockCertVerifier used by all profiles in |
| 30 | // this test. |
| 31 | net::MockCertVerifier* mock_cert_verifier(); |
| 32 | |
| 33 | private: |
| 34 | scoped_ptr<net::MockCertVerifier> mock_cert_verifier_; |
| 35 | }; |
| 36 | |
| 37 | #endif // CHROME_BROWSER_SSL_CERT_VERIFIER_BROWSER_TEST_H_ |