Changeset 157691 in webkit


Ignore:
Timestamp:
Oct 19, 2013 8:15:04 PM (11 years ago)
Author:
ap@apple.com
Message:

Enable webaudio/ tests on DRT/Mac
https://bugs.webkit.org/show_bug.cgi?id=86914

Reviewed by Darin Adler.

Tools:

  • DumpRenderTree/ForwardingHeaders/runtime/ArrayBufferView.h: Copied from Source/WebCore/ForwardingHeaders/runtime/ArrayBufferView.h.
  • DumpRenderTree/ForwardingHeaders/runtime/JSArrayBufferView.h: Copied from Source/WebCore/ForwardingHeaders/runtime/JSArrayBufferView.h.
  • DumpRenderTree/ForwardingHeaders/runtime/TypedArrayInlines.h: Copied from Source/WebCore/ForwardingHeaders/runtime/TypedArrayInlines.h.

There is no way to efficiently get TypedArray buffer using API, so we need some internal headers.

  • DumpRenderTree/TestRunner.cpp:

(setAudioResultCallback):
(TestRunner::staticFunctions):

  • DumpRenderTree/TestRunner.h:

(TestRunner::audioResult):
(TestRunner::setAudioResult):
The function has a different name and argument type now, updated accordingly.
Changed buffer from std::string to std::vector<char>, because it's more idiomatic.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(dumpAudio): Updated for the new name of audioResult accessor.
(dump): Print the result in the format webkitpy currently expects.

  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::dumpAudio): fwrite the whole block at once, splitting into
chunks made no sense.

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::setAudioResult): Added a FIXME about getting off WKBundle SPI.

  • DumpRenderTree/CMakeLists.txt: Added JavaScriptCore/parser to include search list,

so that "SourceProvider.h" can be found.

LayoutTests:

  • TestExpectations: Moved webaudio/javascriptaudionode here, as garbage collection

issues with it are cross-platform.

  • platform/mac-wk2/TestExpectations: Moved out everything, as there is nothing

WK2 specific about WebAudio.

  • platform/mac/TestExpectations: WebAudio expectations here were just ignored. Replaced

with slightly updated expectations from WK2.

