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

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

Issue 1407183002: Rename ShadowRootType::OpenByDefault to ShadowRootType::V0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v1-attach-shadow
Patch Set: Created 5 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/web/WebElementTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "web/TextFinder.h" 6 #include "web/TextFinder.h"
7 7
8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 8 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/NodeList.h" 10 #include "core/dom/NodeList.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 bool wrapWithinFrame = true; 181 bool wrapWithinFrame = true;
182 WebRect* selectionRect = nullptr; 182 WebRect* selectionRect = nullptr;
183 183
184 EXPECT_FALSE(textFinder().find(identifier, searchText, findOptions, wrapWith inFrame, selectionRect)); 184 EXPECT_FALSE(textFinder().find(identifier, searchText, findOptions, wrapWith inFrame, selectionRect));
185 EXPECT_FALSE(textFinder().activeMatch()); 185 EXPECT_FALSE(textFinder().activeMatch());
186 } 186 }
187 187
188 TEST_F(TextFinderTest, FindTextInShadowDOM) 188 TEST_F(TextFinderTest, FindTextInShadowDOM)
189 { 189 {
190 document().body()->setInnerHTML("<b>FOO</b><i>foo</i>", ASSERT_NO_EXCEPTION) ; 190 document().body()->setInnerHTML("<b>FOO</b><i>foo</i>", ASSERT_NO_EXCEPTION) ;
191 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = document().body()->createShadowR ootInternal(ShadowRootType::OpenByDefault, ASSERT_NO_EXCEPTION); 191 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = document().body()->createShadowR ootInternal(ShadowRootType::V0, ASSERT_NO_EXCEPTION);
192 shadowRoot->setInnerHTML("<content select=\"i\"></content><u>Foo</u><content ></content>", ASSERT_NO_EXCEPTION); 192 shadowRoot->setInnerHTML("<content select=\"i\"></content><u>Foo</u><content ></content>", ASSERT_NO_EXCEPTION);
193 Node* textInBElement = document().body()->firstChild()->firstChild(); 193 Node* textInBElement = document().body()->firstChild()->firstChild();
194 Node* textInIElement = document().body()->lastChild()->firstChild(); 194 Node* textInIElement = document().body()->lastChild()->firstChild();
195 Node* textInUElement = shadowRoot->childNodes()->item(1)->firstChild(); 195 Node* textInUElement = shadowRoot->childNodes()->item(1)->firstChild();
196 196
197 int identifier = 0; 197 int identifier = 0;
198 WebString searchText(String("foo")); 198 WebString searchText(String("foo"));
199 WebFindOptions findOptions; // Default. 199 WebFindOptions findOptions; // Default.
200 bool wrapWithinFrame = true; 200 bool wrapWithinFrame = true;
201 WebRect* selectionRect = nullptr; 201 WebRect* selectionRect = nullptr;
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 // There will be only one iteration before timeout, because increment 504 // There will be only one iteration before timeout, because increment
505 // of the TimeProxyPlatform timer is greater than timeout threshold. 505 // of the TimeProxyPlatform timer is greater than timeout threshold.
506 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true ); 506 textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true );
507 while (textFinder().scopingInProgress()) 507 while (textFinder().scopingInProgress())
508 runPendingTasks(); 508 runPendingTasks();
509 509
510 EXPECT_EQ(4, textFinder().totalMatchCount()); 510 EXPECT_EQ(4, textFinder().totalMatchCount());
511 } 511 }
512 512
513 } // namespace blink 513 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebElementTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698