| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 { | 227 { |
| 228 static DummyThread dummyThread; | 228 static DummyThread dummyThread; |
| 229 return &dummyThread; | 229 return &dummyThread; |
| 230 }; | 230 }; |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc, char*
* argv) | 233 ScopedUnittestsEnvironmentSetup::ScopedUnittestsEnvironmentSetup(int argc, char*
* argv) |
| 234 { | 234 { |
| 235 base::CommandLine::Init(argc, argv); | 235 base::CommandLine::Init(argc, argv); |
| 236 | 236 |
| 237 base::test::InitializeICUForTesting(); | |
| 238 | |
| 239 m_discardableMemoryAllocator = wrapUnique(new base::TestDiscardableMemoryAll
ocator); | |
| 240 base::DiscardableMemoryAllocator::SetInstance(m_discardableMemoryAllocator.g
et()); | |
| 241 base::StatisticsRecorder::Initialize(); | |
| 242 | |
| 243 m_platform = wrapUnique(new DummyPlatform); | |
| 244 Platform::setCurrentPlatformForTesting(m_platform.get()); | |
| 245 | |
| 246 WTF::Partitions::initialize(nullptr); | 237 WTF::Partitions::initialize(nullptr); |
| 247 WTF::setTimeFunctionsForTesting(dummyCurrentTime); | |
| 248 WTF::initialize(nullptr); | 238 WTF::initialize(nullptr); |
| 249 | 239 |
| 250 m_compositorSupport = wrapUnique(new cc_blink::WebCompositorSupportImpl); | |
| 251 m_testingPlatformConfig.compositorSupport = m_compositorSupport.get(); | |
| 252 m_testingPlatformSupport = wrapUnique(new TestingPlatformSupport(m_testingPl
atformConfig)); | |
| 253 | |
| 254 ProcessHeap::init(); | 240 ProcessHeap::init(); |
| 255 ThreadState::attachMainThread(); | 241 ThreadState::attachMainThread(); |
| 256 ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr, nullptr,
nullptr); | |
| 257 EventTracer::initialize(); | |
| 258 HTTPNames::init(); | |
| 259 } | 242 } |
| 260 | 243 |
| 261 ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() | 244 ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() |
| 262 { | 245 { |
| 263 } | 246 } |
| 264 | 247 |
| 265 } // namespace blink | 248 } // namespace blink |
| OLD | NEW |