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

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

Issue 2765133002: [WIP] Add DocumentMarkerController::addGrammarMarker() and addSpellingMarker() (Closed)
Patch Set: Respond to comments Created 3 years, 8 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/core/testing/Internals.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 /* 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 6579 matching lines...) Expand 10 before | Expand all | Expand 10 after
6590 document->frame() 6590 document->frame()
6591 ->spellChecker() 6591 ->spellChecker()
6592 .idleSpellCheckCallback() 6592 .idleSpellCheckCallback()
6593 .forceInvocationForTesting(); 6593 .forceInvocationForTesting();
6594 } 6594 }
6595 6595
6596 document->updateStyleAndLayout(); 6596 document->updateStyleAndLayout();
6597 6597
6598 EXPECT_FALSE(exceptionState.hadException()); 6598 EXPECT_FALSE(exceptionState.hadException());
6599 auto range = EphemeralRange::rangeOfContents(*element); 6599 auto range = EphemeralRange::rangeOfContents(*element);
6600 document->markers().addMarker(range.startPosition(), range.endPosition(), 6600 document->markers().addSpellingMarker(range.startPosition(),
6601 DocumentMarker::Spelling); 6601 range.endPosition());
6602 document->markers().addMarker(range.startPosition(), range.endPosition(), 6602 document->markers().addGrammarMarker(range.startPosition(),
6603 DocumentMarker::Grammar); 6603 range.endPosition());
6604 EXPECT_EQ(2U, document->markers().markers().size()); 6604 EXPECT_EQ(2U, document->markers().markers().size());
6605 6605
6606 spellcheck.kickNoResults(); 6606 spellcheck.kickNoResults();
6607 EXPECT_EQ(0U, document->markers().markers().size()); 6607 EXPECT_EQ(0U, document->markers().markers().size());
6608 } 6608 }
6609 6609
6610 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) { 6610 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
6611 registerMockedHttpURLLoad("spell.html"); 6611 registerMockedHttpURLLoad("spell.html");
6612 FrameTestHelpers::WebViewHelper webViewHelper; 6612 FrameTestHelpers::WebViewHelper webViewHelper;
6613 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper); 6613 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
(...skipping 4945 matching lines...) Expand 10 before | Expand all | Expand 10 after
11559 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); 11559 EXPECT_FALSE(testSelectAll("<textarea></textarea>"));
11560 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); 11560 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>"));
11561 EXPECT_FALSE(testSelectAll("<input>")); 11561 EXPECT_FALSE(testSelectAll("<input>"));
11562 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); 11562 EXPECT_TRUE(testSelectAll("<input value='nonempty'>"));
11563 // TODO(amaralp): Empty contenteditable should not have select all enabled. 11563 // TODO(amaralp): Empty contenteditable should not have select all enabled.
11564 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); 11564 EXPECT_TRUE(testSelectAll("<div contenteditable></div>"));
11565 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); 11565 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>"));
11566 } 11566 }
11567 11567
11568 } // namespace blink 11568 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698