Index: content/test/test_blink_web_unit_test_support.cc |
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc |
index b358a0e5c1d6a44f557aa10c690866beb6925f61..77bd9e6220c210d128cbdfe7ac7858bfb602d7ec 100644 |
--- a/content/test/test_blink_web_unit_test_support.cc |
+++ b/content/test/test_blink_web_unit_test_support.cc |
@@ -12,6 +12,8 @@ |
#include "base/path_service.h" |
#include "base/strings/utf_string_conversions.h" |
#include "content/public/common/content_switches.h" |
+#include "content/renderer/scheduler/renderer_scheduler.h" |
+#include "content/renderer/scheduler/web_scheduler_impl.h" |
#include "content/test/mock_webclipboard_impl.h" |
#include "content/test/web_gesture_curve_mock.h" |
#include "content/test/web_layer_tree_view_impl_for_testing.h" |
@@ -319,4 +321,14 @@ bool TestBlinkWebUnitTestSupport::getBlobItems( |
return blob_registry_.GetBlobItems(uuid, items); |
} |
+blink::WebScheduler* TestBlinkWebUnitTestSupport::scheduler() { |
+ // Lazily create the WebSchedulerImpl and RendererScheduler if needed. |
+ if (!web_scheduler_) { |
+ if (!renderer_scheduler_) |
+ renderer_scheduler_ = RendererScheduler::Create(); |
+ web_scheduler_.reset(new WebSchedulerImpl(renderer_scheduler_.get())); |
+ } |
+ return web_scheduler_.get(); |
+} |
+ |
} // namespace content |