[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 15:53:49 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 947673e1a75b0dd57dc1b139148f837435fd6504
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 16 10:54:20 2010 +0000

    2010-11-16  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Assert that DeviceOrientationClientMock is used by only one controller.
            https://bugs.webkit.org/show_bug.cgi?id=48506
    
            This is a design constraint of the DeviceOrientationClientMock because the
            m_controller field can only store a pointer to a single instance of the
            corresponding DeviceOrientationController.
    
            * platform/mock/DeviceOrientationClientMock.cpp:
            (WebCore::DeviceOrientationClientMock::setController):
    2010-11-16  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Move DeviceOrientationClientMock from LayoutTestController to WebViewHost.
            https://bugs.webkit.org/show_bug.cgi?id=48506
    
            This ensures that there is one mock per page WebView / WebViewHost. This is a
            design constraint of the DeviceOrientationClientMock because the m_controller
            field can only store a pointer to a single instance of the corresponding
            DeviceOrientationController.
    
            Test: fast/dom/DeviceOrientation/no-page-cache.html
    
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::setMockDeviceOrientation):
            (LayoutTestController::deviceOrientationClientMock):
            * DumpRenderTree/chromium/LayoutTestController.h:
            * DumpRenderTree/chromium/WebViewHost.cpp:
            (WebViewHost::deviceOrientationClientMock):
            (WebViewHost::deviceOrientationClient):
            (WebViewHost::reset):
            * DumpRenderTree/chromium/WebViewHost.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1c74926..6e57bcb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-16  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Assert that DeviceOrientationClientMock is used by only one controller.
+        https://bugs.webkit.org/show_bug.cgi?id=48506
+
+        This is a design constraint of the DeviceOrientationClientMock because the
+        m_controller field can only store a pointer to a single instance of the
+        corresponding DeviceOrientationController.
+
+        * platform/mock/DeviceOrientationClientMock.cpp:
+        (WebCore::DeviceOrientationClientMock::setController):
+
 2010-11-16  Mihai Parparita  <mihaip at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/platform/mock/DeviceOrientationClientMock.cpp b/WebCore/platform/mock/DeviceOrientationClientMock.cpp
index c2c9316..2fa5acb 100644
--- a/WebCore/platform/mock/DeviceOrientationClientMock.cpp
+++ b/WebCore/platform/mock/DeviceOrientationClientMock.cpp
@@ -39,6 +39,7 @@ DeviceOrientationClientMock::DeviceOrientationClientMock()
 
 void DeviceOrientationClientMock::setController(DeviceOrientationController* controller)
 {
+    ASSERT(!m_controller);
     m_controller = controller;
     ASSERT(m_controller);
 }
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index d316717..16d01ae 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2010-11-16  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Move DeviceOrientationClientMock from LayoutTestController to WebViewHost.
+        https://bugs.webkit.org/show_bug.cgi?id=48506
+
+        This ensures that there is one mock per page WebView / WebViewHost. This is a
+        design constraint of the DeviceOrientationClientMock because the m_controller
+        field can only store a pointer to a single instance of the corresponding
+        DeviceOrientationController.
+
+        Test: fast/dom/DeviceOrientation/no-page-cache.html
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::setMockDeviceOrientation):
+        (LayoutTestController::deviceOrientationClientMock):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::deviceOrientationClientMock):
+        (WebViewHost::deviceOrientationClient):
+        (WebViewHost::reset):
+        * DumpRenderTree/chromium/WebViewHost.h:
+
 2010-11-15  Andras Becsi  <abecsi at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index 5b0c844..386bba3 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -1502,9 +1502,10 @@ void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& argum
         return;
 
     WebDeviceOrientation orientation(arguments[0].toBoolean(), arguments[1].toDouble(), arguments[2].toBoolean(), arguments[3].toDouble(), arguments[4].toBoolean(), arguments[5].toDouble());
-
-    ASSERT(m_deviceOrientationClientMock);
-    m_deviceOrientationClientMock->setOrientation(orientation);
+    // Note that we only call setOrientation on the main page's mock since this is all that the
+    // tests require. If necessary, we could get a list of WebViewHosts from the TestShell and
+    // call setOrientation on each DeviceOrientationClientMock.
+    m_shell->webViewHost()->deviceOrientationClientMock()->setOrientation(orientation);
 }
 
 void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
@@ -1566,13 +1567,6 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp
         result->set(element.document().frame()->markerTextForListItem(element).utf8());
 }
 
-WebDeviceOrientationClient* LayoutTestController::deviceOrientationClient()
-{
-    if (!m_deviceOrientationClientMock.get())
-        m_deviceOrientationClientMock.set(WebDeviceOrientationClientMock::create());
-    return m_deviceOrientationClientMock.get();
-}
-
 void LayoutTestController::hasSpellingMarker(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index fc16827..62f473c 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -49,8 +49,6 @@
 #include <wtf/OwnPtr.h>
 
 namespace WebKit {
-class WebDeviceOrientationClient;
-class WebDeviceOrientationClientMock;
 class WebSpeechInputController;
 class WebSpeechInputControllerMock;
 class WebSpeechInputListener;
@@ -340,7 +338,6 @@ public:
     void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
 
     WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
-    WebKit::WebDeviceOrientationClient* deviceOrientationClient();
     bool shouldDumpAsText() { return m_dumpAsText; }
     bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
     bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
@@ -545,8 +542,6 @@ private:
     WebKit::WebURL m_userStyleSheetLocation;
 
     OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
-
-    OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
 };
 
 #endif // LayoutTestController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index 3f126be..c4e4a76 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -39,6 +39,7 @@
 #include "WebConsoleMessage.h"
 #include "WebContextMenuData.h"
 #include "WebDataSource.h"
+#include "WebDeviceOrientationClientMock.h"
 #include "WebDragData.h"
 #include "WebElement.h"
 #include "WebFrame.h"
@@ -583,9 +584,16 @@ WebSpeechInputController* WebViewHost::speechInputController(WebKit::WebSpeechIn
     return m_shell->layoutTestController()->speechInputController(listener);
 }
 
-WebKit::WebDeviceOrientationClient* WebViewHost::deviceOrientationClient()
+WebDeviceOrientationClientMock* WebViewHost::deviceOrientationClientMock()
 {
-    return m_shell->layoutTestController()->deviceOrientationClient();
+    if (!m_deviceOrientationClientMock.get())
+        m_deviceOrientationClientMock.set(WebDeviceOrientationClientMock::create());
+    return m_deviceOrientationClientMock.get();
+}
+
+WebDeviceOrientationClient* WebViewHost::deviceOrientationClient()
+{
+    return deviceOrientationClientMock();
 }
 
 // WebWidgetClient -----------------------------------------------------------
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index 213cf3d..5fc00f1 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -47,6 +47,7 @@ class TestShell;
 namespace WebKit {
 class WebFrame;
 class WebDeviceOrientationClient;
+class WebDeviceOrientationClientMock;
 class WebGeolocationServiceMock;
 class WebSpeechInputController;
 class WebSpeechInputListener;
@@ -199,6 +200,8 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
     virtual bool allowScript(WebKit::WebFrame*, bool enabledPerSettings);
     virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
 
+    WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();
+
 private:
     LayoutTestController* layoutTestController() const;
 
@@ -305,6 +308,8 @@ private:
     OwnPtr<WebKit::WebGeolocationServiceMock> m_geolocationServiceMock;
 #endif
 
+    OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
+
     OwnPtr<TestNavigationController*> m_navigationController;
 };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list