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

Side by Side Diff: chrome/browser/chromeos/input_method/browser_state_monitor_unittest.cc

Issue 10968064: Move the NOTIFICATION_APP_TERMINATING notification from content to chrome, since it's fired by chro… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: cros compile Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/chromeos/input_method/browser_state_monitor.h" 5 #include "chrome/browser/chromeos/input_method/browser_state_monitor.h"
6 6
7 #include "chrome/browser/api/prefs/pref_member.h" 7 #include "chrome/browser/api/prefs/pref_member.h"
8 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" 8 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
9 #include "chrome/common/chrome_notification_types.h" 9 #include "chrome/common/chrome_notification_types.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 213 }
214 214
215 TEST(BrowserStateMonitorTest, TestObserveAppTerminating) { 215 TEST(BrowserStateMonitorTest, TestObserveAppTerminating) {
216 TestingPrefService prefs; 216 TestingPrefService prefs;
217 RegisterTestPrefs(&prefs); 217 RegisterTestPrefs(&prefs);
218 MockInputMethodManager mock_manager; 218 MockInputMethodManager mock_manager;
219 TestableBrowserStateMonitor monitor(&mock_manager); 219 TestableBrowserStateMonitor monitor(&mock_manager);
220 monitor.SetPrefServiceForTesting(&prefs); 220 monitor.SetPrefServiceForTesting(&prefs);
221 221
222 EXPECT_EQ(1, mock_manager.set_state_count_); 222 EXPECT_EQ(1, mock_manager.set_state_count_);
223 monitor.Observe(content::NOTIFICATION_APP_TERMINATING, 223 monitor.Observe(chrome::NOTIFICATION_APP_TERMINATING,
224 content::NotificationService::AllSources(), 224 content::NotificationService::AllSources(),
225 content::NotificationService::NoDetails()); 225 content::NotificationService::NoDetails());
226 226
227 // Check if the state of the |mock_manager| as well as the |monitor| are both 227 // Check if the state of the |mock_manager| as well as the |monitor| are both
228 // changed. 228 // changed.
229 EXPECT_EQ(2, mock_manager.set_state_count_); 229 EXPECT_EQ(2, mock_manager.set_state_count_);
230 EXPECT_EQ(InputMethodManager::STATE_TERMINATING, 230 EXPECT_EQ(InputMethodManager::STATE_TERMINATING,
231 mock_manager.last_state_); 231 mock_manager.last_state_);
232 EXPECT_EQ(InputMethodManager::STATE_TERMINATING, monitor.state()); 232 EXPECT_EQ(InputMethodManager::STATE_TERMINATING, monitor.state());
233 233
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 monitor.InputMethodChanged(&mock_manager, false); 383 monitor.InputMethodChanged(&mock_manager, false);
384 EXPECT_EQ(0, monitor.update_local_state_count()); 384 EXPECT_EQ(0, monitor.update_local_state_count());
385 EXPECT_EQ(5, monitor.update_user_pref_count()); 385 EXPECT_EQ(5, monitor.update_user_pref_count());
386 EXPECT_EQ(input_method_id_3, monitor.last_user_pref()); 386 EXPECT_EQ(input_method_id_3, monitor.last_user_pref());
387 EXPECT_EQ(input_method_id_2, previous.GetValue()); 387 EXPECT_EQ(input_method_id_2, previous.GetValue());
388 EXPECT_EQ(input_method_id_3, current.GetValue()); 388 EXPECT_EQ(input_method_id_3, current.GetValue());
389 } 389 }
390 390
391 } // namespace input_method 391 } // namespace input_method
392 } // namespace chromeos 392 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/browser_state_monitor.cc ('k') | chrome/browser/chromeos/power/power_button_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698