Apache Cordova
  1. Apache Cordova
  2. CB-2235

FileTransfer spec test failing on iOS5

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0
    • Component/s: iOS
    • Labels:
      None

      Description

      I'm seeing all tests passing on iOS 6 simulator, but 4 tests failing on iOS5 simulator.

        Activity

        Show
        Andrew Grieve added a comment - Fix commit: https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;a=commit;h=db22768362823bf6f84cbaead6c03dd1764f60b2
        Hide
        Max Woghiren added a comment -

        Turns out the "investigation" was prompted by transient connection errors. All is good; the fix is pushed; this error is resolved.

        Show
        Max Woghiren added a comment - Turns out the "investigation" was prompted by transient connection errors. All is good; the fix is pushed; this error is resolved.
        Hide
        Max Woghiren added a comment -

        Never mind—I need to investigate more.

        Show
        Max Woghiren added a comment - Never mind—I need to investigate more.
        Hide
        Max Woghiren added a comment -

        I've updated the fix. Please take a look.

        Show
        Max Woghiren added a comment - I've updated the fix . Please take a look.
        Hide
        Max Woghiren added a comment -

        I made a quick fix for this issue. I'm not certain that it's the correct approach, so please take a look.

        Show
        Max Woghiren added a comment - I made a quick fix for this issue. I'm not certain that it's the correct approach, so please take a look.
        Hide
        Max Woghiren added a comment -

        It looks like the tests are correctly failing on iOS5 and falsely passing on iOS6.

        Your tests will pass in iOS5 if you wildcard the apache subdomains (ie. *.apache.org). The failing tests are trying to access www.apache.org and foobar.apache.org, neither of which passes the whitelist regex check without a leading wildcard.

        The tests pass on iOS6 because the whitelist appears to be completely ignored. Removing the other access tags has no effect; the tests still all pass, and breakpoints in the whitelist methods are not hit when running the iOS6 emulator. The whitelist is broken on iOS6.

        Digging deeper, it looks like the reason has to do with the user agent not being set on the download request. Does this mean anything to you?

        Show
        Max Woghiren added a comment - It looks like the tests are correctly failing on iOS5 and falsely passing on iOS6. Your tests will pass in iOS5 if you wildcard the apache subdomains (ie. *.apache.org). The failing tests are trying to access www.apache.org and foobar.apache.org, neither of which passes the whitelist regex check without a leading wildcard. The tests pass on iOS6 because the whitelist appears to be completely ignored. Removing the other access tags has no effect; the tests still all pass, and breakpoints in the whitelist methods are not hit when running the iOS6 emulator. The whitelist is broken on iOS6. Digging deeper, it looks like the reason has to do with the user agent not being set on the download request. Does this mean anything to you?
        Hide
        Andrew Grieve added a comment -

        Committed your one fix:
        https://git-wip-us.apache.org/repos/asf?p=cordova-mobile-spec.git;a=commit;h=9cf7235ef0db1492944913212c9abca3fd1a25f5

        My guess is the the reason the three remaining tests are failing for me (on IOS5 but not 6) is white-list related. Here's my whitelist:
        <access origin="apache.org*"/>
        <access origin="audio.ibeat.org*"/>
        <access origin="cordova-filetransfer.jitsu.com*"/>
        <access origin="whatheaders.com*"/>

        Show
        Andrew Grieve added a comment - Committed your one fix: https://git-wip-us.apache.org/repos/asf?p=cordova-mobile-spec.git;a=commit;h=9cf7235ef0db1492944913212c9abca3fd1a25f5 My guess is the the reason the three remaining tests are failing for me (on IOS5 but not 6) is white-list related. Here's my whitelist: <access origin="apache.org*"/> <access origin="audio.ibeat.org*"/> <access origin="cordova-filetransfer.jitsu.com*"/> <access origin="whatheaders.com*"/>
        Hide
        Max Woghiren added a comment - - edited

        I only see one failing test: download was failing when trying to do so using file://. The test downloads the window's html file, but on the simulator, part of that URL has spaces (Application Support/iPhone Simulator). This causes a failure, since [NSURL urlWithString:] returns nil when the string has a space.

        On iOS6, the spaces are automatically encoded, so it didn't fail. I changed the test, replacing the spaces after retrieving the URL. The pull request is here.

        Andrew, check it out and make sure it works. Again, I didn't see four failing tests so this might not resolve all the ones you were seeing.

        Show
        Max Woghiren added a comment - - edited I only see one failing test: download was failing when trying to do so using file:// . The test downloads the window's html file, but on the simulator, part of that URL has spaces (Application Support/iPhone Simulator). This causes a failure, since [NSURL urlWithString:] returns nil when the string has a space. On iOS6, the spaces are automatically encoded, so it didn't fail. I changed the test, replacing the spaces after retrieving the URL. The pull request is here . Andrew, check it out and make sure it works. Again, I didn't see four failing tests so this might not resolve all the ones you were seeing.

          People

          • Assignee:
            Max Woghiren
            Reporter:
            Andrew Grieve
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development