Index: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp |
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp |
index 42251b0e09c04f1f965b6847511014d35819d10c..ac872971765d783bb2b7043da920e5cc548376c6 100644 |
--- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp |
+++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp |
@@ -141,12 +141,13 @@ TestingPlatformSupport::TestingPlatformSupport(const Config& config) |
: m_config(config), |
m_oldPlatform(Platform::current()), |
m_interfaceProvider(new TestingInterfaceProvider) { |
- ASSERT(m_oldPlatform); |
- Platform::setCurrentPlatformForTesting(this); |
+ DCHECK(m_oldPlatform); |
} |
TestingPlatformSupport::~TestingPlatformSupport() { |
- Platform::setCurrentPlatformForTesting(m_oldPlatform); |
+ // Checks if Platform::setCurrentPlatformForTesting() was correctly called |
+ // after the construction. |
+ DCHECK_NE(m_oldPlatform, Platform::current()); |
Takashi Toyoshima
2016/12/22 06:29:06
I confirm that this check actually works to catch
|
} |
WebString TestingPlatformSupport::defaultLocale() { |
@@ -332,8 +333,8 @@ ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc, |
m_compositorSupport = WTF::wrapUnique(new cc_blink::WebCompositorSupportImpl); |
m_testingPlatformConfig.compositorSupport = m_compositorSupport.get(); |
- m_testingPlatformSupport = |
- WTF::makeUnique<TestingPlatformSupport>(m_testingPlatformConfig); |
+ m_testingPlatformSupport.reset( |
+ new TestingPlatformSupport(m_testingPlatformConfig)); |
ProcessHeap::init(); |
ThreadState::attachMainThread(); |