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

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

Issue 1316063002: Introduce firstEditablePositionAfterPositionInRoot() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-26T17:01:44 Created 5 years, 4 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/EditingUtilities.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/EditingUtilitiesTest.cpp
diff --git a/Source/core/editing/EditingUtilitiesTest.cpp b/Source/core/editing/EditingUtilitiesTest.cpp
index 3a6481280c5ee06603c399978cbcda46b48a73ad..80d865fcd401d5e1cec6fad53ad7c9b0c8c6dceb 100644
--- a/Source/core/editing/EditingUtilitiesTest.cpp
+++ b/Source/core/editing/EditingUtilitiesTest.cpp
@@ -12,6 +12,25 @@ namespace blink {
class EditingUtilitiesTest : public EditingTestBase {
};
+TEST_F(EditingUtilitiesTest, firstEditablePositionAfterPositionInRoot)
+{
+ const char* bodyContent = "<p id='host' contenteditable><b id='one'></b><b id='two'>22</b></p>";
+ const char* shadowContent = "<content select=#two></content><content select=#one></content><b id='three'>333</b>";
+ setBodyContent(bodyContent);
+ RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent);
+ updateLayoutAndStyleForPainting();
+ Node* host = document().getElementById("host");
+ Node* one = document().getElementById("one");
+ Node* three = shadowRoot->getElementById("three");
+
+ EXPECT_EQ(Position(one, 0), firstEditablePositionAfterPositionInRoot(Position(one, 0), host));
yoichio 2015/08/26 08:58:26 Looks getting same position though function name i
+
+ EXPECT_EQ(PositionInComposedTree(one, 0), firstEditablePositionAfterPositionInRoot(PositionInComposedTree(one, 0), host));
+
+ EXPECT_EQ(Position::firstPositionInNode(host), firstEditablePositionAfterPositionInRoot(Position(three, 0), host));
+ EXPECT_EQ(PositionInComposedTree::afterNode(host), firstEditablePositionAfterPositionInRoot(PositionInComposedTree(three, 0), host));
+}
+
TEST_F(EditingUtilitiesTest, enclosingNodeOfType)
{
const char* bodyContent = "<p id='host'><b id='one'>11</b></p>";
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698