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 "ui/snapshot/snapshot.h" | 5 #include "ui/snapshot/snapshot.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 private: | 180 private: |
181 friend class base::RefCountedThreadSafe<SnapshotHolder>; | 181 friend class base::RefCountedThreadSafe<SnapshotHolder>; |
182 | 182 |
183 virtual ~SnapshotHolder() {} | 183 virtual ~SnapshotHolder() {} |
184 | 184 |
185 gfx::Image image_; | 185 gfx::Image image_; |
186 bool completed_; | 186 bool completed_; |
187 }; | 187 }; |
188 | 188 |
189 scoped_ptr<aura::test::AuraTestHelper> helper_; | 189 std::unique_ptr<aura::test::AuraTestHelper> helper_; |
190 scoped_ptr<aura::Window> test_window_; | 190 std::unique_ptr<aura::Window> test_window_; |
191 scoped_ptr<TestPaintingWindowDelegate> delegate_; | 191 std::unique_ptr<TestPaintingWindowDelegate> delegate_; |
192 std::vector<unsigned char> png_representation_; | 192 std::vector<unsigned char> png_representation_; |
193 | 193 |
194 DISALLOW_COPY_AND_ASSIGN(SnapshotAuraTest); | 194 DISALLOW_COPY_AND_ASSIGN(SnapshotAuraTest); |
195 }; | 195 }; |
196 | 196 |
197 TEST_F(SnapshotAuraTest, FullScreenWindow) { | 197 TEST_F(SnapshotAuraTest, FullScreenWindow) { |
198 SetupTestWindow(root_window()->bounds()); | 198 SetupTestWindow(root_window()->bounds()); |
199 WaitForDraw(); | 199 WaitForDraw(); |
200 | 200 |
201 gfx::Image snapshot = GrabSnapshotForTestWindow(); | 201 gfx::Image snapshot = GrabSnapshotForTestWindow(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 gfx::SizeF snapshot_size(test_bounds.size()); | 292 gfx::SizeF snapshot_size(test_bounds.size()); |
293 snapshot_size.Scale(2.0f); | 293 snapshot_size.Scale(2.0f); |
294 | 294 |
295 gfx::Image snapshot = GrabSnapshotForTestWindow(); | 295 gfx::Image snapshot = GrabSnapshotForTestWindow(); |
296 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), | 296 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), |
297 snapshot.Size().ToString()); | 297 snapshot.Size().ToString()); |
298 EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 2)); | 298 EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 2)); |
299 } | 299 } |
300 | 300 |
301 } // namespace ui | 301 } // namespace ui |
OLD | NEW |