| 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 <list> | 5 #include <list> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 MediaTaskRunnerTestContext::~MediaTaskRunnerTestContext() { | 40 MediaTaskRunnerTestContext::~MediaTaskRunnerTestContext() { |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 class BalancedMediaTaskRunnerTest : public testing::Test { | 45 class BalancedMediaTaskRunnerTest : public testing::Test { |
| 46 public: | 46 public: |
| 47 BalancedMediaTaskRunnerTest(); | 47 BalancedMediaTaskRunnerTest(); |
| 48 virtual ~BalancedMediaTaskRunnerTest(); | 48 ~BalancedMediaTaskRunnerTest() override; |
| 49 | 49 |
| 50 void SetupTest(base::TimeDelta max_delta, | 50 void SetupTest(base::TimeDelta max_delta, |
| 51 const std::vector<std::vector<int> >& timestamps_in_ms, | 51 const std::vector<std::vector<int> >& timestamps_in_ms, |
| 52 const std::vector<size_t>& pattern, | 52 const std::vector<size_t>& pattern, |
| 53 const std::vector<int>& expected_task_timestamps_ms); | 53 const std::vector<int>& expected_task_timestamps_ms); |
| 54 void ProcessAllTasks(); | 54 void ProcessAllTasks(); |
| 55 | 55 |
| 56 protected: | 56 protected: |
| 57 // Expected task order based on their timestamps. | 57 // Expected task order based on their timestamps. |
| 58 std::list<base::TimeDelta> expected_task_timestamps_; | 58 std::list<base::TimeDelta> expected_task_timestamps_; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 timestamps_ms, | 254 timestamps_ms, |
| 255 scheduling_pattern, | 255 scheduling_pattern, |
| 256 expected_timestamps_ms); | 256 expected_timestamps_ms); |
| 257 ProcessAllTasks(); | 257 ProcessAllTasks(); |
| 258 message_loop->Run(); | 258 message_loop->Run(); |
| 259 EXPECT_TRUE(expected_task_timestamps_.empty()); | 259 EXPECT_TRUE(expected_task_timestamps_.empty()); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace media | 262 } // namespace media |
| 263 } // namespace chromecast | 263 } // namespace chromecast |
| OLD | NEW |