Title: [97692] trunk/Source
Revision
97692
Author
[email protected]
Date
2011-10-17 18:24:02 -0700 (Mon, 17 Oct 2011)

Log Message

Unreviewed, rolling out r97690.
http://trac.webkit.org/changeset/97690
https://bugs.webkit.org/show_bug.cgi?id=70161

Hits assertion in CCLayerTreeHostTests

Source/WebCore:

* WebCore.gypi:
* platform/graphics/chromium/cc/CCMainThread.h:
* platform/graphics/chromium/cc/CCMainThreadTask.h:
(WebCore::createMainThreadTask):
* platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Removed.
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxySchedulerClient::scheduleBeginFrameAndCommit):
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::stop):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTest::CCLayerTreeHostTest):
(WTF::CCLayerTreeHostTest::onEndTest):
(WTF::CCLayerTreeHostTest::runTest):
(WTF::CCLayerTreeHostTest::testTimeout):
(WTF::CCLayerTreeHostTest::doBeginTest):
(WTF::CCLayerTreeHostTest::endTest):
(WTF::CCLayerTreeHostTestThreadOnly::runTest):
(WTF::TEST_F):
(WTF::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread):
* tests/CCThreadTest.cpp:
(WebKit::PingPongTestUsingTasks::ping):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97691 => 97692)


--- trunk/Source/WebCore/ChangeLog	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/ChangeLog	2011-10-18 01:24:02 UTC (rev 97692)
@@ -1,3 +1,22 @@
+2011-10-17  James Robinson  <[email protected]>
+
+        Unreviewed, rolling out r97690.
+        http://trac.webkit.org/changeset/97690
+        https://bugs.webkit.org/show_bug.cgi?id=70161
+
+        Hits assertion in CCLayerTreeHostTests
+
+        * WebCore.gypi:
+        * platform/graphics/chromium/cc/CCMainThread.h:
+        * platform/graphics/chromium/cc/CCMainThreadTask.h:
+        (WebCore::createMainThreadTask):
+        * platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Removed.
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxySchedulerClient::scheduleBeginFrameAndCommit):
+        (WebCore::CCThreadProxy::CCThreadProxy):
+        (WebCore::CCThreadProxy::stop):
+        * platform/graphics/chromium/cc/CCThreadProxy.h:
+
 2011-10-17  Julien Chaffraix  <[email protected]>
 
         Remove colSpan / rowSpan caching from RenderTableCell

Modified: trunk/Source/WebCore/WebCore.gypi (97691 => 97692)


--- trunk/Source/WebCore/WebCore.gypi	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/WebCore.gypi	2011-10-18 01:24:02 UTC (rev 97692)
@@ -3538,8 +3538,6 @@
             'platform/graphics/chromium/cc/CCRenderSurface.h',
             'platform/graphics/chromium/cc/CCScheduler.cpp',
             'platform/graphics/chromium/cc/CCScheduler.h',
-            'platform/graphics/chromium/cc/CCScopedMainThreadProxy.h',
-            'platform/graphics/chromium/cc/CCScrollController.h',
             'platform/graphics/chromium/cc/CCSingleThreadProxy.cpp',
             'platform/graphics/chromium/cc/CCSingleThreadProxy.h',
             'platform/graphics/chromium/cc/CCThread.h',
@@ -3550,6 +3548,7 @@
             'platform/graphics/chromium/cc/CCTiledLayerImpl.h',
             'platform/graphics/chromium/cc/CCVideoLayerImpl.cpp',
             'platform/graphics/chromium/cc/CCVideoLayerImpl.h',
