Title: [137997] trunk/Tools
Revision
137997
Author
joc...@chromium.org
Date
2012-12-18 01:05:03 -0800 (Tue, 18 Dec 2012)

Log Message

[chromium] move webintent related methods to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=105164

Reviewed by Darin Fisher.

Also deleted the unused deliveredIntentFailure and
deliveredIntentResult methods.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebKit):
(WebTestRunner::WebTestDelegate::setCurrentWebIntentRequest):
(WebTestRunner::WebTestDelegate::currentWebIntentRequest):
* DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
(WebKit):
(WebTestProxyBase):
(WebTestRunner::WebTestProxy::registerIntentService):
(WebTestRunner::WebTestProxy::dispatchIntent):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::sendWebIntentResponse):
(WebTestRunner):
(WebTestRunner::TestRunner::deliverWebIntent):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
(WebTestRunner::WebTestProxyBase::postAccessibilityNotification):
(WebTestRunner::WebTestProxyBase::registerIntentService):
(WebTestRunner):
(WebTestRunner::WebTestProxyBase::dispatchIntent):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::setCurrentWebIntentRequest):
(WebViewHost::currentWebIntentRequest):
* DumpRenderTree/chromium/WebViewHost.h:
(WebKit):
(WebViewHost):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (137996 => 137997)


--- trunk/Tools/ChangeLog	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/ChangeLog	2012-12-18 09:05:03 UTC (rev 137997)
@@ -1,5 +1,47 @@
 2012-12-18  Jochen Eisinger  <joc...@chromium.org>
 
+        [chromium] move webintent related methods to TestRunner library
+        https://bugs.webkit.org/show_bug.cgi?id=105164
+
+        Reviewed by Darin Fisher.
+
+        Also deleted the unused deliveredIntentFailure and
+        deliveredIntentResult methods.
+
+        * DumpRenderTree/chromium/DRTTestRunner.cpp:
+        (DRTTestRunner::DRTTestRunner):
+        * DumpRenderTree/chromium/DRTTestRunner.h:
+        (DRTTestRunner):
+        * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
+        (WebKit):
+        (WebTestRunner::WebTestDelegate::setCurrentWebIntentRequest):
+        (WebTestRunner::WebTestDelegate::currentWebIntentRequest):
+        * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
+        (WebKit):
+        (WebTestProxyBase):
+        (WebTestRunner::WebTestProxy::registerIntentService):
+        (WebTestRunner::WebTestProxy::dispatchIntent):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::TestRunner):
+        (WebTestRunner::TestRunner::sendWebIntentResponse):
+        (WebTestRunner):
+        (WebTestRunner::TestRunner::deliverWebIntent):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
+        (WebTestRunner::WebTestProxyBase::postAccessibilityNotification):
+        (WebTestRunner::WebTestProxyBase::registerIntentService):
+        (WebTestRunner):
+        (WebTestRunner::WebTestProxyBase::dispatchIntent):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::setCurrentWebIntentRequest):
+        (WebViewHost::currentWebIntentRequest):
+        * DumpRenderTree/chromium/WebViewHost.h:
+        (WebKit):
+        (WebViewHost):
+
+2012-12-18  Jochen Eisinger  <joc...@chromium.org>
+
         [chromium] move editing callback dumping to the WebTestProxy
         https://bugs.webkit.org/show_bug.cgi?id=105013
 

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2012-12-18 09:05:03 UTC (rev 137997)
@@ -50,8 +50,6 @@
 #include "WebGeolocationClientMock.h"
 #include "WebIDBFactory.h"
 #include "WebInputElement.h"
-#include "WebIntent.h"
-#include "WebIntentRequest.h"
 #include "WebKit.h"
 #include "WebNotificationPresenter.h"
 #include "WebPermissions.h"
@@ -87,23 +85,12 @@
 using namespace WebTestRunner;
 using namespace std;
 
-class EmptyWebDeliveredIntentClient : public WebKit::WebDeliveredIntentClient {
-public:
-    EmptyWebDeliveredIntentClient() { }
-    ~EmptyWebDeliveredIntentClient() { }
-
-    virtual void postResult(const WebSerializedScriptValue& data) const { }
-    virtual void postFailure(const WebSerializedScriptValue& data) const { }
-    virtual void destroy() { }
-};
-
 DRTTestRunner::DRTTestRunner(TestShell* shell)
     : m_shell(shell)
     , m_closeRemainingWindows(false)
     , m_deferMainResourceDataLoad(false)
     , m_showDebugLayerTree(false)
     , m_workQueue(this)
