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

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

Issue 2771603002: [WIP] Change DocumentMarkerController::add*Marker() methods to take an EphemeralRange (Closed)
Patch Set: Created 3 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 6519 matching lines...) Expand 10 before | Expand all | Expand 10 after
6530 document->frame() 6530 document->frame()
6531 ->spellChecker() 6531 ->spellChecker()
6532 .idleSpellCheckCallback() 6532 .idleSpellCheckCallback()
6533 .forceInvocationForTesting(); 6533 .forceInvocationForTesting();
6534 } 6534 }
6535 6535
6536 document->updateStyleAndLayout(); 6536 document->updateStyleAndLayout();
6537 6537
6538 EXPECT_FALSE(exceptionState.hadException()); 6538 EXPECT_FALSE(exceptionState.hadException());
6539 auto range = EphemeralRange::rangeOfContents(*element); 6539 auto range = EphemeralRange::rangeOfContents(*element);
6540 document->markers().addSpellingMarker(range.startPosition(), 6540 document->markers().addSpellingMarker(range);
6541 range.endPosition()); 6541 document->markers().addGrammarMarker(range);
6542 document->markers().addGrammarMarker(range.startPosition(),
6543 range.endPosition());
6544 EXPECT_EQ(2U, document->markers().markers().size()); 6542 EXPECT_EQ(2U, document->markers().markers().size());
6545 6543
6546 spellcheck.kickNoResults(); 6544 spellcheck.kickNoResults();
6547 EXPECT_EQ(0U, document->markers().markers().size()); 6545 EXPECT_EQ(0U, document->markers().markers().size());
6548 } 6546 }
6549 6547
6550 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) { 6548 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
6551 registerMockedHttpURLLoad("spell.html"); 6549 registerMockedHttpURLLoad("spell.html");
6552 FrameTestHelpers::WebViewHelper webViewHelper; 6550 FrameTestHelpers::WebViewHelper webViewHelper;
6553 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper); 6551 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
(...skipping 4875 matching lines...) Expand 10 before | Expand all | Expand 10 after
11429 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); 11427 EXPECT_FALSE(testSelectAll("<textarea></textarea>"));
11430 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); 11428 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>"));
11431 EXPECT_FALSE(testSelectAll("<input>")); 11429 EXPECT_FALSE(testSelectAll("<input>"));
11432 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); 11430 EXPECT_TRUE(testSelectAll("<input value='nonempty'>"));
11433 // TODO(amaralp): Empty contenteditable should not have select all enabled. 11431 // TODO(amaralp): Empty contenteditable should not have select all enabled.
11434 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); 11432 EXPECT_TRUE(testSelectAll("<div contenteditable></div>"));
11435 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); 11433 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>"));
11436 } 11434 }
11437 11435
11438 } // namespace blink 11436 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698