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/editing/FrameSelection.h" | 6 #include "core/editing/FrameSelection.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.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/testing/DummyPageHolder.h" | 14 #include "core/testing/DummyPageHolder.h" |
15 #include "wtf/OwnPtr.h" | 15 #include "wtf/OwnPtr.h" |
16 #include "wtf/PassRefPtr.h" | 16 #include "wtf/PassRefPtr.h" |
17 #include "wtf/RefPtr.h" | 17 #include "wtf/RefPtr.h" |
18 #include "wtf/StdLibExtras.h" | 18 #include "wtf/StdLibExtras.h" |
19 #include "wtf/testing/WTFTestHelpers.h" | 19 #include "wtf/testing/WTFTestHelpers.h" |
20 #include <gtest/gtest.h> | 20 #include <gtest/gtest.h> |
21 | 21 |
22 using namespace WebCore; | 22 using namespace blink; |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 class FrameSelectionTest : public ::testing::Test { | 26 class FrameSelectionTest : 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 void setSelection(const VisibleSelection&); | 31 void setSelection(const VisibleSelection&); |
32 const FrameSelection& selection() const; | 32 const FrameSelection& selection() const; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Create a new VisibleSelection for the new document without frame and | 83 // Create a new VisibleSelection for the new document without frame and |
84 // update FrameSelection with the selection. | 84 // update FrameSelection with the selection. |
85 VisibleSelection invalidSelection; | 85 VisibleSelection invalidSelection; |
86 invalidSelection.setWithoutValidation(Position(anotherText, 0), Position(ano
therText, 5)); | 86 invalidSelection.setWithoutValidation(Position(anotherText, 0), Position(ano
therText, 5)); |
87 setSelection(invalidSelection); | 87 setSelection(invalidSelection); |
88 | 88 |
89 EXPECT_TRUE(selection().isNone()); | 89 EXPECT_TRUE(selection().isNone()); |
90 } | 90 } |
91 | 91 |
92 } | 92 } |
OLD | NEW |