From 1c15c0f3ba8eba3e41262c96a3688bfd14b50d7f Mon Sep 17 00:00:00 2001
From: nod_ <nod_@598310.no-reply.drupal.org>
Date: Tue, 20 Aug 2024 22:07:15 +0200
Subject: [PATCH] Issue #3468827 by catch, smustgrave: Speed up
 BigPipeRegressionTest

(cherry picked from commit aae2ffb6ac8a3eca0c4050ce3818bf7a96add517)
---
 .../BigPipeRegressionTest.php                 | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php b/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php
index 6d4b1634c6f9..20244a8fa098 100644
--- a/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php
+++ b/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php
@@ -114,13 +114,22 @@ public function testMessages_2712935(): void {
     }
   }
 
+  /**
+   * Tests edge cases with placeholder HTML.
+   */
+  public function testPlaceholderHtmlEdgeCases(): void {
+    $this->drupalLogin($this->drupalCreateUser());
+    $this->doTestPlaceholderInParagraph_2802923();
+    $this->doTestBigPipeLargeContent();
+    $this->doTestMultipleReplacements();
+  }
+
   /**
    * Ensure default BigPipe placeholder HTML cannot split paragraphs.
    *
    * @see https://www.drupal.org/node/2802923
    */
-  public function testPlaceholderInParagraph_2802923(): void {
-    $this->drupalLogin($this->drupalCreateUser());
+  protected function doTestPlaceholderInParagraph_2802923(): void {
     $this->drupalGet(Url::fromRoute('big_pipe_regression_test.2802923'));
 
     $this->assertJsCondition('document.querySelectorAll(\'p\').length === 1');
@@ -132,9 +141,7 @@ public function testPlaceholderInParagraph_2802923(): void {
    * Repeat loading of same page for two times, after second time the page is
    * cached and the bug consistently reproducible.
    */
-  public function testBigPipeLargeContent(): void {
-    $user = $this->drupalCreateUser();
-    $this->drupalLogin($user);
+  public function doTestBigPipeLargeContent(): void {
     $assert_session = $this->assertSession();
 
     $this->drupalGet(Url::fromRoute('big_pipe_test_large_content'));
@@ -160,7 +167,7 @@ public function testBigPipeLargeContent(): void {
    *
    * @see https://www.drupal.org/node/3390178
    */
-  public function testMultipleReplacements(): void {
+  protected function doTestMultipleReplacements(): void {
     $user = $this->drupalCreateUser();
     $this->drupalLogin($user);
 
-- 
GitLab