Implement testRunner.layoutAndPaintAsyncThen()

This is an improved version of testRunner.displayAsyncThen(). It callbacks
after layout and paint before commit, saving the time originally used to
commit, rasterize, capture pixels, etc.

The original displayAsyncThen() will be still kept until all blink tests are
modified to use the new function.

This depends on https://codereview.chromium.org/1119193003/ at blink side.

BUG=484706

Review URL: https://codereview.chromium.org/1130633002

Cr-Commit-Position: refs/heads/master@{#328647}
diff --git a/content/shell/renderer/test_runner/test_runner.h b/content/shell/renderer/test_runner/test_runner.h
index 44e471e4..f5ae598 100644
--- a/content/shell/renderer/test_runner/test_runner.h
+++ b/content/shell/renderer/test_runner/test_runner.h
@@ -570,10 +570,14 @@
   void AddWebPageOverlay();
   void RemoveWebPageOverlay();
 
+  void LayoutAndPaintAsync();
+  void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback);
+  // TODO(wangxianzhu): Remove the following two methods after all blink
+  // layout tests are modified to use the above two new functions.
   void DisplayAsync();
   void DisplayAsyncThen(v8::Local<v8::Function> callback);
 
-  // Similar to DisplayAsyncThen(), but pass parameters of the captured
+  // Similar to LayoutAndPaintAsyncThen(), but pass parameters of the captured
   // snapshot (width, height, snapshot) to the callback. The snapshot is in
   // uint8 RGBA format.
   void CapturePixelsAsyncThen(v8::Local<v8::Function> callback);