forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb_view_test_client.h
More file actions
63 lines (50 loc) · 2.35 KB
/
web_view_test_client.h
File metadata and controls
63 lines (50 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
#define CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
#include "base/macros.h"
#include "third_party/blink/public/web/web_view_client.h"
namespace blink {
class WebView;
} // namespace blink
namespace test_runner {
class TestRunner;
class WebTestDelegate;
class WebViewTestProxyBase;
// WebViewTestClient implements WebViewClient interface, providing behavior
// expected by tests. WebViewTestClient ends up used by WebViewTestProxy
// which coordinates forwarding WebViewClient calls either to
// WebViewTestClient or to the product code (i.e. to RenderViewImpl).
class WebViewTestClient : public blink::WebViewClient {
public:
// Caller has to ensure |web_view_test_proxy_base| lives longer than |this|.
WebViewTestClient(WebViewTestProxyBase* web_view_test_proxy_base,
std::unique_ptr<blink::WebWidgetClient> web_widget_client);
~WebViewTestClient() override;
// WebViewClient overrides needed by WebViewTestProxy.
blink::WebView* CreateView(blink::WebLocalFrame* creator,
const blink::WebURLRequest& request,
const blink::WebWindowFeatures& features,
const blink::WebString& frame_name,
blink::WebNavigationPolicy policy,
bool suppress_opener,
blink::WebSandboxFlags,
const blink::SessionStorageNamespaceId&) override;
void PrintPage(blink::WebLocalFrame* frame) override;
blink::WebString AcceptLanguages() override;
void DidFocus(blink::WebLocalFrame* calling_frame) override;
bool CanHandleGestureEvent() override;
bool CanUpdateLayout() override;
blink::WebScreenInfo GetScreenInfo() override;
blink::WebWidgetClient* WidgetClient() override;
private:
WebTestDelegate* delegate();
TestRunner* test_runner();
// Borrowed pointer to WebViewTestProxyBase.
WebViewTestProxyBase* web_view_test_proxy_base_;
std::unique_ptr<blink::WebWidgetClient> web_widget_client_;
DISALLOW_COPY_AND_ASSIGN(WebViewTestClient);
};
} // namespace test_runner
#endif // CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_