Chromium Code Reviews| 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 94c2e7cfb7491f5d45ed621acca36654d407852d..3d81d67afd44dc3a26f8ebafe82e787fcac2556a 100644 |
| --- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp |
| +++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp |
| @@ -30,6 +30,12 @@ |
| #include "platform/testing/TestingPlatformSupport.h" |
| +#if !OS(ANDROID) |
| +#include "device/battery/battery_monitor_impl.h" |
| +#endif |
| + |
| +#include <cstring> |
| + |
| namespace blink { |
| TestingDiscardableMemory::TestingDiscardableMemory(size_t size) : m_data(size), m_isLocked(true) |
| @@ -99,14 +105,27 @@ WebCompositorSupport* TestingPlatformSupport::compositorSupport() |
| return m_config.compositorSupport; |
| } |
| +WebThread* TestingPlatformSupport::currentThread() |
| +{ |
| + return m_oldPlatform ? m_oldPlatform->currentThread() : nullptr; |
| +} |
| + |
| WebUnitTestSupport* TestingPlatformSupport::unitTestSupport() |
| { |
| return m_oldPlatform ? m_oldPlatform->unitTestSupport() : nullptr; |
| } |
| -WebThread* TestingPlatformSupport::currentThread() |
| +void TestingPlatformSupport::connectToRemoteService(const char* name, mojo::ScopedMessagePipeHandle handle) |
| { |
| - return m_oldPlatform ? m_oldPlatform->currentThread() : nullptr; |
| +#if !OS(ANDROID) |
|
haraken
2016/02/09 12:01:21
I'm just curious: Why do we need !OS(ANDROID)?
Yuki
2016/02/12 12:36:14
On Android, BatteryMonitor is implemented in Java.
|
| + if (std::strcmp(name, device::BatteryMonitor::Name_) == 0) { |
| + device::BatteryMonitorImpl::Create( |
| + mojo::MakeRequest<device::BatteryMonitor>(std::move(handle))); |
| + return; |
| + } |
| +#endif |
| + |
| + ASSERT_NOT_REACHED(); |
| } |
| class TestingPlatformMockWebTaskRunner : public WebTaskRunner { |