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

Unified Diff: ui/gfx/compositor/layer_unittest.cc

Issue 8873037: Revert 113676 - Attempt 2 at : Makes tests either use mock compositor or mock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
« no previous file with comments | « ui/gfx/compositor/compositor_switches.cc ('k') | ui/views/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_unittest.cc
===================================================================
--- ui/gfx/compositor/layer_unittest.cc (revision 113682)
+++ ui/gfx/compositor/layer_unittest.cc (working copy)
@@ -15,15 +15,10 @@
#include "ui/gfx/compositor/compositor_observer.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animation_sequence.h"
+#include "ui/gfx/compositor/test/test_compositor.h"
#include "ui/gfx/compositor/test/test_compositor_host.h"
#include "ui/gfx/gfx_paths.h"
-#if defined(USE_WEBKIT_COMPOSITOR)
-#include "ui/gfx/compositor/compositor_setup.h"
-#else
-#include "ui/gfx/compositor/test/test_compositor.h"
-#endif
-
namespace ui {
namespace {
@@ -111,9 +106,10 @@
// There are three test classes in here that configure the Compositor and
// Layer's slightly differently:
-// - LayerWithNullDelegateTest uses NullLayerDelegate as the LayerDelegate. This
-// is typically the base class you want to use.
-// - LayerWithDelegateTest uses LayerDelegate on the delegates.
+// - LayerWithNullDelegateTest uses TestCompositor and NullLayerDelegate as the
+// LayerDelegate. This is typically the base class you want to use.
+// - LayerWithDelegateTest uses TestCompositor and does not set a LayerDelegate
+// on the delegates.
// - LayerWithRealCompositorTest when a real compositor is required for testing.
// - Slow because they bring up a window and run the real compositor. This
// is typically not what you want.
@@ -150,9 +146,6 @@
// Overridden from testing::Test:
virtual void SetUp() OVERRIDE {
-#if defined(USE_WEBKIT_COMPOSITOR)
- ui::DisableTestCompositor();
-#endif
const gfx::Rect host_bounds(10, 10, 500, 500);
window_.reset(TestCompositorHost::Create(host_bounds));
window_->Show();
@@ -366,12 +359,7 @@
// Overridden from testing::Test:
virtual void SetUp() OVERRIDE {
-#if defined(USE_WEBKIT_COMPOSITOR)
- ui::SetupTestCompositor();
- compositor_ = ui::Compositor::Create(this, NULL, gfx::Size(1000, 1000));
-#else
compositor_ = new TestCompositor(this);
-#endif
}
virtual void TearDown() OVERRIDE {
@@ -425,7 +413,7 @@
bool schedule_draw_invoked_;
private:
- scoped_refptr<ui::Compositor> compositor_;
+ scoped_refptr<TestCompositor> compositor_;
DISALLOW_COPY_AND_ASSIGN(LayerWithDelegateTest);
};
« no previous file with comments | « ui/gfx/compositor/compositor_switches.cc ('k') | ui/views/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698