Add explicit lifecycle update for tests.

These tests rely on the forced lifecycle update after parsing finished,
which we would like to get rid of.

Bug: 742413
Change-Id: I2f1bb6f4efedd6bf48f903d48fc26344a60148ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1624330
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662136}
diff --git a/third_party/blink/renderer/core/html/lazy_load_image_observer_test.cc b/third_party/blink/renderer/core/html/lazy_load_image_observer_test.cc
index 887dae0..5467861 100644
--- a/third_party/blink/renderer/core/html/lazy_load_image_observer_test.cc
+++ b/third_party/blink/renderer/core/html/lazy_load_image_observer_test.cc
@@ -42,6 +42,7 @@
           <div style='height:10000px;'></div>
           <div id="deferred_image"></div>
         )HTML"));
+    GetDocument().UpdateStyleAndLayoutTree();
   }
 
   void ExpectCSSBackgroundImageDeferredState(bool deferred) {
diff --git a/third_party/blink/renderer/core/input/event_handler_test.cc b/third_party/blink/renderer/core/input/event_handler_test.cc
index 2cc5a61..195a244 100644
--- a/third_party/blink/renderer/core/input/event_handler_test.cc
+++ b/third_party/blink/renderer/core/input/event_handler_test.cc
@@ -1538,6 +1538,8 @@
         <div>foo</div>
       )HTML");
 
+  GetDocument().UpdateStyleAndLayoutTree();
+
   scoped_refptr<SharedBuffer> img =
       test::ReadFromFile(test::CoreTestDataPath("notifications/100x100.png"));
   cursor_request.Complete(img->CopyAs<Vector<char>>());
@@ -1595,6 +1597,8 @@
         <div>foo</div>
       )HTML");
 
+  GetDocument().UpdateStyleAndLayoutTree();
+
   scoped_refptr<SharedBuffer> img =
       test::ReadFromFile(test::CoreTestDataPath("notifications/48x48.png"));
   cursor_request.Complete(img->CopyAs<Vector<char>>());