Changeset 116362 in webkit


Ignore:
Timestamp:
May 7, 2012 4:00:17 PM (12 years ago)
Author:
danakj@chromium.org
Message:

[chromium] Ensure synchronization in threaded unit tests by checking the sourceFrameNumber() to count commits
https://bugs.webkit.org/show_bug.cgi?id=85390

Reviewed by Adrienne Walker.

  • tests/CCLayerTreeHostTest.cpp:

(WTF::CCLayerTreeHostTestScrollMultipleRedraw::beginCommitOnCCThread):
(WTF::CCLayerTreeHostTestAtomicCommit::commitCompleteOnCCThread):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::commitCompleteOnCCThread):
(WTF::CCLayerTreeHostTestScrollChildLayer::beginCommitOnCCThread):

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r116359 r116362  
     12012-05-07  Dana Jansens  <danakj@chromium.org>
     2
     3        [chromium] Ensure synchronization in threaded unit tests by checking the sourceFrameNumber() to count commits
     4        https://bugs.webkit.org/show_bug.cgi?id=85390
     5
     6        Reviewed by Adrienne Walker.
     7
     8        * tests/CCLayerTreeHostTest.cpp:
     9        (WTF::CCLayerTreeHostTestScrollMultipleRedraw::beginCommitOnCCThread):
     10        (WTF::CCLayerTreeHostTestAtomicCommit::commitCompleteOnCCThread):
     11        (WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::commitCompleteOnCCThread):
     12        (WTF::CCLayerTreeHostTestScrollChildLayer::beginCommitOnCCThread):
     13
    1142012-05-07  Adrienne Walker  <enne@google.com>
    215
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp

    r116270 r116362  
    13411341    {
    13421342        LayerChromium* root = m_layerTreeHost->rootLayer();
    1343         if (!m_layerTreeHost->frameNumber())
     1343        if (!impl->sourceFrameNumber())
    13441344            EXPECT_EQ(root->scrollPosition(), m_initialScroll);
    1345         else if (m_layerTreeHost->frameNumber() == 1)
     1345        else if (impl->sourceFrameNumber() == 1)
    13461346            EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount + m_scrollAmount);
    1347         else if (m_layerTreeHost->frameNumber() == 2)
     1347        else if (impl->sourceFrameNumber() == 2)
    13481348            EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount + m_scrollAmount);
    13491349    }
     
    17121712        CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()));
    17131713
    1714         switch (impl->frameNumber()) {
     1714        switch (impl->sourceFrameNumber()) {
    17151715        case 0:
    17161716            // Number of textures should be one.
    1717             EXPECT_EQ(1, context->numTextures());
     1717            ASSERT_EQ(1, context->numTextures());
    17181718            // Number of textures used for commit should be one.
    17191719            EXPECT_EQ(1, context->numUsedTextures());
     
    17261726            // Number of textures should be two as the first texture
    17271727            // is used by impl thread and cannot by used for update.
    1728             EXPECT_EQ(2, context->numTextures());
     1728            ASSERT_EQ(2, context->numTextures());
    17291729            // Number of textures used for commit should still be one.
    17301730            EXPECT_EQ(1, context->numUsedTextures());
     
    17491749        EXPECT_EQ(1, context->numUsedTextures());
    17501750
    1751         if (impl->frameNumber() < 2) {
     1751        if (impl->sourceFrameNumber() < 1) {
    17521752            context->resetUsedTextures();
    17531753            postSetNeedsAnimateAndCommitToMainThread();
     
    18161816        CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(impl->context()));
    18171817
    1818         switch (impl->frameNumber()) {
     1818        switch (impl->sourceFrameNumber()) {
    18191819        case 0:
    18201820            // Number of textures should be two.
    1821             EXPECT_EQ(2, context->numTextures());
     1821            ASSERT_EQ(2, context->numTextures());
    18221822            // Number of textures used for commit should be two.
    18231823            EXPECT_EQ(2, context->numUsedTextures());
     
    18311831            // Number of textures should be four as the first two
    18321832            // textures are used by the impl thread.
    1833             EXPECT_EQ(4, context->numTextures());
     1833            ASSERT_EQ(4, context->numTextures());
    18341834            // Number of textures used for commit should still be two.
    18351835            EXPECT_EQ(2, context->numUsedTextures());
     
    18471847            // partial update and the first two textures are used by
    18481848            // the impl thread.
    1849             EXPECT_EQ(3, context->numTextures());
     1849            ASSERT_EQ(3, context->numTextures());
    18501850            // Number of textures used for commit should still be two.
    18511851            EXPECT_EQ(2, context->numUsedTextures());
     
    18871887        // Number of textures used for drawing should two except for frame 4
    18881888        // where the viewport only contains one layer.
    1889         if (impl->frameNumber() == 4)
     1889        if (impl->sourceFrameNumber() == 3)
    18901890            EXPECT_EQ(1, context->numUsedTextures());
    18911891        else
    18921892            EXPECT_EQ(2, context->numUsedTextures());
    18931893
    1894         if (impl->frameNumber() < 5) {
     1894        if (impl->sourceFrameNumber() < 4) {
    18951895            context->resetUsedTextures();
    18961896            postSetNeedsAnimateAndCommitToMainThread();
Note: See TracChangeset for help on using the changeset viewer.