| 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/scheduler/Scheduler.h" | 6 #include "platform/scheduler/Scheduler.h" |
| 7 | 7 |
| 8 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/TestingPlatformSupport.h" | 9 #include "platform/TestingPlatformSupport.h" |
| 9 #include "platform/TraceLocation.h" | 10 #include "platform/TraceLocation.h" |
| 10 #include "public/platform/Platform.h" | 11 #include "public/platform/Platform.h" |
| 11 #include "public/platform/WebThread.h" | 12 #include "public/platform/WebThread.h" |
| 12 | 13 |
| 13 #include <gmock/gmock.h> | 14 #include <gmock/gmock.h> |
| 14 #include <gtest/gtest.h> | 15 #include <gtest/gtest.h> |
| 15 #include <string> | 16 #include <string> |
| 16 #include <vector> | 17 #include <vector> |
| 17 | 18 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 double m_sharedTimerFireInterval; | 156 double m_sharedTimerFireInterval; |
| 156 double m_monotonicallyIncreasingTime; | 157 double m_monotonicallyIncreasingTime; |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 class SchedulerTest : public testing::Test { | 160 class SchedulerTest : public testing::Test { |
| 160 public: | 161 public: |
| 161 SchedulerTest() | 162 SchedulerTest() |
| 162 : m_reentrantCount(0) | 163 : m_reentrantCount(0) |
| 163 , m_maxRecursion(4) | 164 , m_maxRecursion(4) |
| 164 { | 165 { |
| 166 blink::RuntimeEnabledFeatures::setBlinkSchedulerEnabled(true); |
| 165 SchedulerForTest::initializeOnMainThread(); | 167 SchedulerForTest::initializeOnMainThread(); |
| 166 m_scheduler = static_cast<SchedulerForTest*>(Scheduler::shared()); | 168 m_scheduler = static_cast<SchedulerForTest*>(Scheduler::shared()); |
| 167 } | 169 } |
| 168 | 170 |
| 169 ~SchedulerTest() | 171 ~SchedulerTest() |
| 170 { | 172 { |
| 171 Scheduler::shutdown(); | 173 Scheduler::shutdown(); |
| 172 } | 174 } |
| 173 | 175 |
| 174 virtual void SetUp() override | 176 virtual void SetUp() override |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 m_platformSupport.setMonotonicTimeForTest(1000.5); | 532 m_platformSupport.setMonotonicTimeForTest(1000.5); |
| 531 runPendingTasks(); | 533 runPendingTasks(); |
| 532 | 534 |
| 533 ASSERT_FALSE(m_scheduler->shouldYieldForHighPriorityWork()); | 535 ASSERT_FALSE(m_scheduler->shouldYieldForHighPriorityWork()); |
| 534 m_scheduler->postCompositorTask(FROM_HERE, WTF::bind(&dummyTask)); | 536 m_scheduler->postCompositorTask(FROM_HERE, WTF::bind(&dummyTask)); |
| 535 | 537 |
| 536 EXPECT_FALSE(m_scheduler->shouldYieldForHighPriorityWork()); | 538 EXPECT_FALSE(m_scheduler->shouldYieldForHighPriorityWork()); |
| 537 } | 539 } |
| 538 | 540 |
| 539 } // namespace | 541 } // namespace |
| OLD | NEW |