summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp b/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
index 4bcaccdc3..9076d34d4 100644
--- a/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
+++ b/Source/WebKit/chromium/tests/CCPrioritizedTextureTest.cpp
@@ -31,6 +31,7 @@
#include "CCTexture.h"
#include "CCTiledLayerTestCommon.h"
#include "FakeCCGraphicsContext.h"
+#include "WebCompositorInitializer.h"
#include <gtest/gtest.h>
using namespace WebCore;
@@ -44,6 +45,7 @@ public:
CCPrioritizedTextureTest()
: m_textureSize(256, 256)
, m_textureFormat(GraphicsContext3D::RGBA)
+ , m_compositorInitializer(0)
, m_context(WebKit::createFakeCCGraphicsContext())
{
DebugScopedSetImplThread implThread;
@@ -68,12 +70,12 @@ public:
bool validateTexture(OwnPtr<CCPrioritizedTexture>& texture, bool requestLate)
{
- DebugScopedSetImplThread implThread;
#if !ASSERT_DISABLED
texture->textureManager()->assertInvariants();
#endif
if (requestLate)
texture->requestLate();
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
bool success = texture->canAcquireBackingTexture();
if (success)
texture->acquireBackingTexture(resourceProvider());
@@ -88,6 +90,7 @@ public:
protected:
const IntSize m_textureSize;
const GC3Denum m_textureFormat;
+ WebCompositorInitializer m_compositorInitializer;
OwnPtr<CCGraphicsContext> m_context;
OwnPtr<CCResourceProvider> m_resourceProvider;
};
@@ -128,7 +131,7 @@ TEST_F(CCPrioritizedTextureTest, requestTextureExceedingMaxLimit)
EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->memoryAboveCutoffBytes());
EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
@@ -149,7 +152,7 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits)
for (size_t i = 0; i < maxTextures; ++i)
validateTexture(textures[i], false);
{
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->reduceMemory(resourceProvider());
}
@@ -162,7 +165,7 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits)
for (size_t i = 0; i < maxTextures; ++i)
EXPECT_EQ(validateTexture(textures[i], false), i < 5);
{
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->reduceMemory(resourceProvider());
}
@@ -175,14 +178,14 @@ TEST_F(CCPrioritizedTextureTest, changeMemoryLimits)
for (size_t i = 0; i < maxTextures; ++i)
EXPECT_EQ(validateTexture(textures[i], false), i < 4);
{
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->reduceMemory(resourceProvider());
}
EXPECT_EQ(texturesMemorySize(4), textureManager->memoryAboveCutoffBytes());
EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
@@ -242,7 +245,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerPartialUpdateTextures)
EXPECT_FALSE(textures[2]->haveBackingTexture());
EXPECT_FALSE(textures[3]->haveBackingTexture());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
@@ -282,7 +285,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerPrioritiesAreEqual)
EXPECT_EQ(texturesMemorySize(8), textureManager->memoryAboveCutoffBytes());
EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
@@ -302,7 +305,7 @@ TEST_F(CCPrioritizedTextureTest, textureManagerDestroyedFirst)
EXPECT_TRUE(texture->haveBackingTexture());
{
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
textureManager.clear();
@@ -330,7 +333,7 @@ TEST_F(CCPrioritizedTextureTest, textureMovedToNewManager)
texture->setTextureManager(0);
{
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManagerOne->clearAllMemory(resourceProvider());
}
textureManagerOne.clear();
@@ -346,7 +349,7 @@ TEST_F(CCPrioritizedTextureTest, textureMovedToNewManager)
EXPECT_TRUE(texture->canAcquireBackingTexture());
EXPECT_TRUE(texture->haveBackingTexture());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManagerTwo->clearAllMemory(resourceProvider());
}
@@ -392,7 +395,7 @@ TEST_F(CCPrioritizedTextureTest, renderSurfacesReduceMemoryAvailableOutsideRootS
EXPECT_EQ(texturesMemorySize(4), textureManager->memoryForSelfManagedTextures());
EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
@@ -429,7 +432,7 @@ TEST_F(CCPrioritizedTextureTest, renderSurfacesReduceMemoryAvailableForRequestLa
EXPECT_EQ(texturesMemorySize(4), textureManager->memoryForSelfManagedTextures());
EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}
@@ -469,7 +472,7 @@ TEST_F(CCPrioritizedTextureTest, whenRenderSurfaceNotAvailableTexturesAlsoNotAva
EXPECT_EQ(texturesMemorySize(2), textureManager->memoryForSelfManagedTextures());
EXPECT_LE(textureManager->memoryUseBytes(), textureManager->memoryAboveCutoffBytes());
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked;
textureManager->clearAllMemory(resourceProvider());
}