summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/aura/demo/demo_main.cc3
-rw-r--r--ui/aura/test/test_suite.cc2
-rw-r--r--ui/aura_shell/examples/aura_shell_main.cc2
-rw-r--r--ui/aura_shell/test_suite.cc2
-rw-r--r--ui/gfx/compositor/compositor.gyp34
-rw-r--r--ui/gfx/compositor/layer_animation_element_unittest.cc4
-rw-r--r--ui/gfx/compositor/layer_animation_sequence_unittest.cc6
-rw-r--r--ui/gfx/compositor/layer_animator_unittest.cc6
-rw-r--r--ui/gfx/compositor/layer_unittest.cc187
-rw-r--r--ui/gfx/compositor/run_all_unittests.cc2
-rw-r--r--ui/gfx/compositor/test/compositor_test_support.cc (renamed from ui/gfx/compositor/compositor_test_support.cc)2
-rw-r--r--ui/gfx/compositor/test/compositor_test_support.h (renamed from ui/gfx/compositor/compositor_test_support.h)6
-rw-r--r--ui/gfx/compositor/test/test_compositor.cc (renamed from ui/gfx/compositor/test_compositor.cc)4
-rw-r--r--ui/gfx/compositor/test/test_compositor.h (renamed from ui/gfx/compositor/test_compositor.h)6
-rw-r--r--ui/gfx/compositor/test/test_compositor_host.h (renamed from ui/gfx/compositor/test_compositor_host.h)6
-rw-r--r--ui/gfx/compositor/test/test_compositor_host_linux.cc (renamed from ui/gfx/compositor/test_compositor_host_linux.cc)2
-rw-r--r--ui/gfx/compositor/test/test_compositor_host_win.cc (renamed from ui/gfx/compositor/test_compositor_host_win.cc)2
-rw-r--r--ui/gfx/compositor/test/test_layer_animation_delegate.cc (renamed from ui/gfx/compositor/test_layer_animation_delegate.cc)2
-rw-r--r--ui/gfx/compositor/test/test_layer_animation_delegate.h (renamed from ui/gfx/compositor/test_layer_animation_delegate.h)6
-rw-r--r--ui/gfx/compositor/test/test_layer_animation_observer.cc (renamed from ui/gfx/compositor/test_layer_animation_observer.cc)2
-rw-r--r--ui/gfx/compositor/test/test_layer_animation_observer.h (renamed from ui/gfx/compositor/test_layer_animation_observer.h)6
-rw-r--r--ui/gfx/compositor/test/test_suite.cc (renamed from ui/gfx/compositor/test_suite.cc)4
-rw-r--r--ui/gfx/compositor/test/test_suite.h (renamed from ui/gfx/compositor/test_suite.h)6
-rw-r--r--ui/gfx/compositor/test/test_texture.cc (renamed from ui/gfx/compositor/test_texture.cc)2
-rw-r--r--ui/gfx/compositor/test/test_texture.h (renamed from ui/gfx/compositor/test_texture.h)6
-rw-r--r--ui/gfx/compositor/test/test_utils.cc (renamed from ui/gfx/compositor/test_utils.cc)2
-rw-r--r--ui/gfx/compositor/test/test_utils.h (renamed from ui/gfx/compositor/test_utils.h)6
-rw-r--r--ui/gfx/test/gfx_test_utils.cc2
-rw-r--r--views/run_all_unittests.cc2
-rw-r--r--views/view_unittest.cc4
30 files changed, 239 insertions, 87 deletions
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index f10d3a0..433032e 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -16,7 +16,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/gfx/canvas_skia.h"
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
#include "ui/gfx/rect.h"
#if defined(USE_X11)
@@ -118,4 +118,3 @@ int main(int argc, char** argv) {
return 0;
}
-
diff --git a/ui/aura/test/test_suite.cc b/ui/aura/test/test_suite.cc
index 10cef93..bbf3428 100644
--- a/ui/aura/test/test_suite.cc
+++ b/ui/aura/test/test_suite.cc
@@ -9,7 +9,7 @@
#include "build/build_config.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
#include "ui/gfx/gfx_paths.h"
#include "ui/gfx/gl/gl_implementation.h"
#include "ui/gfx/test/gfx_test_utils.h"
diff --git a/ui/aura_shell/examples/aura_shell_main.cc b/ui/aura_shell/examples/aura_shell_main.cc
index dd2badc..9cacb3b 100644
--- a/ui/aura_shell/examples/aura_shell_main.cc
+++ b/ui/aura_shell/examples/aura_shell_main.cc
@@ -15,7 +15,7 @@
#include "ui/aura_shell/shell_factory.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
namespace {
diff --git a/ui/aura_shell/test_suite.cc b/ui/aura_shell/test_suite.cc
index fcd3a8f..d1168b9 100644
--- a/ui/aura_shell/test_suite.cc
+++ b/ui/aura_shell/test_suite.cc
@@ -9,7 +9,7 @@
#include "build/build_config.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
#include "ui/gfx/gfx_paths.h"
#include "ui/gfx/test/gfx_test_utils.h"
diff --git a/ui/gfx/compositor/compositor.gyp b/ui/gfx/compositor/compositor.gyp
index 99ea28ba..71ac245 100644
--- a/ui/gfx/compositor/compositor.gyp
+++ b/ui/gfx/compositor/compositor.gyp
@@ -116,8 +116,8 @@
'<(DEPTH)/base/base.gyp:base',
],
'sources': [
- 'compositor_test_support.cc',
- 'compositor_test_support.h',
+ 'test/compositor_test_support.cc',
+ 'test/compositor_test_support.h',
],
'conditions': [
['use_webkit_compositor == 1', {
@@ -160,17 +160,17 @@
'layer_animator_unittest.cc',
'layer_unittest.cc',
'run_all_unittests.cc',
- 'test_compositor_host.h',
- 'test_compositor_host_linux.cc',
- 'test_compositor_host_win.cc',
- 'test_layer_animation_delegate.cc',
- 'test_layer_animation_delegate.h',
- 'test_layer_animation_observer.cc',
- 'test_layer_animation_observer.h',
- 'test_suite.cc',
- 'test_suite.h',
- 'test_utils.cc',
- 'test_utils.h',
+ 'test/test_compositor_host.h',
+ 'test/test_compositor_host_linux.cc',
+ 'test/test_compositor_host_win.cc',
+ 'test/test_layer_animation_delegate.cc',
+ 'test/test_layer_animation_delegate.h',
+ 'test/test_layer_animation_observer.cc',
+ 'test/test_layer_animation_observer.h',
+ 'test/test_suite.cc',
+ 'test/test_suite.h',
+ 'test/test_utils.cc',
+ 'test/test_utils.h',
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.rc',
],
@@ -202,10 +202,10 @@
'compositor',
],
'sources': [
- 'test_compositor.cc',
- 'test_compositor.h',
- 'test_texture.cc',
- 'test_texture.h',
+ 'test/test_compositor.cc',
+ 'test/test_compositor.h',
+ 'test/test_texture.cc',
+ 'test/test_texture.h',
],
}],
],
diff --git a/ui/gfx/compositor/layer_animation_element_unittest.cc b/ui/gfx/compositor/layer_animation_element_unittest.cc
index 4637e92..13d549c 100644
--- a/ui/gfx/compositor/layer_animation_element_unittest.cc
+++ b/ui/gfx/compositor/layer_animation_element_unittest.cc
@@ -12,8 +12,8 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/transform.h"
#include "ui/gfx/compositor/layer_animation_delegate.h"
-#include "ui/gfx/compositor/test_layer_animation_delegate.h"
-#include "ui/gfx/compositor/test_utils.h"
+#include "ui/gfx/compositor/test/test_layer_animation_delegate.h"
+#include "ui/gfx/compositor/test/test_utils.h"
namespace ui {
diff --git a/ui/gfx/compositor/layer_animation_sequence_unittest.cc b/ui/gfx/compositor/layer_animation_sequence_unittest.cc
index 11c1e8b..f928d37 100644
--- a/ui/gfx/compositor/layer_animation_sequence_unittest.cc
+++ b/ui/gfx/compositor/layer_animation_sequence_unittest.cc
@@ -13,9 +13,9 @@
#include "ui/gfx/transform.h"
#include "ui/gfx/compositor/layer_animation_delegate.h"
#include "ui/gfx/compositor/layer_animation_element.h"
-#include "ui/gfx/compositor/test_layer_animation_delegate.h"
-#include "ui/gfx/compositor/test_layer_animation_observer.h"
-#include "ui/gfx/compositor/test_utils.h"
+#include "ui/gfx/compositor/test/test_layer_animation_delegate.h"
+#include "ui/gfx/compositor/test/test_layer_animation_observer.h"
+#include "ui/gfx/compositor/test/test_utils.h"
namespace ui {
diff --git a/ui/gfx/compositor/layer_animator_unittest.cc b/ui/gfx/compositor/layer_animator_unittest.cc
index 57ef10d..a272649 100644
--- a/ui/gfx/compositor/layer_animator_unittest.cc
+++ b/ui/gfx/compositor/layer_animator_unittest.cc
@@ -14,9 +14,9 @@
#include "ui/gfx/compositor/layer_animation_delegate.h"
#include "ui/gfx/compositor/layer_animation_element.h"
#include "ui/gfx/compositor/layer_animation_sequence.h"
-#include "ui/gfx/compositor/test_layer_animation_delegate.h"
-#include "ui/gfx/compositor/test_layer_animation_observer.h"
-#include "ui/gfx/compositor/test_utils.h"
+#include "ui/gfx/compositor/test/test_layer_animation_delegate.h"
+#include "ui/gfx/compositor/test/test_layer_animation_observer.h"
+#include "ui/gfx/compositor/test/test_utils.h"
namespace ui {
diff --git a/ui/gfx/compositor/layer_unittest.cc b/ui/gfx/compositor/layer_unittest.cc
index 3595c86..703f9ca 100644
--- a/ui/gfx/compositor/layer_unittest.cc
+++ b/ui/gfx/compositor/layer_unittest.cc
@@ -15,13 +15,82 @@
#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_compositor.h"
-#include "ui/gfx/compositor/test_compositor_host.h"
+#include "ui/gfx/compositor/test/test_compositor.h"
+#include "ui/gfx/compositor/test/test_compositor_host.h"
+#include "ui/gfx/gfx_paths.h"
namespace ui {
namespace {
+// Encodes a bitmap into a PNG and write to disk. Returns true on success. The
+// parent directory does not have to exist.
+bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) {
+ std::vector<unsigned char> png_data;
+ if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data) &&
+ file_util::CreateDirectory(file_path.DirName())) {
+ char* data = reinterpret_cast<char*>(&png_data[0]);
+ int size = static_cast<int>(png_data.size());
+ return file_util::WriteFile(file_path, data, size) == size;
+ }
+ return false;
+}
+
+// Reads and decodes a PNG image to a bitmap. Returns true on success. The PNG
+// should have been encoded using |gfx::PNGCodec::Encode|.
+bool ReadPNGFile(const FilePath& file_path, SkBitmap* bitmap) {
+ DCHECK(bitmap);
+ std::string png_data;
+ return file_util::ReadFileToString(file_path, &png_data) &&
+ gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&png_data[0]),
+ png_data.length(),
+ bitmap);
+}
+
+// Compares with a PNG file on disk, and returns true if it is the same as
+// the given image. |ref_img_path| is absolute.
+bool IsSameAsPNGFile(const SkBitmap& gen_bmp, FilePath ref_img_path) {
+ SkBitmap ref_bmp;
+ if (!ReadPNGFile(ref_img_path, &ref_bmp)) {
+ LOG(ERROR) << "Cannot read reference image: " << ref_img_path.value();
+ return false;
+ }
+
+ if (ref_bmp.width() != gen_bmp.width() ||
+ ref_bmp.height() != gen_bmp.height()) {
+ LOG(ERROR)
+ << "Dimensions do not match (Expected) vs (Actual):"
+ << "(" << ref_bmp.width() << "x" << ref_bmp.height()
+ << ") vs. "
+ << "(" << gen_bmp.width() << "x" << gen_bmp.height() << ")";
+ return false;
+ }
+
+ // Compare pixels and create a simple diff image.
+ int diff_pixels_count = 0;
+ SkAutoLockPixels lock_bmp(gen_bmp);
+ SkAutoLockPixels lock_ref_bmp(ref_bmp);
+ // The reference images were saved with no alpha channel. Use the mask to
+ // set alpha to 0.
+ uint32_t kAlphaMask = 0x00FFFFFF;
+ for (int x = 0; x < gen_bmp.width(); ++x) {
+ for (int y = 0; y < gen_bmp.height(); ++y) {
+ if ((*gen_bmp.getAddr32(x, y) & kAlphaMask) !=
+ (*ref_bmp.getAddr32(x, y) & kAlphaMask)) {
+ ++diff_pixels_count;
+ }
+ }
+ }
+
+ if (diff_pixels_count != 0) {
+ LOG(ERROR) << "Images differ by pixel count: " << diff_pixels_count;
+ return false;
+ }
+
+ return true;
+}
+
+
// There are three test classes in here that configure the Compositor and
// Layer's slightly differently:
// - LayerWithNullDelegateTest uses TestCompositor and NullLayerDelegate as the
@@ -53,7 +122,13 @@ class ColoredLayer : public Layer, public LayerDelegate {
class LayerWithRealCompositorTest : public testing::Test {
public:
- LayerWithRealCompositorTest() {}
+ LayerWithRealCompositorTest() {
+ if (PathService::Get(gfx::DIR_TEST_DATA, &test_data_directory_)) {
+ test_data_directory_ = test_data_directory_.AppendASCII("compositor");
+ } else {
+ LOG(ERROR) << "Could not open test data directory.";
+ }
+ }
virtual ~LayerWithRealCompositorTest() {}
// Overridden from testing::Test:
@@ -105,9 +180,14 @@ class LayerWithRealCompositorTest : public testing::Test {
gfx::Rect(0, 0, layer->bounds().width(), layer->bounds().height()));
}
+ const FilePath& test_data_directory() const { return test_data_directory_; }
+
private:
scoped_ptr<TestCompositorHost> window_;
+ // The root directory for test files.
+ FilePath test_data_directory_;
+
DISALLOW_COPY_AND_ASSIGN(LayerWithRealCompositorTest);
};
@@ -178,20 +258,6 @@ class NullLayerDelegate : public LayerDelegate {
DISALLOW_COPY_AND_ASSIGN(NullLayerDelegate);
};
-// Encodes a bitmap into a PNG and write to disk. Returns true on success. The
-// parent directory does not have to exist.
-bool WritePNGFile(const SkBitmap& bitmap, const FilePath& file_path) {
- std::vector<unsigned char> png_data;
- if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &png_data) &&
- file_util::CreateDirectory(file_path.DirName())) {
- int bytes_written = file_util::WriteFile(
- file_path, reinterpret_cast<char*>(&png_data[0]), png_data.size());
- if (bytes_written == static_cast<int>(png_data.size()))
- return true;
- }
- return false;
-}
-
// Remembers if it has been notified.
class TestCompositorObserver : public CompositorObserver {
public:
@@ -224,6 +290,8 @@ class TestCompositorObserver : public CompositorObserver {
#define MAYBE_DrawPixels DISABLED_DrawPixels
#define MAYBE_SetRootLayer DISABLED_SetRootLayer
#define MAYBE_CompositorObservers DISABLED_CompositorObservers
+#define MAYBE_ModifyHierarchy DISABLED_ModifyHierarchy
+#define MAYBE_Opacity DISABLED_Opacity
#else
#define MAYBE_Delegate Delegate
#define MAYBE_Draw Draw
@@ -233,6 +301,8 @@ class TestCompositorObserver : public CompositorObserver {
#define MAYBE_DrawPixels DrawPixels
#define MAYBE_SetRootLayer SetRootLayer
#define MAYBE_CompositorObservers CompositorObservers
+#define MAYBE_ModifyHierarchy ModifyHierarchy
+#define MAYBE_Opacity Opacity
#endif
TEST_F(LayerWithRealCompositorTest, MAYBE_Draw) {
@@ -1128,4 +1198,87 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_CompositorObservers) {
EXPECT_FALSE(observer.notified());
}
+// Checks that modifying the hierarchy correctly affects final composite.
+TEST_F(LayerWithRealCompositorTest, MAYBE_ModifyHierarchy) {
+ GetCompositor()->WidgetSizeChanged(gfx::Size(50, 50));
+
+ // l0
+ // +-l11
+ // | +-l21
+ // +-l12
+ scoped_ptr<Layer> l0(CreateColorLayer(SK_ColorRED,
+ gfx::Rect(0, 0, 50, 50)));
+ scoped_ptr<Layer> l11(CreateColorLayer(SK_ColorGREEN,
+ gfx::Rect(0, 0, 25, 25)));
+ scoped_ptr<Layer> l21(CreateColorLayer(SK_ColorMAGENTA,
+ gfx::Rect(0, 0, 15, 15)));
+ scoped_ptr<Layer> l12(CreateColorLayer(SK_ColorBLUE,
+ gfx::Rect(10, 10, 25, 25)));
+
+ FilePath ref_img1 = test_data_directory().AppendASCII("ModifyHierarchy1.png");
+ FilePath ref_img2 = test_data_directory().AppendASCII("ModifyHierarchy2.png");
+ SkBitmap bitmap;
+
+ l0->Add(l11.get());
+ l11->Add(l21.get());
+ l0->Add(l12.get());
+ DrawTree(l0.get());
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap));
+ ASSERT_FALSE(bitmap.empty());
+ // WritePNGFile(bitmap, ref_img1);
+ EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img1));
+
+ l0->MoveToFront(l11.get());
+ DrawTree(l0.get());
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap));
+ ASSERT_FALSE(bitmap.empty());
+ // WritePNGFile(bitmap, ref_img2);
+ EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2));
+
+ // l11 is already at the front, should have no effect.
+ l0->MoveToFront(l11.get());
+ DrawTree(l0.get());
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap));
+ ASSERT_FALSE(bitmap.empty());
+ EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2));
+
+ // l11 is already at the front, should have no effect.
+ l0->MoveAbove(l11.get(), l12.get());
+ DrawTree(l0.get());
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap));
+ ASSERT_FALSE(bitmap.empty());
+ EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img2));
+
+ // should restore to original configuration
+ l0->MoveAbove(l12.get(), l11.get());
+ DrawTree(l0.get());
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap));
+ ASSERT_FALSE(bitmap.empty());
+ EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img1));
+}
+
+// Opacity is rendered correctly.
+// Checks that modifying the hierarchy correctly affects final composite.
+TEST_F(LayerWithRealCompositorTest, MAYBE_Opacity) {
+ GetCompositor()->WidgetSizeChanged(gfx::Size(50, 50));
+
+ // l0
+ // +-l11
+ scoped_ptr<Layer> l0(CreateColorLayer(SK_ColorRED,
+ gfx::Rect(0, 0, 50, 50)));
+ scoped_ptr<Layer> l11(CreateColorLayer(SK_ColorGREEN,
+ gfx::Rect(0, 0, 25, 25)));
+
+ FilePath ref_img = test_data_directory().AppendASCII("Opacity.png");
+
+ l11->SetOpacity(0.75);
+ l0->Add(l11.get());
+ DrawTree(l0.get());
+ SkBitmap bitmap;
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap));
+ ASSERT_FALSE(bitmap.empty());
+ // WritePNGFile(bitmap, ref_img);
+ EXPECT_TRUE(IsSameAsPNGFile(bitmap, ref_img));
+}
+
} // namespace ui
diff --git a/ui/gfx/compositor/run_all_unittests.cc b/ui/gfx/compositor/run_all_unittests.cc
index 5419134..3665c79 100644
--- a/ui/gfx/compositor/run_all_unittests.cc
+++ b/ui/gfx/compositor/run_all_unittests.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_suite.h"
+#include "ui/gfx/compositor/test/test_suite.h"
int main(int argc, char** argv) {
return CompositorTestSuite(argc, argv).Run();
diff --git a/ui/gfx/compositor/compositor_test_support.cc b/ui/gfx/compositor/test/compositor_test_support.cc
index e72bd0c..169957a 100644
--- a/ui/gfx/compositor/compositor_test_support.cc
+++ b/ui/gfx/compositor/test/compositor_test_support.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
#if defined(USE_WEBKIT_COMPOSITOR)
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
diff --git a/ui/gfx/compositor/compositor_test_support.h b/ui/gfx/compositor/test/compositor_test_support.h
index 06a7ee8..bcad486 100644
--- a/ui/gfx/compositor/compositor_test_support.h
+++ b/ui/gfx/compositor/test/compositor_test_support.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_SUPPORT_H_
-#define UI_GFX_COMPOSITOR_TEST_SUPPORT_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_SUPPORT_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_SUPPORT_H_
#pragma once
namespace ui {
@@ -18,4 +18,4 @@ class CompositorTestSupport {
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_SUPPORT_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_SUPPORT_H_
diff --git a/ui/gfx/compositor/test_compositor.cc b/ui/gfx/compositor/test/test_compositor.cc
index 5485486..b0b7d33 100644
--- a/ui/gfx/compositor/test_compositor.cc
+++ b/ui/gfx/compositor/test/test_compositor.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_compositor.h"
+#include "ui/gfx/compositor/test/test_compositor.h"
-#include "ui/gfx/compositor/test_texture.h"
+#include "ui/gfx/compositor/test/test_texture.h"
namespace ui {
diff --git a/ui/gfx/compositor/test_compositor.h b/ui/gfx/compositor/test/test_compositor.h
index c84f652..568c159 100644
--- a/ui/gfx/compositor/test_compositor.h
+++ b/ui/gfx/compositor/test/test_compositor.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_
-#define UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_COMPOSITOR_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_COMPOSITOR_H_
#pragma once
#include "base/basictypes.h"
@@ -43,4 +43,4 @@ class TestCompositor : public ui::Compositor {
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_COMPOSITOR_H_
diff --git a/ui/gfx/compositor/test_compositor_host.h b/ui/gfx/compositor/test/test_compositor_host.h
index 3754aab..92650cb 100644
--- a/ui/gfx/compositor/test_compositor_host.h
+++ b/ui/gfx/compositor/test/test_compositor_host.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_COMPOSITOR_HOST_H_
-#define UI_GFX_COMPOSITOR_TEST_COMPOSITOR_HOST_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_COMPOSITOR_HOST_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_COMPOSITOR_HOST_H_
#pragma once
#include "base/message_loop.h"
@@ -31,4 +31,4 @@ class TestCompositorHost : public MessageLoop::Dispatcher {
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_COMPOSITOR_HOST_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_COMPOSITOR_HOST_H_
diff --git a/ui/gfx/compositor/test_compositor_host_linux.cc b/ui/gfx/compositor/test/test_compositor_host_linux.cc
index f3dba94..b714931 100644
--- a/ui/gfx/compositor/test_compositor_host_linux.cc
+++ b/ui/gfx/compositor/test/test_compositor_host_linux.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_compositor_host.h"
+#include "ui/gfx/compositor/test/test_compositor_host.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
diff --git a/ui/gfx/compositor/test_compositor_host_win.cc b/ui/gfx/compositor/test/test_compositor_host_win.cc
index 226ea8c..b4cf17c 100644
--- a/ui/gfx/compositor/test_compositor_host_win.cc
+++ b/ui/gfx/compositor/test/test_compositor_host_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_compositor_host.h"
+#include "ui/gfx/compositor/test/test_compositor_host.h"
#include "base/compiler_specific.h"
#include "ui/base/win/window_impl.h"
diff --git a/ui/gfx/compositor/test_layer_animation_delegate.cc b/ui/gfx/compositor/test/test_layer_animation_delegate.cc
index a7aa124..8b40830 100644
--- a/ui/gfx/compositor/test_layer_animation_delegate.cc
+++ b/ui/gfx/compositor/test/test_layer_animation_delegate.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_layer_animation_delegate.h"
+#include "ui/gfx/compositor/test/test_layer_animation_delegate.h"
namespace ui {
diff --git a/ui/gfx/compositor/test_layer_animation_delegate.h b/ui/gfx/compositor/test/test_layer_animation_delegate.h
index afcafff..37d3c82 100644
--- a/ui/gfx/compositor/test_layer_animation_delegate.h
+++ b/ui/gfx/compositor/test/test_layer_animation_delegate.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_DELEGATE_H_
-#define UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_DELEGATE_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_LAYER_ANIMATION_DELEGATE_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_LAYER_ANIMATION_DELEGATE_H_
#pragma once
#include "base/compiler_specific.h"
@@ -38,4 +38,4 @@ class TestLayerAnimationDelegate : public LayerAnimationDelegate {
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_DELEGATE_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_LAYER_ANIMATION_DELEGATE_H_
diff --git a/ui/gfx/compositor/test_layer_animation_observer.cc b/ui/gfx/compositor/test/test_layer_animation_observer.cc
index 505d528..dc43d26 100644
--- a/ui/gfx/compositor/test_layer_animation_observer.cc
+++ b/ui/gfx/compositor/test/test_layer_animation_observer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_layer_animation_observer.h"
+#include "ui/gfx/compositor/test/test_layer_animation_observer.h"
#include <cstddef>
diff --git a/ui/gfx/compositor/test_layer_animation_observer.h b/ui/gfx/compositor/test/test_layer_animation_observer.h
index d0d6df3..8f7ca2d 100644
--- a/ui/gfx/compositor/test_layer_animation_observer.h
+++ b/ui/gfx/compositor/test/test_layer_animation_observer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_
-#define UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_LAYER_ANIMATION_OBSERVER_
+#define UI_GFX_COMPOSITOR_TEST_TEST_LAYER_ANIMATION_OBSERVER_
#pragma once
#include "base/compiler_specific.h"
@@ -52,4 +52,4 @@ class TestLayerAnimationObserver : public LayerAnimationObserver {
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_LAYER_ANIMATION_OBSERVER_
diff --git a/ui/gfx/compositor/test_suite.cc b/ui/gfx/compositor/test/test_suite.cc
index 66d4b26..c1d76cd 100644
--- a/ui/gfx/compositor/test_suite.cc
+++ b/ui/gfx/compositor/test/test_suite.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_suite.h"
+#include "ui/gfx/compositor/test/test_suite.h"
#include "base/message_loop.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
#include "ui/gfx/gfx_paths.h"
#include "ui/gfx/gl/gl_implementation.h"
diff --git a/ui/gfx/compositor/test_suite.h b/ui/gfx/compositor/test/test_suite.h
index 6de1e3f..d4760ce 100644
--- a/ui/gfx/compositor/test_suite.h
+++ b/ui/gfx/compositor/test/test_suite.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_SUITE_H_
-#define UI_GFX_COMPOSITOR_TEST_SUITE_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_SUITE_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_SUITE_H_
#pragma once
#include "base/compiler_specific.h"
@@ -26,4 +26,4 @@ class CompositorTestSuite : public base::TestSuite {
scoped_ptr<MessageLoop> message_loop_;
};
-#endif // UI_GFX_COMPOSITOR_TEST_SUITE_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_SUITE_H_
diff --git a/ui/gfx/compositor/test_texture.cc b/ui/gfx/compositor/test/test_texture.cc
index ce1b9f4..3e47c6f 100644
--- a/ui/gfx/compositor/test_texture.cc
+++ b/ui/gfx/compositor/test/test_texture.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_texture.h"
+#include "ui/gfx/compositor/test/test_texture.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkDevice.h"
diff --git a/ui/gfx/compositor/test_texture.h b/ui/gfx/compositor/test/test_texture.h
index 95a6f2a..1d78894 100644
--- a/ui/gfx/compositor/test_texture.h
+++ b/ui/gfx/compositor/test/test_texture.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_TEXTURE_H_
-#define UI_GFX_COMPOSITOR_TEST_TEXTURE_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_TEXTURE_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_TEXTURE_H_
#pragma once
#include "base/basictypes.h"
@@ -47,4 +47,4 @@ class TestTexture : public ui::Texture {
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_TEXTURE_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_TEXTURE_H_
diff --git a/ui/gfx/compositor/test_utils.cc b/ui/gfx/compositor/test/test_utils.cc
index 867c354..6700d85 100644
--- a/ui/gfx/compositor/test_utils.cc
+++ b/ui/gfx/compositor/test/test_utils.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/compositor/test_utils.h"
+#include "ui/gfx/compositor/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
diff --git a/ui/gfx/compositor/test_utils.h b/ui/gfx/compositor/test/test_utils.h
index 9c4411c..61a8d41 100644
--- a/ui/gfx/compositor/test_utils.h
+++ b/ui/gfx/compositor/test/test_utils.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_COMPOSITOR_TEST_UTILS_H_
-#define UI_GFX_COMPOSITOR_TEST_UTILS_H_
+#ifndef UI_GFX_COMPOSITOR_TEST_TEST_UTILS_H_
+#define UI_GFX_COMPOSITOR_TEST_TEST_UTILS_H_
#pragma once
namespace gfx {
@@ -19,4 +19,4 @@ void CheckApproximatelyEqual(const gfx::Rect& lhs, const gfx::Rect& rhs);
} // namespace ui
-#endif // UI_GFX_COMPOSITOR_TEST_UTILS_H_
+#endif // UI_GFX_COMPOSITOR_TEST_TEST_UTILS_H_
diff --git a/ui/gfx/test/gfx_test_utils.cc b/ui/gfx/test/gfx_test_utils.cc
index 2f66690..1d66ed7 100644
--- a/ui/gfx/test/gfx_test_utils.cc
+++ b/ui/gfx/test/gfx_test_utils.cc
@@ -7,7 +7,7 @@
#if defined(VIEWS_COMPOSITOR)
#include "base/command_line.h"
#include "ui/gfx/compositor/compositor.h"
-#include "ui/gfx/compositor/test_compositor.h"
+#include "ui/gfx/compositor/test/test_compositor.h"
#endif
#if defined(VIEWS_COMPOSITOR)
diff --git a/views/run_all_unittests.cc b/views/run_all_unittests.cc
index 20522efe..083d4a8 100644
--- a/views/run_all_unittests.cc
+++ b/views/run_all_unittests.cc
@@ -5,7 +5,7 @@
#include "base/test/test_suite.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
-#include "ui/gfx/compositor/compositor_test_support.h"
+#include "ui/gfx/compositor/test/compositor_test_support.h"
#include "ui/gfx/test/gfx_test_utils.h"
#include "views/view.h"
diff --git a/views/view_unittest.cc b/views/view_unittest.cc
index d0ed95f..140a03fa 100644
--- a/views/view_unittest.cc
+++ b/views/view_unittest.cc
@@ -17,8 +17,8 @@
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/compositor/layer_animator.h"
-#include "ui/gfx/compositor/test_compositor.h"
-#include "ui/gfx/compositor/test_texture.h"
+#include "ui/gfx/compositor/test/test_compositor.h"
+#include "ui/gfx/compositor/test/test_texture.h"
#include "ui/gfx/path.h"
#include "ui/gfx/transform.h"
#include "ui/views/test/views_test_base.h"