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

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

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ChildNativePixmapManager or BrowserNativePixmapManager 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 17 matching lines...) Expand all
28 #include "base/base_switches.h" 28 #include "base/base_switches.h"
29 #include "base/command_line.h" 29 #include "base/command_line.h"
30 #include "media/base/media.h" 30 #include "media/base/media.h"
31 #include "ui/gl/test/gl_surface_test_support.h" 31 #include "ui/gl/test/gl_surface_test_support.h"
32 #endif 32 #endif
33 33
34 #if defined(OS_ANDROID) 34 #if defined(OS_ANDROID)
35 #include "content/browser/android/in_process_surface_texture_manager.h" 35 #include "content/browser/android/in_process_surface_texture_manager.h"
36 #endif 36 #endif
37 37
38 #if defined(USE_OZONE)
39 #include "ui/ozone/public/native_pixmap_manager.h"
40 #endif
41
38 namespace content { 42 namespace content {
39 namespace { 43 namespace {
40 44
41 class TestInitializationListener : public testing::EmptyTestEventListener { 45 class TestInitializationListener : public testing::EmptyTestEventListener {
42 public: 46 public:
43 TestInitializationListener() : test_content_client_initializer_(NULL) { 47 TestInitializationListener() : test_content_client_initializer_(NULL) {
44 } 48 }
45 49
46 void OnTestStart(const testing::TestInfo& test_info) override { 50 void OnTestStart(const testing::TestInfo& test_info) override {
47 test_content_client_initializer_ = 51 test_content_client_initializer_ =
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ContentTestSuiteBase::Initialize(); 86 ContentTestSuiteBase::Initialize();
83 { 87 {
84 ContentClient client; 88 ContentClient client;
85 ContentTestSuiteBase::RegisterContentSchemes(&client); 89 ContentTestSuiteBase::RegisterContentSchemes(&client);
86 } 90 }
87 RegisterPathProvider(); 91 RegisterPathProvider();
88 #if !defined(OS_IOS) 92 #if !defined(OS_IOS)
89 media::InitializeMediaLibrary(); 93 media::InitializeMediaLibrary();
90 // When running in a child process for Mac sandbox tests, the sandbox exists 94 // When running in a child process for Mac sandbox tests, the sandbox exists
91 // to initialize GL, so don't do it here. 95 // to initialize GL, so don't do it here.
92 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 96 bool is_child_process = base::CommandLine::ForCurrentProcess()->HasSwitch(
93 switches::kTestChildProcess)) { 97 switches::kTestChildProcess);
98 if (!is_child_process) {
94 gfx::GLSurfaceTestSupport::InitializeOneOff(); 99 gfx::GLSurfaceTestSupport::InitializeOneOff();
95 gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess()); 100 gpu::ApplyGpuDriverBugWorkarounds(base::CommandLine::ForCurrentProcess());
96 } 101 }
97 #endif 102 #endif
98 testing::TestEventListeners& listeners = 103 testing::TestEventListeners& listeners =
99 testing::UnitTest::GetInstance()->listeners(); 104 testing::UnitTest::GetInstance()->listeners();
100 listeners.Append(new TestInitializationListener); 105 listeners.Append(new TestInitializationListener);
101 #if defined(OS_ANDROID) 106 #if defined(OS_ANDROID)
102 SurfaceTextureManager::SetInstance( 107 SurfaceTextureManager::SetInstance(
103 InProcessSurfaceTextureManager::GetInstance()); 108 InProcessSurfaceTextureManager::GetInstance());
104 #endif 109 #endif
105 #if defined(OS_MACOSX) && !defined(OS_IOS) 110 #if defined(OS_MACOSX) && !defined(OS_IOS)
106 IOSurfaceManager::SetInstance(InProcessIOSurfaceManager::GetInstance()); 111 IOSurfaceManager::SetInstance(InProcessIOSurfaceManager::GetInstance());
107 #endif 112 #endif
113 #if defined(USE_OZONE)
114 if (!is_child_process) {
reveman 2015/07/23 14:46:12 why do you need this "!is_child_process" check?
dshwang 2015/07/23 16:42:09 good question. why gfx::GLSurfaceTestSupport::Init
reveman 2015/07/23 18:25:23 Well it's probably called later in that case. Mayb
dshwang 2015/07/24 12:19:00 I'm fixing unittests for ozone in https://coderevi
115 DCHECK(!ui::NativePixmapManager::GetInstance());
reveman 2015/07/23 14:46:12 nit: remove this DCHECK, SetInstance already does
dshwang 2015/07/23 16:42:09 Done.
116 ui::NativePixmapManager::SetInstance(ui::NativePixmapManager::Create());
reveman 2015/07/23 14:46:12 should we be using CreateNativePixmapManagerTest()
dshwang 2015/07/23 16:42:09 CreateNativePixmapManagerTest() is not public for
117 }
118 #endif
108 } 119 }
109 120
110 } // namespace content 121 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698