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

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

Issue 2918203002: cros: Fix loading user profile w/o UserSessionManager (Closed)
Patch Set: rebase Created 3 years, 6 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
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 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
11 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 12 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
12 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 13 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
13 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" 14 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h"
14 #include "chrome/browser/chromeos/profiles/profile_helper.h" 15 #include "chrome/browser/chromeos/profiles/profile_helper.h"
15 #include "chrome/browser/extensions/api/braille_display_private/braille_controll er_brlapi.h" 16 #include "chrome/browser/extensions/api/braille_display_private/braille_controll er_brlapi.h"
16 #include "chrome/browser/extensions/api/braille_display_private/braille_display_ private_api.h" 17 #include "chrome/browser/extensions/api/braille_display_private/braille_display_ private_api.h"
17 #include "chrome/browser/extensions/api/braille_display_private/brlapi_connectio n.h" 18 #include "chrome/browser/extensions/api/braille_display_private/brlapi_connectio n.h"
18 #include "chrome/browser/extensions/api/braille_display_private/stub_braille_con troller.h" 19 #include "chrome/browser/extensions/api/braille_display_private/stub_braille_con troller.h"
19 #include "chrome/browser/extensions/extension_apitest.h" 20 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 #define MAYBE_KeyEventOnLockScreen DISABLED_KeyEventOnLockScreen 330 #define MAYBE_KeyEventOnLockScreen DISABLED_KeyEventOnLockScreen
330 #else 331 #else
331 #define MAYBE_KeyEventOnLockScreen KeyEventOnLockScreen 332 #define MAYBE_KeyEventOnLockScreen KeyEventOnLockScreen
332 #endif 333 #endif
333 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateAPIUserTest, 334 IN_PROC_BROWSER_TEST_F(BrailleDisplayPrivateAPIUserTest,
334 MAYBE_KeyEventOnLockScreen) { 335 MAYBE_KeyEventOnLockScreen) {
335 std::unique_ptr<ScreenLockerTester> tester(ScreenLocker::GetTester()); 336 std::unique_ptr<ScreenLockerTester> tester(ScreenLocker::GetTester());
336 // Log in. 337 // Log in.
337 session_manager::SessionManager::Get()->CreateSession( 338 session_manager::SessionManager::Get()->CreateSession(
338 AccountId::FromUserEmail(kTestUserName), kTestUserName); 339 AccountId::FromUserEmail(kTestUserName), kTestUserName);
340 g_browser_process->profile_manager()->GetProfile(
341 ProfileHelper::Get()->GetProfilePathByUserIdHash(kTestUserName));
339 session_manager::SessionManager::Get()->SessionStarted(); 342 session_manager::SessionManager::Get()->SessionStarted();
340 Profile* profile = ProfileManager::GetActiveUserProfile(); 343 Profile* profile = ProfileManager::GetActiveUserProfile();
341 ASSERT_FALSE( 344 ASSERT_FALSE(
342 ProfileHelper::GetSigninProfile()->IsSameProfile(profile)) 345 ProfileHelper::GetSigninProfile()->IsSameProfile(profile))
343 << ProfileHelper::GetSigninProfile()->GetDebugName() << " vs. " 346 << ProfileHelper::GetSigninProfile()->GetDebugName() << " vs. "
344 << profile->GetDebugName(); 347 << profile->GetDebugName();
345 348
346 // Create API and event delegate for sign in profile. 349 // Create API and event delegate for sign in profile.
347 BrailleDisplayPrivateAPI signin_api(ProfileHelper::GetSigninProfile()); 350 BrailleDisplayPrivateAPI signin_api(ProfileHelper::GetSigninProfile());
348 MockEventDelegate* signin_delegate = SetMockEventDelegate(&signin_api); 351 MockEventDelegate* signin_delegate = SetMockEventDelegate(&signin_api);
(...skipping 22 matching lines...) Expand all
371 DismissLockScreen(tester.get()); 374 DismissLockScreen(tester.get());
372 signin_api.OnBrailleKeyEvent(key_event); 375 signin_api.OnBrailleKeyEvent(key_event);
373 user_api.OnBrailleKeyEvent(key_event); 376 user_api.OnBrailleKeyEvent(key_event);
374 EXPECT_EQ(1, signin_delegate->GetEventCount()); 377 EXPECT_EQ(1, signin_delegate->GetEventCount());
375 EXPECT_EQ(2, user_delegate->GetEventCount()); 378 EXPECT_EQ(2, user_delegate->GetEventCount());
376 } 379 }
377 380
378 } // namespace braille_display_private 381 } // namespace braille_display_private
379 } // namespace api 382 } // namespace api
380 } // namespace extensions 383 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/download/notification/download_notification_browsertest.cc ('k') | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698