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

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

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
OLDNEW
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
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 scoped_ptr<base::trace_event::TracedValue> state(
203 new base::trace_event::TracedValue(); 203 new base::trace_event::TracedValue());
204 source.AsValueInto(state.get()); 204 source.AsValueInto(state.get());
205 } 205 }
206 206
207 // BackToBackBeginFrameSource testing ----------------------------------------- 207 // BackToBackBeginFrameSource testing -----------------------------------------
208 class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource { 208 class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource {
209 public: 209 public:
210 static scoped_ptr<TestBackToBackBeginFrameSource> Create( 210 static scoped_ptr<TestBackToBackBeginFrameSource> Create(
211 base::SimpleTestTickClock* now_src, 211 base::SimpleTestTickClock* now_src,
212 base::SingleThreadTaskRunner* task_runner) { 212 base::SingleThreadTaskRunner* task_runner) {
213 return make_scoped_ptr( 213 return make_scoped_ptr(
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 Mock::VerifyAndClearExpectations(&obs); 898 Mock::VerifyAndClearExpectations(&obs);
899 source1_->SetBeginFrameSourcePaused(true); 899 source1_->SetBeginFrameSourcePaused(true);
900 900
901 // Paused to paused. 901 // Paused to paused.
902 mux_->SetActiveSource(source1_); 902 mux_->SetActiveSource(source1_);
903 Mock::VerifyAndClearExpectations(&obs); 903 Mock::VerifyAndClearExpectations(&obs);
904 } 904 }
905 905
906 } // namespace 906 } // namespace
907 } // namespace cc 907 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698