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

Side by Side Diff: content/public/test/browser_test_base.h

Issue 120313002: Use stub GL draw/clear calls for browser tests that do not need pixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stubgl: use_osmesa Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/media/media_browsertest.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // When the test is running in --single-process mode, runs the given task on 116 // When the test is running in --single-process mode, runs the given task on
117 // the in-process renderer thread. A nested message loop is run until it 117 // the in-process renderer thread. A nested message loop is run until it
118 // returns. 118 // returns.
119 void PostTaskToInProcessRendererAndWait(const base::Closure& task); 119 void PostTaskToInProcessRendererAndWait(const base::Closure& task);
120 120
121 // Call this before SetUp() to use real GL contexts in Compositor for the 121 // Call this before SetUp() to use real GL contexts in Compositor for the
122 // test. 122 // test.
123 void UseRealGLContexts(); 123 void UseRealGLContexts();
124 124
125 // Call this before SetUp() to use real GL drivers instead of OSMesa for the
126 // test.
127 void UseRealGLBindings();
128
129 // Call this before SetUp() to not use GL, but use software compositing 125 // Call this before SetUp() to not use GL, but use software compositing
130 // instead. 126 // instead.
131 void UseSoftwareCompositing(); 127 void UseSoftwareCompositing();
132 128
133 // Returns true if the test will be using GL acceleration via OSMesa. 129 // Returns true if the test will be using GL acceleration via OSMesa.
134 bool UsingOSMesa() const; 130 bool UsingOSMesa() const;
135 131
136 private: 132 private:
137 void ProxyRunTestOnMainThreadLoop(); 133 void ProxyRunTestOnMainThreadLoop();
138 134
139 // Testing server, started on demand. 135 // Testing server, started on demand.
140 scoped_ptr<net::SpawnedTestServer> test_server_; 136 scoped_ptr<net::SpawnedTestServer> test_server_;
141 137
142 // Embedded test server, cheap to create, started on demand. 138 // Embedded test server, cheap to create, started on demand.
143 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; 139 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_;
144 140
145 // Host resolver used during tests. 141 // Host resolver used during tests.
146 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; 142 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_;
147 143
148 // When false, the ui::Compositor will be forced to use real GL contexts for 144 // When false, the ui::Compositor will be forced to use real GL contexts for
149 // the test, so that it produces real pixel output. 145 // the test, so that it produces real pixel output.
150 bool allow_test_contexts_; 146 bool allow_test_contexts_;
151 147
152 // When false, the GL backend will use a real GPU. When true, it uses OSMesa
153 // to run GL on the CPU in a way that works across all platforms.
154 bool allow_osmesa_;
155
156 // When true, do compositing with the software backend instead of using GL. 148 // When true, do compositing with the software backend instead of using GL.
157 bool use_software_compositing_; 149 bool use_software_compositing_;
158 150
159 #if defined(OS_POSIX) 151 #if defined(OS_POSIX)
160 bool handle_sigterm_; 152 bool handle_sigterm_;
161 #endif 153 #endif
162 }; 154 };
163 155
164 } // namespace content 156 } // namespace content
165 157
166 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 158 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
OLDNEW
« no previous file with comments | « content/browser/media/media_browsertest.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698