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

Unified Diff: trunk/src/ash/ime/input_method_menu_manager_unittest.cc

Issue 167823002: Revert 251327 "Reland of: Split out InputMethodMenuManager from ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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: trunk/src/ash/ime/input_method_menu_manager_unittest.cc
===================================================================
--- trunk/src/ash/ime/input_method_menu_manager_unittest.cc (revision 251433)
+++ trunk/src/ash/ime/input_method_menu_manager_unittest.cc (working copy)
@@ -1,76 +0,0 @@
-// Copyright 2014 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 "ash/ime/input_method_menu_manager.h"
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace ash {
-namespace ime {
-
-TEST(InputMethodMenuManagerTest, TestGetSingleton) {
- EXPECT_TRUE(InputMethodMenuManager::GetInstance());
-}
-
-class MockObserver : public InputMethodMenuManager::Observer {
- public:
- MockObserver() : input_method_menu_item_changed_count_(0) {}
- virtual ~MockObserver() {}
-
- // Called when the list of menu items is changed.
- virtual void InputMethodMenuItemChanged(
- InputMethodMenuManager* manager) OVERRIDE {
- input_method_menu_item_changed_count_++;
- }
- int input_method_menu_item_changed_count_;
-};
-
-class InputMethodMenuManagerStatefulTest : public testing::Test{
- public:
- InputMethodMenuManagerStatefulTest()
- : observer_(new MockObserver()) {}
- virtual ~InputMethodMenuManagerStatefulTest() {}
- virtual void SetUp() OVERRIDE {
- menu_manager_ = InputMethodMenuManager::GetInstance();
- menu_manager_->AddObserver(observer_.get());
- }
-
- virtual void TearDown() OVERRIDE {
- menu_manager_->RemoveObserver(observer_.get());
- }
-
- InputMethodMenuManager* menu_manager_;
- scoped_ptr<MockObserver> observer_;
-};
-
-TEST_F(InputMethodMenuManagerStatefulTest, AddAndObserve) {
- EXPECT_EQ(observer_->input_method_menu_item_changed_count_, 0);
- menu_manager_->SetCurrentInputMethodMenuItemList(InputMethodMenuItemList());
- EXPECT_EQ(observer_->input_method_menu_item_changed_count_, 1);
-}
-
-TEST_F(InputMethodMenuManagerStatefulTest, AddAndCheckExists) {
- InputMethodMenuItemList list;
- list.push_back(InputMethodMenuItem("key1", "label1", false, false));
- list.push_back(InputMethodMenuItem("key2", "label2", false, false));
- menu_manager_->SetCurrentInputMethodMenuItemList(list);
- EXPECT_EQ(menu_manager_->GetCurrentInputMethodMenuItemList().size(), 2U);
- EXPECT_EQ(
- menu_manager_->GetCurrentInputMethodMenuItemList().at(0).ToString(),
- "key=key1, label=label1, "
- "is_selection_item=0, is_selection_item_checked=0");
- EXPECT_EQ(
- menu_manager_->GetCurrentInputMethodMenuItemList().at(1).ToString(),
- "key=key2, label=label2, "
- "is_selection_item=0, is_selection_item_checked=0");
-
- EXPECT_TRUE(menu_manager_->HasInputMethodMenuItemForKey("key1"));
- EXPECT_TRUE(menu_manager_->HasInputMethodMenuItemForKey("key2"));
- EXPECT_FALSE(menu_manager_->HasInputMethodMenuItemForKey("key-not-exist"));
-}
-
-} // namespace ime
-} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698