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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler_unittest.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h" 5 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include <memory>
8
8 #include "base/values.h" 9 #include "base/values.h"
9 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" 10 #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
10 #include "chrome/browser/ui/webui/chromeos/login/l10n_util_test_util.h" 11 #include "chrome/browser/ui/webui/chromeos/login/l10n_util_test_util.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 namespace options { 15 namespace options {
15 16
16 class CrosLanguageOptionsHandlerTest : public testing::Test { 17 class CrosLanguageOptionsHandlerTest : public testing::Test {
17 public: 18 public:
(...skipping 12 matching lines...) Expand all
30 input_manager_->AddInputMethod("xkb:fr::fra", "fr", "fr"); 31 input_manager_->AddInputMethod("xkb:fr::fra", "fr", "fr");
31 input_manager_->AddInputMethod("xkb:be::fra", "be", "fr"); 32 input_manager_->AddInputMethod("xkb:be::fra", "be", "fr");
32 input_manager_->AddInputMethod("xkb:is::ice", "is", "is"); 33 input_manager_->AddInputMethod("xkb:is::ice", "is", "is");
33 } 34 }
34 35
35 private: 36 private:
36 MockInputMethodManagerWithInputMethods* input_manager_; 37 MockInputMethodManagerWithInputMethods* input_manager_;
37 }; 38 };
38 39
39 TEST_F(CrosLanguageOptionsHandlerTest, GetInputMethodList) { 40 TEST_F(CrosLanguageOptionsHandlerTest, GetInputMethodList) {
40 scoped_ptr<base::ListValue> list( 41 std::unique_ptr<base::ListValue> list(
41 CrosLanguageOptionsHandler::GetInputMethodList()); 42 CrosLanguageOptionsHandler::GetInputMethodList());
42 ASSERT_EQ(4U, list->GetSize()); 43 ASSERT_EQ(4U, list->GetSize());
43 44
44 base::DictionaryValue* entry = NULL; 45 base::DictionaryValue* entry = NULL;
45 base::DictionaryValue *language_code_set = NULL; 46 base::DictionaryValue *language_code_set = NULL;
46 std::string input_method_id; 47 std::string input_method_id;
47 std::string display_name; 48 std::string display_name;
48 std::string language_code; 49 std::string language_code;
49 50
50 // As shown below, the list should be input method ids should appear in 51 // As shown below, the list should be input method ids should appear in
51 // the same order of the descriptors. 52 // the same order of the descriptors.
(...skipping 30 matching lines...) Expand all
82 ASSERT_TRUE(entry->GetString("displayName", &display_name)); 83 ASSERT_TRUE(entry->GetString("displayName", &display_name));
83 ASSERT_TRUE(entry->GetDictionary("languageCodeSet", &language_code_set)); 84 ASSERT_TRUE(entry->GetDictionary("languageCodeSet", &language_code_set));
84 EXPECT_EQ("xkb:is::ice", input_method_id); 85 EXPECT_EQ("xkb:is::ice", input_method_id);
85 // Commented out. See above. 86 // Commented out. See above.
86 // EXPECT_EQ("Japanese input method (for US keyboard)", display_name); 87 // EXPECT_EQ("Japanese input method (for US keyboard)", display_name);
87 ASSERT_TRUE(language_code_set->HasKey("is")); 88 ASSERT_TRUE(language_code_set->HasKey("is"));
88 } 89 }
89 90
90 } // namespace options 91 } // namespace options
91 } // namespace chromeos 92 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698