OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ | 5 #ifndef IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ |
6 #define IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ | 6 #define IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #import "base/mac/scoped_nsobject.h" |
11 #include "testing/platform_test.h" | 12 #include "testing/platform_test.h" |
12 | 13 |
13 namespace net { | 14 namespace net { |
14 namespace test_server { | 15 namespace test_server { |
15 class EmbeddedTestServer; | 16 class EmbeddedTestServer; |
16 } // namespace test_server | 17 } // namespace test_server |
17 } // namespace net | 18 } // namespace net |
18 | 19 |
19 @class CWVWebView; | 20 @class CWVWebView; |
20 class GURL; | 21 class GURL; |
(...skipping 23 matching lines...) Expand all Loading... |
44 // Loads |URL| in |web_view| and waits until the load completes. Asserts if | 45 // Loads |URL| in |web_view| and waits until the load completes. Asserts if |
45 // loading does not complete. | 46 // loading does not complete. |
46 void LoadUrl(CWVWebView* web_view, NSURL* url); | 47 void LoadUrl(CWVWebView* web_view, NSURL* url); |
47 | 48 |
48 // Waits until |web_view| stops loading. Asserts if loading does not complete. | 49 // Waits until |web_view| stops loading. Asserts if loading does not complete. |
49 void WaitForPageLoadCompletion(CWVWebView* web_view); | 50 void WaitForPageLoadCompletion(CWVWebView* web_view); |
50 | 51 |
51 // PlatformTest methods. | 52 // PlatformTest methods. |
52 void SetUp() override; | 53 void SetUp() override; |
53 | 54 |
| 55 // CWVWebView created with default configuration and frame equal to screen |
| 56 // bounds. |
| 57 base::scoped_nsobject<CWVWebView> web_view_; |
| 58 |
54 // Embedded server for handling requests sent to the URLs returned by the | 59 // Embedded server for handling requests sent to the URLs returned by the |
55 // GetURL* methods. | 60 // GetURL* methods. |
56 std::unique_ptr<net::test_server::EmbeddedTestServer> test_server_; | 61 std::unique_ptr<net::test_server::EmbeddedTestServer> test_server_; |
57 }; | 62 }; |
58 | 63 |
59 } // namespace ios_web_view | 64 } // namespace ios_web_view |
60 | 65 |
61 #endif // IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ | 66 #endif // IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_ |
OLD | NEW |