| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); | 336 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); |
| 337 | 337 |
| 338 pref->SetBoolean(prefs::kEnableContinuousSpellcheck, true); | 338 pref->SetBoolean(prefs::kEnableContinuousSpellcheck, true); |
| 339 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true); | 339 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true); |
| 340 | 340 |
| 341 // For locales supported by the SpellCheck service, this function returns | 341 // For locales supported by the SpellCheck service, this function returns |
| 342 // false for suggestions and true for spellcheck. (The comment in | 342 // false for suggestions and true for spellcheck. (The comment in |
| 343 // SpellingServiceClient::IsAvailable() describes why this function returns | 343 // SpellingServiceClient::IsAvailable() describes why this function returns |
| 344 // false for suggestions.) If there is no language set, then we | 344 // false for suggestions.) If there is no language set, then we |
| 345 // do not allow any remote. | 345 // do not allow any remote. |
| 346 pref->SetString(prefs::kSpellCheckDictionary, ""); | 346 pref->SetString(prefs::kSpellCheckDictionary, std::string()); |
| 347 EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest)); | 347 EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest)); |
| 348 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); | 348 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); |
| 349 | 349 |
| 350 static const char* kSupported[] = { | 350 static const char* kSupported[] = { |
| 351 #if !defined(OS_MACOSX) | 351 #if !defined(OS_MACOSX) |
| 352 "en-AU", "en-CA", "en-GB", "en-US", | 352 "en-AU", "en-CA", "en-GB", "en-US", |
| 353 #endif | 353 #endif |
| 354 }; | 354 }; |
| 355 // If spellcheck is allowed, then suggest is not since spellcheck is a | 355 // If spellcheck is allowed, then suggest is not since spellcheck is a |
| 356 // superset of suggest. | 356 // superset of suggest. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 370 "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sh", "sr", "sv-SE", "tr-TR", | 370 "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sh", "sr", "sv-SE", "tr-TR", |
| 371 "uk-UA", "vi-VN", | 371 "uk-UA", "vi-VN", |
| 372 #endif | 372 #endif |
| 373 }; | 373 }; |
| 374 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kUnsupported); ++i) { | 374 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kUnsupported); ++i) { |
| 375 pref->SetString(prefs::kSpellCheckDictionary, kUnsupported[i]); | 375 pref->SetString(prefs::kSpellCheckDictionary, kUnsupported[i]); |
| 376 EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest)); | 376 EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest)); |
| 377 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); | 377 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); |
| 378 } | 378 } |
| 379 } | 379 } |
| OLD | NEW |