-    , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient))
     , m_shouldStayOnPageAfterHandlingBeforeUnload(false)
 {
 
@@ -208,8 +195,6 @@
     bindProperty("webHistoryItemCount", &m_webHistoryItemCount);
     bindProperty("titleTextDirection", &m_titleTextDirection);
     bindProperty("interceptPostMessage", &m_interceptPostMessage);
-    bindMethod("sendWebIntentResponse", &DRTTestRunner::sendWebIntentResponse);
-    bindMethod("deliverWebIntent", &DRTTestRunner::deliverWebIntent);
 }
 
 DRTTestRunner::~DRTTestRunner()
@@ -1051,49 +1036,6 @@
     result->setNull();
 }
 
-void DRTTestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result)
-{
-    v8::HandleScope scope;
-    v8::Local<v8::Context> ctx = m_shell->webView()->mainFrame()->mainWorldScriptContext();
-    result->set(m_shell->webView()->mainFrame()->selectionAsMarkup().utf8());
-    v8::Context::Scope cscope(ctx);
-
-    WebKit::WebIntentRequest* request = m_shell->webViewHost()->currentIntentRequest();
-    if (request->isNull())
-        return;
-
-    if (arguments.size() == 1) {
-        WebKit::WebCString reply = cppVariantToWebString(arguments[0]).utf8();
-        v8::Handle<v8::Value> v8value = v8::String::New(reply.data(), reply.length());
-        request->postResult(WebKit::WebSerializedScriptValue::serialize(v8value));
-    } else {
-        v8::Handle<v8::Value> v8value = v8::String::New("ERROR");
-        request->postFailure(WebKit::WebSerializedScriptValue::serialize(v8value));
-    }
-    result->setNull();
-}
-
-void DRTTestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result)
-{
-    if (arguments.size() <  3)
-        return;
-
-    v8::HandleScope scope;
-    v8::Local<v8::Context> ctx = m_shell->webView()->mainFrame()->mainWorldScriptContext();
-    result->set(m_shell->webView()->mainFrame()->selectionAsMarkup().utf8());
-    v8::Context::Scope cscope(ctx);
-
-    WebString action = ""
-    WebString type = cppVariantToWebString(arguments[1]);
-    WebKit::WebCString data = ""
-    WebSerializedScriptValue serializedData = WebSerializedScriptValue::serialize(
-        v8::String::New(data.data(), data.length()));
-
-    WebIntent intent = WebIntent::create(action, type, serializedData.toString(), WebVector<WebString>(), WebVector<WebString>());
-
-    m_shell->webView()->mainFrame()->deliverIntent(intent, 0, m_intentClient.get());
-}
-
 class InvokeCallbackTask : public WebMethodTask<DRTTestRunner> {
 public:
     InvokeCallbackTask(DRTTestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments)

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2012-12-18 09:05:03 UTC (rev 137997)
@@ -43,7 +43,6 @@
 #define DRTTestRunner_h
 
 #include "TestRunner/src/TestRunner.h"
-#include "WebDeliveredIntentClient.h"
 #include "WebTask.h"
 #include "WebTextDirection.h"
 #include "platform/WebArrayBufferView.h"
@@ -274,13 +273,6 @@
     void setPointerLockWillRespondAsynchronously(const CppArgumentList&, CppVariant*);
 #endif
 
-    // Expects one string argument for sending successful result, zero
-    // arguments for sending a failure result.
-    void sendWebIntentResponse(const CppArgumentList&, CppVariant*);
-
-    // Cause the web intent to be delivered to this context.
-    void deliverWebIntent(const CppArgumentList&, CppVariant*);
-
     // Used to set the device scale factor.
     void setBackingScaleFactor(const CppArgumentList&, CppVariant*);
 
@@ -515,9 +507,6 @@
     // WAV audio data is stored here.
     WebKit::WebArrayBufferView m_audioData;
 
-    // Mock object for testing delivering web intents.
-    OwnPtr<WebKit::WebDeliveredIntentClient> m_intentClient;
-
     bool m_shouldStayOnPageAfterHandlingBeforeUnload;
 };
 

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h	2012-12-18 09:05:03 UTC (rev 137997)
@@ -38,6 +38,7 @@
 namespace WebKit {
 struct WebContextMenuData;
 class WebGamepads;
+class WebIntentRequest;
 }
 
 namespace WebTestRunner {
@@ -71,6 +72,8 @@
     virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string&) { return WebKit::WebURL(); }
     virtual WebPreferences* preferences() { return 0; }
     virtual void applyPreferences() { };
