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

Side by Side Diff: chrome/renderer/spellchecker/spellcheck_unittest.cc

Issue 10356025: chrome: Instead of doing a conversion just use string16(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avoid temp var at all Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc ('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 // 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
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 spell_check()->RequestTextChecking(string16(), 0, &completion);
851 spell_check()->RequestTextChecking(text, 0, &completion);
852 851
853 MessageLoop::current()->RunAllPending(); 852 MessageLoop::current()->RunAllPending();
854 853
855 EXPECT_EQ(completion.completion_count_, 1U); 854 EXPECT_EQ(completion.completion_count_, 1U);
856 } 855 }
857 856
858 // A simple test case having no misspellings. 857 // A simple test case having no misspellings.
859 TEST_F(SpellCheckTest, RequestSpellCheckWithoutMisspelling) { 858 TEST_F(SpellCheckTest, RequestSpellCheckWithoutMisspelling) {
860 MockTextCheckingCompletion completion; 859 MockTextCheckingCompletion completion;
861 860
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 InitializeSpellCheck("en-US"); 964 InitializeSpellCheck("en-US");
966 965
967 // Calls PostDelayedSpellCheckTask instead of OnInit here for simplicity. 966 // Calls PostDelayedSpellCheckTask instead of OnInit here for simplicity.
968 spell_check()->PostDelayedSpellCheckTask(); 967 spell_check()->PostDelayedSpellCheckTask();
969 MessageLoop::current()->RunAllPending(); 968 MessageLoop::current()->RunAllPending();
970 for (int i = 0; i < 3; ++i) 969 for (int i = 0; i < 3; ++i)
971 EXPECT_EQ(completion[i].completion_count_, 1U); 970 EXPECT_EQ(completion[i].completion_count_, 1U);
972 } 971 }
973 972
974 #endif 973 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698