| 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 "components/test_runner/test_runner.h" | 5 #include "components/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 void TestRunner::SetPluginsEnabled(bool enabled) { | 2345 void TestRunner::SetPluginsEnabled(bool enabled) { |
| 2346 delegate_->Preferences()->plugins_enabled = enabled; | 2346 delegate_->Preferences()->plugins_enabled = enabled; |
| 2347 delegate_->ApplyPreferences(); | 2347 delegate_->ApplyPreferences(); |
| 2348 } | 2348 } |
| 2349 | 2349 |
| 2350 bool TestRunner::GetAnimationScheduled() const { | 2350 bool TestRunner::GetAnimationScheduled() const { |
| 2351 bool is_animation_scheduled = !widgets_with_scheduled_animations_.empty(); | 2351 bool is_animation_scheduled = !widgets_with_scheduled_animations_.empty(); |
| 2352 return is_animation_scheduled; | 2352 return is_animation_scheduled; |
| 2353 } | 2353 } |
| 2354 | 2354 |
| 2355 void TestRunner::RunPendingAnimations() |
| 2356 { |
| 2357 for (auto& widget: widgets_with_scheduled_animations_) { |
| 2358 widget->updateAllLifecyclePhases(); |
| 2359 } |
| 2360 widgets_with_scheduled_animations_.clear(); |
| 2361 } |
| 2362 |
| 2355 void TestRunner::OnAnimationScheduled(blink::WebWidget* widget) { | 2363 void TestRunner::OnAnimationScheduled(blink::WebWidget* widget) { |
| 2356 widgets_with_scheduled_animations_.insert(widget); | 2364 widgets_with_scheduled_animations_.insert(widget); |
| 2357 } | 2365 } |
| 2358 | 2366 |
| 2359 void TestRunner::OnAnimationBegun(blink::WebWidget* widget) { | 2367 void TestRunner::OnAnimationBegun(blink::WebWidget* widget) { |
| 2360 widgets_with_scheduled_animations_.erase(widget); | 2368 widgets_with_scheduled_animations_.erase(widget); |
| 2361 } | 2369 } |
| 2362 | 2370 |
| 2363 void TestRunner::DumpEditingCallbacks() { | 2371 void TestRunner::DumpEditingCallbacks() { |
| 2364 layout_test_runtime_flags_.set_dump_editting_callbacks(true); | 2372 layout_test_runtime_flags_.set_dump_editting_callbacks(true); |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2726 | 2734 |
| 2727 void TestRunner::NotifyDone() { | 2735 void TestRunner::NotifyDone() { |
| 2728 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2736 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2729 !will_navigate_ && work_queue_.is_empty()) | 2737 !will_navigate_ && work_queue_.is_empty()) |
| 2730 delegate_->TestFinished(); | 2738 delegate_->TestFinished(); |
| 2731 layout_test_runtime_flags_.set_wait_until_done(false); | 2739 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2732 OnLayoutTestRuntimeFlagsChanged(); | 2740 OnLayoutTestRuntimeFlagsChanged(); |
| 2733 } | 2741 } |
| 2734 | 2742 |
| 2735 } // namespace test_runner | 2743 } // namespace test_runner |
| OLD | NEW |