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

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

Issue 2763893002: [WIP] Clean up DocumentMarkerController API (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().addMarker(range.startPosition(), range.endPosition(), 6540 document->markers().addSpellingMarker(range.startPosition(),
6541 DocumentMarker::Spelling); 6541 range.endPosition());
6542 document->markers().addMarker(range.startPosition(), range.endPosition(), 6542 document->markers().addGrammarMarker(range.startPosition(),
6543 DocumentMarker::Grammar); 6543 range.endPosition());
6544 EXPECT_EQ(2U, document->markers().markers().size()); 6544 EXPECT_EQ(2U, document->markers().markers().size());
6545 6545
6546 spellcheck.kickNoResults(); 6546 spellcheck.kickNoResults();
6547 EXPECT_EQ(0U, document->markers().markers().size()); 6547 EXPECT_EQ(0U, document->markers().markers().size());
6548 } 6548 }
6549 6549
6550 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) { 6550 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
6551 registerMockedHttpURLLoad("spell.html"); 6551 registerMockedHttpURLLoad("spell.html");
6552 FrameTestHelpers::WebViewHelper webViewHelper; 6552 FrameTestHelpers::WebViewHelper webViewHelper;
6553 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper); 6553 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
(...skipping 4955 matching lines...) Expand 10 before | Expand all | Expand 10 after
11509 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); 11509 EXPECT_FALSE(testSelectAll("<textarea></textarea>"));
11510 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); 11510 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>"));
11511 EXPECT_FALSE(testSelectAll("<input>")); 11511 EXPECT_FALSE(testSelectAll("<input>"));
11512 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); 11512 EXPECT_TRUE(testSelectAll("<input value='nonempty'>"));
11513 // TODO(amaralp): Empty contenteditable should not have select all enabled. 11513 // TODO(amaralp): Empty contenteditable should not have select all enabled.
11514 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); 11514 EXPECT_TRUE(testSelectAll("<div contenteditable></div>"));
11515 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); 11515 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>"));
11516 } 11516 }
11517 11517
11518 } // namespace blink 11518 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698