OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/dom/Range.h" | 6 #include "core/dom/Range.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
10 #include "core/dom/NodeList.h" | 10 #include "core/dom/NodeList.h" |
11 #include "core/dom/Text.h" | 11 #include "core/dom/Text.h" |
12 #include "core/html/HTMLBodyElement.h" | 12 #include "core/html/HTMLBodyElement.h" |
13 #include "core/html/HTMLDocument.h" | 13 #include "core/html/HTMLDocument.h" |
14 #include "core/html/HTMLElement.h" | 14 #include "core/html/HTMLElement.h" |
15 #include "core/html/HTMLHtmlElement.h" | 15 #include "core/html/HTMLHtmlElement.h" |
16 #include "platform/heap/Handle.h" | 16 #include "platform/heap/Handle.h" |
17 #include "wtf/Compiler.h" | 17 #include "wtf/Compiler.h" |
18 #include "wtf/RefPtr.h" | 18 #include "wtf/RefPtr.h" |
19 #include "wtf/text/AtomicString.h" | 19 #include "wtf/text/AtomicString.h" |
20 #include <gtest/gtest.h> | 20 #include <gtest/gtest.h> |
21 | 21 |
22 using namespace blink; | 22 using namespace blink; |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class RangeTest : public ::testing::Test { | 26 class RangeTest : public ::testing::Test { |
27 protected: | 27 protected: |
28 virtual void SetUp() OVERRIDE; | 28 virtual void SetUp() override; |
29 | 29 |
30 HTMLDocument& document() const; | 30 HTMLDocument& document() const; |
31 | 31 |
32 private: | 32 private: |
33 RefPtrWillBePersistent<HTMLDocument> m_document; | 33 RefPtrWillBePersistent<HTMLDocument> m_document; |
34 }; | 34 }; |
35 | 35 |
36 void RangeTest::SetUp() | 36 void RangeTest::SetUp() |
37 { | 37 { |
38 m_document = HTMLDocument::create(); | 38 m_document = HTMLDocument::create(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 EXPECT_EQ(1, rangeInnerRight->endOffset()); | 135 EXPECT_EQ(1, rangeInnerRight->endOffset()); |
136 | 136 |
137 EXPECT_TRUE(rangeFromTextToMiddleOfElement->boundaryPointsValid()); | 137 EXPECT_TRUE(rangeFromTextToMiddleOfElement->boundaryPointsValid()); |
138 EXPECT_EQ(newText, rangeFromTextToMiddleOfElement->startContainer()); | 138 EXPECT_EQ(newText, rangeFromTextToMiddleOfElement->startContainer()); |
139 EXPECT_EQ(3, rangeFromTextToMiddleOfElement->startOffset()); | 139 EXPECT_EQ(3, rangeFromTextToMiddleOfElement->startOffset()); |
140 EXPECT_EQ(outer, rangeFromTextToMiddleOfElement->endContainer()); | 140 EXPECT_EQ(outer, rangeFromTextToMiddleOfElement->endContainer()); |
141 EXPECT_EQ(4, rangeFromTextToMiddleOfElement->endOffset()); | 141 EXPECT_EQ(4, rangeFromTextToMiddleOfElement->endOffset()); |
142 } | 142 } |
143 | 143 |
144 } | 144 } |
OLD | NEW |