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

Unified Diff: cc/resources/scoped_resource_unittest.cc

Issue 20185002: ContextProvider in OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contextprovider: don't access Context3d() in OutputSurface contructors, it's not bound yet Created 7 years, 4 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
« no previous file with comments | « cc/resources/resource_update_controller_unittest.cc ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/scoped_resource_unittest.cc
diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc
index b08c1e21daf5c3f6fd2149047440ebbbec6adfca..9c66180df4e736db00a7ada427007353026ee811 100644
--- a/cc/resources/scoped_resource_unittest.cc
+++ b/cc/resources/scoped_resource_unittest.cc
@@ -6,6 +6,7 @@
#include "cc/output/renderer.h"
#include "cc/test/fake_output_surface.h"
+#include "cc/test/fake_output_surface_client.h"
#include "cc/test/tiled_layer_test_common.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2.h"
@@ -14,9 +15,12 @@ namespace cc {
namespace {
TEST(ScopedResourceTest, NewScopedResource) {
- scoped_ptr<OutputSurface> context(CreateFakeOutputSurface());
+ FakeOutputSurfaceClient output_surface_client;
+ scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d());
+ CHECK(output_surface->BindToClient(&output_surface_client));
+
scoped_ptr<ResourceProvider> resource_provider(
- ResourceProvider::Create(context.get(), 0));
+ ResourceProvider::Create(output_surface.get(), 0));
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
@@ -29,9 +33,12 @@ TEST(ScopedResourceTest, NewScopedResource) {
}
TEST(ScopedResourceTest, CreateScopedResource) {
- scoped_ptr<OutputSurface> context(CreateFakeOutputSurface());
+ FakeOutputSurfaceClient output_surface_client;
+ scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d());
+ CHECK(output_surface->BindToClient(&output_surface_client));
+
scoped_ptr<ResourceProvider> resource_provider(
- ResourceProvider::Create(context.get(), 0));
+ ResourceProvider::Create(output_surface.get(), 0));
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
texture->Allocate(
@@ -47,9 +54,12 @@ TEST(ScopedResourceTest, CreateScopedResource) {
}
TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
- scoped_ptr<OutputSurface> context(CreateFakeOutputSurface());
+ FakeOutputSurfaceClient output_surface_client;
+ scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d());
+ CHECK(output_surface->BindToClient(&output_surface_client));
+
scoped_ptr<ResourceProvider> resource_provider(
- ResourceProvider::Create(context.get(), 0));
+ ResourceProvider::Create(output_surface.get(), 0));
{
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
@@ -76,9 +86,12 @@ TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
}
TEST(ScopedResourceTest, LeakScopedResource) {
- scoped_ptr<OutputSurface> context(CreateFakeOutputSurface());
+ FakeOutputSurfaceClient output_surface_client;
+ scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d());
+ CHECK(output_surface->BindToClient(&output_surface_client));
+
scoped_ptr<ResourceProvider> resource_provider(
- ResourceProvider::Create(context.get(), 0));
+ ResourceProvider::Create(output_surface.get(), 0));
{
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
« no previous file with comments | « cc/resources/resource_update_controller_unittest.cc ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698