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

Unified Diff: content/browser/renderer_host/media/desktop_capture_device_aura_unittest.cc

Issue 145293007: ui: No more TestCompositor. Use NullDraw contexts in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testsnulldraw: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/desktop_capture_device_aura_unittest.cc
diff --git a/content/browser/renderer_host/media/desktop_capture_device_aura_unittest.cc b/content/browser/renderer_host/media/desktop_capture_device_aura_unittest.cc
index e6abac3d8f87f2507d13f641c91d9098a0a3c2c7..2481d8dea5b69d42714ed2779e506ecca40ea973 100644
--- a/content/browser/renderer_host/media/desktop_capture_device_aura_unittest.cc
+++ b/content/browser/renderer_host/media/desktop_capture_device_aura_unittest.cc
@@ -14,6 +14,7 @@
#include "ui/aura/test/aura_test_helper.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
+#include "ui/compositor/test/context_factories_for_test.h"
using ::testing::_;
using ::testing::AnyNumber;
@@ -56,9 +57,11 @@ class DesktopCaptureDeviceAuraTest : public testing::Test {
protected:
virtual void SetUp() OVERRIDE {
+ // The ContextFactory must exist before any Compositors are created.
+ bool enable_pixel_output = false;
+ ui::InitializeContextFactoryForTests(enable_pixel_output);
helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
- bool allow_test_contexts = true;
- helper_->SetUp(allow_test_contexts);
+ helper_->SetUp();
// We need a window to cover desktop area so that DesktopCaptureDeviceAura
// can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the
@@ -79,6 +82,7 @@ class DesktopCaptureDeviceAuraTest : public testing::Test {
desktop_window_.reset();
window_delegate_.reset();
helper_->TearDown();
+ ui::TerminateContextFactoryForTests();
}
aura::Window* root_window() { return helper_->root_window(); }

Powered by Google App Engine
This is Rietveld 408576698