| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class RendererSchedulerImpl; | 58 class RendererSchedulerImpl; |
| 59 } | 59 } |
| 60 class TestingPlatformMockWebTaskRunner; | 60 class TestingPlatformMockWebTaskRunner; |
| 61 class TestingPlatformMockWebThread; | 61 class TestingPlatformMockWebThread; |
| 62 class WebCompositorSupport; | 62 class WebCompositorSupport; |
| 63 class WebThread; | 63 class WebThread; |
| 64 | 64 |
| 65 class TestingCompositorSupport : public WebCompositorSupport { | 65 class TestingCompositorSupport : public WebCompositorSupport { |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class TestingPlatformMockScheduler : public WebScheduler { |
| 69 WTF_MAKE_NONCOPYABLE(TestingPlatformMockScheduler); |
| 70 public: |
| 71 TestingPlatformMockScheduler(); |
| 72 ~TestingPlatformMockScheduler() override; |
| 73 |
| 74 void runSingleTask(); |
| 75 void runAllTasks(); |
| 76 |
| 77 // WebScheduler implementation: |
| 78 WebTaskRunner* loadingTaskRunner() override; |
| 79 WebTaskRunner* timerTaskRunner() override; |
| 80 void shutdown() override {} |
| 81 bool shouldYieldForHighPriorityWork() override { return false; } |
| 82 bool canExceedIdleDeadlineIfRequired() override { return false; } |
| 83 void postIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override {
} |
| 84 void postNonNestableIdleTask(const WebTraceLocation&, WebThread::IdleTask*)
override { } |
| 85 std::unique_ptr<WebViewScheduler> createWebViewScheduler(InterventionReporte
r*) override { return nullptr; } |
| 86 void suspendTimerQueue() override { } |
| 87 void resumeTimerQueue() override { } |
| 88 void addPendingNavigation(WebScheduler::NavigatingFrameType) override { } |
| 89 void removePendingNavigation(WebScheduler::NavigatingFrameType) override { } |
| 90 void onNavigationStarted() override { } |
| 91 |
| 92 private: |
| 93 WTF::Deque<std::unique_ptr<WebTaskRunner::Task>> m_tasks; |
| 94 std::unique_ptr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner; |
| 95 }; |
| 96 |
| 68 class TestingPlatformSupport : public Platform { | 97 class TestingPlatformSupport : public Platform { |
| 69 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport); | 98 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport); |
| 70 public: | 99 public: |
| 71 struct Config { | 100 struct Config { |
| 72 WebCompositorSupport* compositorSupport = nullptr; | 101 WebCompositorSupport* compositorSupport = nullptr; |
| 73 }; | 102 }; |
| 74 | 103 |
| 75 TestingPlatformSupport(); | 104 TestingPlatformSupport(); |
| 76 explicit TestingPlatformSupport(const Config&); | 105 explicit TestingPlatformSupport(const Config&); |
| 77 | 106 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 std::unique_ptr<base::TestDiscardableMemoryAllocator> m_discardableMemoryAll
ocator; | 178 std::unique_ptr<base::TestDiscardableMemoryAllocator> m_discardableMemoryAll
ocator; |
| 150 std::unique_ptr<DummyPlatform> m_platform; | 179 std::unique_ptr<DummyPlatform> m_platform; |
| 151 std::unique_ptr<cc_blink::WebCompositorSupportImpl> m_compositorSupport; | 180 std::unique_ptr<cc_blink::WebCompositorSupportImpl> m_compositorSupport; |
| 152 TestingPlatformSupport::Config m_testingPlatformConfig; | 181 TestingPlatformSupport::Config m_testingPlatformConfig; |
| 153 std::unique_ptr<TestingPlatformSupport> m_testingPlatformSupport; | 182 std::unique_ptr<TestingPlatformSupport> m_testingPlatformSupport; |
| 154 }; | 183 }; |
| 155 | 184 |
| 156 } // namespace blink | 185 } // namespace blink |
| 157 | 186 |
| 158 #endif // TestingPlatformSupport_h | 187 #endif // TestingPlatformSupport_h |
| OLD | NEW |