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

Side by Side Diff: chrome/browser/extensions/api/braille_display_private/braille_display_private_apitest.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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 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 #ifndef USE_BRLAPI 5 #ifndef USE_BRLAPI
6 #error This test requires brlapi. 6 #error This test requires brlapi.
7 #endif 7 #endif
8 8
9 #include <deque> 9 #include <deque>
10 10
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/profiles/profile_manager.h" 23 #include "chrome/browser/profiles/profile_manager.h"
24 #include "chrome/test/base/testing_profile.h" 24 #include "chrome/test/base/testing_profile.h"
25 #include "chromeos/chromeos_switches.h" 25 #include "chromeos/chromeos_switches.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/notification_service.h" 27 #include "content/public/browser/notification_service.h"
28 #include "content/public/test/test_utils.h" 28 #include "content/public/test/test_utils.h"
29 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
30 30
31 using chromeos::ProfileHelper; 31 using chromeos::ProfileHelper;
32 using chromeos::ScreenLocker; 32 using chromeos::ScreenLocker;
33 using chromeos::UserManager;
34 using chromeos::test::ScreenLockerTester; 33 using chromeos::test::ScreenLockerTester;
35 using content::BrowserThread; 34 using content::BrowserThread;
36 35
37 namespace extensions { 36 namespace extensions {
38 namespace api { 37 namespace api {
39 namespace braille_display_private { 38 namespace braille_display_private {
40 39
41 namespace { 40 namespace {
42 41
43 const char kTestUserName[] = "owner@invalid.domain"; 42 const char kTestUserName[] = "owner@invalid.domain";
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 protected: 319 protected:
321 virtual void DisableAccessibilityManagerBraille() OVERRIDE { 320 virtual void DisableAccessibilityManagerBraille() OVERRIDE {
322 // Let the accessibility manager behave as usual for these tests. 321 // Let the accessibility manager behave as usual for these tests.
323 } 322 }
324 }; 323 };
325 324
326 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateAPIUserTest, 325 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateAPIUserTest,
327 KeyEventOnLockScreen) { 326 KeyEventOnLockScreen) {
328 scoped_ptr<ScreenLockerTester> tester(ScreenLocker::GetTester()); 327 scoped_ptr<ScreenLockerTester> tester(ScreenLocker::GetTester());
329 // Log in. 328 // Log in.
330 UserManager::Get()->UserLoggedIn(kTestUserName, kTestUserName, true); 329 chromeos::GetUserManager()->UserLoggedIn(kTestUserName, kTestUserName, true);
331 UserManager::Get()->SessionStarted(); 330 chromeos::GetUserManager()->SessionStarted();
332 Profile* profile = ProfileManager::GetActiveUserProfile(); 331 Profile* profile = ProfileManager::GetActiveUserProfile();
333 ASSERT_FALSE( 332 ASSERT_FALSE(
334 ProfileHelper::GetSigninProfile()->IsSameProfile(profile)) 333 ProfileHelper::GetSigninProfile()->IsSameProfile(profile))
335 << ProfileHelper::GetSigninProfile()->GetDebugName() << " vs. " 334 << ProfileHelper::GetSigninProfile()->GetDebugName() << " vs. "
336 << profile->GetDebugName(); 335 << profile->GetDebugName();
337 336
338 // Create API and event delegate for sign in profile. 337 // Create API and event delegate for sign in profile.
339 BrailleDisplayPrivateAPI signin_api(ProfileHelper::GetSigninProfile()); 338 BrailleDisplayPrivateAPI signin_api(ProfileHelper::GetSigninProfile());
340 MockEventDelegate* signin_delegate = SetMockEventDelegate(&signin_api); 339 MockEventDelegate* signin_delegate = SetMockEventDelegate(&signin_api);
341 EXPECT_EQ(0, signin_delegate->GetEventCount()); 340 EXPECT_EQ(0, signin_delegate->GetEventCount());
(...skipping 21 matching lines...) Expand all
363 DismissLockScreen(tester.get()); 362 DismissLockScreen(tester.get());
364 signin_api.OnBrailleKeyEvent(key_event); 363 signin_api.OnBrailleKeyEvent(key_event);
365 user_api.OnBrailleKeyEvent(key_event); 364 user_api.OnBrailleKeyEvent(key_event);
366 EXPECT_EQ(1, signin_delegate->GetEventCount()); 365 EXPECT_EQ(1, signin_delegate->GetEventCount());
367 EXPECT_EQ(2, user_delegate->GetEventCount()); 366 EXPECT_EQ(2, user_delegate->GetEventCount());
368 } 367 }
369 368
370 } // namespace braille_display_private 369 } // namespace braille_display_private
371 } // namespace api 370 } // namespace api
372 } // namespace extensions 371 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698