OLD | NEW |
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 6576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6587 document->frame() | 6587 document->frame() |
6588 ->spellChecker() | 6588 ->spellChecker() |
6589 .idleSpellCheckCallback() | 6589 .idleSpellCheckCallback() |
6590 .forceInvocationForTesting(); | 6590 .forceInvocationForTesting(); |
6591 } | 6591 } |
6592 | 6592 |
6593 document->updateStyleAndLayout(); | 6593 document->updateStyleAndLayout(); |
6594 | 6594 |
6595 EXPECT_FALSE(exceptionState.hadException()); | 6595 EXPECT_FALSE(exceptionState.hadException()); |
6596 auto range = EphemeralRange::rangeOfContents(*element); | 6596 auto range = EphemeralRange::rangeOfContents(*element); |
6597 document->markers().addMarker(range.startPosition(), range.endPosition(), | 6597 document->markers().addSpellingMarker(range.startPosition(), |
6598 DocumentMarker::Spelling); | 6598 range.endPosition()); |
6599 document->markers().addMarker(range.startPosition(), range.endPosition(), | 6599 document->markers().addGrammarMarker(range.startPosition(), |
6600 DocumentMarker::Grammar); | 6600 range.endPosition()); |
6601 EXPECT_EQ(2U, document->markers().markers().size()); | 6601 EXPECT_EQ(2U, document->markers().markers().size()); |
6602 | 6602 |
6603 spellcheck.kickNoResults(); | 6603 spellcheck.kickNoResults(); |
6604 EXPECT_EQ(0U, document->markers().markers().size()); | 6604 EXPECT_EQ(0U, document->markers().markers().size()); |
6605 } | 6605 } |
6606 | 6606 |
6607 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) { | 6607 TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) { |
6608 registerMockedHttpURLLoad("spell.html"); | 6608 registerMockedHttpURLLoad("spell.html"); |
6609 FrameTestHelpers::WebViewHelper webViewHelper; | 6609 FrameTestHelpers::WebViewHelper webViewHelper; |
6610 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper); | 6610 initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper); |
(...skipping 4888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11499 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); | 11499 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); |
11500 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); | 11500 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); |
11501 EXPECT_FALSE(testSelectAll("<input>")); | 11501 EXPECT_FALSE(testSelectAll("<input>")); |
11502 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); | 11502 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); |
11503 // TODO(amaralp): Empty contenteditable should not have select all enabled. | 11503 // TODO(amaralp): Empty contenteditable should not have select all enabled. |
11504 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); | 11504 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); |
11505 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); | 11505 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); |
11506 } | 11506 } |
11507 | 11507 |
11508 } // namespace blink | 11508 } // namespace blink |
OLD | NEW |