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

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

Issue 22293003: Clean up compositor initialization/destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanupcompositor: UseRealGLBindings in NetInternalsTest Created 7 years, 4 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
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 "net/test/spawned_test_server/spawned_test_server.h" 10 #include "net/test/spawned_test_server/spawned_test_server.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // this. 102 // this.
103 // |test_server_base| is the path, relative to src, to give to the test HTTP 103 // |test_server_base| is the path, relative to src, to give to the test HTTP
104 // server. 104 // server.
105 void CreateTestServer(const base::FilePath& test_server_base); 105 void CreateTestServer(const base::FilePath& test_server_base);
106 106
107 // When the test is running in --single-process mode, runs the given task on 107 // When the test is running in --single-process mode, runs the given task on
108 // the in-process renderer thread. A nested message loop is run until it 108 // the in-process renderer thread. A nested message loop is run until it
109 // returns. 109 // returns.
110 void PostTaskToInProcessRendererAndWait(const base::Closure& task); 110 void PostTaskToInProcessRendererAndWait(const base::Closure& task);
111 111
112 // Call this before SetUp() to use real GL contexts in Compositor for the
113 // test.
114 void UseRealGLContexts() { allow_test_contexts_ = false; }
115
116 // Call this before SetUp() to use real GL drivers instead of OSMesa for the
117 // test.
118 void UseRealGLBindings() { allow_osmesa_ = false; }
119
112 private: 120 private:
113 void ProxyRunTestOnMainThreadLoop(); 121 void ProxyRunTestOnMainThreadLoop();
114 122
115 // Testing server, started on demand. 123 // Testing server, started on demand.
116 scoped_ptr<net::SpawnedTestServer> test_server_; 124 scoped_ptr<net::SpawnedTestServer> test_server_;
117 125
118 // Embedded test server, cheap to create, started on demand. 126 // Embedded test server, cheap to create, started on demand.
119 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; 127 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_;
120 128
129 // When false, the ui::Compositor will be forced to use real GL contexts for
130 // the test, so that it produces real pixel output.
131 bool allow_test_contexts_;
132
133 // When false, the GL backend will use a real GPU. When true, it uses OSMesa
134 // to run GL on the CPU in a way that works across all platforms.
135 bool allow_osmesa_;
136
121 #if defined(OS_POSIX) 137 #if defined(OS_POSIX)
122 bool handle_sigterm_; 138 bool handle_sigterm_;
123 #endif 139 #endif
124 }; 140 };
125 141
126 } // namespace content 142 } // namespace content
127 143
128 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 144 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698