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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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) 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 <vector> 5 #include <vector>
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" 9 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h"
10 #include "chrome/browser/spellchecker/spellcheck_factory.h" 10 #include "chrome/browser/spellchecker/spellcheck_factory.h"
(...skipping 20 matching lines...) Expand all
31 profile_(new TestingProfile()) { 31 profile_(new TestingProfile()) {
32 } 32 }
33 33
34 virtual void SetUp() OVERRIDE { 34 virtual void SetUp() OVERRIDE {
35 // Use SetTestingFactoryAndUse to force creation and initialization. 35 // Use SetTestingFactoryAndUse to force creation and initialization.
36 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( 36 SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse(
37 profile_.get(), &BuildSpellcheckService); 37 profile_.get(), &BuildSpellcheckService);
38 } 38 }
39 39
40 virtual void TearDown() OVERRIDE { 40 virtual void TearDown() OVERRIDE {
41 MessageLoop::current()->RunUntilIdle(); 41 base::MessageLoop::current()->RunUntilIdle();
42 } 42 }
43 43
44 MessageLoop message_loop_; 44 base::MessageLoop message_loop_;
45 content::TestBrowserThread ui_thread_; 45 content::TestBrowserThread ui_thread_;
46 content::TestBrowserThread file_thread_; 46 content::TestBrowserThread file_thread_;
47 47
48 scoped_ptr<TestingProfile> profile_; 48 scoped_ptr<TestingProfile> profile_;
49 }; 49 };
50 50
51 TEST_F(SpellcheckServiceTest, GetSpellCheckLanguages1) { 51 TEST_F(SpellcheckServiceTest, GetSpellCheckLanguages1) {
52 std::vector<std::string> accept_languages; 52 std::vector<std::string> accept_languages;
53 accept_languages.push_back("en"); 53 accept_languages.push_back("en");
54 accept_languages.push_back("en-US"); 54 accept_languages.push_back("en-US");
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 accept_languages.push_back("fr"); 115 accept_languages.push_back("fr");
116 accept_languages.push_back("aa"); // Will not exist. 116 accept_languages.push_back("aa"); // Will not exist.
117 std::vector<std::string> languages; 117 std::vector<std::string> languages;
118 118
119 SpellcheckService::GetSpellCheckLanguagesFromAcceptLanguages( 119 SpellcheckService::GetSpellCheckLanguagesFromAcceptLanguages(
120 accept_languages, "fr", &languages); 120 accept_languages, "fr", &languages);
121 121
122 EXPECT_EQ(1U, languages.size()); 122 EXPECT_EQ(1U, languages.size());
123 EXPECT_EQ("fr", languages[0]); 123 EXPECT_EQ("fr", languages[0]);
124 } 124 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698