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

Unified Diff: cc/debug/micro_benchmark_controller_unittest.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/debug/micro_benchmark_controller.cc ('k') | cc/debug/picture_record_benchmark.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/micro_benchmark_controller_unittest.cc
diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/debug/micro_benchmark_controller_unittest.cc
index 50021daf6ed70b740a5f8a5c5d13fae3de42e410..1f2bfd8258ce376a32bd86b8103d082de19321b0 100644
--- a/cc/debug/micro_benchmark_controller_unittest.cc
+++ b/cc/debug/micro_benchmark_controller_unittest.cc
@@ -33,9 +33,9 @@ class MicroBenchmarkControllerTest : public testing::Test {
}
virtual void TearDown() OVERRIDE {
- layer_tree_host_impl_.reset();
- layer_tree_host_.reset();
- impl_proxy_.reset();
+ layer_tree_host_impl_ = nullptr;
+ layer_tree_host_ = nullptr;
+ impl_proxy_ = nullptr;
}
FakeLayerTreeHostClient layer_tree_host_client_;
@@ -126,7 +126,7 @@ TEST_F(MicroBenchmarkControllerTest, BenchmarkImplRan) {
// Schedule a main thread benchmark.
int id = layer_tree_host_->ScheduleMicroBenchmark(
"unittest_only_benchmark",
- settings.PassAs<base::Value>(),
+ settings.Pass(),
base::Bind(&IncrementCallCount, base::Unretained(&run_count)));
EXPECT_GT(id, 0);
@@ -147,8 +147,8 @@ TEST_F(MicroBenchmarkControllerTest, SendMessage) {
// Send valid message to invalid benchmark (id = 0)
scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue);
message->SetBoolean("can_handle", true);
- bool message_handled = layer_tree_host_->SendMessageToMicroBenchmark(
- 0, message.PassAs<base::Value>());
+ bool message_handled =
+ layer_tree_host_->SendMessageToMicroBenchmark(0, message.Pass());
EXPECT_FALSE(message_handled);
// Schedule a benchmark
@@ -160,17 +160,17 @@ TEST_F(MicroBenchmarkControllerTest, SendMessage) {
EXPECT_GT(id, 0);
// Send valid message to valid benchmark
- message = scoped_ptr<base::DictionaryValue>(new base::DictionaryValue);
+ message = make_scoped_ptr(new base::DictionaryValue);
message->SetBoolean("can_handle", true);
- message_handled = layer_tree_host_->SendMessageToMicroBenchmark(
- id, message.PassAs<base::Value>());
+ message_handled =
+ layer_tree_host_->SendMessageToMicroBenchmark(id, message.Pass());
EXPECT_TRUE(message_handled);
// Send invalid message to valid benchmark
- message = scoped_ptr<base::DictionaryValue>(new base::DictionaryValue);
+ message = make_scoped_ptr(new base::DictionaryValue);
message->SetBoolean("can_handle", false);
- message_handled = layer_tree_host_->SendMessageToMicroBenchmark(
- id, message.PassAs<base::Value>());
+ message_handled =
+ layer_tree_host_->SendMessageToMicroBenchmark(id, message.Pass());
EXPECT_FALSE(message_handled);
}
« no previous file with comments | « cc/debug/micro_benchmark_controller.cc ('k') | cc/debug/picture_record_benchmark.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698