cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse <purplecabb...@gmail.com>
Subject FileTransfer tests
Date Fri, 06 Sep 2013 00:45:07 GMT
I am working through some of the failing tests for wp8 filetransfer and
have some issues with the following tests.  Can anyone add any input on
where some of the following requirements come from?

1. filetransfer.spec.7 should be able to download a file using file://
(when hosted from file://)


{code}
if (!/^file/.exec(remoteFile)) {
    expect(remoteFile).toMatch(/^file:/);
    return;
}
{/code}


This will fail on wp7, wp8, and windows8, all of which are NOT loaded from
the file:// protocol, but have their own specific file-like protocols.
( windows phone uses: x-wmapp0:, and windows 8 uses ms-appx:// )
This should not be a failure, from what I can tell.  I plan to expand the
test to include the current protocol, + specifically load something using
the file:// protocol

2. filetransfer.spec.10 should be stopped by abort() right away

{code}
expect(new Date() - startTime).toBeLessThan(300);
{/code}

Where does the 300 ms rule come from? Shouldn't this just test that aborted
downloads do not complete? and that the target file is not partially
written when aborted?

3. filetransfer.spec.27 should be able to set custom headers
{code}
options.headers = {
                    "CustomHeader1": "CustomValue1",
                    "CustomHeader2": ["CustomValue2", "CustomValue3"],
                };
{/code}

Is it required that we set headers to deeply nested object literals?
Is it required that we support non-well-formed object literals? hence the
extra ','?

4. Android test / dependency on device
{code}
var getMalformedUrl = function() {
        if (device.platform.match(/Android/i)) {
            // bad protocol causes a MalformedUrlException on Android
            return "httpssss://example.com";
        }...
{/code}

This test is dependent on cordova-plugin-device, which may not be present.
I will switch this to use a userAgent check for Android.




@purplecabbage
risingj.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message