OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "core/dom/TaskRunnerHelper.h" | 6 #include "core/dom/TaskRunnerHelper.h" |
| 7 #include "platform/scheduler/renderer/web_view_scheduler.h" |
7 #include "platform/testing/UnitTestHelpers.h" | 8 #include "platform/testing/UnitTestHelpers.h" |
8 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
9 #include "public/platform/WebViewScheduler.h" | |
10 #include "public/web/WebLocalFrame.h" | 10 #include "public/web/WebLocalFrame.h" |
11 #include "public/web/WebScriptExecutionCallback.h" | 11 #include "public/web/WebScriptExecutionCallback.h" |
12 #include "public/web/WebScriptSource.h" | 12 #include "public/web/WebScriptSource.h" |
13 #include "public/web/WebView.h" | 13 #include "public/web/WebView.h" |
14 #include "web/tests/sim/SimRequest.h" | 14 #include "web/tests/sim/SimRequest.h" |
15 #include "web/tests/sim/SimTest.h" | 15 #include "web/tests/sim/SimTest.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 namespace { | 19 namespace { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // ALso schedule a second timer for the same point in time. | 228 // ALso schedule a second timer for the same point in time. |
229 ExecuteJavaScript("setTimeout(() => { run_order.push(2); }, 1000);"); | 229 ExecuteJavaScript("setTimeout(() => { run_order.push(2); }, 1000);"); |
230 | 230 |
231 // The second DOM timer shouldn't have run because pausing virtual time also | 231 // The second DOM timer shouldn't have run because pausing virtual time also |
232 // atomically pauses DOM timers. | 232 // atomically pauses DOM timers. |
233 testing::RunPendingTasks(); | 233 testing::RunPendingTasks(); |
234 EXPECT_EQ("1", ExecuteJavaScript("run_order.join(', ')")); | 234 EXPECT_EQ("1", ExecuteJavaScript("run_order.join(', ')")); |
235 } | 235 } |
236 | 236 |
237 } // namespace blink | 237 } // namespace blink |
OLD | NEW |