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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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) 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 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 // Check that the correct dictionary files are checked in. 1284 // Check that the correct dictionary files are checked in.
1285 TEST_F(SpellCheckTest, DictionaryFiles) { 1285 TEST_F(SpellCheckTest, DictionaryFiles) {
1286 std::vector<std::string> spellcheck_languages; 1286 std::vector<std::string> spellcheck_languages;
1287 chrome::spellcheck_common::SpellCheckLanguages(&spellcheck_languages); 1287 chrome::spellcheck_common::SpellCheckLanguages(&spellcheck_languages);
1288 EXPECT_FALSE(spellcheck_languages.empty()); 1288 EXPECT_FALSE(spellcheck_languages.empty());
1289 1289
1290 base::FilePath hunspell = GetHunspellDirectory(); 1290 base::FilePath hunspell = GetHunspellDirectory();
1291 for (size_t i = 0; i < spellcheck_languages.size(); ++i) { 1291 for (size_t i = 0; i < spellcheck_languages.size(); ++i) {
1292 base::FilePath dict = chrome::spellcheck_common::GetVersionedFileName( 1292 base::FilePath dict = chrome::spellcheck_common::GetVersionedFileName(
1293 spellcheck_languages[i], hunspell); 1293 spellcheck_languages[i], hunspell);
1294 EXPECT_TRUE(file_util::PathExists(dict)) << dict.value() << " not found"; 1294 EXPECT_TRUE(base::PathExists(dict)) << dict.value() << " not found";
1295 } 1295 }
1296 } 1296 }
1297 1297
1298 // TODO(groby): Add a test for hunspell itself, when MAXWORDLEN is exceeded. 1298 // TODO(groby): Add a test for hunspell itself, when MAXWORDLEN is exceeded.
1299 TEST_F(SpellCheckTest, SpellingEngine_CheckSpelling) { 1299 TEST_F(SpellCheckTest, SpellingEngine_CheckSpelling) {
1300 static const struct { 1300 static const struct {
1301 const char* word; 1301 const char* word;
1302 bool expected_result; 1302 bool expected_result;
1303 } kTestCases[] = { 1303 } kTestCases[] = {
1304 { "", true }, 1304 { "", true },
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 strlen(kTestCases[i].misspelled), 1353 strlen(kTestCases[i].misspelled),
1354 0, 1354 0,
1355 &misspelling_start, 1355 &misspelling_start,
1356 &misspelling_length, 1356 &misspelling_length,
1357 &suggestions)); 1357 &suggestions));
1358 EXPECT_GE(suggestions.size(), static_cast<size_t>(1)); 1358 EXPECT_GE(suggestions.size(), static_cast<size_t>(1));
1359 if (suggestions.size() > 0) 1359 if (suggestions.size() > 0)
1360 EXPECT_EQ(suggestions[0], ASCIIToUTF16(kTestCases[i].suggestion)); 1360 EXPECT_EQ(suggestions[0], ASCIIToUTF16(kTestCases[i].suggestion));
1361 } 1361 }
1362 } 1362 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.cc ('k') | chrome/test/automation/proxy_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698