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/platform/Platform.h" | 15 #include "public/platform/Platform.h" |
16 #include "public/web/WebDocument.h" | 16 #include "public/web/WebDocument.h" |
17 #include "web/FindInPageCoordinates.h" | 17 #include "web/FindInPageCoordinates.h" |
18 #include "web/WebLocalFrameImpl.h" | 18 #include "web/WebLocalFrameImpl.h" |
19 #include "web/tests/FrameTestHelpers.h" | 19 #include "web/tests/FrameTestHelpers.h" |
20 #include "wtf/OwnPtr.h" | 20 #include "wtf/OwnPtr.h" |
21 #include <gtest/gtest.h> | 21 #include <gtest/gtest.h> |
22 | 22 |
23 using namespace blink; | 23 using namespace blink; |
24 using namespace blink; | |
25 | 24 |
26 namespace { | 25 namespace { |
27 | 26 |
28 class TextFinderTest : public ::testing::Test { | 27 class TextFinderTest : public ::testing::Test { |
29 protected: | 28 protected: |
30 virtual void SetUp() OVERRIDE; | 29 virtual void SetUp() OVERRIDE; |
31 | 30 |
32 Document& document() const; | 31 Document& document() const; |
33 TextFinder& textFinder() const; | 32 TextFinder& textFinder() const; |
34 | 33 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // There will be only one iteration before timeout, because increment | 469 // There will be only one iteration before timeout, because increment |
471 // of the TimeProxyPlatform timer is greater than timeout threshold. | 470 // of the TimeProxyPlatform timer is greater than timeout threshold. |
472 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true
); | 471 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true
); |
473 while (textFinder().scopingInProgress()) | 472 while (textFinder().scopingInProgress()) |
474 FrameTestHelpers::runPendingTasks(); | 473 FrameTestHelpers::runPendingTasks(); |
475 | 474 |
476 EXPECT_EQ(4, textFinder().totalMatchCount()); | 475 EXPECT_EQ(4, textFinder().totalMatchCount()); |
477 } | 476 } |
478 | 477 |
479 } // namespace | 478 } // namespace |
OLD | NEW |