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

Side by Side Diff: cc/scheduler/vsync_time_source_unittest.cc

Issue 12674030: cc: Hook vsync time source to output surface (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Review tweaks. Created 7 years, 9 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 | « cc/scheduler/vsync_time_source.cc ('k') | cc/test/fake_layer_tree_host_impl_client.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/scheduler/vsync_time_source.h" 5 #include "cc/scheduler/vsync_time_source.h"
6 6
7 #include "cc/test/scheduler_test_common.h" 7 #include "cc/test/scheduler_test_common.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 14 matching lines...) Expand all
25 if (client_) 25 if (client_)
26 client_->DidVSync(frame_time); 26 client_->DidVSync(frame_time);
27 } 27 }
28 28
29 private: 29 private:
30 VSyncClient* client_; 30 VSyncClient* client_;
31 }; 31 };
32 32
33 class VSyncTimeSourceTest : public testing::Test { 33 class VSyncTimeSourceTest : public testing::Test {
34 public: 34 public:
35 VSyncTimeSourceTest() : timer_(VSyncTimeSource::create(&provider_)) { 35 VSyncTimeSourceTest() : timer_(VSyncTimeSource::Create(&provider_)) {
36 timer_->SetClient(&client_); 36 timer_->SetClient(&client_);
37 } 37 }
38 38
39 protected: 39 protected:
40 FakeTimeSourceClient client_; 40 FakeTimeSourceClient client_;
41 FakeVSyncProvider provider_; 41 FakeVSyncProvider provider_;
42 scoped_refptr<VSyncTimeSource> timer_; 42 scoped_refptr<VSyncTimeSource> timer_;
43 }; 43 };
44 44
45 TEST_F(VSyncTimeSourceTest, TaskPostedAndTickCalled) { 45 TEST_F(VSyncTimeSourceTest, TaskPostedAndTickCalled) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 timer_->SetActive(true); 89 timer_->SetActive(true);
90 provider_.Trigger(frame_time); 90 provider_.Trigger(frame_time);
91 ASSERT_EQ(timer_->NextTickTime(), frame_time); 91 ASSERT_EQ(timer_->NextTickTime(), frame_time);
92 92
93 timer_->SetTimebaseAndInterval(frame_time, interval); 93 timer_->SetTimebaseAndInterval(frame_time, interval);
94 ASSERT_EQ(timer_->NextTickTime(), frame_time + interval); 94 ASSERT_EQ(timer_->NextTickTime(), frame_time + interval);
95 } 95 }
96 96
97 } // namespace 97 } // namespace
98 } // namespace cc 98 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/vsync_time_source.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698