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

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

Issue 7222023: Forward handling of low-mem message to the content renderer client. Add APIs to handle this case. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 6 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 18 matching lines...) Expand all
29 29
30 } // namespace 30 } // namespace
31 31
32 class SpellCheckTest : public testing::Test { 32 class SpellCheckTest : public testing::Test {
33 public: 33 public:
34 SpellCheckTest() { 34 SpellCheckTest() {
35 ReinitializeSpellCheck("en-US"); 35 ReinitializeSpellCheck("en-US");
36 } 36 }
37 37
38 void ReinitializeSpellCheck(const std::string& language) { 38 void ReinitializeSpellCheck(const std::string& language) {
39 spell_check_.reset(new SpellCheck()); 39 spell_check_.reset(new SpellCheck(NULL));
40 40
41 FilePath hunspell_directory = GetHunspellDirectory(); 41 FilePath hunspell_directory = GetHunspellDirectory();
42 EXPECT_FALSE(hunspell_directory.empty()); 42 EXPECT_FALSE(hunspell_directory.empty());
43 base::PlatformFile file = base::CreatePlatformFile( 43 base::PlatformFile file = base::CreatePlatformFile(
44 SpellCheckCommon::GetVersionedFileName(language, hunspell_directory), 44 SpellCheckCommon::GetVersionedFileName(language, hunspell_directory),
45 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL, NULL); 45 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, NULL, NULL);
46 spell_check_->Init( 46 spell_check_->Init(
47 file, std::vector<std::string>(), language); 47 file, std::vector<std::string>(), language);
48 } 48 }
49 49
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 string16 misspelled_word(UTF8ToUTF16(kTestCases[i].input)); 698 string16 misspelled_word(UTF8ToUTF16(kTestCases[i].input));
699 string16 expected_autocorrect_word( 699 string16 expected_autocorrect_word(
700 UTF8ToUTF16(kTestCases[i].expected_result)); 700 UTF8ToUTF16(kTestCases[i].expected_result));
701 string16 autocorrect_word = spell_check()->GetAutoCorrectionWord( 701 string16 autocorrect_word = spell_check()->GetAutoCorrectionWord(
702 misspelled_word, 0); 702 misspelled_word, 0);
703 703
704 // Check for spelling. 704 // Check for spelling.
705 EXPECT_EQ(expected_autocorrect_word, autocorrect_word); 705 EXPECT_EQ(expected_autocorrect_word, autocorrect_word);
706 } 706 }
707 } 707 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698