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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 static int runTestSuite(base::TestSuite* testSuite) | 51 static int runTestSuite(base::TestSuite* testSuite) |
52 { | 52 { |
53 int result = testSuite->Run(); | 53 int result = testSuite->Run(); |
54 blink::Heap::collectAllGarbage(); | 54 blink::Heap::collectAllGarbage(); |
55 return result; | 55 return result; |
56 } | 56 } |
57 | 57 |
58 int main(int argc, char** argv) | 58 int main(int argc, char** argv) |
59 { | 59 { |
| 60 WTF::Partitions::initialize(nullptr); |
60 WTF::setAlwaysZeroRandomSourceForTesting(); | 61 WTF::setAlwaysZeroRandomSourceForTesting(); |
61 WTF::initialize(CurrentTime, CurrentTime, nullptr, nullptr); | 62 WTF::initialize(CurrentTime, CurrentTime, nullptr); |
62 WTF::initializeMainThread(0); | 63 WTF::initializeMainThread(0); |
63 | 64 |
64 blink::TestingPlatformSupport::Config platformConfig; | 65 blink::TestingPlatformSupport::Config platformConfig; |
65 cc_blink::WebCompositorSupportImpl compositorSupport; | 66 cc_blink::WebCompositorSupportImpl compositorSupport; |
66 platformConfig.compositorSupport = &compositorSupport; | 67 platformConfig.compositorSupport = &compositorSupport; |
67 blink::TestingPlatformSupport platform(platformConfig); | 68 blink::TestingPlatformSupport platform(platformConfig); |
68 | 69 |
69 blink::Heap::init(); | 70 blink::Heap::init(); |
70 blink::ThreadState::attachMainThread(); | 71 blink::ThreadState::attachMainThread(); |
71 blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr); | 72 blink::ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr); |
72 blink::EventTracer::initialize(); | 73 blink::EventTracer::initialize(); |
73 | 74 |
74 blink::HTTPNames::init(); | 75 blink::HTTPNames::init(); |
75 | 76 |
76 base::TestSuite testSuite(argc, argv); | 77 base::TestSuite testSuite(argc, argv); |
77 int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base
::Unretained(&testSuite))); | 78 int result = base::LaunchUnitTests(argc, argv, base::Bind(runTestSuite, base
::Unretained(&testSuite))); |
78 | 79 |
79 blink::ThreadState::detachMainThread(); | 80 blink::ThreadState::detachMainThread(); |
80 blink::Heap::shutdown(); | 81 blink::Heap::shutdown(); |
81 | 82 |
82 WTF::shutdown(); | 83 WTF::shutdown(); |
| 84 WTF::Partitions::shutdown(); |
83 return result; | 85 return result; |
84 } | 86 } |
OLD | NEW |