| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 double dummyCurrentTime() | 56 double dummyCurrentTime() |
| 57 { | 57 { |
| 58 return 0.0; | 58 return 0.0; |
| 59 } | 59 } |
| 60 | 60 |
| 61 int runTestSuite(base::TestSuite* testSuite) | 61 int runTestSuite(base::TestSuite* testSuite) |
| 62 { | 62 { |
| 63 int result = testSuite->Run(); | 63 int result = testSuite->Run(); |
| 64 blink::Heap::collectAllGarbage(); | 64 blink::ThreadHeap::collectAllGarbage(); |
| 65 return result; | 65 return result; |
| 66 } | 66 } |
| 67 | 67 |
| 68 class DummyPlatform final : public blink::Platform { | 68 class DummyPlatform final : public blink::Platform { |
| 69 public: | 69 public: |
| 70 DummyPlatform() { } | 70 DummyPlatform() { } |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 88 WTF::setTimeFunctionsForTesting(dummyCurrentTime); | 88 WTF::setTimeFunctionsForTesting(dummyCurrentTime); |
| 89 WTF::initialize(nullptr); | 89 WTF::initialize(nullptr); |
| 90 blink::CompositorFactory::initializeDefault(); | 90 blink::CompositorFactory::initializeDefault(); |
| 91 int result = 0; | 91 int result = 0; |
| 92 { | 92 { |
| 93 blink::TestingPlatformSupport::Config platformConfig; | 93 blink::TestingPlatformSupport::Config platformConfig; |
| 94 cc_blink::WebCompositorSupportImpl compositorSupport; | 94 cc_blink::WebCompositorSupportImpl compositorSupport; |
| 95 platformConfig.compositorSupport = &compositorSupport; | 95 platformConfig.compositorSupport = &compositorSupport; |
| 96 blink::TestingPlatformSupport platform(platformConfig); | 96 blink::TestingPlatformSupport platform(platformConfig); |
| 97 | 97 |
| 98 blink::Heap::init(); | 98 blink::ThreadHeap::init(); |
| 99 blink::ThreadState::attachMainThread(); | 99 blink::ThreadState::attachMainThread(); |
| 100 blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr
); | 100 blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr
); |
| 101 blink::EventTracer::initialize(); | 101 blink::EventTracer::initialize(); |
| 102 blink::HTTPNames::init(); | 102 blink::HTTPNames::init(); |
| 103 | 103 |
| 104 base::TestSuite testSuite(argc, argv); | 104 base::TestSuite testSuite(argc, argv); |
| 105 | 105 |
| 106 mojo::edk::Init(); | 106 mojo::edk::Init(); |
| 107 base::TestIOThread testIoThread(base::TestIOThread::kAutoStart); | 107 base::TestIOThread testIoThread(base::TestIOThread::kAutoStart); |
| 108 WTF::OwnPtr<mojo::edk::test::ScopedIPCSupport> ipcSupport(adoptPtr(new m
ojo::edk::test::ScopedIPCSupport(testIoThread.task_runner()))); | 108 WTF::OwnPtr<mojo::edk::test::ScopedIPCSupport> ipcSupport(adoptPtr(new m
ojo::edk::test::ScopedIPCSupport(testIoThread.task_runner()))); |
| 109 result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base
::Unretained(&testSuite))); | 109 result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base
::Unretained(&testSuite))); |
| 110 | 110 |
| 111 blink::ThreadState::detachMainThread(); | 111 blink::ThreadState::detachMainThread(); |
| 112 blink::Heap::shutdown(); | 112 blink::ThreadHeap::shutdown(); |
| 113 } | 113 } |
| 114 blink::CompositorFactory::shutdown(); | 114 blink::CompositorFactory::shutdown(); |
| 115 WTF::shutdown(); | 115 WTF::shutdown(); |
| 116 WTF::Partitions::shutdown(); | 116 WTF::Partitions::shutdown(); |
| 117 return result; | 117 return result; |
| 118 } | 118 } |
| OLD | NEW |