Title: [88483] trunk/Tools
Revision
88483
Author
[email protected]
Date
2011-06-09 14:18:59 -0700 (Thu, 09 Jun 2011)

Log Message

2011-06-09  Dirk Pranke  <[email protected]>

        Reviewed by Tony Chang.

        nrwt: support webaudio in chromium driver
        https://bugs.webkit.org/show_bug.cgi?id=62226

        * Scripts/webkitpy/layout_tests/port/chromium.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (88482 => 88483)


--- trunk/Tools/ChangeLog	2011-06-09 21:11:47 UTC (rev 88482)
+++ trunk/Tools/ChangeLog	2011-06-09 21:18:59 UTC (rev 88483)
@@ -1,3 +1,12 @@
+2011-06-09  Dirk Pranke  <[email protected]>
+
+        Reviewed by Tony Chang.
+
+        nrwt: support webaudio in chromium driver
+        https://bugs.webkit.org/show_bug.cgi?id=62226
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
 2011-06-09  Dan Bernstein  <[email protected]>
 
         Reviewed by Anders Carlsson.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (88482 => 88483)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-06-09 21:11:47 UTC (rev 88482)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-06-09 21:18:59 UTC (rev 88483)
@@ -29,6 +29,7 @@
 
 """Chromium implementations of the Port interface."""
 
+import base64
 import errno
 import logging
 import re
@@ -478,6 +479,8 @@
         actual_checksum = None
         self._clear_output_image()
         start_time = time.time()
+        has_audio = False
+        has_base64 = False
 
         uri = self._port.filename_to_uri(driver_input.filename)
         cmd = self._test_shell_command(uri, driver_input.timeout,
@@ -515,6 +518,10 @@
             elif line.startswith("#TEST_TIMED_OUT"):
                 timeout = True
                 # Test timed out, but we still need to read until #EOF.
+            elif line.startswith("Content-Type: audio/wav"):
+                has_audio = True
+            elif line.startswith("Content-Transfer-Encoding: base64"):
+                has_base64 = True
             elif actual_uri:
                 output.append(line)
             else:
@@ -522,15 +529,22 @@
 
             (line, crash) = self._write_command_and_read_line(input=None)
 
-        # FIXME: Add support for audio when we're ready.
-
         run_time = time.time() - start_time
         output_image = self._output_image_with_retry()
-        text = ''.join(output)
-        if not text:
-            text = None
 
-        return base.DriverOutput(text, output_image, actual_checksum, audio=None,
+        audio_bytes = None
+        text = 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))
 
     def stop(self):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to