OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBFRAMETESTPROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/shell/renderer/test_runner/test_runner.h" |
| 10 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
| 11 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
9 #include "content/shell/renderer/test_runner/WebTestProxy.h" | 12 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
10 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
11 | 14 |
12 namespace WebTestRunner { | 15 namespace WebTestRunner { |
13 | 16 |
14 // Templetized wrapper around RenderFrameImpl objects, which implement | 17 // Templetized wrapper around RenderFrameImpl objects, which implement |
15 // the WebFrameClient interface. | 18 // the WebFrameClient interface. |
16 template<class Base, typename P, typename R> | 19 template<class Base, typename P, typename R> |
17 class WebFrameTestProxy : public Base { | 20 class WebFrameTestProxy : public Base { |
18 public: | 21 public: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Base::didFailLoad(frame, error); | 98 Base::didFailLoad(frame, error); |
96 } | 99 } |
97 virtual void didFinishLoad(blink::WebLocalFrame* frame) | 100 virtual void didFinishLoad(blink::WebLocalFrame* frame) |
98 { | 101 { |
99 Base::didFinishLoad(frame); | 102 Base::didFinishLoad(frame); |
100 } | 103 } |
101 virtual void didChangeSelection(bool is_selection_empty) { | 104 virtual void didChangeSelection(bool is_selection_empty) { |
102 m_baseProxy->didChangeSelection(is_selection_empty); | 105 m_baseProxy->didChangeSelection(is_selection_empty); |
103 Base::didChangeSelection(is_selection_empty); | 106 Base::didChangeSelection(is_selection_empty); |
104 } | 107 } |
| 108 virtual void runModalAlertDialog(const blink::WebString& message) { |
| 109 m_baseProxy->m_delegate->printMessage(std::string("ALERT: ") + message.u
tf8().data() + "\n"); |
| 110 } |
| 111 virtual bool runModalConfirmDialog(const blink::WebString& message) { |
| 112 m_baseProxy->m_delegate->printMessage(std::string("CONFIRM: ") + message
.utf8().data() + "\n"); |
| 113 return true; |
| 114 } |
| 115 virtual bool runModalPromptDialog(const blink::WebString& message, const bli
nk::WebString& defaultValue, blink::WebString*) { |
| 116 m_baseProxy->m_delegate->printMessage(std::string("PROMPT: ") + message.
utf8().data() + ", default text: " + defaultValue.utf8().data() + "\n"); |
| 117 return true; |
| 118 } |
| 119 virtual bool runModalBeforeUnloadDialog(bool is_reload, const blink::WebStri
ng& message) { |
| 120 m_baseProxy->m_delegate->printMessage(std::string("CONFIRM NAVIGATION: "
) + message.utf8().data() + "\n"); |
| 121 return !m_baseProxy->m_testInterfaces->testRunner()->shouldStayOnPageAft
erHandlingBeforeUnload(); |
| 122 } |
105 virtual void showContextMenu(const blink::WebContextMenuData& contextMenuDat
a) { | 123 virtual void showContextMenu(const blink::WebContextMenuData& contextMenuDat
a) { |
106 m_baseProxy->showContextMenu(Base::GetWebFrame()->toWebLocalFrame(), con
textMenuData); | 124 m_baseProxy->showContextMenu(Base::GetWebFrame()->toWebLocalFrame(), con
textMenuData); |
107 Base::showContextMenu(contextMenuData); | 125 Base::showContextMenu(contextMenuData); |
108 } | 126 } |
109 virtual void didDetectXSS(blink::WebLocalFrame* frame, const blink::WebURL&
insecureURL, bool didBlockEntirePage) | 127 virtual void didDetectXSS(blink::WebLocalFrame* frame, const blink::WebURL&
insecureURL, bool didBlockEntirePage) |
110 { | 128 { |
111 // This is not implemented in RenderFrameImpl, so need to explicitly cal
l | 129 // This is not implemented in RenderFrameImpl, so need to explicitly cal
l |
112 // into the base proxy. | 130 // into the base proxy. |
113 m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); | 131 m_baseProxy->didDetectXSS(frame, insecureURL, didBlockEntirePage); |
114 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); | 132 Base::didDetectXSS(frame, insecureURL, didBlockEntirePage); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // It is used instead of a #define and is set by layouttest_support when | 197 // It is used instead of a #define and is set by layouttest_support when |
180 // creating this object. | 198 // creating this object. |
181 int m_version; | 199 int m_version; |
182 | 200 |
183 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 201 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
184 }; | 202 }; |
185 | 203 |
186 } | 204 } |
187 | 205 |
188 #endif // WebTestProxy_h | 206 #endif // WebTestProxy_h |
OLD | NEW |