summaryrefslogtreecommitdiffstats
path: root/cc/test/test_web_graphics_context_3d.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/test/test_web_graphics_context_3d.cc')
-rw-r--r--cc/test/test_web_graphics_context_3d.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index f5ebb6b..1e17f91 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -47,6 +47,7 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D()
times_make_current_succeeds_(-1),
times_bind_texture_succeeds_(-1),
times_end_query_succeeds_(-1),
+ times_gen_mailbox_succeeds_(-1),
context_lost_(false),
times_map_image_chromium_succeeds_(-1),
times_map_buffer_chromium_succeeds_(-1),
@@ -74,6 +75,7 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D(
times_make_current_succeeds_(-1),
times_bind_texture_succeeds_(-1),
times_end_query_succeeds_(-1),
+ times_gen_mailbox_succeeds_(-1),
context_lost_(false),
times_map_image_chromium_succeeds_(-1),
times_map_buffer_chromium_succeeds_(-1),
@@ -329,6 +331,18 @@ void TestWebGraphicsContext3D::getIntegerv(
}
void TestWebGraphicsContext3D::genMailboxCHROMIUM(WebKit::WGC3Dbyte* mailbox) {
+ if (times_gen_mailbox_succeeds_ >= 0) {
+ if (!times_gen_mailbox_succeeds_) {
+ loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
+ GL_INNOCENT_CONTEXT_RESET_ARB);
+ }
+ --times_gen_mailbox_succeeds_;
+ }
+ if (context_lost_) {
+ memset(mailbox, 0, 64);
+ return;
+ }
+
static char mailbox_name1 = '1';
static char mailbox_name2 = '1';
mailbox[0] = mailbox_name1;