Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: ui/snapshot/snapshot_aura_unittest.cc

Issue 2815073002: Revert of Remove CompositorObserver::OnCompositingEnded() (Closed)
Patch Set: Fix CompositorObservers test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/compositor/test/draw_waiter_for_test.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 testing::Test::TearDown(); 119 testing::Test::TearDown();
120 } 120 }
121 121
122 protected: 122 protected:
123 aura::Window* test_window() { return test_window_.get(); } 123 aura::Window* test_window() { return test_window_.get(); }
124 aura::Window* root_window() { return helper_->root_window(); } 124 aura::Window* root_window() { return helper_->root_window(); }
125 aura::TestScreen* test_screen() { return helper_->test_screen(); } 125 aura::TestScreen* test_screen() { return helper_->test_screen(); }
126 126
127 void WaitForDraw() { 127 void WaitForDraw() {
128 helper_->host()->compositor()->ScheduleDraw(); 128 helper_->host()->compositor()->ScheduleDraw();
129 ui::DrawWaiterForTest::WaitForCompositingStarted( 129 ui::DrawWaiterForTest::WaitForCompositingEnded(
130 helper_->host()->compositor()); 130 helper_->host()->compositor());
131 } 131 }
132 132
133 void SetupTestWindow(const gfx::Rect& window_bounds) { 133 void SetupTestWindow(const gfx::Rect& window_bounds) {
134 delegate_.reset(new TestPaintingWindowDelegate(window_bounds.size())); 134 delegate_.reset(new TestPaintingWindowDelegate(window_bounds.size()));
135 test_window_.reset(aura::test::CreateTestWindowWithDelegate( 135 test_window_.reset(aura::test::CreateTestWindowWithDelegate(
136 delegate_.get(), 0, window_bounds, root_window())); 136 delegate_.get(), 0, window_bounds, root_window()));
137 } 137 }
138 138
139 gfx::Image GrabSnapshotForTestWindow() { 139 gfx::Image GrabSnapshotForTestWindow() {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 gfx::SizeF snapshot_size(test_bounds.size()); 286 gfx::SizeF snapshot_size(test_bounds.size());
287 snapshot_size.Scale(2.0f / kUIScale); 287 snapshot_size.Scale(2.0f / kUIScale);
288 288
289 gfx::Image snapshot = GrabSnapshotForTestWindow(); 289 gfx::Image snapshot = GrabSnapshotForTestWindow();
290 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), 290 EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(),
291 snapshot.Size().ToString()); 291 snapshot.Size().ToString());
292 EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 2 / kUIScale)); 292 EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 2 / kUIScale));
293 } 293 }
294 294
295 } // namespace ui 295 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/draw_waiter_for_test.cc ('k') | ui/views/controls/scroll_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698