Bug 107251

Summary: [mac] DRT and WKTR should disable NSBeep
Product: WebKit Reporter: Tim Horton <thorton>
Component: Tools / TestsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 120652    
Bug Blocks:    
Attachments:
Description Flags
meh patch none

Description Tim Horton 2013-01-18 02:43:40 PST
We can't test NSBeep, and we don't, and it's annoying when running layout tests locally, so we should turn it off!
Comment 1 Tim Horton 2013-01-18 03:02:26 PST
Created attachment 183418 [details]
meh patch
Comment 2 Simon Fraser (smfr) 2013-01-18 08:55:50 PST
I don't think we're trying to test NSBeep. I think we get NSBeep when some actions are not handled, no? I thought we overrode some NSResponder methods in a few places to avoid beeping.
Comment 3 Tim Horton 2013-01-18 09:42:12 PST
(In reply to comment #2)
> I don't think we're trying to test NSBeep.

I was joking poorly.

> I think we get NSBeep when some actions are not handled, no? I thought we overrode some NSResponder methods in a few places to avoid beeping.

But we also call it ourselves in a bunch of places (see WebCore::systemBeep())! Those aren't prevented.
Comment 4 Tim Horton 2013-01-18 11:35:36 PST
http://trac.webkit.org/changeset/140188
Comment 5 Alexey Proskuryakov 2013-01-18 23:37:22 PST
FWIW, we use a different technique to shut up plug-ins when snapshotting, and it doesn't involve SPIs:


static void muteAudio(void)
{
    AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyProcessIsAudible, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
    UInt32 propertyData = 0;
    OSStatus result = AudioObjectSetPropertyData(kAudioObjectSystemObject, &propertyAddress, 0, 0, sizeof(UInt32), &propertyData);
    ASSERT_UNUSED(result, result == noErr);
}
Comment 6 Tim Horton 2013-01-27 18:23:59 PST
This... didn't work. It covered some cases, but not all of them. Maybe I should do Alexey's thing instead.
Comment 7 Darin Adler 2013-05-13 18:08:31 PDT
Cleared the review flag so this doesn’t show up as “reviewed but not landed”.
Comment 8 Alexey Proskuryakov 2013-09-03 15:09:08 PDT
I didn't realize that this bug was still open, so I fixed the remaining case in bug 120652 (at least some of them, but hopefully all that remained).

We probably don't want to disable all audio, as we need to test WebAudio.