| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 #include "components/test_runner/web_view_test_proxy.h" | |
| 6 | |
| 7 #include <stddef.h> | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "components/test_runner/accessibility_controller.h" | |
| 11 #include "components/test_runner/test_interfaces.h" | |
| 12 #include "components/test_runner/test_runner.h" | |
| 13 #include "components/test_runner/test_runner_for_specific_view.h" | |
| 14 #include "components/test_runner/text_input_controller.h" | |
| 15 #include "components/test_runner/web_test_delegate.h" | |
| 16 #include "components/test_runner/web_test_interfaces.h" | |
| 17 #include "components/test_runner/web_widget_test_proxy.h" | |
| 18 #include "third_party/WebKit/public/web/WebFrame.h" | |
| 19 #include "third_party/WebKit/public/web/WebView.h" | |
| 20 | |
| 21 namespace test_runner { | |
| 22 | |
| 23 WebViewTestProxyBase::WebViewTestProxyBase() | |
| 24 : test_interfaces_(nullptr), | |
| 25 delegate_(nullptr), | |
| 26 web_view_(nullptr), | |
| 27 accessibility_controller_(new AccessibilityController(this)), | |
| 28 text_input_controller_(new TextInputController(this)), | |
| 29 view_test_runner_(new TestRunnerForSpecificView(this)) { | |
| 30 WebWidgetTestProxyBase::set_web_view_test_proxy_base(this); | |
| 31 } | |
| 32 | |
| 33 WebViewTestProxyBase::~WebViewTestProxyBase() { | |
| 34 test_interfaces_->WindowClosed(this); | |
| 35 } | |
| 36 | |
| 37 void WebViewTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { | |
| 38 test_interfaces_ = interfaces->GetTestInterfaces(); | |
| 39 test_interfaces_->WindowOpened(this); | |
| 40 } | |
| 41 | |
| 42 void WebViewTestProxyBase::Reset() { | |
| 43 accessibility_controller_->Reset(); | |
| 44 // text_input_controller_ doesn't have any state to reset. | |
| 45 view_test_runner_->Reset(); | |
| 46 WebWidgetTestProxyBase::Reset(); | |
| 47 | |
| 48 for (blink::WebFrame* frame = web_view_->mainFrame(); frame; | |
| 49 frame = frame->traverseNext()) { | |
| 50 if (frame->isWebLocalFrame()) | |
| 51 delegate_->GetWebWidgetTestProxyBase(frame->toWebLocalFrame())->Reset(); | |
| 52 } | |
| 53 } | |
| 54 | |
| 55 void WebViewTestProxyBase::BindTo(blink::WebLocalFrame* frame) { | |
| 56 accessibility_controller_->Install(frame); | |
| 57 text_input_controller_->Install(frame); | |
| 58 view_test_runner_->Install(frame); | |
| 59 } | |
| 60 | |
| 61 } // namespace test_runner | |
| OLD | NEW |