Title: [100127] trunk/Source/WebKit/chromium
Revision
100127
Author
[email protected]
Date
2011-11-14 04:41:03 -0800 (Mon, 14 Nov 2011)

Log Message

[chromium] Fix incorrect usage of ASSERT in CCLayerTreeHostTest
https://bugs.webkit.org/show_bug.cgi?id=72026

ASSERT is stripped out in release builds so it shouldn't be used
in unit tests, except when calling debug-only functions like
isMainThread().

Replacing with ASSERT_TRUE (or EXPECT_TRUE in constructors, where
we can't return a value).

Patch by Iain Merrick <[email protected]> on 2011-11-14
Reviewed by Tony Gentilcore.

* tests/CCLayerTreeHostTest.cpp:
(WTF::MockLayerTreeHost::MockLayerTreeHost):
(WTF::CCLayerTreeHostTest::onEndTest):
(WTF::CCLayerTreeHostTest::dispatchSetNeedsCommit):
(WTF::CCLayerTreeHostTest::dispatchSetNeedsRedraw):
(WTF::CCLayerTreeHostTest::runTest):
(WTF::CCLayerTreeHostTest::doBeginTest):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (100126 => 100127)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-11-14 12:20:19 UTC (rev 100126)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-11-14 12:41:03 UTC (rev 100127)
@@ -1,3 +1,25 @@
+2011-11-14  Iain Merrick  <[email protected]>
+
+        [chromium] Fix incorrect usage of ASSERT in CCLayerTreeHostTest
+        https://bugs.webkit.org/show_bug.cgi?id=72026
+
+        ASSERT is stripped out in release builds so it shouldn't be used
+        in unit tests, except when calling debug-only functions like
+        isMainThread().
+
+        Replacing with ASSERT_TRUE (or EXPECT_TRUE in constructors, where
+        we can't return a value).
+
+        Reviewed by Tony Gentilcore.
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::MockLayerTreeHost::MockLayerTreeHost):
+        (WTF::CCLayerTreeHostTest::onEndTest):
+        (WTF::CCLayerTreeHostTest::dispatchSetNeedsCommit):
+        (WTF::CCLayerTreeHostTest::dispatchSetNeedsRedraw):
+        (WTF::CCLayerTreeHostTest::runTest):
+        (WTF::CCLayerTreeHostTest::doBeginTest):
+
 2011-11-14  Alexander Pavlov  <[email protected]>
 
         [chromium] r99963 causes inspector/debugger/script-formatter.html to fail text diff

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (100126 => 100127)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2011-11-14 12:20:19 UTC (rev 100126)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2011-11-14 12:41:03 UTC (rev 100127)
@@ -116,8 +116,7 @@
     {
         setRootLayer(rootLayer);
         bool success = initialize();
-        ASSERT(success);
-        UNUSED_PARAM(success);
+        EXPECT_TRUE(success);
     }
 
     TestHooks* m_testHooks;
@@ -254,7 +253,7 @@
         webkit_support::QuitMessageLoop();
         webkit_support::RunAllPendingMessages();
         CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
-        ASSERT(test);
+        ASSERT_TRUE(test);
         test->m_layerTreeHost.clear();
     }
 
@@ -262,7 +261,7 @@
     {
       ASSERT(isMainThread());
       CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
-      ASSERT(test);
+      ASSERT_TRUE(test);
       if (test->m_layerTreeHost)
           test->m_layerTreeHost->setNeedsCommit();
     }
@@ -271,7 +270,7 @@
     {
       ASSERT(isMainThread());
       CCLayerTreeHostTest* test = static_cast<CCLayerTreeHostTest*>(self);
-      ASSERT(test);
+      ASSERT_TRUE(test);
       if (test->m_layerTreeHost)
           test->m_layerTreeHost->setNeedsRedraw();
     }
@@ -334,7 +333,7 @@
         if (m_timeoutTask)
             m_timeoutTask->clearTest();
 
-        ASSERT(!m_layerTreeHost.get());
+        ASSERT_FALSE(m_layerTreeHost.get());
         m_client.clear();
         if (m_timedOut) {
             FAIL() << "Test timed out";
@@ -366,7 +365,7 @@
 
     m_rootLayer = LayerChromium::create(0);
     m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), m_rootLayer, m_settings);
-    ASSERT(m_layerTreeHost);
+    ASSERT_TRUE(m_layerTreeHost);
     m_rootLayer->setLayerTreeHost(m_layerTreeHost.get());
 
     m_beginning = true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to