Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Unified Diff: Source/core/editing/StyledMarkupSerializerTest.cpp

Issue 1204843003: Add StyledMarkupSerializerTest.AcrossShadow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/EditingTestBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/StyledMarkupSerializerTest.cpp
diff --git a/Source/core/editing/StyledMarkupSerializerTest.cpp b/Source/core/editing/StyledMarkupSerializerTest.cpp
index 15dfabd5160389c92fc4592a67b174b921043586..553b764f8d9cd5cf37e416e5893adcdac70e2848 100644
--- a/Source/core/editing/StyledMarkupSerializerTest.cpp
+++ b/Source/core/editing/StyledMarkupSerializerTest.cpp
@@ -192,4 +192,29 @@ TEST_F(StyledMarkupSerializerTest, ShadowTreeStyle)
EXPECT_EQ(serializedDOM, serializedICT);
}
+TEST_F(StyledMarkupSerializerTest, AcrossShadow)
+{
+ const char* bodyContent = "<p id='host1'>[<span id='one'>11</span>]</p><p id='host2'>[<span id='two'>22</span>]</p>";
+ setBodyContent(bodyContent);
+ RefPtrWillBeRawPtr<Element> one = document().getElementById("one");
+ RefPtrWillBeRawPtr<Element> two = document().getElementById("two");
+ Position startDOM(toText(one->firstChild()), 0);
+ Position endDOM(toText(two->firstChild()), 2);
+ const std::string& serializedDOM = serializePart<EditingStrategy>(startDOM, endDOM, AnnotateForInterchange);
+
+ bodyContent = "<p id='host1'><span id='one'>11</span></p><p id='host2'><span id='two'>22</span></p>";
+ const char* shadowContent1 = "[<content select=#one></content>]";
+ const char* shadowContent2 = "[<content select=#two></content>]";
+ setBodyContent(bodyContent);
+ setShadowContent(shadowContent1, "host1");
+ setShadowContent(shadowContent2, "host2");
+ one = document().getElementById("one");
+ two = document().getElementById("two");
+ PositionInComposedTree startICT(toText(one->firstChild()), 0);
+ PositionInComposedTree endICT(toText(two->firstChild()), 2);
+ const std::string& serializedICT = serializePart<EditingInComposedTreeStrategy>(startICT, endICT, AnnotateForInterchange);
+
+ EXPECT_EQ(serializedDOM, serializedICT);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/editing/EditingTestBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698