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

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

Issue 1935593004: Extract WebWidgetTestClient out of WebTestProxyBase and WebViewTestClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test-runner-for-specific-view-separate
Patch Set: Created 4 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 2016 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 COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
6 #define COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
7
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "third_party/WebKit/public/web/WebWidgetClient.h"
11
12 namespace blink {
13 class WebWidget;
14 } // namespace blink
15
16 namespace test_runner {
17
18 class TestRunner;
19 class WebTestDelegate;
20 class WebTestProxyBase;
21
22 // WebWidgetTestClient implements WebWidgetClient interface, providing behavior
23 // expected by tests. WebWidgetTestClient ends up used by WebTestProxy which
24 // coordinates forwarding WebWidgetClient calls either to WebWidgetTestClient or
25 // to the product code (i.e. currently to RenderViewImpl).
26 class WebWidgetTestClient : public blink::WebWidgetClient {
27 public:
28 // Caller has to ensure that all arguments (i.e. |test_runner| and |delegate|)
29 // live longer than |this|.
30 WebWidgetTestClient(TestRunner* test_runner,
31 WebTestProxyBase* web_test_proxy_base);
32
33 virtual ~WebWidgetTestClient();
34
35 // WebWidgetClient overrides needed by WebTestProxy.
36 blink::WebScreenInfo screenInfo() override;
37 void scheduleAnimation() override;
38 bool requestPointerLock() override;
39 void requestPointerUnlock() override;
40 bool isPointerLocked() override;
41 void didFocus() override;
42 void setToolTipText(const blink::WebString& text,
43 blink::WebTextDirection direction) override;
44 void resetInputMethod() override;
45
46 private:
47 void AnimateNow();
48
49 // Borrowed pointers to other parts of Layout Tests state.
50 TestRunner* test_runner_;
51 WebTestProxyBase* web_test_proxy_base_;
52
53 bool animation_scheduled_;
54
55 base::WeakPtrFactory<WebWidgetTestClient> weak_factory_;
56
57 DISALLOW_COPY_AND_ASSIGN(WebWidgetTestClient);
58 };
59
60 } // namespace test_runner
61
62 #endif // COMPONENTS_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
OLDNEW
« no previous file with comments | « components/test_runner/web_view_test_client.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