OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/cancelable_callback.h" | 7 #include "base/cancelable_callback.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
11 #include "base/test/test_pending_task.h" | 12 #include "base/test/test_pending_task.h" |
12 #include "cc/test/ordered_simple_task_runner.h" | 13 #include "cc/test/ordered_simple_task_runner.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 // We pass EXPECT_TRUE / EXPECT_FALSE macros rather than a boolean as on some | 16 // We pass EXPECT_TRUE / EXPECT_FALSE macros rather than a boolean as on some |
16 // compilers EXPECT_EQ(false, XXXX) fails to compile as gtest tries to convert | 17 // compilers EXPECT_EQ(false, XXXX) fails to compile as gtest tries to convert |
17 // the false value to null causing a -Werror=conversion-null error. | 18 // the false value to null causing a -Werror=conversion-null error. |
18 #define RUN_AND_CHECK_RESULT( \ | 19 #define RUN_AND_CHECK_RESULT( \ |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 435 |
435 task_runner_->SetRunTaskLimit(0); | 436 task_runner_->SetRunTaskLimit(0); |
436 RUN_AND_CHECK_RESULT(EXPECT_TRUE, RunUntilTime(run_to), ""); | 437 RUN_AND_CHECK_RESULT(EXPECT_TRUE, RunUntilTime(run_to), ""); |
437 | 438 |
438 task_runner_->SetRunTaskLimit(100); | 439 task_runner_->SetRunTaskLimit(100); |
439 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)"); |
440 EXPECT_EQ(run_to, now_src_->NowTicks()); | 441 EXPECT_EQ(run_to, now_src_->NowTicks()); |
441 } | 442 } |
442 | 443 |
443 } // namespace cc | 444 } // namespace cc |
OLD | NEW |