+    virtual void setCurrentWebIntentRequest(const WebKit::WebIntentRequest&) { };
+    virtual WebKit::WebIntentRequest* currentWebIntentRequest() { return 0; }
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h	2012-12-18 09:05:03 UTC (rev 137997)
@@ -43,10 +43,13 @@
 class WebDragData;
 class WebFrame;
 class WebImage;
+class WebIntentRequest;
+class WebIntentServiceInfo;
 class WebNode;
 class WebRange;
 class WebString;
 struct WebPoint;
+class WebSerializedScriptValue;
 struct WebSize;
 }
 
@@ -88,6 +91,8 @@
     void didChangeSelection(bool isEmptySelection);
     void didChangeContents();
     void didEndEditing();
+    void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&);
+    void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&);
 
 private:
     WebTestInterfaces* m_testInterfaces;
@@ -208,6 +213,16 @@
         WebTestProxyBase::didEndEditing();
         WebViewClientImpl::didEndEditing();
     }
+    virtual void registerIntentService(WebKit::WebFrame* frame, const WebKit::WebIntentServiceInfo& service)
+    {
+        WebTestProxyBase::registerIntentService(frame, service);
+        WebViewClientImpl::registerIntentService(frame, service);
+    }
+    virtual void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest& request)
+    {
+        WebTestProxyBase::dispatchIntent(source, request);
+        WebViewClientImpl::dispatchIntent(source, request);
+    }
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2012-12-18 09:05:03 UTC (rev 137997)
@@ -39,6 +39,8 @@
 #include "WebFindOptions.h"
 #include "WebFrame.h"
 #include "WebInputElement.h"
+#include "WebIntent.h"
+#include "WebIntentRequest.h"
 #include "WebPreferences.h"
 #include "WebScriptSource.h"
 #include "WebSecurityPolicy.h"
@@ -48,6 +50,7 @@
 #include "WebView.h"
 #include "WebWorkerInfo.h"
 #include "platform/WebPoint.h"
+#include "platform/WebSerializedScriptValue.h"
 #include "v8/include/v8.h"
 #include <wtf/text/WTFString.h>
 
@@ -60,9 +63,24 @@
 
 namespace WebTestRunner {
 
+namespace {
+
+class EmptyWebDeliveredIntentClient : public WebDeliveredIntentClient {
+public:
+    EmptyWebDeliveredIntentClient() { }
+    ~EmptyWebDeliveredIntentClient() { }
+
+    virtual void postResult(const WebSerializedScriptValue& data) const { }
+    virtual void postFailure(const WebSerializedScriptValue& data) const { }
+    virtual void destroy() { }
+};
+
+}
+
 TestRunner::TestRunner()
     : m_delegate(0)
     , m_webView(0)
+    , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient))
 {
     // Methods implemented in terms of chromium's public WebKit API.
     bindMethod("setTabKeyCyclesThroughElements", &TestRunner::setTabKeyCyclesThroughElements);
@@ -117,6 +135,10 @@
     // The following modify the state of the TestRunner.
     bindMethod("dumpEditingCallbacks", &TestRunner::dumpEditingCallbacks);
 
+    // The following methods interact with the WebTestProxy.
+    bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse);
+    bindMethod("deliverWebIntent", &TestRunner::deliverWebIntent);
+
     // Properties.
     bindProperty("workerThreadCount", &TestRunner::workerThreadCount);
     bindProperty("globalFlag", &m_globalFlag);
@@ -851,6 +873,48 @@
     result->setNull();
 }
 
