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 "chrome/browser/spellchecker/spellcheck_service.h" | 5 #include "chrome/browser/spellchecker/spellcheck_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
| 10 #include <tuple> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
16 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
17 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
18 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
19 #include "base/tuple.h" | |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 22 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
23 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
27 #include "chrome/common/spellcheck_common.h" | 27 #include "chrome/common/spellcheck_common.h" |
28 #include "chrome/common/spellcheck_messages.h" | 28 #include "chrome/common/spellcheck_messages.h" |
29 #include "chrome/test/base/in_process_browser_test.h" | 29 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 EXPECT_NE(nullptr, message); | 148 EXPECT_NE(nullptr, message); |
149 if (!message) | 149 if (!message) |
150 return false; | 150 return false; |
151 | 151 |
152 SpellCheckMsg_EnableSpellCheck::Param param; | 152 SpellCheckMsg_EnableSpellCheck::Param param; |
153 bool ok = SpellCheckMsg_EnableSpellCheck::Read(message, ¶m); | 153 bool ok = SpellCheckMsg_EnableSpellCheck::Read(message, ¶m); |
154 EXPECT_TRUE(ok); | 154 EXPECT_TRUE(ok); |
155 if (!ok) | 155 if (!ok) |
156 return false; | 156 return false; |
157 | 157 |
158 return base::get<0>(param); | 158 return std::get<0>(param); |
159 } | 159 } |
160 | 160 |
161 private: | 161 private: |
162 scoped_ptr<content::MockRenderProcessHost> renderer_; | 162 scoped_ptr<content::MockRenderProcessHost> renderer_; |
163 | 163 |
164 // Not owned preferences service. | 164 // Not owned preferences service. |
165 PrefService* prefs_; | 165 PrefService* prefs_; |
166 }; | 166 }; |
167 | 167 |
168 // Removing a spellcheck language from accept languages should remove it from | 168 // Removing a spellcheck language from accept languages should remove it from |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 EXPECT_TRUE(GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 368 EXPECT_TRUE(GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
369 EXPECT_EQ(2U, GetPrefs()->GetList(prefs::kSpellCheckDictionaries)->GetSize()); | 369 EXPECT_EQ(2U, GetPrefs()->GetList(prefs::kSpellCheckDictionaries)->GetSize()); |
370 std::string pref; | 370 std::string pref; |
371 ASSERT_TRUE( | 371 ASSERT_TRUE( |
372 GetPrefs()->GetList(prefs::kSpellCheckDictionaries)->GetString(0, &pref)); | 372 GetPrefs()->GetList(prefs::kSpellCheckDictionaries)->GetString(0, &pref)); |
373 EXPECT_EQ("en-US", pref); | 373 EXPECT_EQ("en-US", pref); |
374 ASSERT_TRUE( | 374 ASSERT_TRUE( |
375 GetPrefs()->GetList(prefs::kSpellCheckDictionaries)->GetString(1, &pref)); | 375 GetPrefs()->GetList(prefs::kSpellCheckDictionaries)->GetString(1, &pref)); |
376 EXPECT_EQ("fr", pref); | 376 EXPECT_EQ("fr", pref); |
377 } | 377 } |
OLD | NEW |