src/ui/a11y/bin/a11y_manager/tests/app_unittest.cc
// Covers a couple additional edge cases around removing listeners.
Covers a couple additional edge cases around removing listeners.
Covers a couple additional edge cases around removing listeners .
TEST_F(AppUnitTest, ListenerRemoveOneByOne) {
  {
    fuchsia::settings::AccessibilitySettings settings;
    settings.set_screen_reader(true);
    settings.set_enable_magnification(true);
    mock_setui_.Set(std::move(settings), [](auto) {});
  }
  RunLoopUntilIdle();
  {
    fuchsia::settings::AccessibilitySettings settings;
    settings.set_screen_reader(false);
    settings.set_enable_magnification(true);
    mock_setui_.Set(std::move(settings), [](auto) {});
  }
  RunLoopUntilIdle();
  EXPECT_EQ(app_.state().screen_reader_enabled(), false);
  EXPECT_EQ(app_.state().magnifier_enabled(), true);
  ASSERT_TRUE(mock_pointer_event_registry_.listener());
  EXPECT_EQ(SendUnrecognizedGesture(&mock_pointer_event_registry_.listener()),
            EventHandling::REJECTED);
  {
    fuchsia::settings::AccessibilitySettings settings;
    settings.set_screen_reader(false);
    settings.set_enable_magnification(false);
    mock_setui_.Set(std::move(settings), [](auto) {});
  }
  RunLoopUntilIdle();
  EXPECT_EQ(app_.state().magnifier_enabled(), false);
  EXPECT_FALSE(mock_pointer_event_registry_.listener());
}
TEST_F ( AppUnitTest , ListenerRemoveOneByOne ) { { fuchsia :: settings :: AccessibilitySettings settings ; settings . set_screen_reader ( true ) ; settings . set_enable_magnification ( true ) ; mock_setui_ . Set ( std :: move ( settings ) , [ ] ( auto ) { } ) ; } RunLoopUntilIdle ( ) ; { fuchsia :: settings :: AccessibilitySettings settings ; settings . set_screen_reader ( false ) ; settings . set_enable_magnification ( true ) ; mock_setui_ . Set ( std :: move ( settings ) , [ ] ( auto ) { } ) ; } RunLoopUntilIdle ( ) ; EXPECT_EQ ( app_ . state ( ) . screen_reader_enabled ( ) , false ) ; EXPECT_EQ ( app_ . state ( ) . magnifier_enabled ( ) , true ) ; ASSERT_TRUE ( mock_pointer_event_registry_ . listener ( ) ) ; EXPECT_EQ ( SendUnrecognizedGesture ( & mock_pointer_event_registry_ . listener ( ) ) , EventHandling :: REJECTED ) ; { fuchsia :: settings :: AccessibilitySettings settings ; settings . set_screen_reader ( false ) ; settings . set_enable_magnification ( false ) ; mock_setui_ . Set ( std :: move ( settings ) , [ ] ( auto ) { } ) ; } RunLoopUntilIdle ( ) ; EXPECT_EQ ( app_ . state ( ) . magnifier_enabled ( ) , false ) ; EXPECT_FALSE ( mock_pointer_event_registry_ . listener ( ) ) ; }
Covers a couple additional edge cases around removing listeners.
Covers a couple additional edge cases around removing listeners .