summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 19:31:05 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-13 19:31:05 +0000
commit95fc42145e5a8cdb0c7624060bf5bfd298838e19 (patch)
tree2b9a293e6581a60afbe69fe32177cf2b73704b9e /cc
parent14ac682365925234f1f7bc3572f185b69f798814 (diff)
downloadchromium_src-95fc42145e5a8cdb0c7624060bf5bfd298838e19.zip
chromium_src-95fc42145e5a8cdb0c7624060bf5bfd298838e19.tar.gz
chromium_src-95fc42145e5a8cdb0c7624060bf5bfd298838e19.tar.bz2
aura,cc: Make TestContextProvider usable outside cc.
This makes the TestWebGraphicsContext3D available outside of cc, and replaces ui::TestWGC3D with the class from cc. R=jbauman, piman BUG=258625 Review URL: https://chromiumcodereview.appspot.com/22293007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/cc.gyp2
-rw-r--r--cc/cc_tests.gyp2
-rw-r--r--cc/debug/test_web_graphics_context_3d.cc (renamed from cc/test/test_web_graphics_context_3d.cc)23
-rw-r--r--cc/debug/test_web_graphics_context_3d.h (renamed from cc/test/test_web_graphics_context_3d.h)16
-rw-r--r--cc/layers/delegated_renderer_layer_impl_unittest.cc2
-rw-r--r--cc/layers/scrollbar_layer_unittest.cc2
-rw-r--r--cc/layers/texture_layer_unittest.cc2
-rw-r--r--cc/output/gl_renderer_unittest.cc2
-rw-r--r--cc/output/output_surface_unittest.cc2
-rw-r--r--cc/resources/resource_provider_unittest.cc2
-rw-r--r--cc/resources/resource_update_controller_unittest.cc2
-rw-r--r--cc/resources/video_resource_updater_unittest.cc2
-rw-r--r--cc/scheduler/texture_uploader_unittest.cc2
-rw-r--r--cc/test/fake_layer_tree_host_client.cc2
-rw-r--r--cc/test/fake_output_surface.h2
-rw-r--r--cc/test/fake_web_graphics_context_3d_unittest.cc2
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc2
-rw-r--r--cc/trees/layer_tree_host_unittest_context.cc2
18 files changed, 34 insertions, 37 deletions
diff --git a/cc/cc.gyp b/cc/cc.gyp
index 11353ff..5a2f405 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -88,6 +88,8 @@
'debug/rendering_stats_instrumentation.cc',
'debug/rendering_stats_instrumentation.h',
'debug/ring_buffer.h',
+ 'debug/test_web_graphics_context_3d.cc',
+ 'debug/test_web_graphics_context_3d.h',
'debug/traced_picture.cc',
'debug/traced_picture.h',
'debug/traced_value.cc',
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index 7256836..4e4f438 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -172,8 +172,6 @@
'test/skia_common.h',
'test/test_tile_priorities.cc',
'test/test_tile_priorities.h',
- 'test/test_web_graphics_context_3d.cc',
- 'test/test_web_graphics_context_3d.h',
'test/tiled_layer_test_common.cc',
'test/tiled_layer_test_common.h',
],
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/debug/test_web_graphics_context_3d.cc
index e68f938..b0f1847 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/debug/test_web_graphics_context_3d.cc
@@ -1,8 +1,8 @@
-// Copyright 2011 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "cc/test/test_web_graphics_context_3d.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include <algorithm>
#include <string>
@@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "gpu/GLES2/gl2extchromium.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2ext.h"
using WebKit::WGC3Dboolean;
@@ -274,7 +273,7 @@ WebGLId TestWebGraphicsContext3D::createFramebuffer() {
}
void TestWebGraphicsContext3D::deleteFramebuffer(WebGLId id) {
- EXPECT_EQ(kFramebufferId | context_id_ << 16, id);
+ DCHECK_EQ(kFramebufferId | context_id_ << 16, id);
}
WebGLId TestWebGraphicsContext3D::createProgram() {
@@ -282,7 +281,7 @@ WebGLId TestWebGraphicsContext3D::createProgram() {
}
void TestWebGraphicsContext3D::deleteProgram(WebGLId id) {
- EXPECT_EQ(kProgramId | context_id_ << 16, id);
+ DCHECK_EQ(kProgramId | context_id_ << 16, id);
}
WebGLId TestWebGraphicsContext3D::createRenderbuffer() {
@@ -290,7 +289,7 @@ WebGLId TestWebGraphicsContext3D::createRenderbuffer() {
}
void TestWebGraphicsContext3D::deleteRenderbuffer(WebGLId id) {
- EXPECT_EQ(kRenderbufferId | context_id_ << 16, id);
+ DCHECK_EQ(kRenderbufferId | context_id_ << 16, id);
}
WebGLId TestWebGraphicsContext3D::createShader(WGC3Denum) {
@@ -298,7 +297,7 @@ WebGLId TestWebGraphicsContext3D::createShader(WGC3Denum) {
}
void TestWebGraphicsContext3D::deleteShader(WebGLId id) {
- EXPECT_EQ(kShaderId | context_id_ << 16, id);
+ DCHECK_EQ(kShaderId | context_id_ << 16, id);
}
WebGLId TestWebGraphicsContext3D::createTexture() {
@@ -318,28 +317,28 @@ void TestWebGraphicsContext3D::deleteTexture(WebGLId texture_id) {
}
void TestWebGraphicsContext3D::attachShader(WebGLId program, WebGLId shader) {
- EXPECT_EQ(kProgramId | context_id_ << 16, program);
- EXPECT_EQ(kShaderId | context_id_ << 16, shader);
+ DCHECK_EQ(kProgramId | context_id_ << 16, program);
+ DCHECK_EQ(kShaderId | context_id_ << 16, shader);
}
void TestWebGraphicsContext3D::useProgram(WebGLId program) {
if (!program)
return;
- EXPECT_EQ(kProgramId | context_id_ << 16, program);
+ DCHECK_EQ(kProgramId | context_id_ << 16, program);
}
void TestWebGraphicsContext3D::bindFramebuffer(
WGC3Denum target, WebGLId framebuffer) {
if (!framebuffer)
return;
- EXPECT_EQ(kFramebufferId | context_id_ << 16, framebuffer);
+ DCHECK_EQ(kFramebufferId | context_id_ << 16, framebuffer);
}
void TestWebGraphicsContext3D::bindRenderbuffer(
WGC3Denum target, WebGLId renderbuffer) {
if (!renderbuffer)
return;
- EXPECT_EQ(kRenderbufferId | context_id_ << 16, renderbuffer);
+ DCHECK_EQ(kRenderbufferId | context_id_ << 16, renderbuffer);
}
void TestWebGraphicsContext3D::bindTexture(
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/debug/test_web_graphics_context_3d.h
index fb278ef..1415ea4 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/debug/test_web_graphics_context_3d.h
@@ -1,9 +1,9 @@
-// Copyright 2011 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
-#define CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
+#ifndef CC_DEBUG_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
+#define CC_DEBUG_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
#include <vector>
@@ -15,18 +15,16 @@
#include "base/memory/weak_ptr.h"
#include "base/stl_util.h"
#include "base/synchronization/lock.h"
+#include "cc/base/cc_export.h"
#include "cc/base/scoped_ptr_hash_map.h"
#include "cc/debug/fake_web_graphics_context_3d.h"
#include "third_party/khronos/GLES2/gl2.h"
-namespace WebKit {
-class WebGraphicsContext3D;
-struct WebGraphicsMemoryAllocation;
-}
+namespace WebKit { struct WebGraphicsMemoryAllocation; }
namespace cc {
-class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
+class CC_EXPORT TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
public:
static scoped_ptr<TestWebGraphicsContext3D> Create();
static base::Callback<
@@ -294,4 +292,4 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
} // namespace cc
-#endif // CC_TEST_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
+#endif // CC_DEBUG_TEST_WEB_GRAPHICS_CONTEXT_3D_H_
diff --git a/cc/layers/delegated_renderer_layer_impl_unittest.cc b/cc/layers/delegated_renderer_layer_impl_unittest.cc
index 1584782..2537c53 100644
--- a/cc/layers/delegated_renderer_layer_impl_unittest.cc
+++ b/cc/layers/delegated_renderer_layer_impl_unittest.cc
@@ -5,6 +5,7 @@
#include "cc/layers/delegated_renderer_layer_impl.h"
#include "cc/base/scoped_ptr_vector.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/layers/append_quads_data.h"
#include "cc/layers/quad_sink.h"
#include "cc/layers/solid_color_layer_impl.h"
@@ -20,7 +21,6 @@
#include "cc/test/mock_quad_culler.h"
#include "cc/test/render_pass_test_common.h"
#include "cc/test/render_pass_test_utils.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 0c160c4..962efa0 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -5,6 +5,7 @@
#include "cc/layers/scrollbar_layer.h"
#include "cc/animation/scrollbar_animation_controller.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/layers/append_quads_data.h"
#include "cc/layers/scrollbar_layer_impl.h"
#include "cc/quads/solid_color_draw_quad.h"
@@ -19,7 +20,6 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/mock_quad_culler.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/tree_synchronizer.h"
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index 1635591..744bf00 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/callback.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/layers/texture_layer_client.h"
#include "cc/layers/texture_layer_impl.h"
#include "cc/test/fake_impl_proxy.h"
@@ -15,7 +16,6 @@
#include "cc/test/fake_output_surface.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/layer_tree_test.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index e4213d6..9e930cc 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -7,6 +7,7 @@
#include <set>
#include "cc/base/math_util.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/output/compositor_frame_metadata.h"
#include "cc/resources/prioritized_resource_manager.h"
#include "cc/resources/resource_provider.h"
@@ -18,7 +19,6 @@
#include "cc/test/pixel_test.h"
#include "cc/test/render_pass_test_common.h"
#include "cc/test/render_pass_test_utils.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
index 276828c..8dc7ca8 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -5,13 +5,13 @@
#include "cc/output/output_surface.h"
#include "base/test/test_simple_task_runner.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/output/managed_memory_policy.h"
#include "cc/output/output_surface_client.h"
#include "cc/output/software_output_device.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/scheduler_test_common.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/platform/WebGraphicsMemoryAllocation.h"
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
index a23af0b..ad6b3d3 100644
--- a/cc/resources/resource_provider_unittest.cc
+++ b/cc/resources/resource_provider_unittest.cc
@@ -11,10 +11,10 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "cc/base/scoped_ptr_deque.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/output/output_surface.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/resources/resource_update_controller_unittest.cc b/cc/resources/resource_update_controller_unittest.cc
index 1060801..9dcb23c 100644
--- a/cc/resources/resource_update_controller_unittest.cc
+++ b/cc/resources/resource_update_controller_unittest.cc
@@ -5,11 +5,11 @@
#include "cc/resources/resource_update_controller.h"
#include "base/test/test_simple_task_runner.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/resources/prioritized_resource_manager.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/scheduler_test_common.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/test/tiled_layer_test_common.h"
#include "cc/trees/single_thread_proxy.h" // For DebugScopedSetImplThread
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index ff574ff..ca6ebd0 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -5,9 +5,9 @@
#include "cc/resources/video_resource_updater.h"
#include "base/memory/shared_memory.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/resources/resource_provider.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "media/base/video_frame.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/scheduler/texture_uploader_unittest.cc b/cc/scheduler/texture_uploader_unittest.cc
index f4b4ce6..0595917 100644
--- a/cc/scheduler/texture_uploader_unittest.cc
+++ b/cc/scheduler/texture_uploader_unittest.cc
@@ -5,8 +5,8 @@
#include "cc/scheduler/texture_uploader.h"
#include "cc/base/util.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/resources/prioritized_resource.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2.h"
diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc
index d0a1954..5e2caab 100644
--- a/cc/test/fake_layer_tree_host_client.cc
+++ b/cc/test/fake_layer_tree_host_client.cc
@@ -4,9 +4,9 @@
#include "cc/test/fake_layer_tree_host_client.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/output/context_provider.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/test_web_graphics_context_3d.h"
namespace cc {
diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h
index 5091dff..12fdcfc 100644
--- a/cc/test/fake_output_surface.h
+++ b/cc/test/fake_output_surface.h
@@ -7,11 +7,11 @@
#include "base/callback.h"
#include "base/time/time.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/output_surface.h"
#include "cc/output/software_output_device.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
namespace cc {
diff --git a/cc/test/fake_web_graphics_context_3d_unittest.cc b/cc/test/fake_web_graphics_context_3d_unittest.cc
index 3d119ee..ef0f143f 100644
--- a/cc/test/fake_web_graphics_context_3d_unittest.cc
+++ b/cc/test/fake_web_graphics_context_3d_unittest.cc
@@ -4,7 +4,7 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "cc/test/test_web_graphics_context_3d.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index ab81c67..764a9cf 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/containers/hash_tables.h"
#include "cc/base/math_util.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/input/top_controls_manager.h"
#include "cc/layers/delegated_renderer_layer_impl.h"
#include "cc/layers/heads_up_display_layer_impl.h"
@@ -39,7 +40,6 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/render_pass_test_common.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
#include "media/base/media.h"
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 4384369..a0d7f3d 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -6,6 +6,7 @@
#include "base/basictypes.h"
#include "cc/debug/fake_context_provider.h"
+#include "cc/debug/test_web_graphics_context_3d.h"
#include "cc/layers/content_layer.h"
#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/io_surface_layer.h"
@@ -30,7 +31,6 @@
#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/render_pass_test_common.h"
-#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"