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/ui/webui/options/language_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/language_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 #if !defined(OS_MACOSX) | 13 #if !defined(OS_MACOSX) |
14 TEST(LanguageOptionsHandlerTest, GetUILanguageCodeSet) { | 14 TEST(LanguageOptionsHandlerTest, GetUILanguageCodeSet) { |
15 scoped_ptr<base::DictionaryValue> dictionary( | 15 std::unique_ptr<base::DictionaryValue> dictionary( |
16 options::LanguageOptionsHandler::GetUILanguageCodeSet()); | 16 options::LanguageOptionsHandler::GetUILanguageCodeSet()); |
17 EXPECT_TRUE(dictionary->HasKey("en-US")); | 17 EXPECT_TRUE(dictionary->HasKey("en-US")); |
18 // Note that we don't test a false case, as such an expectation will | 18 // Note that we don't test a false case, as such an expectation will |
19 // fail when we add support for the language. | 19 // fail when we add support for the language. |
20 // EXPECT_FALSE(dictionary->HasKey("no")); | 20 // EXPECT_FALSE(dictionary->HasKey("no")); |
21 } | 21 } |
22 #endif // !defined(OS_MACOSX) | 22 #endif // !defined(OS_MACOSX) |
23 | 23 |
24 TEST(LanguageOptionsHandlerTest, GetSpellCheckLanguageCodeSet) { | 24 TEST(LanguageOptionsHandlerTest, GetSpellCheckLanguageCodeSet) { |
25 scoped_ptr<base::DictionaryValue> dictionary( | 25 std::unique_ptr<base::DictionaryValue> dictionary( |
26 options::LanguageOptionsHandler::GetSpellCheckLanguageCodeSet()); | 26 options::LanguageOptionsHandler::GetSpellCheckLanguageCodeSet()); |
27 EXPECT_TRUE(dictionary->HasKey("en-US")); | 27 EXPECT_TRUE(dictionary->HasKey("en-US")); |
28 } | 28 } |
OLD | NEW |