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

Side by Side Diff: ios/web_view/test/chrome_web_view_test.h

Issue 2892193002: Add unittest to test CWVWebView. (Closed)
Patch Set: Respond to comments. Created 3 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_
6 #define IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "testing/platform_test.h"
12
13 namespace net {
14 namespace test_server {
15 class EmbeddedTestServer;
16 } // namespace test_server
17 } // namespace net
18
19 @class CWVWebView;
20 class GURL;
21 @class NSURL;
22
23 namespace ios_web_view {
24
25 class ChromeWebViewTest : public PlatformTest {
Eugene But (OOO till 7-30) 2017/05/24 15:32:14 Do you want to explain in the comments what this f
michaeldo 2017/05/24 16:37:08 Done.
26 protected:
27 ChromeWebViewTest();
28 ~ChromeWebViewTest() override;
29
30 // Returns URL to an html page with title set to |title|.
31 GURL GetUrlForPageWithTitle(const std::string& title);
32
33 // Returns URL to an html page with |html| within page's body tags.
34 GURL GetUrlForPageWithHTMLBody(const std::string& html);
35
36 // Loads |URL| in |web_view| and waits until the load completes. Asserts if
37 // loading does not complete.
38 void LoadUrl(CWVWebView* web_view, NSURL* url);
39
40 // Waits until |web_view| stops loading. Asserts if loading does not complete.
41 void WaitForPageLoadCompletion(CWVWebView* web_view);
42
43 // PlatformTest methods.
44 void SetUp() override;
45
46 // Embedded server for handling responses to urls as registered by
47 // net/test/embedded_test_server/default_handlers.h and the GetURLForPageWith*
48 // methods.
49 std::unique_ptr<net::test_server::EmbeddedTestServer> test_server_;
50 };
51
52 } // namespace ios_web_view
53
54 #endif // IOS_WEB_VIEW_TEST_CHROME_WEB_VIEW_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698