Title: [142568] trunk/Source
Revision
142568
Author
[email protected]
Date
2013-02-11 18:50:58 -0800 (Mon, 11 Feb 2013)

Log Message

[chromium] Add WebUnitTestSupport::createLayerTreeViewForTesting for webkit_unit_tests
https://bugs.webkit.org/show_bug.cgi?id=109403

Reviewed by Adam Barth.

Source/Platform:

webkit_unit_tests that need compositing support need only a simple WebLayerTreeView implementation, not the full
thing.

* chromium/public/WebCompositorSupport.h:
(WebCompositorSupport):
(WebKit::WebCompositorSupport::createLayerTreeView):
* chromium/public/WebUnitTestSupport.h:
(WebKit):
(WebUnitTestSupport):
(WebKit::WebUnitTestSupport::createLayerTreeViewForTesting):

Source/WebKit/chromium:

* tests/GraphicsLayerChromiumTest.cpp:
(WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
* tests/ScrollingCoordinatorChromiumTest.cpp:
(WebKit::FakeWebViewClient::initializeLayerTreeView):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (142567 => 142568)


--- trunk/Source/Platform/ChangeLog	2013-02-12 02:38:54 UTC (rev 142567)
+++ trunk/Source/Platform/ChangeLog	2013-02-12 02:50:58 UTC (rev 142568)
@@ -1,3 +1,21 @@
+2013-02-11  James Robinson  <[email protected]>
+
+        [chromium] Add WebUnitTestSupport::createLayerTreeViewForTesting for webkit_unit_tests
+        https://bugs.webkit.org/show_bug.cgi?id=109403
+
+        Reviewed by Adam Barth.
+
+        webkit_unit_tests that need compositing support need only a simple WebLayerTreeView implementation, not the full
+        thing.
+
+        * chromium/public/WebCompositorSupport.h:
+        (WebCompositorSupport):
+        (WebKit::WebCompositorSupport::createLayerTreeView):
+        * chromium/public/WebUnitTestSupport.h:
+        (WebKit):
+        (WebUnitTestSupport):
+        (WebKit::WebUnitTestSupport::createLayerTreeViewForTesting):
+
 2013-02-10  Florin Malita  <[email protected]>
 
         [Chromium] FilterTypeSaturatingBrightness enum

Modified: trunk/Source/Platform/chromium/public/WebCompositorSupport.h (142567 => 142568)


--- trunk/Source/Platform/chromium/public/WebCompositorSupport.h	2013-02-12 02:38:54 UTC (rev 142567)
+++ trunk/Source/Platform/chromium/public/WebCompositorSupport.h	2013-02-12 02:50:58 UTC (rev 142568)
@@ -69,9 +69,6 @@
     // after shutdown.
     virtual void shutdown() { }
 
-    // May return 0 if initialization fails.
-    virtual WebLayerTreeView* createLayerTreeView(WebLayerTreeViewClient*, const WebLayer& root, const WebLayerTreeView::Settings&) { return 0; }
-
     // Creates an output surface for the compositor backed by a 3d context.
     virtual WebCompositorOutputSurface* createOutputSurfaceFor3D(WebKit::WebGraphicsContext3D*) { return 0; }
 
@@ -107,6 +104,13 @@
 
     virtual WebTransformOperations* createTransformOperations() { return 0; }
 
+
+    // Testing ------------------------------------------------------
+
+    // DEPRECATED
+    // May return 0 if initialization fails.
+    virtual WebLayerTreeView* createLayerTreeView(WebLayerTreeViewClient*, const WebLayer& root, const WebLayerTreeView::Settings&) { return 0; }
+
 protected:
     virtual ~WebCompositorSupport() { }
 };

Modified: trunk/Source/Platform/chromium/public/WebUnitTestSupport.h (142567 => 142568)


