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

Unified Diff: Source/core/dom/PositionTest.cpp

Issue 1263033003: Make PositionAlgorithm<Strategy>::next() to use Strategy::index() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-03T16:32:43 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/dom/Position.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/PositionTest.cpp
diff --git a/Source/core/dom/PositionTest.cpp b/Source/core/dom/PositionTest.cpp
index 516d4a8ed23840fb884eea4a17379289fcf8f8f4..a5ae99170fa9e9401026c42a85dfc2f2ea261d42 100644
--- a/Source/core/dom/PositionTest.cpp
+++ b/Source/core/dom/PositionTest.cpp
@@ -12,6 +12,19 @@ namespace blink {
class PositionTest : public EditingTestBase {
};
+TEST_F(PositionTest, NextNodeIndex)
+{
+ const char* bodyContent = "<p id='host'>00<b id='one'>11</b><b id='two'>22</b>33</p>";
+ const char* shadowContent = "<content select=#two></content><content select=#one></content>";
+ setBodyContent(bodyContent);
+ RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent);
+ Node* host = document().getElementById("host");
+ Node* two = document().getElementById("two");
+
+ EXPECT_EQ(Position(host, 3), Position(two, 2).next());
+ EXPECT_EQ(PositionInComposedTree(host, 1), PositionInComposedTree(two, 2).next());
+}
+
TEST_F(PositionTest, NodeAsRangeLastNodeNull)
{
EXPECT_EQ(nullptr, Position().nodeAsRangeLastNode());
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698