Commit 65676227 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Make CustomElementUpgradeSorterTest to use Element::AttachShadowRootInternal()

This patch changes |CustomElementUpgradeSorterTest| to use
|AttachShadowRootInternal()| instead of |Element::attachShadow()| to avoid using
script only functions for improving code health.

Change-Id: I625737366659a64ee26d4802c2972e1fd0488348
Reviewed-on: https://chromium-review.googlesource.com/1068537Reviewed-by: default avatarHayato Ito <hayato@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560978}
parent b423ee3e
...@@ -36,14 +36,6 @@ class CustomElementUpgradeSorterTest : public PageTestBase { ...@@ -36,14 +36,6 @@ class CustomElementUpgradeSorterTest : public PageTestBase {
ScriptState* GetScriptState() { ScriptState* GetScriptState() {
return ToScriptStateForMainWorld(&GetFrame()); return ToScriptStateForMainWorld(&GetFrame());
} }
ShadowRoot* AttachShadowTo(Element* element) {
NonThrowableExceptionState no_exceptions;
ShadowRootInit shadow_root_init;
shadow_root_init.setMode("open");
return element->attachShadow(GetScriptState(), shadow_root_init,
no_exceptions);
}
}; };
TEST_F(CustomElementUpgradeSorterTest, inOtherDocument_notInSet) { TEST_F(CustomElementUpgradeSorterTest, inOtherDocument_notInSet) {
...@@ -185,7 +177,7 @@ TEST_F(CustomElementUpgradeSorterTest, sorter_shadow) { ...@@ -185,7 +177,7 @@ TEST_F(CustomElementUpgradeSorterTest, sorter_shadow) {
Element* d = CreateElementWithId("a-a", "d"); Element* d = CreateElementWithId("a-a", "d");
GetDocument().documentElement()->AppendChild(a); GetDocument().documentElement()->AppendChild(a);
ShadowRoot* s = AttachShadowTo(a); ShadowRoot* s = &a->AttachShadowRootInternal(ShadowRootType::kOpen);
a->AppendChild(d); a->AppendChild(d);
s->AppendChild(b); s->AppendChild(b);
......
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