Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Side by Side Diff: content/test/content_test_suite.cc

Issue 1208603002: content: implement unittests backend for Ozone GBM Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #if defined(OS_MACOSX) 71 #if defined(OS_MACOSX)
72 base::mac::ScopedNSAutoreleasePool autorelease_pool; 72 base::mac::ScopedNSAutoreleasePool autorelease_pool;
73 #if !defined(OS_IOS) 73 #if !defined(OS_IOS)
74 mock_cr_app::RegisterMockCrApp(); 74 mock_cr_app::RegisterMockCrApp();
75 #endif 75 #endif
76 #endif 76 #endif
77 77
78 #if defined(OS_WIN) 78 #if defined(OS_WIN)
79 gfx::InitDeviceScaleFactor(1.0f); 79 gfx::InitDeviceScaleFactor(1.0f);
80 #endif 80 #endif
81 #if !defined(OS_IOS)
82 bool is_child_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
83 switches::kTestChildProcess);
84 #endif
85 #if defined(USE_OZONE)
86 if (!is_child_process) {
87 ozone_ = ui::OzoneInitializerForTest::Create();
88 DCHECK(ozone_);
89 }
90 #endif
81 91
82 ContentTestSuiteBase::Initialize(); 92 ContentTestSuiteBase::Initialize();
83 { 93 {
84 ContentClient client; 94 ContentClient client;
85 ContentTestSuiteBase::RegisterContentSchemes(&client); 95 ContentTestSuiteBase::RegisterContentSchemes(&client);
86 } 96 }
87 RegisterPathProvider(); 97 RegisterPathProvider();
88 #if !defined(OS_IOS) 98 #if !defined(OS_IOS)
89 media::InitializeMediaLibrary(); 99 media::InitializeMediaLibrary();
90 // When running in a child process for Mac sandbox tests, the sandbox exists 100 // When running in a child process for Mac sandbox tests, the sandbox exists
91 // to initialize GL, so don't do it here. 101 // to initialize GL, so don't do it here.
92 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 102 if (!is_child_process) {
93 switches::kTestChildProcess)) {
94 gfx::GLSurface::InitializeOneOffForTests(); 103 gfx::GLSurface::InitializeOneOffForTests();
95 gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess()); 104 gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess());
96 } 105 }
97 #endif 106 #endif
98 testing::TestEventListeners& listeners = 107 testing::TestEventListeners& listeners =
99 testing::UnitTest::GetInstance()->listeners(); 108 testing::UnitTest::GetInstance()->listeners();
100 listeners.Append(new TestInitializationListener); 109 listeners.Append(new TestInitializationListener);
101 #if defined(OS_ANDROID) 110 #if defined(OS_ANDROID)
102 SurfaceTextureManager::SetInstance( 111 SurfaceTextureManager::SetInstance(
103 InProcessSurfaceTextureManager::GetInstance()); 112 InProcessSurfaceTextureManager::GetInstance());
104 #endif 113 #endif
105 #if defined(OS_MACOSX) && !defined(OS_IOS) 114 #if defined(OS_MACOSX) && !defined(OS_IOS)
106 IOSurfaceManager::SetInstance(InProcessIOSurfaceManager::GetInstance()); 115 IOSurfaceManager::SetInstance(InProcessIOSurfaceManager::GetInstance());
107 #endif 116 #endif
108 } 117 }
109 118
110 } // namespace content 119 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698