| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/begin_frame_source.h" | 5 #include "cc/scheduler/begin_frame_source.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
| 10 #include "cc/test/begin_frame_args_test.h" | 10 #include "cc/test/begin_frame_args_test.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void OnBeginFrameSourcePausedChanged(bool paused) override {} | 192 void OnBeginFrameSourcePausedChanged(bool paused) override {} |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 TEST(BeginFrameSourceBaseTest, DetectAsValueIntoLoop) { | 195 TEST(BeginFrameSourceBaseTest, DetectAsValueIntoLoop) { |
| 196 LoopingBeginFrameObserver obs; | 196 LoopingBeginFrameObserver obs; |
| 197 FakeBeginFrameSource source; | 197 FakeBeginFrameSource source; |
| 198 | 198 |
| 199 obs.source_ = &source; | 199 obs.source_ = &source; |
| 200 source.AddObserver(&obs); | 200 source.AddObserver(&obs); |
| 201 | 201 |
| 202 scoped_refptr<base::trace_event::TracedValue> state = | 202 auto state = make_scoped_ptr(new base::trace_event::TracedValue); |
| 203 new base::trace_event::TracedValue(); | |
| 204 source.AsValueInto(state.get()); | 203 source.AsValueInto(state.get()); |
| 205 } | 204 } |
| 206 | 205 |
| 207 // BackToBackBeginFrameSource testing ----------------------------------------- | 206 // BackToBackBeginFrameSource testing ----------------------------------------- |
| 208 class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource { | 207 class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource { |
| 209 public: | 208 public: |
| 210 static scoped_ptr<TestBackToBackBeginFrameSource> Create( | 209 static scoped_ptr<TestBackToBackBeginFrameSource> Create( |
| 211 base::SimpleTestTickClock* now_src, | 210 base::SimpleTestTickClock* now_src, |
| 212 base::SingleThreadTaskRunner* task_runner) { | 211 base::SingleThreadTaskRunner* task_runner) { |
| 213 return make_scoped_ptr( | 212 return make_scoped_ptr( |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 Mock::VerifyAndClearExpectations(&obs); | 897 Mock::VerifyAndClearExpectations(&obs); |
| 899 source1_->SetBeginFrameSourcePaused(true); | 898 source1_->SetBeginFrameSourcePaused(true); |
| 900 | 899 |
| 901 // Paused to paused. | 900 // Paused to paused. |
| 902 mux_->SetActiveSource(source1_); | 901 mux_->SetActiveSource(source1_); |
| 903 Mock::VerifyAndClearExpectations(&obs); | 902 Mock::VerifyAndClearExpectations(&obs); |
| 904 } | 903 } |
| 905 | 904 |
| 906 } // namespace | 905 } // namespace |
| 907 } // namespace cc | 906 } // namespace cc |
| OLD | NEW |