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

Side by Side Diff: Source/platform/TimerTest.cpp

Issue 1213003004: Fix virtual/override/final usage in Source/platform/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/Timer.h ('k') | Source/platform/TracedValue.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 #include "platform/Timer.h" 6 #include "platform/Timer.h"
7 7
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "public/platform/WebScheduler.h" 9 #include "public/platform/WebScheduler.h"
10 #include "public/platform/WebThread.h" 10 #include "public/platform/WebThread.h"
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 EXPECT_FLOAT_EQ(18.0, timer.nextFireInterval()); 654 EXPECT_FLOAT_EQ(18.0, timer.nextFireInterval());
655 655
656 runUntilIdleOrDeadlinePassed(m_startTime + 50.0); 656 runUntilIdleOrDeadlinePassed(m_startTime + 50.0);
657 EXPECT_THAT(m_runTimes, ElementsAre(m_startTime + 20.0, m_startTime + 40.0)) ; 657 EXPECT_THAT(m_runTimes, ElementsAre(m_startTime + 20.0, m_startTime + 40.0)) ;
658 } 658 }
659 659
660 class MockTimerWithAlignment : public TimerBase { 660 class MockTimerWithAlignment : public TimerBase {
661 public: 661 public:
662 MockTimerWithAlignment() : m_lastFireTime(0.0), m_alignedFireTime(0.0) { } 662 MockTimerWithAlignment() : m_lastFireTime(0.0), m_alignedFireTime(0.0) { }
663 663
664 virtual void fired() override 664 void fired() override
665 { 665 {
666 } 666 }
667 667
668 double alignedFireTime(double fireTime) const override 668 double alignedFireTime(double fireTime) const override
669 { 669 {
670 m_lastFireTime = fireTime; 670 m_lastFireTime = fireTime;
671 return m_alignedFireTime; 671 return m_alignedFireTime;
672 } 672 }
673 673
674 void setAlignedFireTime(double alignedFireTime) 674 void setAlignedFireTime(double alignedFireTime)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 timer.didChangeAlignmentInterval(monotonicallyIncreasingTime()); 727 timer.didChangeAlignmentInterval(monotonicallyIncreasingTime());
728 728
729 EXPECT_FLOAT_EQ(0.0, timer.nextFireInterval()); 729 EXPECT_FLOAT_EQ(0.0, timer.nextFireInterval());
730 EXPECT_FLOAT_EQ(0.0, timer.nextUnalignedFireInterval()); 730 EXPECT_FLOAT_EQ(0.0, timer.nextUnalignedFireInterval());
731 EXPECT_FLOAT_EQ(m_startTime, timer.lastFireTime()); 731 EXPECT_FLOAT_EQ(m_startTime, timer.lastFireTime());
732 } 732 }
733 733
734 734
735 } // namespace 735 } // namespace
736 } // namespace blink 736 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/Timer.h ('k') | Source/platform/TracedValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698