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

Unified Diff: chrome/browser/dom_ui/options/language_options_handler_unittest.cc

Issue 6296017: dom-ui settings: enable languages & spell checker settings for all platforms.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review tweak Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/options/language_options_handler_unittest.cc
===================================================================
--- chrome/browser/dom_ui/options/language_options_handler_unittest.cc (revision 71884)
+++ chrome/browser/dom_ui/options/language_options_handler_unittest.cc (working copy)
@@ -2,45 +2,45 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(csilv): This is for the move CL. Changes to make this cross-platform
-// will come in the followup CL.
-#if defined(OS_CHROMEOS)
-
#include "chrome/browser/dom_ui/options/language_options_handler.h"
#include <string>
#include "base/scoped_ptr.h"
#include "base/values.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/input_method_library.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#endif // defined(OS_CHROMEOS)
-namespace chromeos {
-
-static InputMethodDescriptors CreateInputMethodDescriptors() {
- InputMethodDescriptors descriptors;
+#if defined(OS_CHROMEOS)
+static chromeos::InputMethodDescriptors CreateInputMethodDescriptors() {
+ chromeos::InputMethodDescriptors descriptors;
descriptors.push_back(
- InputMethodDescriptor("xkb:us::eng", "USA", "us", "eng"));
+ chromeos::InputMethodDescriptor("xkb:us::eng", "USA", "us", "eng"));
descriptors.push_back(
- InputMethodDescriptor("xkb:fr::fra", "France", "fr", "fra"));
+ chromeos::InputMethodDescriptor("xkb:fr::fra", "France", "fr", "fra"));
descriptors.push_back(
- InputMethodDescriptor("xkb:be::fra", "Belgium", "be", "fr"));
+ chromeos::InputMethodDescriptor("xkb:be::fra", "Belgium", "be", "fr"));
descriptors.push_back(
- InputMethodDescriptor("mozc", "Mozc (US keyboard layout)", "us", "ja"));
+ chromeos::InputMethodDescriptor("mozc", "Mozc (US keyboard layout)", "us",
+ "ja"));
return descriptors;
}
TEST(LanguageOptionsHandlerTest, GetInputMethodList) {
// Use the stub libcros. The object will take care of the cleanup.
- ScopedStubCrosEnabler stub_cros_enabler;
+ chromeos::ScopedStubCrosEnabler stub_cros_enabler;
// Reset the library implementation so it will be initialized
// again. Otherwise, non-stub implementation can be reused, if it's
// already initialized elsewhere, which results in a crash.
- CrosLibrary::Get()->GetTestApi()->SetInputMethodLibrary(NULL, false);
+ chromeos::CrosLibrary::Get()->GetTestApi()->SetInputMethodLibrary(NULL,
+ false);
- InputMethodDescriptors descriptors = CreateInputMethodDescriptors();
+ chromeos::InputMethodDescriptors descriptors = CreateInputMethodDescriptors();
scoped_ptr<ListValue> list(
LanguageOptionsHandler::GetInputMethodList(descriptors));
ASSERT_EQ(4U, list->GetSize());
@@ -94,7 +94,7 @@
}
TEST(LanguageOptionsHandlerTest, GetLanguageList) {
- InputMethodDescriptors descriptors = CreateInputMethodDescriptors();
+ chromeos::InputMethodDescriptors descriptors = CreateInputMethodDescriptors();
scoped_ptr<ListValue> list(
LanguageOptionsHandler::GetLanguageList(descriptors));
ASSERT_EQ(6U, list->GetSize());
@@ -158,23 +158,21 @@
EXPECT_EQ("espa\u00F1ol (Latinoam\u00E9rica y el Caribe)",
native_display_name);
}
+#endif // defined(OS_CHROMEOS)
-TEST(LanguageOptionsHandlerTest, GetUiLanguageCodeSet) {
+#if !defined(OS_MACOSX)
+TEST(LanguageOptionsHandlerTest, GetUILanguageCodeSet) {
scoped_ptr<DictionaryValue> dictionary(
- LanguageOptionsHandler::GetUiLanguageCodeSet());
+ LanguageOptionsHandler::GetUILanguageCodeSet());
EXPECT_TRUE(dictionary->HasKey("en-US"));
// Note that we don't test a false case, as such an expectation will
// fail when we add support for the language.
// EXPECT_FALSE(dictionary->HasKey("no"));
}
+#endif // !defined(OS_MACOSX)
TEST(LanguageOptionsHandlerTest, GetSpellCheckLanguageCodeSet) {
scoped_ptr<DictionaryValue> dictionary(
LanguageOptionsHandler::GetSpellCheckLanguageCodeSet());
EXPECT_TRUE(dictionary->HasKey("en-US"));
}
-
-} // namespace chromeos
-
-#endif // OS_CHROMEOS
-
« no previous file with comments | « chrome/browser/dom_ui/options/language_options_handler.cc ('k') | chrome/browser/dom_ui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698