Bug 1348028 - Implement fuzzPriv.enableAccessibility() in FuzzingFunctions r=smaug,surkov

This enables accessibility until the next GC, which is also how fuzzPriv worked.
This commit is contained in:
Jesse Schwartzentruber 2017-11-16 16:42:39 -05:00
parent 8b9701dd72
commit ff2729cb15
3 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,8 @@
#include "nsJSEnvironment.h"
#include "js/GCAPI.h"
#include "nsIAccessibilityService.h"
#include "xpcAccessibilityService.h"
namespace mozilla {
namespace dom {
@ -26,5 +28,18 @@ FuzzingFunctions::CycleCollect(const GlobalObject&)
nsJSContext::CycleCollectNow();
}
/* static */ void
FuzzingFunctions::EnableAccessibility(const GlobalObject&,
ErrorResult& aRv)
{
RefPtr<nsIAccessibilityService> a11y;
nsresult rv;
rv = NS_GetAccessibilityService(getter_AddRefs(a11y));
if (NS_FAILED(rv)) {
aRv.Throw(rv);
}
}
} // namespace dom
} // namespace mozilla

View File

@ -20,6 +20,9 @@ public:
static void
CycleCollect(const GlobalObject&);
static void
EnableAccessibility(const GlobalObject&, ErrorResult& aRv);
};
} // namespace dom

View File

@ -21,4 +21,10 @@ interface FuzzingFunctions {
* Synchronously perform a cycle collection.
*/
static void cycleCollect();
/**
* Enable accessibility.
*/
[Throws]
static void enableAccessibility();
};