| Index: content/shell/renderer/test_runner/WebTestProxy.cpp
|
| diff --git a/content/shell/renderer/test_runner/WebTestProxy.cpp b/content/shell/renderer/test_runner/WebTestProxy.cpp
|
| index 9d454a2b7053366c91a1ce0e4c4e9eaec113f6da..0bb5b4bf69e44dea146fd7d83e80c3dc1b1aaf82 100644
|
| --- a/content/shell/renderer/test_runner/WebTestProxy.cpp
|
| +++ b/content/shell/renderer/test_runner/WebTestProxy.cpp
|
| @@ -35,6 +35,7 @@
|
| #include "third_party/WebKit/public/web/WebElement.h"
|
| #include "third_party/WebKit/public/web/WebFrame.h"
|
| #include "third_party/WebKit/public/web/WebHistoryItem.h"
|
| +#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
| #include "third_party/WebKit/public/web/WebMIDIClientMock.h"
|
| #include "third_party/WebKit/public/web/WebNode.h"
|
| #include "third_party/WebKit/public/web/WebPluginParams.h"
|
| @@ -871,8 +872,11 @@ void WebTestProxyBase::postAccessibilityEvent(const blink::WebAXObject& obj, bli
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::startDragging(WebFrame*, const WebDragData& data, WebDragOperationsMask mask, const WebImage&, const WebPoint&)
|
| -{
|
| +void WebTestProxyBase::startDragging(WebLocalFrame*,
|
| + const WebDragData& data,
|
| + WebDragOperationsMask mask,
|
| + const WebImage&,
|
| + const WebPoint&) {
|
| // When running a test, we need to fake a drag drop operation otherwise
|
| // Windows waits for real mouse events to know when the drag is over.
|
| m_testInterfaces->eventSender()->DoDragDrop(data, mask);
|
| @@ -893,8 +897,12 @@ void WebTestProxyBase::didChangeContents()
|
| m_delegate->printMessage("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n");
|
| }
|
|
|
| -bool WebTestProxyBase::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy, bool)
|
| -{
|
| +bool WebTestProxyBase::createView(WebLocalFrame*,
|
| + const WebURLRequest& request,
|
| + const WebWindowFeatures&,
|
| + const WebString&,
|
| + WebNavigationPolicy,
|
| + bool) {
|
| if (!m_testInterfaces->testRunner()->canOpenWindows())
|
| return false;
|
| if (m_testInterfaces->testRunner()->shouldDumpCreateView())
|
| @@ -902,8 +910,8 @@ bool WebTestProxyBase::createView(WebFrame*, const WebURLRequest& request, const
|
| return true;
|
| }
|
|
|
| -WebPlugin* WebTestProxyBase::createPlugin(WebFrame* frame, const WebPluginParams& params)
|
| -{
|
| +WebPlugin* WebTestProxyBase::createPlugin(WebLocalFrame* frame,
|
| + const WebPluginParams& params) {
|
| if (TestPlugin::isSupportedMimeType(params.mimeType))
|
| return TestPlugin::create(frame, params, m_delegate);
|
| return 0;
|
| @@ -922,8 +930,9 @@ void WebTestProxyBase::didStopLoading()
|
| m_delegate->printMessage("postProgressFinishedNotification\n");
|
| }
|
|
|
| -void WebTestProxyBase::showContextMenu(WebFrame*, const WebContextMenuData& contextMenuData)
|
| -{
|
| +void WebTestProxyBase::showContextMenu(
|
| + WebLocalFrame*,
|
| + const WebContextMenuData& contextMenuData) {
|
| m_testInterfaces->eventSender()->SetContextMenuData(contextMenuData);
|
| }
|
|
|
| @@ -935,8 +944,7 @@ WebUserMediaClient* WebTestProxyBase::userMediaClient()
|
| }
|
|
|
| // Simulate a print by going into print mode and then exit straight away.
|
| -void WebTestProxyBase::printPage(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::printPage(WebLocalFrame* frame) {
|
| WebSize pageSizeInPixels = webWidget()->size();
|
| if (pageSizeInPixels.isEmpty())
|
| return;
|
| @@ -1019,8 +1027,7 @@ bool WebTestProxyBase::isChooserShown()
|
| return 0 < m_chooserCount;
|
| }
|
|
|
| -void WebTestProxyBase::didStartProvisionalLoad(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::didStartProvisionalLoad(WebLocalFrame* frame) {
|
| if (!m_testInterfaces->testRunner()->topLoadingFrame())
|
| m_testInterfaces->testRunner()->setTopLoadingFrame(frame, false);
|
|
|
| @@ -1033,16 +1040,16 @@ void WebTestProxyBase::didStartProvisionalLoad(WebFrame* frame)
|
| printFrameUserGestureStatus(m_delegate, frame, " - in didStartProvisionalLoadForFrame\n");
|
| }
|
|
|
| -void WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(
|
| + WebLocalFrame* frame) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didReceiveServerRedirectForProvisionalLoadForFrame\n");
|
| }
|
| }
|
|
|
| -bool WebTestProxyBase::didFailProvisionalLoad(WebFrame* frame, const WebURLError&)
|
| -{
|
| +bool WebTestProxyBase::didFailProvisionalLoad(WebLocalFrame* frame,
|
| + const WebURLError&) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didFailProvisionalLoadWithError\n");
|
| @@ -1051,16 +1058,16 @@ bool WebTestProxyBase::didFailProvisionalLoad(WebFrame* frame, const WebURLError
|
| return !frame->provisionalDataSource();
|
| }
|
|
|
| -void WebTestProxyBase::didCommitProvisionalLoad(WebFrame* frame, bool)
|
| -{
|
| +void WebTestProxyBase::didCommitProvisionalLoad(WebLocalFrame* frame, bool) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didCommitLoadForFrame\n");
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction)
|
| -{
|
| +void WebTestProxyBase::didReceiveTitle(WebLocalFrame* frame,
|
| + const WebString& title,
|
| + WebTextDirection direction) {
|
| WebCString title8 = title.utf8();
|
|
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| @@ -1072,16 +1079,14 @@ void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title,
|
| m_delegate->printMessage(string("TITLE CHANGED: '") + title8.data() + "'\n");
|
| }
|
|
|
| -void WebTestProxyBase::didChangeIcon(WebFrame* frame, WebIconURL::Type)
|
| -{
|
| +void WebTestProxyBase::didChangeIcon(WebLocalFrame* frame, WebIconURL::Type) {
|
| if (m_testInterfaces->testRunner()->shouldDumpIconChanges()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(string(" - didChangeIcons\n"));
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::didFinishDocumentLoad(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::didFinishDocumentLoad(WebLocalFrame* frame) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didFinishDocumentLoadForFrame\n");
|
| @@ -1096,16 +1101,14 @@ void WebTestProxyBase::didFinishDocumentLoad(WebFrame* frame)
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::didHandleOnloadEvents(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::didHandleOnloadEvents(WebLocalFrame* frame) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didHandleOnloadEventsForFrame\n");
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::didFailLoad(WebFrame* frame, const WebURLError&)
|
| -{
|
| +void WebTestProxyBase::didFailLoad(WebLocalFrame* frame, const WebURLError&) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didFailLoadWithError\n");
|
| @@ -1113,8 +1116,7 @@ void WebTestProxyBase::didFailLoad(WebFrame* frame, const WebURLError&)
|
| locationChangeDone(frame);
|
| }
|
|
|
| -void WebTestProxyBase::didFinishLoad(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::didFinishLoad(WebLocalFrame* frame) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(" - didFinishLoadForFrame\n");
|
| @@ -1122,20 +1124,20 @@ void WebTestProxyBase::didFinishLoad(WebFrame* frame)
|
| locationChangeDone(frame);
|
| }
|
|
|
| -void WebTestProxyBase::didDetectXSS(WebFrame*, const WebURL&, bool)
|
| -{
|
| +void WebTestProxyBase::didDetectXSS(WebLocalFrame*, const WebURL&, bool) {
|
| if (m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks())
|
| m_delegate->printMessage("didDetectXSS\n");
|
| }
|
|
|
| -void WebTestProxyBase::didDispatchPingLoader(WebFrame*, const WebURL& url)
|
| -{
|
| +void WebTestProxyBase::didDispatchPingLoader(WebLocalFrame*,
|
| + const WebURL& url) {
|
| if (m_testInterfaces->testRunner()->shouldDumpPingLoaderCallbacks())
|
| m_delegate->printMessage(string("PingLoader dispatched to '") + URLDescription(url).c_str() + "'.\n");
|
| }
|
|
|
| -void WebTestProxyBase::willRequestResource(WebFrame* frame, const blink::WebCachedURLRequest& request)
|
| -{
|
| +void WebTestProxyBase::willRequestResource(
|
| + WebLocalFrame* frame,
|
| + const blink::WebCachedURLRequest& request) {
|
| if (m_testInterfaces->testRunner()->shouldDumpResourceRequestCallbacks()) {
|
| printFrameDescription(m_delegate, frame);
|
| m_delegate->printMessage(string(" - ") + request.initiatorName().utf8().data());
|
| @@ -1143,8 +1145,11 @@ void WebTestProxyBase::willRequestResource(WebFrame* frame, const blink::WebCach
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::willSendRequest(WebFrame*, unsigned identifier, blink::WebURLRequest& request, const blink::WebURLResponse& redirectResponse)
|
| -{
|
| +void WebTestProxyBase::willSendRequest(
|
| + WebLocalFrame*,
|
| + unsigned identifier,
|
| + blink::WebURLRequest& request,
|
| + const blink::WebURLResponse& redirectResponse) {
|
| // Need to use GURL for host() and SchemeIs()
|
| GURL url = request.url();
|
| string requestURL = url.possibly_invalid_spec();
|
| @@ -1200,8 +1205,10 @@ void WebTestProxyBase::willSendRequest(WebFrame*, unsigned identifier, blink::We
|
| request.setURL(m_delegate->rewriteLayoutTestsURL(request.url().spec()));
|
| }
|
|
|
| -void WebTestProxyBase::didReceiveResponse(WebFrame*, unsigned identifier, const blink::WebURLResponse& response)
|
| -{
|
| +void WebTestProxyBase::didReceiveResponse(
|
| + WebLocalFrame*,
|
| + unsigned identifier,
|
| + const blink::WebURLResponse& response) {
|
| if (m_testInterfaces->testRunner()->shouldDumpResourceLoadCallbacks()) {
|
| if (m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end())
|
| m_delegate->printMessage("<unknown>");
|
| @@ -1222,8 +1229,10 @@ void WebTestProxyBase::didReceiveResponse(WebFrame*, unsigned identifier, const
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::didChangeResourcePriority(WebFrame*, unsigned identifier, const blink::WebURLRequest::Priority& priority)
|
| -{
|
| +void WebTestProxyBase::didChangeResourcePriority(
|
| + WebLocalFrame*,
|
| + unsigned identifier,
|
| + const blink::WebURLRequest::Priority& priority) {
|
| if (m_testInterfaces->testRunner()->shouldDumpResourcePriorities()) {
|
| if (m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end())
|
| m_delegate->printMessage("<unknown>");
|
| @@ -1235,8 +1244,8 @@ void WebTestProxyBase::didChangeResourcePriority(WebFrame*, unsigned identifier,
|
| }
|
| }
|
|
|
| -void WebTestProxyBase::didFinishResourceLoad(WebFrame*, unsigned identifier)
|
| -{
|
| +void WebTestProxyBase::didFinishResourceLoad(WebLocalFrame*,
|
| + unsigned identifier) {
|
| if (m_testInterfaces->testRunner()->shouldDumpResourceLoadCallbacks()) {
|
| if (m_resourceIdentifierMap.find(identifier) == m_resourceIdentifierMap.end())
|
| m_delegate->printMessage("<unknown>");
|
| @@ -1289,38 +1298,44 @@ void WebTestProxyBase::didAddMessageToConsole(const WebConsoleMessage& message,
|
| m_delegate->printMessage(string("\n"));
|
| }
|
|
|
| -void WebTestProxyBase::runModalAlertDialog(WebFrame*, const WebString& message)
|
| -{
|
| +void WebTestProxyBase::runModalAlertDialog(WebLocalFrame*,
|
| + const WebString& message) {
|
| m_delegate->printMessage(string("ALERT: ") + message.utf8().data() + "\n");
|
| }
|
|
|
| -bool WebTestProxyBase::runModalConfirmDialog(WebFrame*, const WebString& message)
|
| -{
|
| +bool WebTestProxyBase::runModalConfirmDialog(WebLocalFrame*,
|
| + const WebString& message) {
|
| m_delegate->printMessage(string("CONFIRM: ") + message.utf8().data() + "\n");
|
| return true;
|
| }
|
|
|
| -bool WebTestProxyBase::runModalPromptDialog(WebFrame* frame, const WebString& message, const WebString& defaultValue, WebString*)
|
| -{
|
| +bool WebTestProxyBase::runModalPromptDialog(WebLocalFrame* frame,
|
| + const WebString& message,
|
| + const WebString& defaultValue,
|
| + WebString*) {
|
| m_delegate->printMessage(string("PROMPT: ") + message.utf8().data() + ", default text: " + defaultValue.utf8().data() + "\n");
|
| return true;
|
| }
|
|
|
| -bool WebTestProxyBase::runModalBeforeUnloadDialog(WebFrame*, const WebString& message)
|
| -{
|
| +bool WebTestProxyBase::runModalBeforeUnloadDialog(WebLocalFrame*,
|
| + const WebString& message) {
|
| m_delegate->printMessage(string("CONFIRM NAVIGATION: ") + message.utf8().data() + "\n");
|
| return !m_testInterfaces->testRunner()->shouldStayOnPageAfterHandlingBeforeUnload();
|
| }
|
|
|
| -void WebTestProxyBase::locationChangeDone(WebFrame* frame)
|
| -{
|
| +void WebTestProxyBase::locationChangeDone(WebLocalFrame* frame) {
|
| if (frame != m_testInterfaces->testRunner()->topLoadingFrame())
|
| return;
|
| m_testInterfaces->testRunner()->setTopLoadingFrame(frame, true);
|
| }
|
|
|
| -WebNavigationPolicy WebTestProxyBase::decidePolicyForNavigation(WebFrame*, WebDataSource::ExtraData*, const WebURLRequest& request, WebNavigationType type, WebNavigationPolicy defaultPolicy, bool isRedirect)
|
| -{
|
| +WebNavigationPolicy WebTestProxyBase::decidePolicyForNavigation(
|
| + WebLocalFrame*,
|
| + WebDataSource::ExtraData*,
|
| + const WebURLRequest& request,
|
| + WebNavigationType type,
|
| + WebNavigationPolicy defaultPolicy,
|
| + bool isRedirect) {
|
| WebNavigationPolicy result;
|
| if (!m_testInterfaces->testRunner()->policyDelegateEnabled())
|
| return defaultPolicy;
|
| @@ -1336,8 +1351,10 @@ WebNavigationPolicy WebTestProxyBase::decidePolicyForNavigation(WebFrame*, WebDa
|
| return result;
|
| }
|
|
|
| -bool WebTestProxyBase::willCheckAndDispatchMessageEvent(WebFrame*, WebFrame*, WebSecurityOrigin, WebDOMMessageEvent)
|
| -{
|
| +bool WebTestProxyBase::willCheckAndDispatchMessageEvent(WebLocalFrame*,
|
| + WebFrame*,
|
| + WebSecurityOrigin,
|
| + WebDOMMessageEvent) {
|
| if (m_testInterfaces->testRunner()->shouldInterceptPostMessage()) {
|
| m_delegate->printMessage("intercepted postMessage\n");
|
| return true;
|
|
|