+void TestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result)
+{
+    v8::HandleScope scope;
+    v8::Local<v8::Context> ctx = m_webView->mainFrame()->mainWorldScriptContext();
+    result->set(m_webView->mainFrame()->selectionAsMarkup().utf8());
+    v8::Context::Scope cscope(ctx);
+
+    WebIntentRequest* request = m_delegate->currentWebIntentRequest();
+    if (request->isNull())
+        return;
+
+    if (arguments.size() == 1) {
+        WebCString reply = cppVariantToWebString(arguments[0]).utf8();
+        v8::Handle<v8::Value> v8value = v8::String::New(reply.data(), reply.length());
+        request->postResult(WebSerializedScriptValue::serialize(v8value));
+    } else {
+        v8::Handle<v8::Value> v8value = v8::String::New("ERROR");
+        request->postFailure(WebSerializedScriptValue::serialize(v8value));
+    }
+    result->setNull();
+}
+
+void TestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() <  3)
+        return;
+
+    v8::HandleScope scope;
+    v8::Local<v8::Context> ctx = m_webView->mainFrame()->mainWorldScriptContext();
+    result->set(m_webView->mainFrame()->selectionAsMarkup().utf8());
+    v8::Context::Scope cscope(ctx);
+
+    WebString action = ""
+    WebString type = cppVariantToWebString(arguments[1]);
+    WebCString data = ""
+    WebSerializedScriptValue serializedData = WebSerializedScriptValue::serialize(v8::String::New(data.data(), data.length()));
+
+    WebIntent intent = WebIntent::create(action, type, serializedData.toString(), WebVector<WebString>(), WebVector<WebString>());
+
+    m_webView->mainFrame()->deliverIntent(intent, 0, m_intentClient.get());
+}
+
 void TestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
 {
     m_dumpEditingCallbacks = true;

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2012-12-18 09:05:03 UTC (rev 137997)
@@ -33,6 +33,7 @@
 #define TestRunner_h
 
 #include "CppBoundClass.h"
+#include "WebDeliveredIntentClient.h"
 #include "WebTestRunner.h"
 #include "platform/WebURL.h"
 
@@ -186,6 +187,16 @@
     void dumpEditingCallbacks(const CppArgumentList&, CppVariant*);
 
     ///////////////////////////////////////////////////////////////////////////
+    // Methods interacting with the WebTestProxy
+
+    // Expects one string argument for sending successful result, zero
+    // arguments for sending a failure result.
+    void sendWebIntentResponse(const CppArgumentList&, CppVariant*);
+
+    // Cause the web intent to be delivered to this context.
+    void deliverWebIntent(const CppArgumentList&, CppVariant*);
+
+    ///////////////////////////////////////////////////////////////////////////
     // Properties
     void workerThreadCount(CppVariant*);
 
@@ -223,6 +234,9 @@
 
     WebTestDelegate* m_delegate;
     WebKit::WebView* m_webView;
+
+    // Mock object for testing delivering web intents.
+    OwnPtr<WebKit::WebDeliveredIntentClient> m_intentClient;
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp	2012-12-18 09:05:03 UTC (rev 137997)
@@ -36,6 +36,9 @@
 #include "WebAccessibilityObject.h"
 #include "WebElement.h"
 #include "WebEventSender.h"
+#include "WebIntent.h"
+#include "WebIntentRequest.h"
+#include "WebIntentServiceInfo.h"
 #include "WebNode.h"
 #include "WebRange.h"
 #include "WebTestDelegate.h"
@@ -392,4 +395,35 @@
         m_delegate->printMessage("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n");
 }
 
+void WebTestProxyBase::registerIntentService(WebFrame*, const WebIntentServiceInfo& service)
+{
+    m_delegate->printMessage(string("Registered Web Intent Service: action="" + service.action().utf8().data() + " type=" + service.type().utf8().data() + " title=" + service.title().utf8().data() + " url="" + service.url().spec().data() + " disposition=" + service.disposition().utf8().data() + "\n");
 }
+
+void WebTestProxyBase::dispatchIntent(WebFrame* source, const WebIntentRequest& request)
+{
+    m_delegate->printMessage(string("Received Web Intent: action="" + request.intent().action().utf8().data() + " type=" + request.intent().type().utf8().data() + "\n");
+    WebMessagePortChannelArray* ports = request.intent().messagePortChannelsRelease();
+    m_delegate->setCurrentWebIntentRequest(request);
+    if (ports) {
+        char data[100];
+        snprintf(data, sizeof(data), "Have %d ports\n", static_cast<int>(ports->size()));
+        m_delegate->printMessage(data);
+        for (size_t i = 0; i < ports->size(); ++i)
+            (*ports)[i]->destroy();
+        delete ports;
+    }
+
+    if (!request.intent().service().isEmpty())
+        m_delegate->printMessage(string("Explicit intent service: ") + request.intent().service().spec().data() + "\n");
+
+    WebVector<WebString> extras = request.intent().extrasNames();
+    for (size_t i = 0; i < extras.size(); ++i)
+        m_delegate->printMessage(string("Extras[") + extras[i].utf8().data() + "] = " + request.intent().extrasValue(extras[i]).utf8().data() + "\n");
+
+    WebVector<WebURL> suggestions = request.intent().suggestions();
+    for (size_t i = 0; i < suggestions.size(); ++i)
+        m_delegate->printMessage(string("Have suggestion ") + suggestions[i].spec().data() + "\n");
+}
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2012-12-18 09:05:03 UTC (rev 137997)
@@ -50,8 +50,6 @@
 #include "WebFrame.h"
 #include "WebGeolocationClientMock.h"
 #include "WebHistoryItem.h"
-#include "WebIntent.h"
-#include "WebIntentServiceInfo.h"
 #include "WebKit.h"
 #include "WebNode.h"
 #include "WebPluginParams.h"
@@ -1183,50 +1181,6 @@
     return false;
 }
 
-void WebViewHost::registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo& service)
-{
-    printf("Registered Web Intent Service: action="" type=%s title=%s url="" disposition=%s\n",
-           service.action().utf8().data(), service.type().utf8().data(), service.title().utf8().data(), service.url().spec().data(), service.disposition().utf8().data());
-}
-
-void WebViewHost::dispatchIntent(WebFrame* source, const WebIntentRequest& request)
-{
-    printf("Received Web Intent: action="" type=%s\n",
-           request.intent().action().utf8().data(),
-           request.intent().type().utf8().data());
-    WebMessagePortChannelArray* ports = request.intent().messagePortChannelsRelease();
-    m_currentRequest = request;
-    if (ports) {
-        printf("Have %d ports\n", static_cast<int>(ports->size()));
-        for (size_t i = 0; i < ports->size(); ++i)
-            (*ports)[i]->destroy();
-        delete ports;
-    }
-
-    if (!request.intent().service().isEmpty())
-        printf("Explicit intent service: %s\n", request.intent().service().spec().data());
-
-    WebVector<WebString> extras = request.intent().extrasNames();
-    for (size_t i = 0; i < extras.size(); ++i) {
-        printf("Extras[%s] = %s\n", extras[i].utf8().data(),
-               request.intent().extrasValue(extras[i]).utf8().data());
-    }
-
-    WebVector<WebURL> suggestions = request.intent().suggestions();
-    for (size_t i = 0; i < suggestions.size(); ++i)
-        printf("Have suggestion %s\n", suggestions[i].spec().data());
-}
-
-void WebViewHost::deliveredIntentResult(WebFrame* frame, int id, const WebSerializedScriptValue& data)
-{
-    printf("Web intent success for id %d\n", id);
-}
-
-void WebViewHost::deliveredIntentFailure(WebFrame* frame, int id, const WebSerializedScriptValue& data)
-{
-    printf("Web intent failure for id %d\n", id);
-}
-
 // WebTestDelegate ------------------------------------------------------------
 
 WebContextMenuData* WebViewHost::lastContextMenuData() const
@@ -1311,6 +1265,16 @@
     m_shell->applyPreferences();
 }
 