Location:
trunk
Files:
11 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157689 r157691  
     12013-10-19  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable webaudio/ tests on DRT/Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=86914
     5
     6        Reviewed by Darin Adler.
     7
     8        * TestExpectations: Moved webaudio/javascriptaudionode here, as garbage collection
     9        issues with it are cross-platform.
     10
     11        * platform/mac-wk2/TestExpectations: Moved out everything, as there is nothing
     12        WK2 specific about WebAudio.
     13
     14        * platform/mac/TestExpectations: WebAudio expectations here were just ignored. Replaced
     15        with slightly updated expectations from WK2.
     16
    1172013-10-19  Santosh Mahto  <santosh.ma@samsung.com>
    218
  • trunk/LayoutTests/TestExpectations

    r157430 r157691  
    5252webkit.org/b/112521 [ Release ] webaudio/javascriptaudionode.html [ Pass Failure ]
    5353webkit.org/b/112521 [ Debug ] webaudio/javascriptaudionode.html [ Pass Crash ]
     54webkit.org/b/120148 [ Release ] webaudio/javascriptaudionode-upmix2-8channel-input.html [ Pass Failure ]
     55webkit.org/b/120148 [ Debug ] webaudio/javascriptaudionode-upmix2-8channel-input.html [ Pass Crash ]
    5456
    5557# The test frequently times out, and is just unsuccessful at detecting incorrect behavior when it passes.
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r157246 r157691  
    331331webkit.org/b/104104 fast/overflow/scrollbar-click-retains-focus.html [ Pass ]
    332332
    333 # Flakily fails in release build, asserts in debug.
    334 webkit.org/b/120148 webaudio/javascriptaudionode-upmix2-8channel-input.html [ Pass Crash Failure ]
    335 
    336 webkit.org/b/120161 [ Lion ] webaudio/codec-tests/mp3/128kbps-44khz.html [ Failure ]
    337 
    338333webkit.org/b/121581 [ Lion ] media/video-object-fit.html [ ImageOnlyFailure ]
    339334
     
    456451editing/secure-input/reset-state-on-navigation.html [ Pass ]
    457452
    458 # WebAudio tests are supported in WK2
    459 webaudio/ [ Pass ]
    460 # Except for these
    461 webaudio/mediastreamaudiodestinationnode.html
    462 webaudio/mediastreamaudiosourcenode.html
    463 webaudio/codec-tests/vorbis/
    464 webkit.org/b/119467 webaudio/audiobuffersource-loop-points.html [ Skip ]
    465 
    466453# Asserts in WebKit1-debug only, so reenabling.
    467454compositing/geometry/fixed-position-flipped-writing-mode.html [ Pass ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r157626 r157691  
    362362compositing/rtl/rtl-iframe-fixed.html
    363363compositing/rtl/rtl-iframe-relative.html
    364 
    365 # For now, Web Audio tests are disabled
    366 # https://bugs.webkit.org/show_bug.cgi?id=86914
    367 webaudio/
    368364
    369365# ENABLE(DRAGGABLE_REGION) is disabled
     
    938934webkit.org/b/86142 ietestcenter/css3/namespaces/syntax-021.xml [ ImageOnlyFailure ]
    939935
    940 # Disable webaudio codec tests, including proprietary codecs.
    941 webkit.org/b/88794 webaudio/codec-tests
     936webaudio/mediastreamaudiodestinationnode.html [ Failure ]
     937webaudio/mediastreamaudiosourcenode.html [ Failure ]
     938webaudio/codec-tests/vorbis/ [ WontFix ]
     939webkit.org/b/119467 webaudio/audiobuffersource-loop-points.html [ Skip ]
    942940
    943941# Text Autosizing is not enabled.
  • trunk/Tools/ChangeLog

    r157687 r157691  
     12013-10-19  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Enable webaudio/ tests on DRT/Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=86914
     5
     6        Reviewed by Darin Adler.
     7
     8        * DumpRenderTree/ForwardingHeaders/runtime/ArrayBufferView.h: Copied from Source/WebCore/ForwardingHeaders/runtime/ArrayBufferView.h.
     9        * DumpRenderTree/ForwardingHeaders/runtime/JSArrayBufferView.h: Copied from Source/WebCore/ForwardingHeaders/runtime/JSArrayBufferView.h.
     10        * DumpRenderTree/ForwardingHeaders/runtime/TypedArrayInlines.h: Copied from Source/WebCore/ForwardingHeaders/runtime/TypedArrayInlines.h.
     11        There is no way to efficiently get TypedArray buffer using API, so we need some internal headers.
     12
     13        * DumpRenderTree/TestRunner.cpp:
     14        (setAudioResultCallback):
     15        (TestRunner::staticFunctions):
     16        * DumpRenderTree/TestRunner.h:
     17        (TestRunner::audioResult):
     18        (TestRunner::setAudioResult):
     19        The function has a different name and argument type now, updated accordingly.
     20        Changed buffer from std::string to std::vector<char>, because it's more idiomatic.
     21
     22        * DumpRenderTree/mac/DumpRenderTree.mm:
     23        (dumpAudio): Updated for the new name of audioResult accessor.
     24        (dump): Print the result in the format webkitpy currently expects.
     25
     26        * WebKitTestRunner/TestInvocation.cpp:
     27        (WTR::TestInvocation::dumpAudio): fwrite the whole block at once, splitting into
     28        chunks made no sense.
     29
     30        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     31        (WTR::TestRunner::setAudioResult): Added a FIXME about getting off WKBundle SPI.
     32
     33        * DumpRenderTree/CMakeLists.txt: Added JavaScriptCore/parser to include search list,
     34        so that "SourceProvider.h" can be found.
     35
    1362013-10-19  Ryosuke Niwa  <rniwa@webkit.org>
    237
  • trunk/Tools/DumpRenderTree/CMakeLists.txt

    r156538 r157691  
    5555    ${JAVASCRIPTCORE_DIR}/jit
    5656    ${JAVASCRIPTCORE_DIR}/llint
     57    ${JAVASCRIPTCORE_DIR}/parser
    5758    ${JAVASCRIPTCORE_DIR}/profiler
    5859    ${JAVASCRIPTCORE_DIR}/runtime
  • trunk/Tools/DumpRenderTree/ForwardingHeaders/runtime/ArrayBufferView.h

    r157672 r157691  
    1 #ifndef WebCore_FWD_ArrayBufferView_h
    2 #define WebCore_FWD_ArrayBufferView_h
    31#include <JavaScriptCore/ArrayBufferView.h>
    4 #endif
  • trunk/Tools/DumpRenderTree/ForwardingHeaders/runtime/JSArrayBufferView.h

    r157672 r157691  
    1 #ifndef WebCore_FWD_JSArrayBufferView_h
    2 #define WebCore_FWD_JSArrayBufferView_h
    31#include <JavaScriptCore/JSArrayBufferView.h>
    4 #endif
  • trunk/Tools/DumpRenderTree/ForwardingHeaders/runtime/TypedArrayInlines.h

    r157672 r157691  
    1 #ifndef WebCore_FWD_TypedArrayInliness_h
    2 #define WebCore_FWD_TypedArrayInliness_h
    31#include <JavaScriptCore/TypedArrayInlines.h>
    4 #endif
  • trunk/Tools/DumpRenderTree/TestRunner.cpp

    r156100 r157691  
    3333#include "WorkQueue.h"
    3434#include "WorkQueueItem.h"
     35#include <JavaScriptCore/APICast.h>
    3536#include <JavaScriptCore/JSContextRef.h>
    3637#include <JavaScriptCore/JSCTestRunnerUtils.h>
     
    3940#include <cstring>
    4041#include <locale.h>
     42#include <runtime/ArrayBufferView.h>
     43#include <runtime/JSArrayBufferView.h>
     44#include <runtime/TypedArrayInlines.h>
    4145#include <stdio.h>
    4246#include <wtf/Assertions.h>
     
    329333}
    330334
    331 static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    332 {
    333     if (argumentCount < 1)
    334         return JSValueMakeUndefined(context);
    335 
    336     JSRetainPtr<JSStringRef> encodedAudioData(Adopt, JSValueToStringCopy(context, arguments[0], exception));
    337     ASSERT(!*exception);
    338    
    339     size_t maxLength = JSStringGetMaximumUTF8CStringSize(encodedAudioData.get());
    340     auto encodedAudioDataBuffer = std::make_unique<char[]>(maxLength + 1);
    341     JSStringGetUTF8CString(encodedAudioData.get(), encodedAudioDataBuffer.get(), maxLength + 1);
    342 
    343     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    344     controller->setEncodedAudioData(encodedAudioDataBuffer.get());
     335static JSValueRef setAudioResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     336{
     337    if (argumentCount < 1)
     338        return JSValueMakeUndefined(context);
     339
     340    // FIXME (123058): Use a JSC API to get buffer contents once such is exposed.
     341    JSC::JSArrayBufferView* jsBufferView = JSC::jsDynamicCast<JSC::JSArrayBufferView*>(toJS(toJS(context), arguments[0]));
     342    ASSERT(jsBufferView);
     343    RefPtr<JSC::ArrayBufferView> bufferView = jsBufferView->impl();
     344    const char* buffer = static_cast<const char*>(bufferView->baseAddress());
     345    std::vector<char> audioData(buffer, buffer + bufferView->byteLength());
     346
     347    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     348    controller->setAudioResult(audioData);
    345349    controller->setDumpAsAudio(true);
    346    
     350
    347351    return JSValueMakeUndefined(context);
    348352}
     
    21272131        { "setAppCacheMaximumSize", setAppCacheMaximumSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    21282132        { "setApplicationCacheOriginQuota", setApplicationCacheOriginQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    2129         { "setEncodedAudioData", setEncodedAudioDataCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2133        { "setAudioResult", setAudioResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    21302134        { "setAuthenticationPassword", setAuthenticationPasswordCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    21312135        { "setAuthenticationUsername", setAuthenticationUsernameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/Tools/DumpRenderTree/TestRunner.h

    r155496 r157691  
    287287    const std::string& expectedPixelHash() const { return m_expectedPixelHash; }
    288288
    289     const std::string& encodedAudioData() const { return m_encodedAudioData; }
    290     void setEncodedAudioData(const std::string& encodedAudioData) { m_encodedAudioData = encodedAudioData; }
     289    const std::vector<char>& audioResult() const { return m_audioResult; }
     290    void setAudioResult(const std::vector<char>& audioData) { m_audioResult = audioData; }
    291291
    292292    void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
     
    419419
    420420    std::set<std::string> m_willSendRequestClearHeaders;
    421    
    422     // base64 encoded WAV audio data is stored here.
    423     std::string m_encodedAudioData;
     421
     422    std::vector<char> m_audioResult;
    424423
    425424    std::map<std::string, std::string> m_URLsToRedirect;
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r156724 r157691  
    972972static NSData *dumpAudio()
    973973{
    974     const char *encodedAudioData = gTestRunner->encodedAudioData().c_str();
    975    
    976     NSData *data = [NSData dataWithBytes:encodedAudioData length:gTestRunner->encodedAudioData().length()];
     974    const vector<char>& dataVector = gTestRunner->audioResult();
     975   
     976    NSData *data = [NSData dataWithBytes:dataVector.data() length:dataVector.size()];
    977977    return data;
    978978}
     
    12191219        printf("Content-Type: %s\n", [resultMimeType UTF8String]);
    12201220
    1221         if (gTestRunner->dumpAsAudio())
    1222             printf("Content-Transfer-Encoding: base64\n");
    1223 
    12241221        WTF::FastMallocStatistics mallocStats = WTF::fastMallocStatistics();
    12251222        printf("DumpMalloc: %li\n", mallocStats.committedVMBytes);
    12261223
     1224        if (gTestRunner->dumpAsAudio())
     1225            printf("Content-Length: %lu\n", [resultData length]);
     1226
    12271227        if (resultData) {
    12281228            fwrite([resultData bytes], 1, [resultData length], stdout);
    12291229
    1230             if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive())
     1230            if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive() && !gTestRunner->dumpAsAudio())
    12311231                dumpFrameScrollPosition(mainFrame);
    12321232
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r156100 r157691  
    379379void TestRunner::setAudioResult(JSContextRef context, JSValueRef data)
    380380{
     381    // FIXME (123058): Use a JSC API to get buffer contents once such is exposed.
    381382    WKRetainPtr<WKDataRef> audioData(AdoptWK, WKBundleCreateWKDataFromUInt8Array(InjectedBundle::shared().bundle(), context, data));
    382383    InjectedBundle::shared().setAudioResult(audioData.get());
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r156793 r157691  
    354354    printf("Content-Length: %lu\n", static_cast<unsigned long>(length));
    355355
    356     const size_t bytesToWriteInOneChunk = 1 << 15;
    357     size_t dataRemainingToWrite = length;
    358     while (dataRemainingToWrite) {
    359         size_t bytesToWriteInThisChunk = std::min(dataRemainingToWrite, bytesToWriteInOneChunk);
    360         size_t bytesWritten = fwrite(data, 1, bytesToWriteInThisChunk, stdout);
    361         if (bytesWritten != bytesToWriteInThisChunk)
    362             break;
    363         dataRemainingToWrite -= bytesWritten;
    364         data += bytesWritten;
    365     }
     356    fwrite(data, 1, length, stdout);
    366357    printf("#EOF\n");
    367358    fprintf(stderr, "#EOF\n");
Note: See TracChangeset for help on using the changeset viewer.