OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_TEST_UTILS_H_ |
6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_TEST_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class InterstitialPage; | 14 class InterstitialPage; |
15 class WebContents; | 15 class WebContents; |
16 } | 16 } |
17 | 17 |
18 class GURL; | 18 class GURL; |
| 19 |
| 20 namespace security_interstitials { |
19 class SecurityInterstitialPage; | 21 class SecurityInterstitialPage; |
| 22 } |
20 | 23 |
21 namespace chrome_browser_interstitials { | 24 namespace chrome_browser_interstitials { |
22 | 25 |
23 bool IsInterstitialDisplayingText( | 26 bool IsInterstitialDisplayingText( |
24 const content::InterstitialPage* const interstitial, | 27 const content::InterstitialPage* const interstitial, |
25 const std::string& text); | 28 const std::string& text); |
26 | 29 |
27 // This class is used for testing the display of IDN names in security | 30 // This class is used for testing the display of IDN names in security |
28 // interstitials. | 31 // interstitials. |
29 class SecurityInterstitialIDNTest : public InProcessBrowserTest { | 32 class SecurityInterstitialIDNTest : public InProcessBrowserTest { |
30 public: | 33 public: |
31 // InProcessBrowserTest implementation | 34 // InProcessBrowserTest implementation |
32 void SetUpOnMainThread() override; | 35 void SetUpOnMainThread() override; |
33 | 36 |
34 // Run a test that creates an interstitial with an IDN request URL | 37 // Run a test that creates an interstitial with an IDN request URL |
35 // and checks that it is properly decoded. | 38 // and checks that it is properly decoded. |
36 testing::AssertionResult VerifyIDNDecoded() const; | 39 testing::AssertionResult VerifyIDNDecoded() const; |
37 | 40 |
38 protected: | 41 protected: |
39 virtual SecurityInterstitialPage* CreateInterstitial( | 42 virtual security_interstitials::SecurityInterstitialPage* CreateInterstitial( |
40 content::WebContents* contents, | 43 content::WebContents* contents, |
41 const GURL& request_url) const = 0; | 44 const GURL& request_url) const = 0; |
42 }; | 45 }; |
43 | 46 |
44 } // namespace chrome_browser_interstitials | 47 } // namespace chrome_browser_interstitials |
45 | 48 |
46 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_TEST_UTILS_H_ | 49 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_TEST_UTILS_H_ |
OLD | NEW |