summaryrefslogtreecommitdiffstats
path: root/cc/test/test_web_graphics_context_3d.h
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-17 23:35:33 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-17 23:35:33 +0000
commitb8ae812b1bf122164de5f0f51c9ce4069b7fdfb9 (patch)
tree1176001b30f7e5185624b33a5d2036736547f852 /cc/test/test_web_graphics_context_3d.h
parent8e6e44ed7090c674297cc0727af1781ebcb50929 (diff)
downloadchromium_src-b8ae812b1bf122164de5f0f51c9ce4069b7fdfb9.zip
chromium_src-b8ae812b1bf122164de5f0f51c9ce4069b7fdfb9.tar.gz
chromium_src-b8ae812b1bf122164de5f0f51c9ce4069b7fdfb9.tar.bz2
Skip raster if MapImage fails
MapImage should never fail with proper memory management. Android WebView currently lacks memory management and this patch avoids a crash in production (with DCHECK turned off) when MapImage fails. Also add a test for this case for both pixel buffer and image worker pools. BUG=247983 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/16093038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_web_graphics_context_3d.h')
-rw-r--r--cc/test/test_web_graphics_context_3d.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index bdec155..401fa4a4 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -154,6 +154,15 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
times_end_query_succeeds_ = times;
}
+ // When set, mapImageCHROMIUM and mapBufferCHROMIUM will return NULL after
+ // this many times.
+ void set_times_map_image_chromium_succeeds(int times) {
+ times_map_image_chromium_succeeds_ = times;
+ }
+ void set_times_map_buffer_chromium_succeeds(int times) {
+ times_map_buffer_chromium_succeeds_ = times;
+ }
+
size_t NumTextures() const { return textures_.size(); }
WebKit::WebGLId TextureAt(int i) const { return textures_[i]; }
@@ -207,6 +216,8 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
int times_bind_texture_succeeds_;
int times_end_query_succeeds_;
bool context_lost_;
+ int times_map_image_chromium_succeeds_;
+ int times_map_buffer_chromium_succeeds_;
WebGraphicsContextLostCallback* context_lost_callback_;
WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* swap_buffers_callback_;
std::vector<WebGraphicsSyncPointCallback*> sync_point_callbacks_;