OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "wtf/Vector.h" | 50 #include "wtf/Vector.h" |
51 #include "wtf/testing/WTFTestHelpers.h" | 51 #include "wtf/testing/WTFTestHelpers.h" |
52 #include <gtest/gtest.h> | 52 #include <gtest/gtest.h> |
53 | 53 |
54 using namespace blink; | 54 using namespace blink; |
55 | 55 |
56 namespace { | 56 namespace { |
57 | 57 |
58 class TextIteratorTest : public ::testing::Test { | 58 class TextIteratorTest : public ::testing::Test { |
59 protected: | 59 protected: |
60 virtual void SetUp() OVERRIDE; | 60 virtual void SetUp() override; |
61 | 61 |
62 HTMLDocument& document() const; | 62 HTMLDocument& document() const; |
63 | 63 |
64 Vector<String> iterate(TextIteratorBehavior = TextIteratorDefaultBehavior); | 64 Vector<String> iterate(TextIteratorBehavior = TextIteratorDefaultBehavior); |
65 Vector<String> iteratePartial(const Position& start, const Position& end, Te
xtIteratorBehavior = TextIteratorDefaultBehavior); | 65 Vector<String> iteratePartial(const Position& start, const Position& end, Te
xtIteratorBehavior = TextIteratorDefaultBehavior); |
66 | 66 |
67 void setBodyInnerHTML(const char*); | 67 void setBodyInnerHTML(const char*); |
68 PassRefPtrWillBeRawPtr<Range> getBodyRange() const; | 68 PassRefPtrWillBeRawPtr<Range> getBodyRange() const; |
69 | 69 |
70 private: | 70 private: |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 | 559 |
560 Node* divNode = document().getElementById("div"); | 560 Node* divNode = document().getElementById("div"); |
561 RefPtrWillBeRawPtr<Range> entireRange = Range::create(document(), divNode, 0
, divNode, 3); | 561 RefPtrWillBeRawPtr<Range> entireRange = Range::create(document(), divNode, 0
, divNode, 3); |
562 | 562 |
563 RefPtrWillBeRawPtr<Range> subrange = TextIterator::subrange(entireRange.get(
), 2, 3); | 563 RefPtrWillBeRawPtr<Range> subrange = TextIterator::subrange(entireRange.get(
), 2, 3); |
564 EXPECT_EQ(0, subrange->startOffset()); | 564 EXPECT_EQ(0, subrange->startOffset()); |
565 EXPECT_EQ(3, subrange->endOffset()); | 565 EXPECT_EQ(3, subrange->endOffset()); |
566 } | 566 } |
567 | 567 |
568 } | 568 } |
OLD | NEW |