VT: More speculative fixes to ViewTransitionCaptureTest

* Disable paint holding
* Use for test function for resizing
* Force device scale factor to 1.f
* Add an extra rAF to initial capture (the part that seems to fail
  correct capture)

[email protected]

Bug: 400187507
Change-Id: Icc05a16168f0e6a09d838063add46a3a3167b1de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6409851
Commit-Queue: Vladimir Levin <[email protected]>
Reviewed-by: Kevin Ellis <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1439673}
diff --git a/content/browser/renderer_host/view_transition_browsertest.cc b/content/browser/renderer_host/view_transition_browsertest.cc
index f458415..1741ab6 100644
--- a/content/browser/renderer_host/view_transition_browsertest.cc
+++ b/content/browser/renderer_host/view_transition_browsertest.cc
@@ -402,12 +402,13 @@
       public ::testing::WithParamInterface<std::string> {
  public:
   ViewTransitionCaptureTest() {
-    EnablePixelOutput();
+    EnablePixelOutput(1.f);
     feature_list_.InitWithFeatures(
         /*enabled_features=*/
         {viz::mojom::EnableVizTestApis,
          features::kViewTransitionCaptureAndDisplay},
-        /*disabled_features=*/{});
+        /*disabled_features=*/
+        {blink::features::kPaintHolding});
   }
 
   void SetUpOnMainThread() override {
@@ -445,11 +446,14 @@
                        ViewTransitionNoArtifactDuringCapture) {
   GURL test_url(embedded_test_server()->GetURL(GetParam()));
   auto* web_contents = shell()->web_contents();
-  web_contents->Resize({0, 0, 20, 20});
   ASSERT_TRUE(NavigateToURL(web_contents, test_url));
+  shell()->ResizeWebContentForTests(gfx::Size(20, 20));
+
   ASSERT_EQ(EvalJs(web_contents, JsReplace(R"(
             new Promise(resolve => {
-              requestAnimationFrame(() => resolve("ok"));
+              requestAnimationFrame(() => {
+                requestAnimationFrame(() => resolve("ok"));
+              });
             }))")),
             "ok");
   WaitForCopyableViewInWebContents(shell()->web_contents());