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

Side by Side Diff: components/test_runner/web_widget_test_client.h

Issue 2213653002: Revert of Add WebWidgetTestProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
6 #define COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_ 6 #define COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "third_party/WebKit/public/web/WebWidgetClient.h" 10 #include "third_party/WebKit/public/web/WebWidgetClient.h"
11 11
12 namespace blink { 12 namespace blink {
13 class WebWidget; 13 class WebWidget;
14 } // namespace blink 14 } // namespace blink
15 15
16 namespace test_runner { 16 namespace test_runner {
17 17
18 class TestRunner; 18 class TestRunner;
19 class WebTestDelegate; 19 class WebTestDelegate;
20 class WebViewTestProxyBase; 20 class WebViewTestProxyBase;
21 class WebWidgetTestProxyBase;
22 21
23 // WebWidgetTestClient implements WebWidgetClient interface, providing behavior 22 // WebWidgetTestClient implements WebWidgetClient interface, providing behavior
24 // expected by tests. WebWidgetTestClient ends up used by WebViewTestProxy 23 // expected by tests. WebWidgetTestClient ends up used by WebViewTestProxy
25 // which coordinates forwarding WebWidgetClient calls either to 24 // which coordinates forwarding WebWidgetClient calls either to
26 // WebWidgetTestClient or to the product code (i.e. currently to 25 // WebWidgetTestClient or to the product code (i.e. currently to
27 // RenderViewImpl). 26 // RenderViewImpl).
28 class WebWidgetTestClient : public blink::WebWidgetClient { 27 class WebWidgetTestClient : public blink::WebWidgetClient {
29 public: 28 public:
30 // Caller has to ensure that all arguments (i.e. |test_runner| and |delegate|) 29 // Caller has to ensure that all arguments (i.e. |test_runner| and |delegate|)
31 // live longer than |this|. 30 // live longer than |this|.
32 WebWidgetTestClient(TestRunner* test_runner, 31 WebWidgetTestClient(TestRunner* test_runner,
33 WebWidgetTestProxyBase* web_widget_test_proxy_base); 32 WebViewTestProxyBase* web_view_test_proxy_base);
34 33
35 virtual ~WebWidgetTestClient(); 34 virtual ~WebWidgetTestClient();
36 35
37 void set_web_view_test_proxy_base(
38 WebViewTestProxyBase* web_view_test_proxy_base) {
39 web_view_test_proxy_base_ = web_view_test_proxy_base;
40 }
41
42 // WebWidgetClient overrides needed by WebViewTestProxy. 36 // WebWidgetClient overrides needed by WebViewTestProxy.
43 blink::WebScreenInfo screenInfo() override; 37 blink::WebScreenInfo screenInfo() override;
44 void scheduleAnimation() override; 38 void scheduleAnimation() override;
45 bool requestPointerLock() override; 39 bool requestPointerLock() override;
46 void requestPointerUnlock() override; 40 void requestPointerUnlock() override;
47 bool isPointerLocked() override; 41 bool isPointerLocked() override;
48 void setToolTipText(const blink::WebString& text, 42 void setToolTipText(const blink::WebString& text,
49 blink::WebTextDirection direction) override; 43 blink::WebTextDirection direction) override;
50 void resetInputMethod() override; 44 void resetInputMethod() override;
51 45
52 private: 46 private:
53 void AnimateNow(); 47 void AnimateNow();
54 48
55 // Borrowed pointers to other parts of Layout Tests state. 49 // Borrowed pointers to other parts of Layout Tests state.
56 TestRunner* test_runner_; 50 TestRunner* test_runner_;
57 WebViewTestProxyBase* web_view_test_proxy_base_; 51 WebViewTestProxyBase* web_view_test_proxy_base_;
58 WebWidgetTestProxyBase* web_widget_test_proxy_base_;
59 52
60 bool animation_scheduled_; 53 bool animation_scheduled_;
61 54
62 base::WeakPtrFactory<WebWidgetTestClient> weak_factory_; 55 base::WeakPtrFactory<WebWidgetTestClient> weak_factory_;
63 56
64 DISALLOW_COPY_AND_ASSIGN(WebWidgetTestClient); 57 DISALLOW_COPY_AND_ASSIGN(WebWidgetTestClient);
65 }; 58 };
66 59
67 } // namespace test_runner 60 } // namespace test_runner
68 61
69 #endif // COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_ 62 #endif // COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
OLDNEW
« no previous file with comments | « components/test_runner/web_view_test_proxy.cc ('k') | components/test_runner/web_widget_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698