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

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

Issue 1408203003: Disable insertion points in v1 shadow trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v1-youngest-shadow-root-ref
Patch Set: remove expectations 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
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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 WebVector<WebFloatRect> matchRects; 295 WebVector<WebFloatRect> matchRects;
296 textFinder().findMatchRects(matchRects); 296 textFinder().findMatchRects(matchRects);
297 ASSERT_EQ(2u, matchRects.size()); 297 ASSERT_EQ(2u, matchRects.size());
298 EXPECT_EQ(findInPageRect(textNode, 4, textNode, 10), matchRects[0]); 298 EXPECT_EQ(findInPageRect(textNode, 4, textNode, 10), matchRects[0]);
299 EXPECT_EQ(findInPageRect(textNode, 14, textNode, 20), matchRects[1]); 299 EXPECT_EQ(findInPageRect(textNode, 14, textNode, 20), matchRects[1]);
300 } 300 }
301 301
302 TEST_F(TextFinderTest, ScopeTextMatchesWithShadowDOM) 302 TEST_F(TextFinderTest, ScopeTextMatchesWithShadowDOM)
303 { 303 {
304 document().body()->setInnerHTML("<b>FOO</b><i>foo</i>", ASSERT_NO_EXCEPTION) ; 304 document().body()->setInnerHTML("<b>FOO</b><i>foo</i>", ASSERT_NO_EXCEPTION) ;
305 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = document().body()->createShadowR ootInternal(ShadowRootType::Open, ASSERT_NO_EXCEPTION); 305 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = document().body()->createShadowR ootInternal(ShadowRootType::V0, ASSERT_NO_EXCEPTION);
306 shadowRoot->setInnerHTML("<content select=\"i\"></content><u>Foo</u><content ></content>", ASSERT_NO_EXCEPTION); 306 shadowRoot->setInnerHTML("<content select=\"i\"></content><u>Foo</u><content ></content>", ASSERT_NO_EXCEPTION);
307 Node* textInBElement = document().body()->firstChild()->firstChild(); 307 Node* textInBElement = document().body()->firstChild()->firstChild();
308 Node* textInIElement = document().body()->lastChild()->firstChild(); 308 Node* textInIElement = document().body()->lastChild()->firstChild();
309 Node* textInUElement = shadowRoot->childNodes()->item(1)->firstChild(); 309 Node* textInUElement = shadowRoot->childNodes()->item(1)->firstChild();
310 310
311 int identifier = 0; 311 int identifier = 0;
312 WebString searchText(String("fOO")); 312 WebString searchText(String("fOO"));
313 WebFindOptions findOptions; // Default. 313 WebFindOptions findOptions; // Default.
314 314
315 textFinder().resetMatchCount(); 315 textFinder().resetMatchCount();
(...skipping 188 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

Powered by Google App Engine
This is Rietveld 408576698