RESOLVED FIXED 62226
nrwt: support webaudio in chromium driver
https://bugs.webkit.org/show_bug.cgi?id=62226
Summary nrwt: support webaudio in chromium driver
Dirk Pranke
Reported 2011-06-07 12:20:06 PDT
nrwt: support webaudio in chromium driver
Attachments
Patch (2.57 KB, patch)
2011-06-07 12:20 PDT, Dirk Pranke
no flags
fix uninitialized variables (2.91 KB, patch)
2011-06-07 12:21 PDT, Dirk Pranke
no flags
fix bugs uncovered in testing (base64 import, encoding header) (3.05 KB, patch)
2011-06-07 16:41 PDT, Dirk Pranke
no flags
update w/ review feedback (2.88 KB, patch)
2011-06-08 17:40 PDT, Dirk Pranke
no flags
Dirk Pranke
Comment 1 2011-06-07 12:20:27 PDT
Dirk Pranke
Comment 2 2011-06-07 12:21:41 PDT
Created attachment 96282 [details] fix uninitialized variables
Dirk Pranke
Comment 3 2011-06-07 16:41:33 PDT
Created attachment 96328 [details] fix bugs uncovered in testing (base64 import, encoding header)
Tony Chang
Comment 4 2011-06-08 10:15:46 PDT
Comment on attachment 96328 [details] fix bugs uncovered in testing (base64 import, encoding header) View in context: https://bugs.webkit.org/attachment.cgi?id=96328&action=review > Tools/Scripts/webkitpy/layout_tests/port/chromium.py:530 > + if has_audio: > + audio.append(line) > + else: > + output.append(line) Is it possible to have audio and other output from the same test? If so, I guess the text output has to come first and there's an audio header in the middle? If not, seems like we don't need a separate |audio| variable.
Chris Rogers
Comment 5 2011-06-08 10:26:16 PDT
We're planning on either having text output or audio output, but not both in the same test. (In reply to comment #4) > (From update of attachment 96328 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=96328&action=review > > > Tools/Scripts/webkitpy/layout_tests/port/chromium.py:530 > > + if has_audio: > > + audio.append(line) > > + else: > > + output.append(line) > > Is it possible to have audio and other output from the same test? If so, I guess the text output has to come first and there's an audio header in the middle? If not, seems like we don't need a separate |audio| variable.
Dirk Pranke
Comment 6 2011-06-08 13:27:50 PDT
(In reply to comment #4) > (From update of attachment 96328 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=96328&action=review > > > Tools/Scripts/webkitpy/layout_tests/port/chromium.py:530 > > + if has_audio: > > + audio.append(line) > > + else: > > + output.append(line) > > Is it possible to have audio and other output from the same test? If so, I guess the text output has to come first and there's an audio header in the middle? If not, seems like we don't need a separate |audio| variable. As Chris noted, we can't have both audio and text output. So, we could reuse the output variable, but we'd have to have a branch later in the function to make sure that the output is passed to the audio= param of the DriverOutput constructor instead of the text= param. I thought having a single constructor call in the end was better, but it might help to rename output to 'text' or something like that to make it clear(er) that that variable was only ever used for a single type of output as well. WDYT?
Tony Chang
Comment 7 2011-06-08 13:43:08 PDT
Comment on attachment 96328 [details] fix bugs uncovered in testing (base64 import, encoding header) View in context: https://bugs.webkit.org/attachment.cgi?id=96328&action=review >>>> Tools/Scripts/webkitpy/layout_tests/port/chromium.py:530 >>>> + output.append(line) >>> >>> Is it possible to have audio and other output from the same test? If so, I guess the text output has to come first and there's an audio header in the middle? If not, seems like we don't need a separate |audio| variable. >> >> > > As Chris noted, we can't have both audio and text output. So, we could reuse the output variable, but we'd have to have a branch later in the function to make sure that the output is passed to the audio= param of the DriverOutput constructor instead of the text= param. > > I thought having a single constructor call in the end was better, but it might help to rename output to 'text' or something like that to make it clear(er) that that variable was only ever used for a single type of output as well. > > WDYT? I think using audio_bytes is fine. You can still do that. Something like: audio_bytes = None if has_audio: if has_base64: audio_bytes = base64.b64decode(''.join(output)) else: audio_bytes = ''.join(output) else: text = ''.join(output) if not text: text = None return base.DriverOutput(text, output_image, actual_checksum, audio=audio_bytes, crash=crash, test_time=run_time, timeout=timeout, error=''.join(error))
Dirk Pranke
Comment 8 2011-06-08 13:44:57 PDT
(In reply to comment #7) > (From update of attachment 96328 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=96328&action=review > > >>>> Tools/Scripts/webkitpy/layout_tests/port/chromium.py:530 > >>>> + output.append(line) > >>> > >>> Is it possible to have audio and other output from the same test? If so, I guess the text output has to come first and there's an audio header in the middle? If not, seems like we don't need a separate |audio| variable. > >> > >> > > > > As Chris noted, we can't have both audio and text output. So, we could reuse the output variable, but we'd have to have a branch later in the function to make sure that the output is passed to the audio= param of the DriverOutput constructor instead of the text= param. > > > > I thought having a single constructor call in the end was better, but it might help to rename output to 'text' or something like that to make it clear(er) that that variable was only ever used for a single type of output as well. > > > > WDYT? > > I think using audio_bytes is fine. You can still do that. Something like: > > audio_bytes = None > if has_audio: > if has_base64: > audio_bytes = base64.b64decode(''.join(output)) > else: > audio_bytes = ''.join(output) > else: > text = ''.join(output) > if not text: > text = None > > return base.DriverOutput(text, output_image, actual_checksum, audio=audio_bytes, > crash=crash, test_time=run_time, timeout=timeout, error=''.join(error)) OK.
Dirk Pranke
Comment 9 2011-06-08 17:40:49 PDT
Created attachment 96515 [details] update w/ review feedback
Tony Chang
Comment 10 2011-06-09 09:50:49 PDT
Comment on attachment 96515 [details] update w/ review feedback Should we have a test case for this?
Dirk Pranke
Comment 11 2011-06-09 09:58:01 PDT
(In reply to comment #10) > (From update of attachment 96515 [details]) > Should we have a test case for this? Yeah, that would be good, but we don't quite have the right infrastructure to run the tests cleanly. I need to update the mock_drt code and figure out how to wire it in for this sort of testing. Shouldn't be too hard and I should be able to get to it soon.
Dirk Pranke
Comment 12 2011-06-09 14:19:20 PDT
Comment on attachment 96515 [details] update w/ review feedback Clearing flags on attachment: 96515 Committed r88483: <http://trac.webkit.org/changeset/88483>
Dirk Pranke
Comment 13 2011-06-09 14:19:27 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.