| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/test/launcher/unit_test_launcher.h" | 10 #include "base/test/launcher/unit_test_launcher.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 blink::WebTaskRunner* taskRunner() override { return web_task_runner_.get(); } | 52 blink::WebTaskRunner* taskRunner() override { return web_task_runner_.get(); } |
| 53 | 53 |
| 54 bool isCurrentThread() const override { return true; } | 54 bool isCurrentThread() const override { return true; } |
| 55 | 55 |
| 56 blink::PlatformThreadId threadId() const override { return 17; } | 56 blink::PlatformThreadId threadId() const override { return 17; } |
| 57 | 57 |
| 58 blink::WebScheduler* scheduler() const override { | 58 blink::WebScheduler* scheduler() const override { |
| 59 return web_scheduler_.get(); | 59 return web_scheduler_.get(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 double virtualTimeSeconds() override { |
| 63 return scheduler_->VirtualTimeSeconds(); |
| 64 } |
| 65 |
| 66 double monotonicallyIncreasingVirtualTimeSeconds() override { |
| 67 return scheduler_->MonotonicallyIncreasingVirtualTimeSeconds(); |
| 68 } |
| 69 |
| 62 private: | 70 private: |
| 63 scoped_refptr<scheduler::SchedulerTqmDelegate> task_runner_delegate_; | 71 scoped_refptr<scheduler::SchedulerTqmDelegate> task_runner_delegate_; |
| 64 scoped_ptr<scheduler::RendererSchedulerImpl> scheduler_; | 72 scoped_ptr<scheduler::RendererSchedulerImpl> scheduler_; |
| 65 scoped_ptr<blink::WebScheduler> web_scheduler_; | 73 scoped_ptr<blink::WebScheduler> web_scheduler_; |
| 66 scoped_ptr<blink::WebTaskRunner> web_task_runner_; | 74 scoped_ptr<blink::WebTaskRunner> web_task_runner_; |
| 67 }; | 75 }; |
| 68 | 76 |
| 69 class TestBlinkPlatformSupport : NON_EXPORTED_BASE(public blink::Platform) { | 77 class TestBlinkPlatformSupport : NON_EXPORTED_BASE(public blink::Platform) { |
| 70 public: | 78 public: |
| 71 ~TestBlinkPlatformSupport() override; | 79 ~TestBlinkPlatformSupport() override; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 blink::initialize(blink_platform_support_.get()); | 135 blink::initialize(blink_platform_support_.get()); |
| 128 } | 136 } |
| 129 | 137 |
| 130 int main(int argc, char** argv) { | 138 int main(int argc, char** argv) { |
| 131 BlinkMediaTestSuite test_suite(argc, argv); | 139 BlinkMediaTestSuite test_suite(argc, argv); |
| 132 | 140 |
| 133 return base::LaunchUnitTests( | 141 return base::LaunchUnitTests( |
| 134 argc, argv, base::Bind(&BlinkMediaTestSuite::Run, | 142 argc, argv, base::Bind(&BlinkMediaTestSuite::Run, |
| 135 base::Unretained(&test_suite))); | 143 base::Unretained(&test_suite))); |
| 136 } | 144 } |
| OLD | NEW |