| 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 #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 <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 void BroadcastEvent(scoped_ptr<Event> event) override { ++event_count_; } | 280 void BroadcastEvent(scoped_ptr<Event> event) override { ++event_count_; } |
| 281 bool HasListener() override { return true; } | 281 bool HasListener() override { return true; } |
| 282 | 282 |
| 283 private: | 283 private: |
| 284 int event_count_; | 284 int event_count_; |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 MockEventDelegate* SetMockEventDelegate(BrailleDisplayPrivateAPI* api) { | 287 MockEventDelegate* SetMockEventDelegate(BrailleDisplayPrivateAPI* api) { |
| 288 MockEventDelegate* delegate = new MockEventDelegate(); | 288 MockEventDelegate* delegate = new MockEventDelegate(); |
| 289 api->SetEventDelegateForTest( | 289 api->SetEventDelegateForTest( |
| 290 scoped_ptr<BrailleDisplayPrivateAPI::EventDelegate>(delegate).Pass()); | 290 scoped_ptr<BrailleDisplayPrivateAPI::EventDelegate>(delegate)); |
| 291 return delegate; | 291 return delegate; |
| 292 } | 292 } |
| 293 | 293 |
| 294 void LockScreen(ScreenLockerTester* tester) { | 294 void LockScreen(ScreenLockerTester* tester) { |
| 295 ScreenLocker::Show(); | 295 ScreenLocker::Show(); |
| 296 tester->EmulateWindowManagerReady(); | 296 tester->EmulateWindowManagerReady(); |
| 297 content::WindowedNotificationObserver lock_state_observer( | 297 content::WindowedNotificationObserver lock_state_observer( |
| 298 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 298 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 299 content::NotificationService::AllSources()); | 299 content::NotificationService::AllSources()); |
| 300 if (!tester->IsLocked()) | 300 if (!tester->IsLocked()) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 DismissLockScreen(tester.get()); | 359 DismissLockScreen(tester.get()); |
| 360 signin_api.OnBrailleKeyEvent(key_event); | 360 signin_api.OnBrailleKeyEvent(key_event); |
| 361 user_api.OnBrailleKeyEvent(key_event); | 361 user_api.OnBrailleKeyEvent(key_event); |
| 362 EXPECT_EQ(1, signin_delegate->GetEventCount()); | 362 EXPECT_EQ(1, signin_delegate->GetEventCount()); |
| 363 EXPECT_EQ(2, user_delegate->GetEventCount()); | 363 EXPECT_EQ(2, user_delegate->GetEventCount()); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace braille_display_private | 366 } // namespace braille_display_private |
| 367 } // namespace api | 367 } // namespace api |
| 368 } // namespace extensions | 368 } // namespace extensions |
| OLD | NEW |