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 SimTest_h | 5 #ifndef SimTest_h |
6 #define SimTest_h | 6 #define SimTest_h |
7 | 7 |
8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
9 #include "web/tests/FrameTestHelpers.h" | 9 #include "web/tests/FrameTestHelpers.h" |
10 #include "web/tests/sim/SimCompositor.h" | 10 #include "web/tests/sim/SimCompositor.h" |
11 #include "web/tests/sim/SimNetwork.h" | 11 #include "web/tests/sim/SimNetwork.h" |
12 #include "web/tests/sim/SimPage.h" | 12 #include "web/tests/sim/SimPage.h" |
13 #include "web/tests/sim/SimWebFrameClient.h" | 13 #include "web/tests/sim/SimWebFrameClient.h" |
14 #include "web/tests/sim/SimWebViewClient.h" | 14 #include "web/tests/sim/SimWebViewClient.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class WebViewImpl; | 18 class WebViewBase; |
19 class WebLocalFrameImpl; | 19 class WebLocalFrameImpl; |
20 class Document; | 20 class Document; |
21 class LocalDOMWindow; | 21 class LocalDOMWindow; |
22 | 22 |
23 class SimTest : public ::testing::Test { | 23 class SimTest : public ::testing::Test { |
24 protected: | 24 protected: |
25 SimTest(); | 25 SimTest(); |
26 ~SimTest() override; | 26 ~SimTest() override; |
27 | 27 |
28 void LoadURL(const String& url); | 28 void LoadURL(const String& url); |
29 | 29 |
30 LocalDOMWindow& Window(); | 30 LocalDOMWindow& Window(); |
31 SimPage& Page(); | 31 SimPage& Page(); |
32 Document& GetDocument(); | 32 Document& GetDocument(); |
33 WebViewImpl& WebView(); | 33 WebViewBase& WebView(); |
34 WebLocalFrameImpl& MainFrame(); | 34 WebLocalFrameImpl& MainFrame(); |
35 const SimWebViewClient& WebViewClient() const; | 35 const SimWebViewClient& WebViewClient() const; |
36 SimCompositor& Compositor(); | 36 SimCompositor& Compositor(); |
37 | 37 |
38 Vector<String>& ConsoleMessages() { return console_messages_; } | 38 Vector<String>& ConsoleMessages() { return console_messages_; } |
39 | 39 |
40 private: | 40 private: |
41 friend class SimWebFrameClient; | 41 friend class SimWebFrameClient; |
42 | 42 |
43 void AddConsoleMessage(const String&); | 43 void AddConsoleMessage(const String&); |
44 | 44 |
45 SimNetwork network_; | 45 SimNetwork network_; |
46 SimCompositor compositor_; | 46 SimCompositor compositor_; |
47 SimWebViewClient web_view_client_; | 47 SimWebViewClient web_view_client_; |
48 SimWebFrameClient web_frame_client_; | 48 SimWebFrameClient web_frame_client_; |
49 SimPage page_; | 49 SimPage page_; |
50 FrameTestHelpers::WebViewHelper web_view_helper_; | 50 FrameTestHelpers::WebViewHelper web_view_helper_; |
51 | 51 |
52 Vector<String> console_messages_; | 52 Vector<String> console_messages_; |
53 }; | 53 }; |
54 | 54 |
55 } // namespace blink | 55 } // namespace blink |
56 | 56 |
57 #endif | 57 #endif |
OLD | NEW |