+            'platform/graphics/chromium/cc/CCScrollController.h',
             'platform/graphics/cocoa/FontPlatformDataCocoa.mm',
             'platform/graphics/efl/FontEfl.cpp',
             'platform/graphics/efl/IconEfl.cpp',

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h (97691 => 97692)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h	2011-10-18 01:24:02 UTC (rev 97692)
@@ -29,10 +29,7 @@
 
 namespace WebCore {
 
-class CCScopedMainThreadProxy;
-
 // Task wrapper around WTF::callOnMainThreadThread
-// To post a Task to run on the main thread, see CCScopedMainThreadProxy.
 class CCMainThread {
 public:
     class Task {
@@ -47,12 +44,8 @@
     };
 
     static void initialize();
+    static void postTask(PassOwnPtr<Task>); // Executes the task on main thread asynchronously.
 private:
-    friend class CCScopedMainThreadProxy;
-    // Executes the task on main thread asynchronously.
-    // Only visible to CCScopedMainThreadProxy.
-    static void postTask(PassOwnPtr<Task>);
-
     static void performTask(void*);
 };
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h (97691 => 97692)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h	2011-10-18 01:24:02 UTC (rev 97692)
@@ -243,6 +243,11 @@
 template<typename T>
 PassOwnPtr<CCMainThread::Task> createMainThreadTask(
     T* const callee,
+    void (T::*method)());
+
+template<typename T>
+PassOwnPtr<CCMainThread::Task> createMainThreadTask(
+    T* const callee,
     void (T::*method)())
 {
     return MainThreadTask0<T>::create(

Deleted: trunk/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h (97691 => 97692)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCScopedMainThreadProxy.h	2011-10-18 01:24:02 UTC (rev 97692)
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CCScopedMainThreadProxy_h
-#define CCScopedMainThreadProxy_h
-
-#include "cc/CCMainThreadTask.h"
-#include "cc/CCProxy.h"
-#include <wtf/ThreadSafeRefCounted.h>
-
-namespace WebCore {
-
-// This class is a proxy used to post tasks to the main thread from any other thread. The proxy may be shut down at
-// any point from the main thread after which no more tasks posted to the proxy will run. In other words, all
-// tasks posted via a proxy are scoped to the lifecycle of the proxy. Use this when posting tasks to an object that
-// might die with tasks in flight.
-//
-// The proxy must be created and shut down from the main thread, tasks may be posted from any thread.
-//
-// Implementation note: Unlike ScopedRunnableMethodFactory in Chromium, pending tasks are not cancelled by actually
-// destroying the proxy. Instead each pending task holds a reference to the proxy to avoid maintaining an explicit
-// list of outstanding tasks.
-class CCScopedMainThreadProxy : public ThreadSafeRefCounted<CCScopedMainThreadProxy> {
-public:
-    static PassRefPtr<CCScopedMainThreadProxy> create()
-    {
-        ASSERT(CCProxy::isMainThread());
-        return adoptRef(new CCScopedMainThreadProxy);
-    }
-
-    // Can be called from any thread. Posts a task to the main thread that runs unless
-    // shutdown() is called before it runs.
-    void postTask(PassOwnPtr<CCMainThread::Task> task)
-    {
-        ref();
-        CCMainThread::postTask(createMainThreadTask(this, &CCScopedMainThreadProxy::runTaskIfNotShutdown, task));
-    }
-
-    void shutdown()
-    {
-        ASSERT(CCProxy::isMainThread());
-        ASSERT(!m_shutdown);
-        m_shutdown = true;
-    }
-
-private:
-    CCScopedMainThreadProxy()
-        : m_shutdown(false)
-    {
-    }
-
-    void runTaskIfNotShutdown(PassOwnPtr<CCMainThread::Task> popTask)
-    {
-        ASSERT(CCProxy::isMainThread());
-        OwnPtr<CCMainThread::Task> task = popTask;
-        if (!m_shutdown)
-            task->performTask();
-        deref();
-    }
-
-    bool m_shutdown; // Only accessed on the main thread
-};
-
-}
-
-#endif

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (97691 => 97692)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2011-10-18 01:24:02 UTC (rev 97692)
@@ -32,7 +32,6 @@
 #include "cc/CCLayerTreeHost.h"
 #include "cc/CCMainThreadTask.h"
 #include "cc/CCScheduler.h"
-#include "cc/CCScopedMainThreadProxy.h"
 #include "cc/CCScrollController.h"
 #include "cc/CCThreadTask.h"
 #include <wtf/CurrentTime.h>
@@ -62,7 +61,7 @@
 
     virtual void scheduleBeginFrameAndCommit()
     {
-        m_proxy->postBeginFrameAndCommitOnCCThread();
+        CCMainThread::postTask(m_proxy->createBeginFrameAndCommitTaskOnCCThread());
     }
 
     virtual void scheduleDrawAndPresent()
@@ -115,7 +114,6 @@
     , m_started(false)
     , m_lastExecutedBeginFrameAndCommitSequenceNumber(-1)
     , m_numBeginFrameAndCommitsIssuedOnCCThread(0)
-    , m_mainThreadProxy(CCScopedMainThreadProxy::create())
 {
     TRACE_EVENT("CCThreadProxy::CCThreadProxy", this, 0);
     ASSERT(isMainThread());
@@ -301,8 +299,6 @@
     s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::layerTreeHostClosedOnCCThread, AllowCrossThreadAccess(&completion)));
     completion.wait();
 
-    m_mainThreadProxy->shutdown(); // Stop running tasks posted to us.
-
     ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted.
     m_layerTreeHost = 0;
     m_started = false;
@@ -321,11 +317,6 @@
     completion->signal();
 }
 
-void CCThreadProxy::postBeginFrameAndCommitOnCCThread()
-{
-    m_mainThreadProxy->postTask(createBeginFrameAndCommitTaskOnCCThread());
-}
-
 void CCThreadProxy::obtainBeginFrameAndCommitTaskFromCCThread(CCCompletionEvent* completion, CCMainThread::Task** taskPtr)
 {
     OwnPtr<CCMainThread::Task> task = createBeginFrameAndCommitTaskOnCCThread();

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h (97691 => 97692)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h	2011-10-18 01:24:02 UTC (rev 97692)
@@ -36,7 +36,6 @@
 class CCInputHandler;
 class CCLayerTreeHost;
 class CCScheduler;
-class CCScopedMainThreadProxy;
 class CCThread;
 class CCThreadProxySchedulerClient;
 class CCThreadProxyScrollControllerAdapter;
@@ -73,7 +72,6 @@
     void beginFrameAndCommit(int sequenceNumber, double frameBeginTime, PassOwnPtr<CCScrollUpdateSet>);
 
     // Called on CCThread
-    void postBeginFrameAndCommitOnCCThread();
     PassOwnPtr<CCMainThread::Task> createBeginFrameAndCommitTaskOnCCThread();
     void obtainBeginFrameAndCommitTaskFromCCThread(CCCompletionEvent*, CCMainThread::Task**);
     void commitOnCCThread(CCCompletionEvent*);
@@ -107,8 +105,6 @@
     OwnPtr<CCScheduler> m_schedulerOnCCThread;
     OwnPtr<CCThreadProxySchedulerClient> m_schedulerClientOnCCThread;
 
-    RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;
-
     static CCThread* s_ccThread;
 };
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (97691 => 97692)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-10-18 01:24:02 UTC (rev 97692)
@@ -1,5 +1,26 @@
 2011-10-17  James Robinson  <[email protected]>
 
+        Unreviewed, rolling out r97690.
+        http://trac.webkit.org/changeset/97690
+        https://bugs.webkit.org/show_bug.cgi?id=70161
+
+        Hits assertion in CCLayerTreeHostTests
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::CCLayerTreeHostTest::CCLayerTreeHostTest):
+        (WTF::CCLayerTreeHostTest::onEndTest):
+        (WTF::CCLayerTreeHostTest::runTest):
+        (WTF::CCLayerTreeHostTest::testTimeout):
+        (WTF::CCLayerTreeHostTest::doBeginTest):
+        (WTF::CCLayerTreeHostTest::endTest):
+        (WTF::CCLayerTreeHostTestThreadOnly::runTest):
+        (WTF::TEST_F):
+        (WTF::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread):
+        * tests/CCThreadTest.cpp:
+        (WebKit::PingPongTestUsingTasks::ping):
+
+2011-10-17  James Robinson  <[email protected]>
+
         [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests
         https://bugs.webkit.org/show_bug.cgi?id=70161
 

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (97691 => 97692)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2011-10-18 01:24:02 UTC (rev 97692)
@@ -24,12 +24,13 @@
 
 #include "config.h"
 
+#if USE(THREADED_COMPOSITING)
+
 #include "cc/CCLayerTreeHost.h"
 
 #include "cc/CCLayerImpl.h"
 #include "cc/CCLayerTreeHostImpl.h"
 #include "cc/CCMainThreadTask.h"
-#include "cc/CCScopedMainThreadProxy.h"
 #include "cc/CCThreadTask.h"
 #include "GraphicsContext3DPrivate.h"
 #include <gtest/gtest.h>
@@ -169,7 +170,9 @@
     {
     }
 
+#if !USE(THREADED_COMPOSITING)
     virtual void scheduleComposite() { }
+#endif
 
 private:
     explicit MockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { }
@@ -204,27 +207,20 @@
         callOnMainThread(CCLayerTreeHostTest::dispatchSetNeedsRedraw, this);
     }
 
