Disable accessibility notifications after each test
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 17:28:55 +0000 (17:28 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 17:28:55 +0000 (17:28 +0000)
commit129655a2f04734b6b61627ce2680cae5504e918c
tree7001f54d8e6f6d189a0e9f1fa5fec0ca7c24df96
parent761ce0b2d217823c45f4f272940bd7c1707f3778
Disable accessibility notifications after each test
https://bugs.webkit.org/show_bug.cgi?id=112579

Reviewed by Tim Horton.

In WebKitTestRunner, if any tests triggered accessibility notifications,
the global notification handler would thereafter be active, and fire
notifications for all subsequent tests.

Fix by implementing AccessibilityController::resetToConsistentState() for
Mac, and using it to clear the global notification handler.

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
(WTR::AccessibilityController::addNotificationListener): Remove stupid comment.
(WTR::AccessibilityController::removeNotificationListener): Explicitly call
-stopObserving so that unregistering the observer doesn't rely on object lifetimes
(e.g. because of -autorelease).
(WTR::AccessibilityController::logAccessibilityEvents): Stub.
(WTR::AccessibilityController::resetToConsistentState): Remove the notification listener
if there is one.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.h:
Add -stopObserving
* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
(-[AccessibilityNotificationHandler dealloc]): Call -stopObserving
(-[AccessibilityNotificationHandler stopObserving]): Unregister from the notification
center.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.h
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm