OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 class TestingPlatformSupport::TestingInterfaceProvider | 64 class TestingPlatformSupport::TestingInterfaceProvider |
65 : public blink::InterfaceProvider { | 65 : public blink::InterfaceProvider { |
66 public: | 66 public: |
67 TestingInterfaceProvider() = default; | 67 TestingInterfaceProvider() = default; |
68 virtual ~TestingInterfaceProvider() = default; | 68 virtual ~TestingInterfaceProvider() = default; |
69 | 69 |
70 void getInterface(const char* name, | 70 void getInterface(const char* name, |
71 mojo::ScopedMessagePipeHandle handle) override { | 71 mojo::ScopedMessagePipeHandle handle) override { |
72 if (std::string(name) == mojom::blink::MimeRegistry::Name_) { | 72 if (std::string(name) == mojom::blink::MimeRegistry::Name_) { |
73 mojo::MakeStrongBinding( | 73 mojo::MakeStrongBinding( |
74 makeUnique<MockMimeRegistry>(), | 74 WTF::makeUnique<MockMimeRegistry>(), |
75 mojo::MakeRequest<mojom::blink::MimeRegistry>(std::move(handle))); | 75 mojo::MakeRequest<mojom::blink::MimeRegistry>(std::move(handle))); |
76 return; | 76 return; |
77 } | 77 } |
78 } | 78 } |
79 }; | 79 }; |
80 | 80 |
81 namespace { | 81 namespace { |
82 | 82 |
83 double dummyCurrentTime() { | 83 double dummyCurrentTime() { |
84 return 0.0; | 84 return 0.0; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 }; | 311 }; |
312 }; | 312 }; |
313 | 313 |
314 ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc, | 314 ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc, |
315 char** argv) { | 315 char** argv) { |
316 base::CommandLine::Init(argc, argv); | 316 base::CommandLine::Init(argc, argv); |
317 | 317 |
318 base::test::InitializeICUForTesting(); | 318 base::test::InitializeICUForTesting(); |
319 | 319 |
320 m_discardableMemoryAllocator = | 320 m_discardableMemoryAllocator = |
321 wrapUnique(new base::TestDiscardableMemoryAllocator); | 321 WTF::wrapUnique(new base::TestDiscardableMemoryAllocator); |
322 base::DiscardableMemoryAllocator::SetInstance( | 322 base::DiscardableMemoryAllocator::SetInstance( |
323 m_discardableMemoryAllocator.get()); | 323 m_discardableMemoryAllocator.get()); |
324 base::StatisticsRecorder::Initialize(); | 324 base::StatisticsRecorder::Initialize(); |
325 | 325 |
326 m_platform = wrapUnique(new DummyPlatform); | 326 m_platform = WTF::wrapUnique(new DummyPlatform); |
327 Platform::setCurrentPlatformForTesting(m_platform.get()); | 327 Platform::setCurrentPlatformForTesting(m_platform.get()); |
328 | 328 |
329 WTF::Partitions::initialize(nullptr); | 329 WTF::Partitions::initialize(nullptr); |
330 WTF::setTimeFunctionsForTesting(dummyCurrentTime); | 330 WTF::setTimeFunctionsForTesting(dummyCurrentTime); |
331 WTF::initialize(nullptr); | 331 WTF::initialize(nullptr); |
332 | 332 |
333 m_compositorSupport = wrapUnique(new cc_blink::WebCompositorSupportImpl); | 333 m_compositorSupport = WTF::wrapUnique(new cc_blink::WebCompositorSupportImpl); |
334 m_testingPlatformConfig.compositorSupport = m_compositorSupport.get(); | 334 m_testingPlatformConfig.compositorSupport = m_compositorSupport.get(); |
335 m_testingPlatformSupport = | 335 m_testingPlatformSupport = |
336 makeUnique<TestingPlatformSupport>(m_testingPlatformConfig); | 336 WTF::makeUnique<TestingPlatformSupport>(m_testingPlatformConfig); |
337 | 337 |
338 ProcessHeap::init(); | 338 ProcessHeap::init(); |
339 ThreadState::attachMainThread(); | 339 ThreadState::attachMainThread(); |
340 ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr, nullptr, | 340 ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr, nullptr, |
341 nullptr); | 341 nullptr); |
342 HTTPNames::init(); | 342 HTTPNames::init(); |
343 } | 343 } |
344 | 344 |
345 ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() {} | 345 ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() {} |
346 | 346 |
347 } // namespace blink | 347 } // namespace blink |
OLD | NEW |