-    void timeout()
-    {
-        m_timedOut = true;
-        endTest();
-    }
-
-    void clearTimeout()
-    {
-        m_timeoutTask = 0;
-    }
-
-
 protected:
     CCLayerTreeHostTest()
         : m_beginning(false)
         , m_endWhenBeginReturns(false)
+        , m_running(false)
         , m_timedOut(false)
-        , m_mainThreadProxy(CCScopedMainThreadProxy::create())
     {
         m_webThread = adoptPtr(webKitPlatformSupport()->createThread("CCLayerTreeHostTest"));
         WebCompositor::setThread(m_webThread.get());
+#if USE(THREADED_COMPOSITING)
+        m_settings.enableCompositorThread = true;
+#else
+        m_settings.enableCompositorThread = false;
+#endif
     }
 
     void doBeginTest();
@@ -238,7 +234,6 @@
     {
         ASSERT(isMainThread());
         webkit_support::QuitMessageLoop();
-        webkit_support::RunAllPendingMessages();
         CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
         ASSERT(test);
         test->m_layerTreeHost.clear();
@@ -262,55 +257,32 @@
           test->m_layerTreeHost->setNeedsRedraw();
     }
 
-    class TimeoutTask : public webkit_support::TaskAdaptor {
-    public:
-        explicit TimeoutTask(CCLayerTreeHostTest* test)
-            : m_test(test)
-        {
-        }
-
-        void clearTest()
-        {
-            m_test = 0;
-        }
-
-        virtual ~TimeoutTask()
-        {
-            if (m_test)
-                m_test->clearTimeout();
-        }
-
-        virtual void Run()
-        {
-            if (m_test)
-                m_test->timeout();
-        }
-
-    private:
-        CCLayerTreeHostTest* m_test;
-    };
-
-    virtual void runTest(bool threaded)
+    virtual void runTest()
     {
-        m_settings.enableCompositorThread = threaded;
         webkit_support::PostDelayedTask(CCLayerTreeHostTest::onBeginTest, static_cast<void*>(this), 0);
-        m_timeoutTask = new TimeoutTask(this);
-        webkit_support::PostDelayedTask(m_timeoutTask, 5000); // webkit_support takes ownership of the task
+        webkit_support::PostDelayedTask(CCLayerTreeHostTest::testTimeout, static_cast<void*>(this), 5000);
         webkit_support::RunMessageLoop();
+        m_running = false;
+        bool timedOut = m_timedOut; // Save whether we're timed out in case RunAllPendingMessages has the timeout.
         webkit_support::RunAllPendingMessages();
-
-        if (m_timeoutTask)
-            m_timeoutTask->clearTest();
-
         ASSERT(!m_layerTreeHost.get());
         m_client.clear();
-        if (m_timedOut) {
+        if (timedOut) {
             FAIL() << "Test timed out";
             return;
         }
         afterTest();
     }
 
+    static void testTimeout(void* self)
+    {
+        CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
+        if (!test->m_running)
+            return;
+        test->m_timedOut = true;
+        test->endTest();
+    }
+
     CCSettings m_settings;
     OwnPtr<MockLayerTreeHostClient> m_client;
     RefPtr<CCLayerTreeHost> m_layerTreeHost;
@@ -318,16 +290,17 @@
 private:
     bool m_beginning;
     bool m_endWhenBeginReturns;
+    bool m_running;
     bool m_timedOut;
 
     OwnPtr<WebThread> m_webThread;
-    RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;
-    TimeoutTask* m_timeoutTask;
 };
 
 void CCLayerTreeHostTest::doBeginTest()
 {
     ASSERT(isMainThread());
+    ASSERT(!m_running);
+    m_running = true;
     m_client = MockLayerTreeHostClient::create(this);
 
     RefPtr<LayerChromium> rootLayer = LayerChromium::create(0);
@@ -345,7 +318,7 @@
 {
     // If we are called from the CCThread, re-call endTest on the main thread.
     if (!isMainThread())
-        m_mainThreadProxy->postTask(createMainThreadTask(this, &CCLayerTreeHostTest::endTest));
+        CCMainThread::postTask(createMainThreadTask(this, &CCLayerTreeHostTest::endTest));
     else {
         // For the case where we endTest during beginTest(), set a flag to indicate that
         // the test should end the second beginTest regains control.
@@ -358,9 +331,10 @@
 
 class CCLayerTreeHostTestThreadOnly : public CCLayerTreeHostTest {
 public:
-    void runTest()
+    virtual void runTest()
     {
-        CCLayerTreeHostTest::runTest(true);
+        if (m_settings.enableCompositorThread)
+            CCLayerTreeHostTest::runTest();
     }
 };
 
@@ -378,19 +352,11 @@
     {
     }
 };
+TEST_F(CCLayerTreeHostTestShortlived1, run)
+{
+    runTest();
+}
 
-#define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \
-    TEST_F(TEST_FIXTURE_NAME, runSingleThread)            \
-    {                                                     \
-        runTest(false);                                   \
-    }                                                     \
-    TEST_F(TEST_FIXTURE_NAME, runMultiThread)             \
-    {                                                     \
-        runTest(true);                                    \
-    }
-
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived1)
-
 // Shortlived layerTreeHosts shouldn't die with a commit in flight.
 class CCLayerTreeHostTestShortlived2 : public CCLayerTreeHostTest {
 public:
@@ -406,9 +372,11 @@
     {
     }
 };
+TEST_F(CCLayerTreeHostTestShortlived2, run)
+{
+    runTest();
+}
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived2)
-
 // Shortlived layerTreeHosts shouldn't die with a redraw in flight.
 class CCLayerTreeHostTestShortlived3 : public CCLayerTreeHostTest {
 public:
@@ -424,9 +392,11 @@
     {
     }
 };
