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

Side by Side Diff: chrome/browser/spellchecker/spelling_service_client_unittest.cc

Issue 11635063: [Spellcheck] Removing the "no more suggestions from Google" line when using the spelling service (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responding to comments (browsertest, prebind) Created 7 years, 11 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 <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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 307
308 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { 308 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) {
309 client_.SetHTTPRequest(kTests[i].request_type, kTests[i].request_text, 309 client_.SetHTTPRequest(kTests[i].request_type, kTests[i].request_text,
310 kTests[i].language); 310 kTests[i].language);
311 client_.SetHTTPResponse(kTests[i].response_status, kTests[i].response_data); 311 client_.SetHTTPResponse(kTests[i].response_status, kTests[i].response_data);
312 client_.SetExpectedTextCheckResult(kTests[i].success, 312 client_.SetExpectedTextCheckResult(kTests[i].success,
313 kTests[i].corrected_text); 313 kTests[i].corrected_text);
314 pref->SetString(prefs::kSpellCheckDictionary, kTests[i].language); 314 pref->SetString(prefs::kSpellCheckDictionary, kTests[i].language);
315 client_.RequestTextCheck( 315 client_.RequestTextCheck(
316 &profile_, 316 &profile_,
317 0,
318 kTests[i].request_type, 317 kTests[i].request_type,
319 ASCIIToUTF16(kTests[i].request_text), 318 ASCIIToUTF16(kTests[i].request_text),
320 base::Bind(&SpellingServiceClientTest::OnTextCheckComplete, 319 base::Bind(&SpellingServiceClientTest::OnTextCheckComplete,
321 base::Unretained(this))); 320 base::Unretained(this), 0));
322 client_.CallOnURLFetchComplete(); 321 client_.CallOnURLFetchComplete();
323 } 322 }
324 } 323 }
325 324
326 // Verify that SpellingServiceClient::IsAvailable() returns true only when it 325 // Verify that SpellingServiceClient::IsAvailable() returns true only when it
327 // can send suggest requests or spellcheck requests. 326 // can send suggest requests or spellcheck requests.
328 TEST_F(SpellingServiceClientTest, AvailableServices) { 327 TEST_F(SpellingServiceClientTest, AvailableServices) {
329 const SpellingServiceClient::ServiceType kSuggest = 328 const SpellingServiceClient::ServiceType kSuggest =
330 SpellingServiceClient::SUGGEST; 329 SpellingServiceClient::SUGGEST;
331 const SpellingServiceClient::ServiceType kSpellcheck = 330 const SpellingServiceClient::ServiceType kSpellcheck =
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sh", "sr", "sv-SE", "tr-TR", 373 "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sh", "sr", "sv-SE", "tr-TR",
375 "uk-UA", "vi-VN", 374 "uk-UA", "vi-VN",
376 #endif 375 #endif
377 }; 376 };
378 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kUnsupported); ++i) { 377 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kUnsupported); ++i) {
379 pref->SetString(prefs::kSpellCheckDictionary, kUnsupported[i]); 378 pref->SetString(prefs::kSpellCheckDictionary, kUnsupported[i]);
380 EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest)); 379 EXPECT_TRUE(client_.IsAvailable(&profile_, kSuggest));
381 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); 380 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck));
382 } 381 }
383 } 382 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spelling_service_client.cc ('k') | chrome/browser/tab_contents/spelling_menu_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698