OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" | 5 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" |
6 | 6 |
7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
8 | 8 |
9 class RenderWidgetSnapshotTakerTest : public ChromeRenderViewHostTestHarness { | 9 class RenderWidgetSnapshotTakerTest : public ChromeRenderViewHostTestHarness { |
10 public: | 10 public: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 RenderWidgetSnapshotTaker snapshot_taker; | 68 RenderWidgetSnapshotTaker snapshot_taker; |
69 const gfx::Size size(100, 100); | 69 const gfx::Size size(100, 100); |
70 snapshot_taker.AskForSnapshot( | 70 snapshot_taker.AskForSnapshot( |
71 rvh(), | 71 rvh(), |
72 base::Bind(&RenderWidgetSnapshotTakerTest::SnapshotReady, | 72 base::Bind(&RenderWidgetSnapshotTakerTest::SnapshotReady, |
73 base::Unretained(this)), | 73 base::Unretained(this)), |
74 size, | 74 size, |
75 size); | 75 size); |
76 EXPECT_EQ(1U, snapshot_taker.callback_map_.size()); | 76 EXPECT_EQ(1U, snapshot_taker.callback_map_.size()); |
77 const int sequence_num = 1; | 77 const int sequence_num = 1; |
78 const gfx::Size size2(200, 200); | 78 // Ensure this is bigger than the max scale factor X the size. |
| 79 const gfx::Size size2(300, 300); |
79 snapshot_taker.WidgetDidReceivePaintAtSizeAck( | 80 snapshot_taker.WidgetDidReceivePaintAtSizeAck( |
80 content::RenderViewHostTestHarness::rvh(), | 81 content::RenderViewHostTestHarness::rvh(), |
81 sequence_num, | 82 sequence_num, |
82 size2); | 83 size2); |
83 EXPECT_FALSE(snapshot_taker.callback_map_.empty()); | 84 EXPECT_FALSE(snapshot_taker.callback_map_.empty()); |
84 EXPECT_FALSE(snapshot_ready_called()); | 85 EXPECT_FALSE(snapshot_ready_called()); |
85 } | 86 } |
OLD | NEW |