Index: Source/core/animation/CompositorAnimationsTestHelper.h |
diff --git a/Source/core/animation/CompositorAnimationsTestHelper.h b/Source/core/animation/CompositorAnimationsTestHelper.h |
index 31c0f09ab9561789275e1dfd63b48e9da0ed98b2..4f45a41245a424691eb26156e728a1e7c8d09d76 100644 |
--- a/Source/core/animation/CompositorAnimationsTestHelper.h |
+++ b/Source/core/animation/CompositorAnimationsTestHelper.h |
@@ -142,7 +142,16 @@ public: |
private: |
class PlatformProxy : public Platform { |
public: |
- PlatformProxy(WebCompositorSupportMock** compositor) : m_compositor(compositor) { } |
+ PlatformProxy(WebCompositorSupportMock** compositor) |
+ : m_compositor(compositor) |
+ , m_platform(Platform::current()) |
+ { |
+ } |
+ |
+ ~PlatformProxy() |
+ { |
+ Platform::initialize(m_platform); |
+ } |
virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length) { ASSERT_NOT_REACHED(); } |
const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName) override |
@@ -151,29 +160,31 @@ private: |
return &tracingIsDisabled; |
} |
+ virtual WebThread* currentThread() override |
+ { |
+ if (m_platform) |
Sami
2015/05/19 10:41:51
Will this ever be null?
sof
2015/05/19 16:12:07
We can safely assume that it won't be; thanks, rem
|
+ return m_platform->currentThread(); |
+ |
+ return nullptr; |
+ } |
+ |
private: |
WebCompositorSupportMock** m_compositor; |
virtual WebCompositorSupport* compositorSupport() override { return *m_compositor; } |
+ |
+ Platform* m_platform; |
}; |
WebCompositorSupportMock* m_mockCompositor; |
PlatformProxy m_proxyPlatform; |
protected: |
- Platform* m_platform; |
- |
virtual void SetUp() |
{ |
m_mockCompositor = 0; |
- m_platform = Platform::current(); |
Platform::initialize(&m_proxyPlatform); |
} |
- virtual void TearDown() |
- { |
- Platform::initialize(m_platform); |
- } |
- |
void setCompositorForTesting(WebCompositorSupportMock& mock) |
{ |
ASSERT(!m_mockCompositor); |