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

Unified Diff: ash/wm/video_detector_unittest.cc

Issue 303163003: ash: Fix VideoDetectorTest's WindowState usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test instead Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/window_state.cc » ('j') | ash/wm/window_state.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/video_detector_unittest.cc
diff --git a/ash/wm/video_detector_unittest.cc b/ash/wm/video_detector_unittest.cc
index 7bd1ab98014ae7c58c981725c941d156a31e179c..025de6370f485ace010b0954b3704492ffff85b9 100644
--- a/ash/wm/video_detector_unittest.cc
+++ b/ash/wm/video_detector_unittest.cc
@@ -284,10 +284,10 @@ TEST_F(VideoDetectorTest, FullscreenWindow) {
const gfx::Rect kLeftBounds(gfx::Point(), gfx::Size(1024, 768));
scoped_ptr<aura::Window> window(
CreateTestWindowInShell(SK_ColorRED, 12345, kLeftBounds));
- wm::WindowState window_state(window.get());
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
- window_state.OnWMEvent(&toggle_fullscreen_event);
- ASSERT_TRUE(window_state.IsFullscreen());
+ window_state->OnWMEvent(&toggle_fullscreen_event);
+ ASSERT_TRUE(window_state->IsFullscreen());
window->Focus();
const gfx::Rect kUpdateRegion(
gfx::Point(),
@@ -301,14 +301,14 @@ TEST_F(VideoDetectorTest, FullscreenWindow) {
// Make the first window non-fullscreen and open a second fullscreen window on
// a different desktop.
- window_state.OnWMEvent(&toggle_fullscreen_event);
- ASSERT_FALSE(window_state.IsFullscreen());
+ window_state->OnWMEvent(&toggle_fullscreen_event);
+ ASSERT_FALSE(window_state->IsFullscreen());
const gfx::Rect kRightBounds(gfx::Point(1024, 0), gfx::Size(1024, 768));
scoped_ptr<aura::Window> other_window(
CreateTestWindowInShell(SK_ColorBLUE, 6789, kRightBounds));
- wm::WindowState other_window_state(other_window.get());
- other_window_state.OnWMEvent(&toggle_fullscreen_event);
- ASSERT_TRUE(other_window_state.IsFullscreen());
+ wm::WindowState* other_window_state = wm::GetWindowState(other_window.get());
+ other_window_state->OnWMEvent(&toggle_fullscreen_event);
+ ASSERT_TRUE(other_window_state->IsFullscreen());
// When video is detected in the first (now non-fullscreen) window, fullscreen
// video should still be reported due to the second window being fullscreen.
@@ -324,8 +324,8 @@ TEST_F(VideoDetectorTest, FullscreenWindow) {
// Make the second window non-fullscreen and check that the next video report
// is non-fullscreen.
- other_window_state.OnWMEvent(&toggle_fullscreen_event);
- ASSERT_FALSE(other_window_state.IsFullscreen());
+ other_window_state->OnWMEvent(&toggle_fullscreen_event);
+ ASSERT_FALSE(other_window_state->IsFullscreen());
observer_->reset_stats();
AdvanceTime(base::TimeDelta::FromSeconds(2));
for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i)
« no previous file with comments | « no previous file | ash/wm/window_state.cc » ('j') | ash/wm/window_state.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698