content/gpu: Create a framework for testing GpuChannel and friends.
commit4219d29844433113130c95e020953285b813fa28
authorsunnyps <sunnyps@chromium.org>
Fri, 21 Aug 2015 06:20:07 +0000 (20 23:20 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 21 Aug 2015 06:20:50 +0000 (21 06:20 +0000)
treead9f5c44ab0a521eb4e9cd96d19289807acf9446
parent1c74d0dd6a2c6377e2cb2905527e81ef370d876f
content/gpu: Create a framework for testing GpuChannel and friends.

GpuChannelManager, GpuChannel, etc. have a lot of untested code around
handling IPC messages. This CL attempts to fix that by making it easy
to add such tests. This was possible by some refactoring:

1. Made test classes for GpuChannelManager and GpuChannel that override
   the Send method and other related IPC methods.
2. Removed dependencies on base::ThreadTaskRunnerHandle and
   base::MessageLoop::current.
3. Had to work around code which would cause IPC messages to be sent in
   a destructor.

BUG=514809

Review URL: https://codereview.chromium.org/1283973002

Cr-Commit-Position: refs/heads/master@{#344705}
14 files changed:
content/common/gpu/gpu_channel.cc
content/common/gpu/gpu_channel.h
content/common/gpu/gpu_channel_manager.cc
content/common/gpu/gpu_channel_manager.h
content/common/gpu/gpu_channel_manager_unittest.cc
content/common/gpu/gpu_channel_test_common.cc [new file with mode: 0644]
content/common/gpu/gpu_channel_test_common.h [new file with mode: 0644]
content/common/gpu/gpu_channel_unittest.cc [new file with mode: 0644]
content/common/gpu/gpu_command_buffer_stub.cc
content/common/gpu/gpu_command_buffer_stub.h
content/common/gpu/stream_texture_android.cc
content/content_tests.gypi
content/gpu/gpu_child_thread.cc
content/gpu/gpu_child_thread.h