Home | History | Annotate | Download | only in input_method
      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
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
      6 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
      7 #include "chromeos/dbus/dbus_thread_manager.h"
      8 #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h"
      9 #include "content/public/browser/browser_thread.h"
     10 #include "testing/gtest/include/gtest/gtest.h"
     11 
     12 namespace chromeos {
     13 namespace input_method {
     14 
     15 class InputMethodConfigurationTest : public testing::Test {
     16  public:
     17   virtual void SetUp() {
     18     chromeos::DBusThreadManager::InitializeForTesting(
     19         new chromeos::MockDBusThreadManagerWithoutGMock());
     20   }
     21 
     22   virtual void TearDown() {
     23     chromeos::DBusThreadManager::Shutdown();
     24   }
     25 };
     26 
     27 TEST_F(InputMethodConfigurationTest, TestInitialize) {
     28   Initialize(
     29       content::BrowserThread::GetMessageLoopProxyForThread(
     30           content::BrowserThread::UI),
     31       content::BrowserThread::GetMessageLoopProxyForThread(
     32           content::BrowserThread::FILE));
     33   InputMethodManager* manager = InputMethodManager::Get();
     34   EXPECT_TRUE(manager);
     35   Shutdown();
     36 }
     37 
     38 TEST_F(InputMethodConfigurationTest, TestInitializeForTesting) {
     39   InitializeForTesting(new MockInputMethodManager);
     40   InputMethodManager* manager = InputMethodManager::Get();
     41   EXPECT_TRUE(manager);
     42   Shutdown();
     43 }
     44 
     45 }  // namespace input_method
     46 }  // namespace chromeos
     47