context_factories_for_test.h revision cedac228d2dd51db4b79ea1e72c7f249408ee061
1b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Copyright 2013 The Chromium Authors. All rights reserved.
2b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Use of this source code is governed by a BSD-style license that can be
3b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// found in the LICENSE file.
4b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
5b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgnamespace ui {
6b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
7b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ContextFactory;
8b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
9b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Set up the compositor ContextFactory for a test environment. Unit tests
10b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// that do not have a full content environment need to call this before
11b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// initializing the Compositor.
12b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Some tests expect pixel output, and they should pass true for
13b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// |enable_pixel_output|. Most unit tests should pass false. Once this has been
14b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// called, the caller must call TerminateContextFactoryForTests() to clean up.
15937634675cd05832ef69c6e376f36b413ef13bcaphoglund@webrtc.org// TODO(sky): this should return a scoped_ptr and then nuke
16b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// TerminateContextFactoryForTests().
17937634675cd05832ef69c6e376f36b413ef13bcaphoglund@webrtc.orgui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output);
18937634675cd05832ef69c6e376f36b413ef13bcaphoglund@webrtc.orgvoid TerminateContextFactoryForTests();
19937634675cd05832ef69c6e376f36b413ef13bcaphoglund@webrtc.org
20937634675cd05832ef69c6e376f36b413ef13bcaphoglund@webrtc.org}  // namespace ui
21937634675cd05832ef69c6e376f36b413ef13bcaphoglund@webrtc.org