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

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

Issue 1397713004: Don't bother layout until first navigation is done. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another attempt to fix tests Created 4 years, 9 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 13 matching lines...) Expand all
24 #include "wtf/OwnPtr.h" 24 #include "wtf/OwnPtr.h"
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 // Explicitly navigate to about:blank to avoid operating on
35 // initial empty document.
36 m_webViewHelper.initializeAndLoad("about:blank");
37
35 WebLocalFrameImpl& frameImpl = *m_webViewHelper.webViewImpl()->mainFrame Impl(); 38 WebLocalFrameImpl& frameImpl = *m_webViewHelper.webViewImpl()->mainFrame Impl();
36 frameImpl.viewImpl()->resize(WebSize(640, 480)); 39 frameImpl.viewImpl()->resize(WebSize(640, 480));
37 frameImpl.viewImpl()->updateAllLifecyclePhases(); 40 frameImpl.viewImpl()->updateAllLifecyclePhases();
38 m_document = PassRefPtrWillBeRawPtr<Document>(frameImpl.document()); 41 m_document = PassRefPtrWillBeRawPtr<Document>(frameImpl.document());
39 m_textFinder = &frameImpl.ensureTextFinder(); 42 m_textFinder = &frameImpl.ensureTextFinder();
40 } 43 }
41 44
42 Document& document() const; 45 Document& document() const;
43 TextFinder& textFinder() const; 46 TextFinder& textFinder() const;
44 47
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // There will be only one iteration before timeout, because increment 497 // There will be only one iteration before timeout, because increment
495 // of the TimeProxyPlatform timer is greater than timeout threshold. 498 // of the TimeProxyPlatform timer is greater than timeout threshold.
496 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true ); 499 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true );
497 while (textFinder().scopingInProgress()) 500 while (textFinder().scopingInProgress())
498 runPendingTasks(); 501 runPendingTasks();
499 502
500 EXPECT_EQ(4, textFinder().totalMatchCount()); 503 EXPECT_EQ(4, textFinder().totalMatchCount());
501 } 504 }
502 505
503 } // namespace blink 506 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698