| Index: ui/snapshot/snapshot_aura_unittest.cc
|
| diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc
|
| index 7be0d703fa1c2006a3b69d30f9b137db124db89f..e9fc843c1f016b62c5e944cf9033ee5393fe6320 100644
|
| --- a/ui/snapshot/snapshot_aura_unittest.cc
|
| +++ b/ui/snapshot/snapshot_aura_unittest.cc
|
| @@ -140,19 +140,17 @@ class SnapshotAuraTest : public testing::Test {
|
| aura::Window::ConvertRectToTarget(
|
| test_window(), root_window(), &source_rect);
|
|
|
| - scoped_refptr<base::TestSimpleTaskRunner> task_runner(
|
| - new base::TestSimpleTaskRunner());
|
| scoped_refptr<SnapshotHolder> holder(new SnapshotHolder);
|
| ui::GrabWindowSnapshotAsync(
|
| root_window(),
|
| source_rect,
|
| - task_runner,
|
| base::Bind(&SnapshotHolder::SnapshotCallback, holder));
|
|
|
| // Wait for copy response.
|
| + // TODO(eseckler): This doesn't actually wait until the copy response is
|
| + // issued, because cc::Display::DrawAndSwap() executes surface draw
|
| + // callbacks before drawing the frame on the renderer.
|
| WaitForDraw();
|
| - // Run internal snapshot callback to scale/rotate response image.
|
| - task_runner->RunUntilIdle();
|
| // Run SnapshotHolder callback.
|
| helper_->RunAllPendingInMessageLoop();
|
|
|
| @@ -169,10 +167,9 @@ class SnapshotAuraTest : public testing::Test {
|
| public:
|
| SnapshotHolder() : completed_(false) {}
|
|
|
| - void SnapshotCallback(scoped_refptr<base::RefCountedBytes> png_data) {
|
| + void SnapshotCallback(const gfx::Image& image) {
|
| DCHECK(!completed_);
|
| - image_ = gfx::Image::CreateFrom1xPNGBytes(&(png_data->data()[0]),
|
| - png_data->size());
|
| + image_ = image;
|
| completed_ = true;
|
| }
|
| bool completed() const {
|
|
|