| OLD | NEW |
| (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_ |
| OLD | NEW |