diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-06 12:48:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:33:43 +0000 |
commit | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch) | |
tree | fa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc | |
parent | 79b4f909db1049fca459c07cca55af56a9b54fe3 (diff) | |
download | qtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz |
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc b/chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc index 7417837c7a2..224132811f2 100644 --- a/chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc +++ b/chromium/third_party/blink/renderer/core/exported/web_frame_serializer_sanitization_test.cc @@ -94,21 +94,23 @@ class WebFrameSerializerSanitizationTest : public testing::Test { test::RunPendingTasks(); } - ShadowRoot* SetShadowContent(TreeScope& scope, - const char* host, - ShadowRootType shadow_type, - const char* shadow_content, - bool delegates_focus = false) { + ShadowRoot* SetShadowContent( + TreeScope& scope, + const char* host, + ShadowRootType shadow_type, + const char* shadow_content, + FocusDelegation focus_delegation = FocusDelegation::kNone) { Element* host_element = scope.getElementById(AtomicString::FromUTF8(host)); ShadowRoot* shadow_root; if (shadow_type == ShadowRootType::V0) { - DCHECK(!delegates_focus); + DCHECK_EQ(focus_delegation, FocusDelegation::kNone); shadow_root = &host_element->CreateV0ShadowRootForTesting(); } else { - shadow_root = - &host_element->AttachShadowRootInternal(shadow_type, delegates_focus); + shadow_root = &host_element->AttachShadowRootInternal(shadow_type, + focus_delegation); } - shadow_root->SetDelegatesFocus(delegates_focus); + shadow_root->SetDelegatesFocus(focus_delegation == + FocusDelegation::kDelegateFocus); shadow_root->setInnerHTML(String::FromUTF8(shadow_content), ASSERT_NO_EXCEPTION); scope.GetDocument().View()->UpdateAllLifecyclePhases( @@ -337,9 +339,9 @@ TEST_F(WebFrameSerializerSanitizationTest, ShadowDOM) { LoadFrame("http://www.test.com", "shadow_dom.html", "text/html"); Document* document = MainFrameImpl()->GetFrame()->GetDocument(); SetShadowContent(*document, "h1", ShadowRootType::V0, "V0 shadow"); - ShadowRoot* shadowRoot = - SetShadowContent(*document, "h2", ShadowRootType::kOpen, - "Parent shadow\n<p id=\"h3\">Foo</p>", true); + ShadowRoot* shadowRoot = SetShadowContent( + *document, "h2", ShadowRootType::kOpen, + "Parent shadow\n<p id=\"h3\">Foo</p>", FocusDelegation::kDelegateFocus); SetShadowContent(*shadowRoot, "h3", ShadowRootType::kClosed, "Nested shadow"); String mhtml = WebFrameSerializerTestHelper::GenerateMHTML(MainFrameImpl()); |