+TEST_F(CCLayerTreeHostTestShortlived3, run)
+{
+    runTest();
+}
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestShortlived3)
-
 // Constantly redrawing layerTreeHosts shouldn't die when they commit
 class CCLayerTreeHostTestCommitingWithContinuousRedraw : public CCLayerTreeHostTest {
 public:
@@ -465,12 +435,14 @@
     int m_numCompleteCommits;
     int m_numDraws;
 };
+TEST_F(CCLayerTreeHostTestCommitingWithContinuousRedraw, run)
+{
+    runTest();
+}
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestCommitingWithContinuousRedraw)
-
 // Two setNeedsCommits in a row should lead to at least 1 commit and at least 1
 // draw with frame 0.
-class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTestThreadOnly {
+class CCLayerTreeHostTestSetNeedsCommit1 : public CCLayerTreeHostTest {
 public:
     CCLayerTreeHostTestSetNeedsCommit1()
         : m_numCommits(0)
@@ -506,15 +478,14 @@
     int m_numCommits;
     int m_numDraws;
 };
-
-TEST_F(CCLayerTreeHostTestSetNeedsCommit1, runMultiThread)
+TEST_F(CCLayerTreeHostTestSetNeedsCommit1, run)
 {
     runTest();
 }
 
 // A setNeedsCommit should lead to 1 commit. Issuing a second commit after that
 // first committed frame draws should lead to another commit.
-class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTestThreadOnly {
+class CCLayerTreeHostTestSetNeedsCommit2 : public CCLayerTreeHostTest {
 public:
     CCLayerTreeHostTestSetNeedsCommit2()
         : m_numCommits(0)
@@ -550,15 +521,14 @@
     int m_numCommits;
     int m_numDraws;
 };
-
-TEST_F(CCLayerTreeHostTestSetNeedsCommit2, runMultiThread)
+TEST_F(CCLayerTreeHostTestSetNeedsCommit2, run)
 {
     runTest();
 }
 
 // 1 setNeedsRedraw after the first commit has completed should lead to 1
 // additional draw.
-class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTestThreadOnly {
+class CCLayerTreeHostTestSetNeedsRedraw : public CCLayerTreeHostTest {
 public:
     CCLayerTreeHostTestSetNeedsRedraw()
         : m_numCommits(0)
@@ -583,7 +553,6 @@
 
     virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*)
     {
-        EXPECT_EQ(0, m_numDraws);
         m_numCommits++;
     }
 
@@ -597,9 +566,9 @@
     int m_numCommits;
     int m_numDraws;
 };
-
-TEST_F(CCLayerTreeHostTestSetNeedsRedraw, runMultiThread)
+TEST_F(CCLayerTreeHostTestSetNeedsRedraw, run)
 {
+    CCSettings setings;
     runTest();
 }
 
@@ -668,8 +637,7 @@
     IntSize m_scrollAmount;
     int m_scrolls;
 };
-
-TEST_F(CCLayerTreeHostTestScrollSimple, runMultiThread)
+TEST_F(CCLayerTreeHostTestScrollSimple, run)
 {
     runTest();
 }
@@ -742,11 +710,11 @@
     IntSize m_scrollAmount;
     int m_scrolls;
 };
-
-TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, runMultiThread)
+TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, run)
 {
     runTest();
 }
 
 } // namespace
 
+#endif

Modified: trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp (97691 => 97692)


--- trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp	2011-10-18 01:19:17 UTC (rev 97691)
+++ trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp	2011-10-18 01:24:02 UTC (rev 97692)
@@ -32,7 +32,6 @@
 #include "WebThread.h"
 #include "cc/CCCompletionEvent.h"
 #include "cc/CCMainThreadTask.h"
-#include "cc/CCScopedMainThreadProxy.h"
 #include "cc/CCThreadTask.h"
 
 #include <gtest/gtest.h>
@@ -72,14 +71,9 @@
 
 class PingPongTestUsingTasks {
 public:
-    PingPongTestUsingTasks()
-        : m_mainThreadProxy(CCScopedMainThreadProxy::create())
-    {
-    }
-
     void ping()
     {
-        m_mainThreadProxy->postTask(createMainThreadTask(this, &PingPongTestUsingTasks::pong));
+        CCMainThread::postTask(createMainThreadTask(this, &PingPongTestUsingTasks::pong));
         hit = true;
     }
 
@@ -90,9 +84,6 @@
     }
 
     bool hit;
-
-private:
-    RefPtr<CCScopedMainThreadProxy> m_mainThreadProxy;
 };
 
 #if OS(WINDOWS) || OS(MAC_OS_X)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to