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

Side by Side Diff: Source/core/editing/iterators/TextIteratorTest.cpp

Issue 1213483003: Get rid of redundant parameter PositionIsOffsetInAnchor from PositionAlgorithm constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 private: 59 private:
60 template <typename Tree> 60 template <typename Tree>
61 std::string iterateWithIterator(typename Tree::TextIteratorType&); 61 std::string iterateWithIterator(typename Tree::TextIteratorType&);
62 }; 62 };
63 63
64 template <typename Tree> 64 template <typename Tree>
65 std::string TextIteratorTest::iterate(TextIteratorBehavior iteratorBehavior) 65 std::string TextIteratorTest::iterate(TextIteratorBehavior iteratorBehavior)
66 { 66 {
67 RefPtrWillBeRawPtr<Element> body = document().body(); 67 RefPtrWillBeRawPtr<Element> body = document().body();
68 using PositionType = typename Tree::PositionType; 68 using PositionType = typename Tree::PositionType;
69 auto start = PositionType(body, 0, PositionType::PositionIsOffsetInAnchor); 69 auto start = PositionType(body, 0);
70 auto end = PositionType(body, Tree::countChildren(*body), PositionType::Posi tionIsOffsetInAnchor); 70 auto end = PositionType(body, Tree::countChildren(*body));
71 typename Tree::TextIteratorType iterator(start, end, iteratorBehavior); 71 typename Tree::TextIteratorType iterator(start, end, iteratorBehavior);
72 return iterateWithIterator<Tree>(iterator); 72 return iterateWithIterator<Tree>(iterator);
73 } 73 }
74 74
75 template <typename Tree> 75 template <typename Tree>
76 std::string TextIteratorTest::iteratePartial(const typename Tree::PositionType& start, const typename Tree::PositionType& end, TextIteratorBehavior iteratorBeha vior) 76 std::string TextIteratorTest::iteratePartial(const typename Tree::PositionType& start, const typename Tree::PositionType& end, TextIteratorBehavior iteratorBeha vior)
77 { 77 {
78 typename Tree::TextIteratorType iterator(start, end, iteratorBehavior); 78 typename Tree::TextIteratorType iterator(start, end, iteratorBehavior);
79 return iterateWithIterator<Tree>(iterator); 79 return iterateWithIterator<Tree>(iterator);
80 } 80 }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 430
431 Node* divNode = document().getElementById("div"); 431 Node* divNode = document().getElementById("div");
432 RefPtrWillBeRawPtr<Range> entireRange = Range::create(document(), divNode, 0 , divNode, 3); 432 RefPtrWillBeRawPtr<Range> entireRange = Range::create(document(), divNode, 0 , divNode, 3);
433 433
434 RefPtrWillBeRawPtr<Range> subrange = TextIterator::subrange(entireRange.get( ), 2, 3); 434 RefPtrWillBeRawPtr<Range> subrange = TextIterator::subrange(entireRange.get( ), 2, 3);
435 EXPECT_EQ(0, subrange->startOffset()); 435 EXPECT_EQ(0, subrange->startOffset());
436 EXPECT_EQ(3, subrange->endOffset()); 436 EXPECT_EQ(3, subrange->endOffset());
437 } 437 }
438 438
439 } // namespace blink 439 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/iterators/TextIterator.cpp ('k') | Source/core/html/HTMLTextFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698