Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: third_party/WebKit/Source/web/tests/TextFinderTest.cpp

Issue 1605863002: Restart search in page when new text is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, clean-up Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "web/TextFinder.h" 5 #include "web/TextFinder.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/NodeList.h" 9 #include "core/dom/NodeList.h"
10 #include "core/dom/Range.h" 10 #include "core/dom/Range.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 { 59 {
60 return *m_textFinder; 60 return *m_textFinder;
61 } 61 }
62 62
63 WebFloatRect TextFinderTest::findInPageRect(Node* startContainer, int startOffse t, Node* endContainer, int endOffset) 63 WebFloatRect TextFinderTest::findInPageRect(Node* startContainer, int startOffse t, Node* endContainer, int endOffset)
64 { 64 {
65 RefPtrWillBeRawPtr<Range> range = Range::create(startContainer->document(), startContainer, startOffset, endContainer, endOffset); 65 RefPtrWillBeRawPtr<Range> range = Range::create(startContainer->document(), startContainer, startOffset, endContainer, endOffset);
66 return WebFloatRect(findInPageRectFromRange(range.get())); 66 return WebFloatRect(findInPageRectFromRange(range.get()));
67 } 67 }
68 68
69 TEST_F(TextFinderTest, FindTextSimple) 69 /*TEST_F(TextFinderTest, FindTextSimple)
70 { 70 {
71 document().body()->setInnerHTML("XXXXFindMeYYYYfindmeZZZZ", ASSERT_NO_EXCEPT ION); 71 document().body()->setInnerHTML("XXXXFindMeYYYYfindmeZZZZ", ASSERT_NO_EXCEPT ION);
72 Node* textNode = document().body()->firstChild(); 72 Node* textNode = document().body()->firstChild();
73 73
74 int identifier = 0; 74 int identifier = 0;
75 WebString searchText(String("FindMe")); 75 WebString searchText(String("FindMe"));
76 WebFindOptions findOptions; // Default. 76 WebFindOptions findOptions; // Default.
77 bool wrapWithinFrame = true; 77 bool wrapWithinFrame = true;
78 WebRect* selectionRect = nullptr; 78 WebRect* selectionRect = nullptr;
79 79
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 textFinder().resetMatchCount(); 453 textFinder().resetMatchCount();
454 454
455 // There will be only one iteration before timeout, because increment 455 // There will be only one iteration before timeout, because increment
456 // of the TimeProxyPlatform timer is greater than timeout threshold. 456 // of the TimeProxyPlatform timer is greater than timeout threshold.
457 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true ); 457 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true );
458 while (textFinder().scopingInProgress()) 458 while (textFinder().scopingInProgress())
459 runPendingTasks(); 459 runPendingTasks();
460 460
461 EXPECT_EQ(4, textFinder().totalMatchCount()); 461 EXPECT_EQ(4, textFinder().totalMatchCount());
462 } 462 }*/
463 463
464 } // namespace blink 464 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698