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

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

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 14 matching lines...) Expand all
25 25
26 using blink::testing::runPendingTasks; 26 using blink::testing::runPendingTasks;
27 27
28 namespace blink { 28 namespace blink {
29 29
30 class TextFinderTest : public ::testing::Test { 30 class TextFinderTest : public ::testing::Test {
31 protected: 31 protected:
32 TextFinderTest() 32 TextFinderTest()
33 { 33 {
34 m_webViewHelper.initialize(); 34 m_webViewHelper.initialize();
35 WebLocalFrameImpl& frameImpl = *m_webViewHelper.webViewImpl()->mainFrame Impl(); 35 WebLocalFrameImpl& frameImpl = *m_webViewHelper.webView()->mainFrameImpl ();
36 frameImpl.viewImpl()->resize(WebSize(640, 480)); 36 frameImpl.viewImpl()->resize(WebSize(640, 480));
37 frameImpl.viewImpl()->updateAllLifecyclePhases(); 37 frameImpl.viewImpl()->updateAllLifecyclePhases();
38 m_document = static_cast<Document*>(frameImpl.document()); 38 m_document = static_cast<Document*>(frameImpl.document());
39 m_textFinder = &frameImpl.ensureTextFinder(); 39 m_textFinder = &frameImpl.ensureTextFinder();
40 } 40 }
41 41
42 Document& document() const; 42 Document& document() const;
43 TextFinder& textFinder() const; 43 TextFinder& textFinder() const;
44 44
45 static WebFloatRect findInPageRect(Node* startContainer, int startOffset, No de* endContainer, int endOffset); 45 static WebFloatRect findInPageRect(Node* startContainer, int startOffset, No de* endContainer, int endOffset);
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // There will be only one iteration before timeout, because increment 494 // There will be only one iteration before timeout, because increment
495 // of the TimeProxyPlatform timer is greater than timeout threshold. 495 // of the TimeProxyPlatform timer is greater than timeout threshold.
496 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true ); 496 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true );
497 while (textFinder().scopingInProgress()) 497 while (textFinder().scopingInProgress())
498 runPendingTasks(); 498 runPendingTasks();
499 499
500 EXPECT_EQ(4, textFinder().totalMatchCount()); 500 EXPECT_EQ(4, textFinder().totalMatchCount());
501 } 501 }
502 502
503 } // namespace blink 503 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698