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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ash/wm/wm_event.h" | 10 #include "ash/wm/wm_event.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
15 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
16 #include "ui/aura/test/test_windows.h" | 16 #include "ui/aura/test/test_windows.h" |
17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
18 #include "ui/aura/window_event_dispatcher.h" | 18 #include "ui/aura/window_event_dispatcher.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
20 #include "ui/wm/public/window_types.h" | 20 #include "ui/wm/public/window_types.h" |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
23 namespace test { | 23 namespace test { |
24 | 24 |
25 // Implementation that just counts the number of times we've been told that a | 25 // Implementation that just counts the number of times we've been told that a |
26 // video is playing. | 26 // video is playing. |
27 class TestVideoDetectorObserver : public VideoDetectorObserver { | 27 class TestVideoDetectorObserver : public VideoDetectorObserver { |
28 public: | 28 public: |
29 TestVideoDetectorObserver() : num_invocations_(0), | 29 TestVideoDetectorObserver() : num_invocations_(0), |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 AdvanceTime(base::TimeDelta::FromSeconds(2)); | 330 AdvanceTime(base::TimeDelta::FromSeconds(2)); |
331 for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i) | 331 for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i) |
332 detector_->OnDelegatedFrameDamage(window.get(), kUpdateRegion); | 332 detector_->OnDelegatedFrameDamage(window.get(), kUpdateRegion); |
333 EXPECT_EQ(1, observer_->num_invocations()); | 333 EXPECT_EQ(1, observer_->num_invocations()); |
334 EXPECT_EQ(0, observer_->num_fullscreens()); | 334 EXPECT_EQ(0, observer_->num_fullscreens()); |
335 EXPECT_EQ(1, observer_->num_not_fullscreens()); | 335 EXPECT_EQ(1, observer_->num_not_fullscreens()); |
336 } | 336 } |
337 | 337 |
338 } // namespace test | 338 } // namespace test |
339 } // namespace ash | 339 } // namespace ash |
OLD | NEW |