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

Unified Diff: chrome/browser/chromeos/input_method/ibus_controller_unittest.cc

Issue 9701095: cleanup: Split ibus_controller.h into 5 headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 8 years, 9 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/chromeos/input_method/ibus_controller_unittest.cc
diff --git a/chrome/browser/chromeos/input_method/ibus_controller_unittest.cc b/chrome/browser/chromeos/input_method/ibus_controller_unittest.cc
deleted file mode 100644
index 76c5749350736c07a7dbe8b0b727e8dbe6c42d74..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/input_method/ibus_controller_unittest.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/input_method/ibus_controller.h"
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(USE_VIRTUAL_KEYBOARD)
-// Since USE_VIRTUAL_KEYBOARD build only supports a few keyboard layouts, we
-// skip the tests for now.
-#define TestCreateInputMethodDescriptor DISABLED_TestCreateInputMethodDescriptor
-#define TestInputMethodIdIsWhitelisted DISABLED_TestInputMethodIdIsWhitelisted
-#define TestXkbLayoutIsSupported DISABLED_TestXkbLayoutIsSupported
-#endif // USE_VIRTUAL_KEYBOARD
-
-namespace chromeos {
-namespace input_method {
-
-namespace {
-InputMethodDescriptor GetDesc(IBusController* controller,
- const std::string& raw_layout) {
- return controller->CreateInputMethodDescriptor(
- "id", "", raw_layout, "language_code");
-}
-} // namespace
-
-TEST(IBusControllerTest, TestInputMethodIdIsWhitelisted) {
- scoped_ptr<IBusController> controller(IBusController::Create());
- EXPECT_TRUE(controller->InputMethodIdIsWhitelisted("mozc"));
- EXPECT_TRUE(controller->InputMethodIdIsWhitelisted("xkb:us:dvorak:eng"));
- EXPECT_FALSE(controller->InputMethodIdIsWhitelisted("mozc,"));
- EXPECT_FALSE(controller->InputMethodIdIsWhitelisted(
- "mozc,xkb:us:dvorak:eng"));
- EXPECT_FALSE(controller->InputMethodIdIsWhitelisted("not-supported-id"));
- EXPECT_FALSE(controller->InputMethodIdIsWhitelisted(","));
- EXPECT_FALSE(controller->InputMethodIdIsWhitelisted(""));
-}
-
-TEST(IBusControllerTest, TestXkbLayoutIsSupported) {
- scoped_ptr<IBusController> controller(IBusController::Create());
- EXPECT_TRUE(controller->XkbLayoutIsSupported("us"));
- EXPECT_TRUE(controller->XkbLayoutIsSupported("us(dvorak)"));
- EXPECT_TRUE(controller->XkbLayoutIsSupported("fr"));
- EXPECT_FALSE(controller->XkbLayoutIsSupported("us,"));
- EXPECT_FALSE(controller->XkbLayoutIsSupported("us,fr"));
- EXPECT_FALSE(controller->XkbLayoutIsSupported("xkb:us:dvorak:eng"));
- EXPECT_FALSE(controller->XkbLayoutIsSupported("mozc"));
- EXPECT_FALSE(controller->XkbLayoutIsSupported(","));
- EXPECT_FALSE(controller->XkbLayoutIsSupported(""));
-}
-
-TEST(IBusControllerTest, TestCreateInputMethodDescriptor) {
- scoped_ptr<IBusController> controller(IBusController::Create());
- EXPECT_EQ("us", GetDesc(controller.get(), "us").keyboard_layout());
- EXPECT_EQ("us", GetDesc(controller.get(), "us,us(dvorak)").keyboard_layout());
- EXPECT_EQ("us(dvorak)",
- GetDesc(controller.get(), "us(dvorak),us").keyboard_layout());
-
- EXPECT_EQ("fr", GetDesc(controller.get(), "fr").keyboard_layout());
- EXPECT_EQ("fr", GetDesc(controller.get(), "fr,us(dvorak)").keyboard_layout());
- EXPECT_EQ("us(dvorak)",
- GetDesc(controller.get(), "us(dvorak),fr").keyboard_layout());
-
- EXPECT_EQ("fr",
- GetDesc(controller.get(), "not-supported,fr").keyboard_layout());
- EXPECT_EQ("fr",
- GetDesc(controller.get(), "fr,not-supported").keyboard_layout());
-
- static const char kFallbackLayout[] = "us";
- EXPECT_EQ(kFallbackLayout,
- GetDesc(controller.get(), "not-supported").keyboard_layout());
- EXPECT_EQ(kFallbackLayout, GetDesc(controller.get(), ",").keyboard_layout());
- EXPECT_EQ(kFallbackLayout, GetDesc(controller.get(), "").keyboard_layout());
-
- // TODO(yusukes): Add tests for |virtual_keyboard_layout| member.
-}
-
-} // namespace input_method
-} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/input_method/ibus_controller.cc ('k') | chrome/browser/chromeos/input_method/input_method_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698