+void WebViewHost::setCurrentWebIntentRequest(const WebIntentRequest& request)
+{
+    m_currentRequest = request;
+}
+
+WebIntentRequest* WebViewHost::currentWebIntentRequest()
+{
+    return &m_currentRequest;
+}
+
 // Public functions -----------------------------------------------------------
 
 WebViewHost::WebViewHost(TestShell* shell)

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (137996 => 137997)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2012-12-18 09:02:09 UTC (rev 137996)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2012-12-18 09:05:03 UTC (rev 137997)
@@ -62,7 +62,6 @@
 class WebGeolocationClient;
 class WebGeolocationClientMock;
 class WebGeolocationServiceMock;
-class WebIntentServiceInfo;
 class WebSerializedScriptValue;
 class WebSharedWorkerClient;
 class WebSpeechInputController;
@@ -147,6 +146,8 @@
     virtual WebKit::WebURL rewriteLayoutTestsURL(const std::string&) OVERRIDE;
     virtual WebTestRunner::WebPreferences* preferences() OVERRIDE;
     virtual void applyPreferences() OVERRIDE;
+    virtual void setCurrentWebIntentRequest(const WebKit::WebIntentRequest&) OVERRIDE;
+    virtual WebKit::WebIntentRequest* currentWebIntentRequest() OVERRIDE;
 
     // NavigationHost
     virtual bool navigate(const TestNavigationEntry&, bool reload);
@@ -275,10 +276,6 @@
     virtual bool willCheckAndDispatchMessageEvent(
         WebKit::WebFrame* sourceFrame, WebKit::WebFrame* targetFrame, 
         WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent);
-    virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&);
-    virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&);
-    virtual void deliveredIntentResult(WebKit::WebFrame*, int, const WebKit::WebSerializedScriptValue&);
-    virtual void deliveredIntentFailure(WebKit::WebFrame*, int, const WebKit::WebSerializedScriptValue&);
 
     WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();
     
@@ -292,9 +289,6 @@
     // Pending task list, Note taht the method is referred from WebMethodTask class.
     WebTestRunner::WebTaskList* taskList() { return &m_taskList; }
 
-    // The current web intents request.
-    WebKit::WebIntentRequest* currentIntentRequest() { return &m_currentRequest; }
-
 private:
 
     class HostMethodTask : public WebTestRunner::WebMethodTask<WebViewHost> {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to