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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/throttling_helper_unittest.cc

Issue 2256943003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 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 "platform/scheduler/renderer/throttling_helper.h" 5 #include "platform/scheduler/renderer/throttling_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 29 matching lines...) Expand all
40 public: 40 public:
41 ThrottlingHelperTest() {} 41 ThrottlingHelperTest() {}
42 ~ThrottlingHelperTest() override {} 42 ~ThrottlingHelperTest() override {}
43 43
44 void SetUp() override { 44 void SetUp() override {
45 clock_.reset(new base::SimpleTestTickClock()); 45 clock_.reset(new base::SimpleTestTickClock());
46 clock_->Advance(base::TimeDelta::FromMicroseconds(5000)); 46 clock_->Advance(base::TimeDelta::FromMicroseconds(5000));
47 mock_task_runner_ = 47 mock_task_runner_ =
48 make_scoped_refptr(new cc::OrderedSimpleTaskRunner(clock_.get(), true)); 48 make_scoped_refptr(new cc::OrderedSimpleTaskRunner(clock_.get(), true));
49 delegate_ = SchedulerTqmDelegateForTest::Create( 49 delegate_ = SchedulerTqmDelegateForTest::Create(
50 mock_task_runner_, base::WrapUnique(new TestTimeSource(clock_.get()))); 50 mock_task_runner_, base::MakeUnique<TestTimeSource>(clock_.get()));
51 scheduler_.reset(new RendererSchedulerImpl(delegate_)); 51 scheduler_.reset(new RendererSchedulerImpl(delegate_));
52 throttling_helper_ = scheduler_->throttling_helper(); 52 throttling_helper_ = scheduler_->throttling_helper();
53 timer_queue_ = scheduler_->NewTimerTaskRunner("test_queue"); 53 timer_queue_ = scheduler_->NewTimerTaskRunner("test_queue");
54 } 54 }
55 55
56 void TearDown() override { 56 void TearDown() override {
57 scheduler_->Shutdown(); 57 scheduler_->Shutdown();
58 scheduler_.reset(); 58 scheduler_.reset();
59 } 59 }
60 60
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get()); 471 throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get());
472 EXPECT_FALSE(timer_queue_->IsQueueEnabled()); 472 EXPECT_FALSE(timer_queue_->IsQueueEnabled());
473 473
474 scheduler_->EnableVirtualTime(); 474 scheduler_->EnableVirtualTime();
475 EXPECT_TRUE(timer_queue_->IsQueueEnabled()); 475 EXPECT_TRUE(timer_queue_->IsQueueEnabled());
476 EXPECT_EQ(timer_queue_->GetTimeDomain(), scheduler_->GetVirtualTimeDomain()); 476 EXPECT_EQ(timer_queue_->GetTimeDomain(), scheduler_->GetVirtualTimeDomain());
477 } 477 }
478 478
479 } // namespace scheduler 479 } // namespace scheduler
480 } // namespace blink 480 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698