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 "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/test/aura_test_helper.h" | 9 #include "ui/aura/test/aura_test_helper.h" |
10 #include "ui/aura/test/test_screen.h" | 10 #include "ui/aura/test/test_screen.h" |
11 #include "ui/aura/test/test_window_delegate.h" | 11 #include "ui/aura/test/test_window_delegate.h" |
12 #include "ui/aura/test/test_windows.h" | 12 #include "ui/aura/test/test_windows.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/compositor/compositor_setup.h" | |
15 #include "ui/compositor/layer.h" | 14 #include "ui/compositor/layer.h" |
16 #include "ui/gfx/canvas.h" | 15 #include "ui/gfx/canvas.h" |
17 #include "ui/gfx/gfx_paths.h" | 16 #include "ui/gfx/gfx_paths.h" |
18 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
19 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
20 #include "ui/gfx/size_conversions.h" | 19 #include "ui/gfx/size_conversions.h" |
21 #include "ui/gfx/transform.h" | 20 #include "ui/gfx/transform.h" |
22 #include "ui/gl/gl_implementation.h" | 21 #include "ui/gl/gl_implementation.h" |
23 | 22 |
24 namespace ui { | 23 namespace ui { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 gfx::SizeF snapshot_size(test_bounds.size()); | 213 gfx::SizeF snapshot_size(test_bounds.size()); |
215 snapshot_size.Scale(2.0f / kUIScale); | 214 snapshot_size.Scale(2.0f / kUIScale); |
216 | 215 |
217 gfx::Image snapshot = GrabSnapshotForTestWindow(); | 216 gfx::Image snapshot = GrabSnapshotForTestWindow(); |
218 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), | 217 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), |
219 snapshot.Size().ToString()); | 218 snapshot.Size().ToString()); |
220 EXPECT_EQ(0u, GetFailedPixelsCount(snapshot)); | 219 EXPECT_EQ(0u, GetFailedPixelsCount(snapshot)); |
221 } | 220 } |
222 | 221 |
223 } // namespace ui | 222 } // namespace ui |
OLD | NEW |