Apache Cordova
  1. Apache Cordova
  2. CB-382

[iOS] Create tests for CDVLocalStorage core plugin

    Details

    • Type: Test Test
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 2.0.0
    • Component/s: iOS
    • Labels:
      None

      Description

      Can't get a delay for UIWebViewDelegate::webViewDidStartLoad before unit-tests run - postponing this

        Activity

        Hide
        Filip Maj added a comment -

        Are these native tests or JS tests?

        Show
        Filip Maj added a comment - Are these native tests or JS tests?
        Hide
        Shazron Abdullah added a comment -

        All native.

        Show
        Shazron Abdullah added a comment - All native.
        Hide
        Filip Maj added a comment -

        Awwwww shiet.

        Show
        Filip Maj added a comment - Awwwww shiet.
        Hide
        Shazron Abdullah added a comment -

        Punting

        Show
        Shazron Abdullah added a comment - Punting
        Hide
        Shazron Abdullah added a comment -

        Punting

        Show
        Shazron Abdullah added a comment - Punting
        Hide
        Shazron Abdullah added a comment -

        Punting - ran out of time for 1.9.0. Do this first for 2.0.0!

        Show
        Shazron Abdullah added a comment - Punting - ran out of time for 1.9.0. Do this first for 2.0.0!
        Hide
        Andrew Grieve added a comment -

        Some initial investigations into this reveal that using:

        while (!loaded)

        { [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; }

        Will cause the webview to finish loading. Also, a second call to it is required after executing a localStorage.setItem() in order for the file__0.localstorage file to be written to disk.

        I'll put together a unit test base class using this technique as well as some tests for CDVLocalStorage.

        Show
        Andrew Grieve added a comment - Some initial investigations into this reveal that using: while (!loaded) { [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]]; } Will cause the webview to finish loading. Also, a second call to it is required after executing a localStorage.setItem() in order for the file__0.localstorage file to be written to disk. I'll put together a unit test base class using this technique as well as some tests for CDVLocalStorage.
        Show
        Andrew Grieve added a comment - Implemented some tests: https://github.com/apache/incubator-cordova-ios/pull/26 https://github.com/apache/incubator-cordova-ios/pull/27
        Hide
        Shazron Abdullah added a comment -

        Great job on this!
        1st of 7 commits: http://markmail.org/message/g4x2nzpwdfd34i2t

        Show
        Shazron Abdullah added a comment - Great job on this! 1st of 7 commits: http://markmail.org/message/g4x2nzpwdfd34i2t

          People

          • Assignee:
            Shazron Abdullah
            Reporter:
            Shazron Abdullah
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development