| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/video_detector.h" | 5 #include "ash/wm/video_detector.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 while (now_ < start_time + 2 * kMinDuration) { | 245 while (now_ < start_time + 2 * kMinDuration) { |
| 246 detector_->OnDelegatedFrameDamage(window1.get(), kMinRect); | 246 detector_->OnDelegatedFrameDamage(window1.get(), kMinRect); |
| 247 detector_->OnDelegatedFrameDamage(window2.get(), kMinRect); | 247 detector_->OnDelegatedFrameDamage(window2.get(), kMinRect); |
| 248 AdvanceTime(time_between_updates); | 248 AdvanceTime(time_between_updates); |
| 249 } | 249 } |
| 250 EXPECT_EQ(VideoDetector::State::PLAYING_WINDOWED, observer_->PopState()); | 250 EXPECT_EQ(VideoDetector::State::PLAYING_WINDOWED, observer_->PopState()); |
| 251 EXPECT_TRUE(observer_->empty()); | 251 EXPECT_TRUE(observer_->empty()); |
| 252 } | 252 } |
| 253 | 253 |
| 254 TEST_F(VideoDetectorTest, ReportFullscreen) { | 254 TEST_F(VideoDetectorTest, ReportFullscreen) { |
| 255 if (!SupportsMultipleDisplays()) | |
| 256 return; | |
| 257 | |
| 258 UpdateDisplay("1024x768,1024x768"); | 255 UpdateDisplay("1024x768,1024x768"); |
| 259 | 256 |
| 260 std::unique_ptr<aura::Window> window = | 257 std::unique_ptr<aura::Window> window = |
| 261 CreateTestWindow(gfx::Rect(0, 0, 1024, 768)); | 258 CreateTestWindow(gfx::Rect(0, 0, 1024, 768)); |
| 262 wm::WindowState* window_state = wm::GetWindowState(window.get()); | 259 wm::WindowState* window_state = wm::GetWindowState(window.get()); |
| 263 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); | 260 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
| 264 window_state->OnWMEvent(&toggle_fullscreen_event); | 261 window_state->OnWMEvent(&toggle_fullscreen_event); |
| 265 ASSERT_TRUE(window_state->IsFullscreen()); | 262 ASSERT_TRUE(window_state->IsFullscreen()); |
| 266 window->Focus(); | 263 window->Focus(); |
| 267 SendUpdates(window.get(), kMinRect, 2 * kMinFps, 2 * kMinDuration); | 264 SendUpdates(window.get(), kMinRect, 2 * kMinFps, 2 * kMinDuration); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 292 // immediately notified about windowed video. | 289 // immediately notified about windowed video. |
| 293 observer_->reset(); | 290 observer_->reset(); |
| 294 other_window_state->OnWMEvent(&toggle_fullscreen_event); | 291 other_window_state->OnWMEvent(&toggle_fullscreen_event); |
| 295 ASSERT_FALSE(other_window_state->IsFullscreen()); | 292 ASSERT_FALSE(other_window_state->IsFullscreen()); |
| 296 EXPECT_EQ(VideoDetector::State::PLAYING_WINDOWED, observer_->PopState()); | 293 EXPECT_EQ(VideoDetector::State::PLAYING_WINDOWED, observer_->PopState()); |
| 297 EXPECT_TRUE(observer_->empty()); | 294 EXPECT_TRUE(observer_->empty()); |
| 298 } | 295 } |
| 299 | 296 |
| 300 } // namespace test | 297 } // namespace test |
| 301 } // namespace ash | 298 } // namespace ash |
| OLD | NEW |