OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/dom/StaticRange.h" | 5 #include "core/dom/StaticRange.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/V8BindingForTesting.h" | 8 #include "bindings/core/v8/V8BindingForTesting.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/Range.h" | 11 #include "core/dom/Range.h" |
12 #include "core/dom/Text.h" | 12 #include "core/dom/Text.h" |
13 #include "core/html/HTMLBodyElement.h" | 13 #include "core/html/HTMLBodyElement.h" |
14 #include "core/html/HTMLDocument.h" | 14 #include "core/html/HTMLDocument.h" |
15 #include "core/html/HTMLElement.h" | 15 #include "core/html/HTMLElement.h" |
16 #include "core/html/HTMLHtmlElement.h" | 16 #include "core/html/HTMLHtmlElement.h" |
17 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
18 #include "platform/wtf/Compiler.h" | 18 #include "platform/wtf/Compiler.h" |
19 #include "platform/wtf/RefPtr.h" | 19 #include "platform/wtf/RefPtr.h" |
20 #include "platform/wtf/text/AtomicString.h" | 20 #include "platform/wtf/text/AtomicString.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
24 | 24 |
25 class StaticRangeTest : public testing::Test { | 25 class StaticRangeTest : public ::testing::Test { |
26 protected: | 26 protected: |
27 void SetUp() override; | 27 void SetUp() override; |
28 | 28 |
29 HTMLDocument& GetDocument() const; | 29 HTMLDocument& GetDocument() const; |
30 | 30 |
31 private: | 31 private: |
32 Persistent<HTMLDocument> document_; | 32 Persistent<HTMLDocument> document_; |
33 }; | 33 }; |
34 | 34 |
35 void StaticRangeTest::SetUp() { | 35 void StaticRangeTest::SetUp() { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 EXPECT_EQ(old_text, static_range04->endContainer()); | 247 EXPECT_EQ(old_text, static_range04->endContainer()); |
248 EXPECT_EQ(4u, static_range04->endOffset()); | 248 EXPECT_EQ(4u, static_range04->endOffset()); |
249 | 249 |
250 // Invalid StaticRange. | 250 // Invalid StaticRange. |
251 DummyExceptionStateForTesting exception_state; | 251 DummyExceptionStateForTesting exception_state; |
252 static_range04->toRange(exception_state); | 252 static_range04->toRange(exception_state); |
253 EXPECT_TRUE(exception_state.HadException()); | 253 EXPECT_TRUE(exception_state.HadException()); |
254 } | 254 } |
255 | 255 |
256 } // namespace blink | 256 } // namespace blink |
OLD | NEW |