--- trunk/Source/Platform/chromium/public/WebUnitTestSupport.h	2013-02-12 02:38:54 UTC (rev 142567)
+++ trunk/Source/Platform/chromium/public/WebUnitTestSupport.h	2013-02-12 02:50:58 UTC (rev 142568)
@@ -31,6 +31,7 @@
 
 namespace WebKit {
 
+class WebLayerTreeView;
 class WebURL;
 class WebURLResponse;
 struct WebURLError;
@@ -52,6 +53,18 @@
 
     // Returns the root directory of the WebKit code.
     virtual WebString webKitRootDir() { return WebString(); }
+
+    // Constructs a WebLayerTreeView set up with reasonable defaults for
+    // testing. A LayerTreeTypeUnitTest view can initialize and perform most
+    // operations, but is not capable of rendering pixels. A
+    // LayerTreeTypeLayoutTest view can render.
+
+#define HAVE_CREATELAYERTREEVIEWFORTESTING 1
+    enum TestViewType {
+        TestViewTypeUnitTest,
+        TestViewTypeLayoutTest
+    };
+    virtual WebLayerTreeView* createLayerTreeViewForTesting(TestViewType type) { return 0; }
 };
 
 }

Modified: trunk/Source/WebKit/chromium/ChangeLog (142567 => 142568)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-02-12 02:38:54 UTC (rev 142567)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-02-12 02:50:58 UTC (rev 142568)
@@ -1,3 +1,15 @@
+2013-02-11  James Robinson  <[email protected]>
+
+        [chromium] Add WebUnitTestSupport::createLayerTreeViewForTesting for webkit_unit_tests
+        https://bugs.webkit.org/show_bug.cgi?id=109403
+
+        Reviewed by Adam Barth.
+
+        * tests/GraphicsLayerChromiumTest.cpp:
+        (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
+        * tests/ScrollingCoordinatorChromiumTest.cpp:
+        (WebKit::FakeWebViewClient::initializeLayerTreeView):
+
 2013-02-11  Sheriff Bot  <[email protected]>
 
         Unreviewed.  Rolled Chromium DEPS to r181817.  Requested by

Modified: trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp (142567 => 142568)


--- trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp	2013-02-12 02:38:54 UTC (rev 142567)
+++ trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp	2013-02-12 02:50:58 UTC (rev 142568)
@@ -35,11 +35,11 @@
 #include "WebLayerTreeViewTestCommon.h"
 #include <gtest/gtest.h>
 #include <public/Platform.h>
-#include <public/WebCompositorSupport.h>
 #include <public/WebFloatAnimationCurve.h>
 #include <public/WebGraphicsContext3D.h>
 #include <public/WebLayerTreeView.h>
 #include <public/WebTransformationMatrix.h>
+#include <public/WebUnitTestSupport.h>
 #include <wtf/PassOwnPtr.h>
 
 using namespace WebCore;
@@ -62,7 +62,9 @@
         Platform::current()->compositorSupport()->initialize(0);
         m_graphicsLayer = adoptPtr(new GraphicsLayerChromium(&m_client));
         m_platformLayer = m_graphicsLayer->platformLayer();
-        m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(&m_layerTreeViewClient, *m_platformLayer, WebLayerTreeView::Settings()));
+        m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest));
+        ASSERT_TRUE(m_layerTreeView);
+        m_layerTreeView->setRootLayer(*m_platformLayer);
         m_layerTreeView->setViewportSize(WebSize(1, 1), WebSize(1, 1));
     }
 

Modified: trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp (142567 => 142568)


--- trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp	2013-02-12 02:38:54 UTC (rev 142567)
+++ trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp	2013-02-12 02:50:58 UTC (rev 142568)
@@ -59,8 +59,9 @@
 
     virtual void initializeLayerTreeView(WebLayerTreeViewClient* client, const WebLayer& rootLayer, const WebLayerTreeView::Settings& settings)
     {
-        m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(client, rootLayer, settings));
+        m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest));
         ASSERT(m_layerTreeView);
+        m_layerTreeView->setRootLayer(rootLayer);
     }
 
     virtual WebLayerTreeView* layerTreeView()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to