| 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/SurroundingText.h" | 6 #include "core/editing/SurroundingText.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" |
| 8 #include "core/dom/Position.h" | 9 #include "core/dom/Position.h" |
| 9 #include "core/dom/Range.h" | 10 #include "core/dom/Range.h" |
| 10 #include "core/dom/Text.h" | 11 #include "core/dom/Text.h" |
| 11 #include "core/editing/VisibleSelection.h" | 12 #include "core/editing/VisibleSelection.h" |
| 12 #include "core/html/HTMLElement.h" | 13 #include "core/html/HTMLElement.h" |
| 13 #include "core/testing/DummyPageHolder.h" | 14 #include "core/testing/DummyPageHolder.h" |
| 14 #include <gtest/gtest.h> | 15 #include <gtest/gtest.h> |
| 15 | 16 |
| 16 using namespace blink; | 17 using namespace blink; |
| 17 | 18 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 VisibleSelection selection = select(0, 7); | 256 VisibleSelection selection = select(0, 7); |
| 256 SurroundingText surroundingText(*selection.firstRange(), 1337); | 257 SurroundingText surroundingText(*selection.firstRange(), 1337); |
| 257 | 258 |
| 258 EXPECT_EQ("This is outside of foo bar the selected node", surroundingTex
t.content().simplifyWhiteSpace()); | 259 EXPECT_EQ("This is outside of foo bar the selected node", surroundingTex
t.content().simplifyWhiteSpace()); |
| 259 EXPECT_EQ(20u, surroundingText.startOffsetInContent()); | 260 EXPECT_EQ(20u, surroundingText.startOffsetInContent()); |
| 260 EXPECT_EQ(27u, surroundingText.endOffsetInContent()); | 261 EXPECT_EQ(27u, surroundingText.endOffsetInContent()); |
| 261 } | 262 } |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // anonymous namespace | 265 } // anonymous namespace |
| OLD | NEW |