Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 840 TestSpellCheckParagraph(text, expected); | 840 TestSpellCheckParagraph(text, expected); |
| 841 } | 841 } |
| 842 | 842 |
| 843 // We also skip RequestSpellCheck tests on Mac, because a system spellchecker | 843 // We also skip RequestSpellCheck tests on Mac, because a system spellchecker |
| 844 // is used on Mac instead of SpellCheck::RequestTextChecking. | 844 // is used on Mac instead of SpellCheck::RequestTextChecking. |
| 845 | 845 |
| 846 // Make sure RequestTextChecking does not crash if input is empty. | 846 // Make sure RequestTextChecking does not crash if input is empty. |
| 847 TEST_F(SpellCheckTest, RequestSpellCheckWithEmptyString) { | 847 TEST_F(SpellCheckTest, RequestSpellCheckWithEmptyString) { |
| 848 MockTextCheckingCompletion completion; | 848 MockTextCheckingCompletion completion; |
| 849 | 849 |
| 850 const string16 text = ASCIIToUTF16(""); | 850 const string16 text(); |
|
Ben Goodger (Google)
2012/05/04 21:21:00
text;
| |
| 851 spell_check()->RequestTextChecking(text, 0, &completion); | 851 spell_check()->RequestTextChecking(text, 0, &completion); |
| 852 | 852 |
| 853 MessageLoop::current()->RunAllPending(); | 853 MessageLoop::current()->RunAllPending(); |
| 854 | 854 |
| 855 EXPECT_EQ(completion.completion_count_, 1U); | 855 EXPECT_EQ(completion.completion_count_, 1U); |
| 856 } | 856 } |
| 857 | 857 |
| 858 // A simple test case having no misspellings. | 858 // A simple test case having no misspellings. |
| 859 TEST_F(SpellCheckTest, RequestSpellCheckWithoutMisspelling) { | 859 TEST_F(SpellCheckTest, RequestSpellCheckWithoutMisspelling) { |
| 860 MockTextCheckingCompletion completion; | 860 MockTextCheckingCompletion completion; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 InitializeSpellCheck("en-US"); | 965 InitializeSpellCheck("en-US"); |
| 966 | 966 |
| 967 // Calls PostDelayedSpellCheckTask instead of OnInit here for simplicity. | 967 // Calls PostDelayedSpellCheckTask instead of OnInit here for simplicity. |
| 968 spell_check()->PostDelayedSpellCheckTask(); | 968 spell_check()->PostDelayedSpellCheckTask(); |
| 969 MessageLoop::current()->RunAllPending(); | 969 MessageLoop::current()->RunAllPending(); |
| 970 for (int i = 0; i < 3; ++i) | 970 for (int i = 0; i < 3; ++i) |
| 971 EXPECT_EQ(completion[i].completion_count_, 1U); | 971 EXPECT_EQ(completion[i].completion_count_, 1U); |
| 972 } | 972 } |
| 973 | 973 |
| 974 #endif | 974 #endif |
| OLD | NEW |