| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/test/content_test_suite.h" | 5 #include "content/test/content_test_suite.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
| 10 #include "content/public/common/content_paths.h" | 10 #include "content/public/common/content_paths.h" |
| 11 #include "content/public/test/test_content_client_initializer.h" | 11 #include "content/public/test/test_content_client_initializer.h" |
| 12 #include "gpu/config/gpu_util.h" | 12 #include "gpu/config/gpu_util.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 #include "ui/gfx/dpi.h" |
| 15 #if defined(OS_WIN) | |
| 16 #include "ui/gfx/win/dpi.h" | |
| 17 #endif | |
| 18 | 15 |
| 19 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
| 20 #include "base/mac/scoped_nsautorelease_pool.h" | 17 #include "base/mac/scoped_nsautorelease_pool.h" |
| 21 #if !defined(OS_IOS) | 18 #if !defined(OS_IOS) |
| 22 #include "base/test/mock_chrome_application_mac.h" | 19 #include "base/test/mock_chrome_application_mac.h" |
| 23 #endif | 20 #endif |
| 24 #endif | 21 #endif |
| 25 | 22 |
| 26 #if !defined(OS_IOS) | 23 #if !defined(OS_IOS) |
| 27 #include "base/base_switches.h" | 24 #include "base/base_switches.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 61 } |
| 65 | 62 |
| 66 void ContentTestSuite::Initialize() { | 63 void ContentTestSuite::Initialize() { |
| 67 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
| 68 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 65 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| 69 #if !defined(OS_IOS) | 66 #if !defined(OS_IOS) |
| 70 mock_cr_app::RegisterMockCrApp(); | 67 mock_cr_app::RegisterMockCrApp(); |
| 71 #endif | 68 #endif |
| 72 #endif | 69 #endif |
| 73 | 70 |
| 74 #if defined(OS_WIN) | 71 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 75 gfx::InitDeviceScaleFactor(1.0f); | 72 gfx::InitDeviceScaleFactor(1.0f); |
| 76 #endif | 73 #endif |
| 77 | 74 |
| 78 ContentTestSuiteBase::Initialize(); | 75 ContentTestSuiteBase::Initialize(); |
| 79 { | 76 { |
| 80 ContentClient client; | 77 ContentClient client; |
| 81 ContentTestSuiteBase::RegisterContentSchemes(&client); | 78 ContentTestSuiteBase::RegisterContentSchemes(&client); |
| 82 } | 79 } |
| 83 RegisterPathProvider(); | 80 RegisterPathProvider(); |
| 84 #if !defined(OS_IOS) | 81 #if !defined(OS_IOS) |
| 85 media::InitializeMediaLibraryForTesting(); | 82 media::InitializeMediaLibraryForTesting(); |
| 86 // When running in a child process for Mac sandbox tests, the sandbox exists | 83 // When running in a child process for Mac sandbox tests, the sandbox exists |
| 87 // to initialize GL, so don't do it here. | 84 // to initialize GL, so don't do it here. |
| 88 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 85 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 89 switches::kTestChildProcess)) { | 86 switches::kTestChildProcess)) { |
| 90 gfx::GLSurface::InitializeOneOffForTests(); | 87 gfx::GLSurface::InitializeOneOffForTests(); |
| 91 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); | 88 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); |
| 92 } | 89 } |
| 93 #endif | 90 #endif |
| 94 testing::TestEventListeners& listeners = | 91 testing::TestEventListeners& listeners = |
| 95 testing::UnitTest::GetInstance()->listeners(); | 92 testing::UnitTest::GetInstance()->listeners(); |
| 96 listeners.Append(new TestInitializationListener); | 93 listeners.Append(new TestInitializationListener); |
| 97 } | 94 } |
| 98 | 95 |
| 99 } // namespace content | 96 } // namespace content |
| OLD | NEW |