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

Side by Side Diff: ash/wm/video_detector_unittest.cc

Issue 1540753002: Switch to standard integer types in ash/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arraysize Created 5 years 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 | « ash/wm/video_detector.h ('k') | ash/wm/window_animations.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) 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"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 gfx::Size(VideoDetector::kMinUpdateWidth, 259 gfx::Size(VideoDetector::kMinUpdateWidth,
260 VideoDetector::kMinUpdateHeight)); 260 VideoDetector::kMinUpdateHeight));
261 for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i) 261 for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i)
262 detector_->OnDelegatedFrameDamage(window.get(), update_region); 262 detector_->OnDelegatedFrameDamage(window.get(), update_region);
263 EXPECT_EQ(1, observer_->num_invocations()); 263 EXPECT_EQ(1, observer_->num_invocations());
264 EXPECT_EQ(0, observer_->num_fullscreens()); 264 EXPECT_EQ(0, observer_->num_fullscreens());
265 EXPECT_EQ(1, observer_->num_not_fullscreens()); 265 EXPECT_EQ(1, observer_->num_not_fullscreens());
266 // Let enough time pass that a second notification should be sent. 266 // Let enough time pass that a second notification should be sent.
267 observer_->reset_stats(); 267 observer_->reset_stats();
268 AdvanceTime(base::TimeDelta::FromSeconds( 268 AdvanceTime(base::TimeDelta::FromSeconds(
269 static_cast<int64>(VideoDetector::kNotifyIntervalSec + 1))); 269 static_cast<int64_t>(VideoDetector::kNotifyIntervalSec + 1)));
270 for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i) 270 for (int i = 0; i < VideoDetector::kMinFramesPerSecond; ++i)
271 detector_->OnDelegatedFrameDamage(window.get(), update_region); 271 detector_->OnDelegatedFrameDamage(window.get(), update_region);
272 EXPECT_EQ(1, observer_->num_invocations()); 272 EXPECT_EQ(1, observer_->num_invocations());
273 EXPECT_EQ(0, observer_->num_fullscreens()); 273 EXPECT_EQ(0, observer_->num_fullscreens());
274 EXPECT_EQ(1, observer_->num_not_fullscreens()); 274 EXPECT_EQ(1, observer_->num_not_fullscreens());
275 } 275 }
276 276
277 // Test that the observer receives a true value when the window is fullscreen. 277 // Test that the observer receives a true value when the window is fullscreen.
278 TEST_F(VideoDetectorTest, FullscreenWindow) { 278 TEST_F(VideoDetectorTest, FullscreenWindow) {
279 if (!SupportsMultipleDisplays()) 279 if (!SupportsMultipleDisplays())
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ash/wm/video_detector.h ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698