Commit 28856969 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Prepare IsFocused test for parser blocking sheets.

Test relied on html parsing continuing before sheet in head was loaded.
That is not the case with BlockHTMLParserOnStyleSheets enabled.

Bug: 891767
Change-Id: Iec83d26fd55cd8e667ba7b321e7f89cca16597fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928784Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718566}
parent 098e2381
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "third_party/blink/renderer/core/testing/page_test_base.h" #include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h" #include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h" #include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
namespace blink { namespace blink {
...@@ -76,13 +77,20 @@ TEST_F(WebNodeSimTest, IsFocused) { ...@@ -76,13 +77,20 @@ TEST_F(WebNodeSimTest, IsFocused) {
css_resource.Start(); css_resource.Start();
EXPECT_TRUE(GetDocument().GetStyleEngine().HasPendingRenderBlockingSheets());
WebNode input_node(GetDocument().getElementById("focusable")); WebNode input_node(GetDocument().getElementById("focusable"));
EXPECT_FALSE(input_node.IsFocusable()); EXPECT_FALSE(input_node.IsFocusable());
EXPECT_EQ(!RuntimeEnabledFeatures::BlockHTMLParserOnStyleSheetsEnabled(),
GetDocument().GetStyleEngine().HasPendingRenderBlockingSheets());
main_resource.Finish(); main_resource.Finish();
css_resource.Complete("dummy {}"); css_resource.Complete("dummy {}");
test::RunPendingTasks();
if (RuntimeEnabledFeatures::BlockHTMLParserOnStyleSheetsEnabled()) {
// Need to re-initialize the WebNode since it was null on construction.
EXPECT_TRUE(input_node.IsNull());
input_node = GetDocument().getElementById("focusable");
}
EXPECT_TRUE(input_node.IsFocusable()); EXPECT_TRUE(input_node.IsFocusable());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment