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

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: chromeos namespace fix, part 4 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
-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,7 +158,9 @@
EXPECT_EQ("espa\u00F1ol (Latinoam\u00E9rica y el Caribe)",
native_display_name);
}
+#endif // OS_CHROMEOS
+#if !defined(OS_MACOSX)
TEST(LanguageOptionsHandlerTest, GetUiLanguageCodeSet) {
James Hawkins 2011/01/20 03:11:08 s/Ui/UI/
csilv 2011/01/20 20:09:55 Done.
scoped_ptr<DictionaryValue> dictionary(
LanguageOptionsHandler::GetUiLanguageCodeSet());
@@ -167,14 +169,10 @@
// fail when we add support for the language.
// EXPECT_FALSE(dictionary->HasKey("no"));
}
+#endif
TEST(LanguageOptionsHandlerTest, GetSpellCheckLanguageCodeSet) {
scoped_ptr<DictionaryValue> dictionary(
LanguageOptionsHandler::GetSpellCheckLanguageCodeSet());
EXPECT_TRUE(dictionary->HasKey("en-US"));
}
-
-} // namespace chromeos
-
-#endif // OS_CHROMEOS
-

Powered by Google App Engine
This is Rietveld 408576698