Changeset 142568 in webkit


Ignore:
Timestamp:
Feb 11, 2013 6:50:58 PM (11 years ago)
Author:
jamesr@google.com
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):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/Platform/ChangeLog

    r142496 r142568  
     12013-02-11  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Add WebUnitTestSupport::createLayerTreeViewForTesting for webkit_unit_tests
     4        https://bugs.webkit.org/show_bug.cgi?id=109403
     5
     6        Reviewed by Adam Barth.
     7
     8        webkit_unit_tests that need compositing support need only a simple WebLayerTreeView implementation, not the full
     9        thing.
     10
     11        * chromium/public/WebCompositorSupport.h:
     12        (WebCompositorSupport):
     13        (WebKit::WebCompositorSupport::createLayerTreeView):
     14        * chromium/public/WebUnitTestSupport.h:
     15        (WebKit):
     16        (WebUnitTestSupport):
     17        (WebKit::WebUnitTestSupport::createLayerTreeViewForTesting):
     18
    1192013-02-10  Florin Malita  <fmalita@chromium.org>
    220
  • trunk/Source/Platform/chromium/public/WebCompositorSupport.h

    r140184 r142568  
    7070    virtual void shutdown() { }
    7171
    72     // May return 0 if initialization fails.
    73     virtual WebLayerTreeView* createLayerTreeView(WebLayerTreeViewClient*, const WebLayer& root, const WebLayerTreeView::Settings&) { return 0; }
    74 
    7572    // Creates an output surface for the compositor backed by a 3d context.
    7673    virtual WebCompositorOutputSurface* createOutputSurfaceFor3D(WebKit::WebGraphicsContext3D*) { return 0; }
     
    108105    virtual WebTransformOperations* createTransformOperations() { return 0; }
    109106
     107
     108    // Testing ------------------------------------------------------
     109
     110    // DEPRECATED
     111    // May return 0 if initialization fails.
     112    virtual WebLayerTreeView* createLayerTreeView(WebLayerTreeViewClient*, const WebLayer& root, const WebLayerTreeView::Settings&) { return 0; }
     113
    110114protected:
    111115    virtual ~WebCompositorSupport() { }
  • trunk/Source/Platform/chromium/public/WebUnitTestSupport.h

    r142388 r142568  
    3232namespace WebKit {
    3333
     34class WebLayerTreeView;
    3435class WebURL;
    3536class WebURLResponse;
     
    5354    // Returns the root directory of the WebKit code.
    5455    virtual WebString webKitRootDir() { return WebString(); }
     56
     57    // Constructs a WebLayerTreeView set up with reasonable defaults for
     58    // testing. A LayerTreeTypeUnitTest view can initialize and perform most
     59    // operations, but is not capable of rendering pixels. A
     60    // LayerTreeTypeLayoutTest view can render.
     61
     62#define HAVE_CREATELAYERTREEVIEWFORTESTING 1
     63    enum TestViewType {
     64        TestViewTypeUnitTest,
     65        TestViewTypeLayoutTest
     66    };
     67    virtual WebLayerTreeView* createLayerTreeViewForTesting(TestViewType type) { return 0; }
    5568};
    5669
  • trunk/Source/WebKit/chromium/ChangeLog

    r142566 r142568  
     12013-02-11  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Add WebUnitTestSupport::createLayerTreeViewForTesting for webkit_unit_tests
     4        https://bugs.webkit.org/show_bug.cgi?id=109403
     5
     6        Reviewed by Adam Barth.
     7
     8        * tests/GraphicsLayerChromiumTest.cpp:
     9        (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest):
     10        * tests/ScrollingCoordinatorChromiumTest.cpp:
     11        (WebKit::FakeWebViewClient::initializeLayerTreeView):
     12
    1132013-02-11  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp

    r139829 r142568  
    3636#include <gtest/gtest.h>
    3737#include <public/Platform.h>
    38 #include <public/WebCompositorSupport.h>
    3938#include <public/WebFloatAnimationCurve.h>
    4039#include <public/WebGraphicsContext3D.h>
    4140#include <public/WebLayerTreeView.h>
    4241#include <public/WebTransformationMatrix.h>
     42#include <public/WebUnitTestSupport.h>
    4343#include <wtf/PassOwnPtr.h>
    4444
     
    6363        m_graphicsLayer = adoptPtr(new GraphicsLayerChromium(&m_client));
    6464        m_platformLayer = m_graphicsLayer->platformLayer();
    65         m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(&m_layerTreeViewClient, *m_platformLayer, WebLayerTreeView::Settings()));
     65        m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest));
     66        ASSERT_TRUE(m_layerTreeView);
     67        m_layerTreeView->setRootLayer(*m_platformLayer);
    6668        m_layerTreeView->setViewportSize(WebSize(1, 1), WebSize(1, 1));
    6769    }
  • trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp

    r142422 r142568  
    6060    virtual void initializeLayerTreeView(WebLayerTreeViewClient* client, const WebLayer& rootLayer, const WebLayerTreeView::Settings& settings)
    6161    {
    62         m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(client, rootLayer, settings));
     62        m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest));
    6363        ASSERT(m_layerTreeView);
     64        m_layerTreeView->setRootLayer(rootLayer);
    6465    }
    6566
Note: See TracChangeset for help on using the changeset viewer.