| 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/command_line.h" | 8 #include "base/command_line.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 // A test class used for testing the SpellingServiceClient class. This class | 184 // A test class used for testing the SpellingServiceClient class. This class |
| 185 // implements a callback function used by the SpellingServiceClient class to | 185 // implements a callback function used by the SpellingServiceClient class to |
| 186 // monitor the class calls the callback with expected results. | 186 // monitor the class calls the callback with expected results. |
| 187 class SpellingServiceClientTest : public testing::Test { | 187 class SpellingServiceClientTest : public testing::Test { |
| 188 public: | 188 public: |
| 189 SpellingServiceClientTest() {} | 189 SpellingServiceClientTest() {} |
| 190 virtual ~SpellingServiceClientTest() {} | 190 virtual ~SpellingServiceClientTest() {} |
| 191 | 191 |
| 192 void SetUp() OVERRIDE { | 192 void SetUp() OVERRIDE { |
| 193 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 194 switches::kUseSpellingService); | |
| 195 } | 193 } |
| 196 | 194 |
| 197 void OnTextCheckComplete(int tag, | 195 void OnTextCheckComplete(int tag, |
| 198 bool success, | 196 bool success, |
| 199 const string16& text, | 197 const string16& text, |
| 200 const std::vector<SpellCheckResult>& results) { | 198 const std::vector<SpellCheckResult>& results) { |
| 201 client_.VerifyResponse(success, text, results); | 199 client_.VerifyResponse(success, text, results); |
| 202 } | 200 } |
| 203 | 201 |
| 204 protected: | 202 protected: |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sh", "sr", "sv-SE", "tr-TR", | 371 "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sh", "sr", "sv-SE", "tr-TR", |
| 374 "uk-UA", "vi-VN", | 372 "uk-UA", "vi-VN", |
| 375 #endif | 373 #endif |
| 376 }; | 374 }; |
| 377 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kUnsupported); ++i) { | 375 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kUnsupported); ++i) { |
| 378 pref->SetString(prefs::kSpellCheckDictionary, kUnsupported[i]); | 376 pref->SetString(prefs::kSpellCheckDictionary, kUnsupported[i]); |
| 379 EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest)); | 377 EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest)); |
| 380 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); | 378 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); |
| 381 } | 379 } |
| 382 } | 380 } |
| OLD | NEW |