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

Side by Side Diff: cc/test/ordered_simple_task_runner_unittest.cc

Issue 2434783002: Use OnceClosure in TestPendingTask (Closed)
Patch Set: +comment Created 3 years, 11 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
« no previous file with comments | « cc/test/ordered_simple_task_runner.cc ('k') | device/bluetooth/test/bluetooth_test_win.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/ordered_simple_task_runner.h" 5 #include "cc/test/ordered_simple_task_runner.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 30 matching lines...) Expand all
41 TestOrderablePendingTask b; 41 TestOrderablePendingTask b;
42 TestOrderablePendingTask c; 42 TestOrderablePendingTask c;
43 43
44 EXPECT_EQ(a, a); 44 EXPECT_EQ(a, a);
45 EXPECT_EQ(b, b); 45 EXPECT_EQ(b, b);
46 EXPECT_EQ(c, c); 46 EXPECT_EQ(c, c);
47 EXPECT_LT(a, b); 47 EXPECT_LT(a, b);
48 EXPECT_LT(b, c); 48 EXPECT_LT(b, c);
49 EXPECT_LT(a, c); 49 EXPECT_LT(a, c);
50 50
51 TestOrderablePendingTask a2 = a; 51 TestOrderablePendingTask a2 = std::move(a);
52 EXPECT_EQ(a, a2);
53 EXPECT_LT(a2, b); 52 EXPECT_LT(a2, b);
54 EXPECT_LT(b, c); 53 EXPECT_LT(b, c);
55 EXPECT_LT(a2, c); 54 EXPECT_LT(a2, c);
56 } 55 }
57 56
58 class OrderedSimpleTaskRunnerTest : public testing::Test { 57 class OrderedSimpleTaskRunnerTest : public testing::Test {
59 public: 58 public:
60 OrderedSimpleTaskRunnerTest() 59 OrderedSimpleTaskRunnerTest()
61 : now_src_(new base::SimpleTestTickClock()), 60 : now_src_(new base::SimpleTestTickClock()),
62 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)) {} 61 task_runner_(new OrderedSimpleTaskRunner(now_src_.get(), true)) {}
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 435
437 task_runner_->SetRunTaskLimit(0); 436 task_runner_->SetRunTaskLimit(0);
438 RUN_AND_CHECK_RESULT(EXPECT_TRUE, RunUntilTime(run_to), ""); 437 RUN_AND_CHECK_RESULT(EXPECT_TRUE, RunUntilTime(run_to), "");
439 438
440 task_runner_->SetRunTaskLimit(100); 439 task_runner_->SetRunTaskLimit(100);
441 RUN_AND_CHECK_RESULT(EXPECT_FALSE, RunUntilTime(run_to), "4(4ms) 5(5ms)"); 440 RUN_AND_CHECK_RESULT(EXPECT_FALSE, RunUntilTime(run_to), "4(4ms) 5(5ms)");
442 EXPECT_EQ(run_to, now_src_->NowTicks()); 441 EXPECT_EQ(run_to, now_src_->NowTicks());
443 } 442 }
444 443
445 } // namespace cc 444 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/ordered_simple_task_runner.cc ('k') | device/bluetooth/test/bluetooth_test_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698