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

Unified Diff: cc/resources/tile_task_worker_pool_unittest.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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/tile.cc ('k') | cc/resources/tiling_set_raster_queue_all.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_task_worker_pool_unittest.cc
diff --git a/cc/resources/tile_task_worker_pool_unittest.cc b/cc/resources/tile_task_worker_pool_unittest.cc
index d7cb155ef956c0cd06fd780e57df27916d05f77a..72f9d2097a50ff324b06095d3ae9f15ea682dac9 100644
--- a/cc/resources/tile_task_worker_pool_unittest.cc
+++ b/cc/resources/tile_task_worker_pool_unittest.cc
@@ -28,6 +28,7 @@
#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_web_graphics_context_3d.h"
+#include "gpu/GLES2/gl2extchromium.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -275,6 +276,14 @@ class TileTaskWorkerPoolTest
return completed_tasks_;
}
+ void LoseContext(ContextProvider* context_provider) {
+ if (!context_provider)
+ return;
+ context_provider->ContextGL()->LoseContextCHROMIUM(
+ GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
+ context_provider->ContextGL()->Flush();
+ }
+
private:
void Create3dOutputSurfaceAndResourceProvider() {
output_surface_ = FakeOutputSurface::Create3d(
@@ -404,6 +413,21 @@ TEST_P(TileTaskWorkerPoolTest, LargeResources) {
RunMessageLoopUntilAllTasksHaveCompleted();
}
+TEST_P(TileTaskWorkerPoolTest, LostContext) {
+ LoseContext(output_surface_->context_provider());
+ LoseContext(output_surface_->worker_context_provider());
+
+ AppendTask(0u);
+ AppendTask(1u);
+ ScheduleTasks();
+
+ RunMessageLoopUntilAllTasksHaveCompleted();
+
+ ASSERT_EQ(2u, completed_tasks().size());
+ EXPECT_FALSE(completed_tasks()[0].canceled);
+ EXPECT_FALSE(completed_tasks()[1].canceled);
+}
+
INSTANTIATE_TEST_CASE_P(
TileTaskWorkerPoolTests,
TileTaskWorkerPoolTest,
« no previous file with comments | « cc/resources/tile.cc ('k') | cc/resources/tiling_set_raster_queue_all.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698