OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 8 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
9 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h" | 9 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 virtual ~ModeIndicatorBrowserTest() {} | 95 virtual ~ModeIndicatorBrowserTest() {} |
96 | 96 |
97 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 97 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
98 ui::SetUpInputMethodFactoryForTesting(); | 98 ui::SetUpInputMethodFactoryForTesting(); |
99 } | 99 } |
100 | 100 |
101 void InitializeIMF() { | 101 void InitializeIMF() { |
102 InputMethodManager::Get() | 102 InputMethodManager::Get() |
103 ->GetInputMethodUtil() | 103 ->GetInputMethodUtil() |
104 ->InitXkbInputMethodsForTesting(); | 104 ->InitXkbInputMethodsForTesting(); |
105 // Make sure ComponentExtensionIMEManager is initialized. | |
106 // ComponentExtensionIMEManagerImpl::InitializeAsync posts | |
107 // ReadComponentExtensionsInfo to the FILE thread for the | |
108 // initialization. If it is never initialized for some reasons, | |
109 // the test is timed out and failed. | |
110 ComponentExtensionIMEManager* ceimm = | |
111 InputMethodManager::Get()->GetComponentExtensionIMEManager(); | |
112 while (!ceimm->IsInitialized()) { | |
113 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | |
114 } | |
115 } | 105 } |
116 | 106 |
117 private: | 107 private: |
118 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorBrowserTest); | 108 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorBrowserTest); |
119 }; | 109 }; |
120 | 110 |
121 namespace { | 111 namespace { |
122 // 43 is the designed size of the inner contents. | 112 // 43 is the designed size of the inner contents. |
123 // This value corresponds with kMinSize defined in | 113 // This value corresponds with kMinSize defined in |
124 // mode_indicator_delegate_view.cc. | 114 // mode_indicator_delegate_view.cc. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // When a new mode indicator is displayed, the previous one should be | 214 // When a new mode indicator is displayed, the previous one should be |
225 // closed. | 215 // closed. |
226 content::RunAllPendingInMessageLoop(); | 216 content::RunAllPendingInMessageLoop(); |
227 EXPECT_EQ(1UL, observer.widget_list_size()); | 217 EXPECT_EQ(1UL, observer.widget_list_size()); |
228 const views::Widget* widget2 = observer.widget_list()[0]; | 218 const views::Widget* widget2 = observer.widget_list()[0]; |
229 EXPECT_NE(widget1, widget2); | 219 EXPECT_NE(widget1, widget2); |
230 } | 220 } |
231 } | 221 } |
232 } // namespace input_method | 222 } // namespace input_method |
233 } // namespace chromeos | 223 } // namespace chromeos |
OLD | NEW |