| 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 | 6 |
| 7 #include "web/TextFinder.h" | 7 #include "web/TextFinder.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 9 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| 11 #include "core/dom/NodeList.h" | 11 #include "core/dom/NodeList.h" |
| 12 #include "core/dom/Range.h" | 12 #include "core/dom/Range.h" |
| 13 #include "core/dom/shadow/ShadowRoot.h" | 13 #include "core/dom/shadow/ShadowRoot.h" |
| 14 #include "core/html/HTMLElement.h" | 14 #include "core/html/HTMLElement.h" |
| 15 #include "public/web/WebDocument.h" | 15 #include "public/web/WebDocument.h" |
| 16 #include "web/FindInPageCoordinates.h" | 16 #include "web/FindInPageCoordinates.h" |
| 17 #include "web/WebLocalFrameImpl.h" | 17 #include "web/WebLocalFrameImpl.h" |
| 18 #include "web/tests/FrameTestHelpers.h" | 18 #include "web/tests/FrameTestHelpers.h" |
| 19 #include "wtf/OwnPtr.h" | 19 #include "wtf/OwnPtr.h" |
| 20 #include <gtest/gtest.h> | 20 #include <gtest/gtest.h> |
| 21 | 21 |
| 22 using namespace blink; | 22 using namespace blink; |
| 23 using namespace WebCore; | 23 using namespace blink; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class TextFinderTest : public ::testing::Test { | 27 class TextFinderTest : public ::testing::Test { |
| 28 protected: | 28 protected: |
| 29 virtual void SetUp() OVERRIDE; | 29 virtual void SetUp() OVERRIDE; |
| 30 | 30 |
| 31 Document& document() const; | 31 Document& document() const; |
| 32 TextFinder& textFinder() const; | 32 TextFinder& textFinder() const; |
| 33 | 33 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 EXPECT_EQ(3, textFinder().totalMatchCount()); | 283 EXPECT_EQ(3, textFinder().totalMatchCount()); |
| 284 WebVector<WebFloatRect> matchRects; | 284 WebVector<WebFloatRect> matchRects; |
| 285 textFinder().findMatchRects(matchRects); | 285 textFinder().findMatchRects(matchRects); |
| 286 ASSERT_EQ(3u, matchRects.size()); | 286 ASSERT_EQ(3u, matchRects.size()); |
| 287 EXPECT_EQ(findInPageRect(textInUElement, 0, textInUElement, 3), matchRects[0
]); | 287 EXPECT_EQ(findInPageRect(textInUElement, 0, textInUElement, 3), matchRects[0
]); |
| 288 EXPECT_EQ(findInPageRect(textInBElement, 0, textInBElement, 3), matchRects[1
]); | 288 EXPECT_EQ(findInPageRect(textInBElement, 0, textInBElement, 3), matchRects[1
]); |
| 289 EXPECT_EQ(findInPageRect(textInIElement, 0, textInIElement, 3), matchRects[2
]); | 289 EXPECT_EQ(findInPageRect(textInIElement, 0, textInIElement, 3), matchRects[2
]); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace | 292 } // namespace |
| OLD | NEW |