8d2184f7990de77345448a0f8b28db13c19bd35a
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / input_method / input_method_configuration_unittest.cc
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 "content/public/browser/browser_thread.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace chromeos {
11 namespace input_method {
12
13 TEST(InputMethodConfigurationTest, TestInitialize) {
14   InputMethodManager* manager = InputMethodManager::Get();
15   EXPECT_FALSE(manager);
16
17   Initialize(
18       content::BrowserThread::GetMessageLoopProxyForThread(
19           content::BrowserThread::UI),
20       content::BrowserThread::GetMessageLoopProxyForThread(
21           content::BrowserThread::FILE));
22   manager = InputMethodManager::Get();
23   EXPECT_TRUE(manager);
24   Shutdown();
25 }
26
27 TEST(InputMethodConfigurationTest, TestInitializeForTesting) {
28   InputMethodManager* manager = InputMethodManager::Get();
29   EXPECT_FALSE(manager);
30
31   InitializeForTesting(new MockInputMethodManager);
32   manager = InputMethodManager::Get();
33   EXPECT_TRUE(manager);
34   Shutdown();
35 }
36
37 }  // namespace input_method
38 }  // namespace chromeos