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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 class SnapshotAuraTest : public testing::Test { | 62 class SnapshotAuraTest : public testing::Test { |
63 public: | 63 public: |
64 SnapshotAuraTest() {} | 64 SnapshotAuraTest() {} |
65 virtual ~SnapshotAuraTest() {} | 65 virtual ~SnapshotAuraTest() {} |
66 | 66 |
67 virtual void SetUp() OVERRIDE { | 67 virtual void SetUp() OVERRIDE { |
68 testing::Test::SetUp(); | 68 testing::Test::SetUp(); |
69 helper_.reset(new aura::test::AuraTestHelper(MessageLoopForUI::current())); | 69 helper_.reset( |
| 70 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
70 helper_->SetUp(); | 71 helper_->SetUp(); |
71 } | 72 } |
72 | 73 |
73 virtual void TearDown() OVERRIDE { | 74 virtual void TearDown() OVERRIDE { |
74 test_window_.reset(); | 75 test_window_.reset(); |
75 delegate_.reset(); | 76 delegate_.reset(); |
76 helper_->RunAllPendingInMessageLoop(); | 77 helper_->RunAllPendingInMessageLoop(); |
77 helper_->TearDown(); | 78 helper_->TearDown(); |
78 testing::Test::TearDown(); | 79 testing::Test::TearDown(); |
79 } | 80 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 gfx::SizeF snapshot_size(test_bounds.size()); | 214 gfx::SizeF snapshot_size(test_bounds.size()); |
214 snapshot_size.Scale(2.0f / kUIScale); | 215 snapshot_size.Scale(2.0f / kUIScale); |
215 | 216 |
216 gfx::Image snapshot = GrabSnapshotForTestWindow(); | 217 gfx::Image snapshot = GrabSnapshotForTestWindow(); |
217 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), | 218 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), |
218 snapshot.Size().ToString()); | 219 snapshot.Size().ToString()); |
219 EXPECT_EQ(0u, GetFailedPixelsCount(snapshot)); | 220 EXPECT_EQ(0u, GetFailedPixelsCount(snapshot)); |
220 } | 221 } |
221 | 222 |
222 } // namespace ui | 223 } // namespace ui |
OLD | NEW |