You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2012/08/23 21:36:42 UTC

[jira] [Commented] (CB-1272) Pausing and Resuming breaks subsequent deviceready events

    [ https://issues.apache.org/jira/browse/CB-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440587#comment-13440587 ] 

Andrew Grieve commented on CB-1272:
-----------------------------------

Looks like the bug was the result of a failed refactoring :(

In:
https://github.com/apache/incubator-cordova-android/commit/b234b0bded73cf878fdc8521a337bef6b2f8fb62

the if (!keepRunning) in onPause got copy & pasted into: if (keepRunning)

And so timers were being disabled and never re-enabled.

Fix commit:
https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=commit;h=b30f5d782d2936d99f83f91806a4e134dd39b16a
                
> Pausing and Resuming breaks subsequent deviceready events
> ---------------------------------------------------------
>
>                 Key: CB-1272
>                 URL: https://issues.apache.org/jira/browse/CB-1272
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.1.0
>         Environment: Galaxy Nexus
>            Reporter: Andrew Grieve
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> Repro steps:
> 1. Run the mobile spec
> 2. Click on a sub-page link (any one)
> 3. Sleep phone
> 4. Resume phone (no waiting necessary)
> 5. Click the back button to go to the main mobile-spec page.
> 6. Notice that the device info does not get populated.
> Take away the sleep step, and I can go back and forth forever. For some reason throwing a sleep in there messes things up.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (CB-1272) Pausing and Resuming breaks subsequent deviceready events

Posted by Andrew Grieve <ag...@chromium.org>.
thanks :).

We could record the state of pauseTimers() / resumeTimers() in our WebView
subclass, and assert that it gets the correct value after handleResume /
handlePause are called. Certainly not a horrible test, but might be limited
in usefulness in that it doesn't test for onResume actually being called at
the right times...

Did you have anything else in mind for testing such things?



On Thu, Aug 23, 2012 at 3:47 PM, Joe Bowser <bo...@gmail.com> wrote:

> Good catch! How hard would it be to write an automated test to capture
> this use case.  I know it didn't actually get released, but it'd be
> good to test.
>
> On Thu, Aug 23, 2012 at 12:36 PM, Andrew Grieve (JIRA) <ji...@apache.org>
> wrote:
> >
> >     [
> https://issues.apache.org/jira/browse/CB-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440587#comment-13440587]
> >
> > Andrew Grieve commented on CB-1272:
> > -----------------------------------
> >
> > Looks like the bug was the result of a failed refactoring :(
> >
> > In:
> >
> https://github.com/apache/incubator-cordova-android/commit/b234b0bded73cf878fdc8521a337bef6b2f8fb62
> >
> > the if (!keepRunning) in onPause got copy & pasted into: if (keepRunning)
> >
> > And so timers were being disabled and never re-enabled.
> >
> > Fix commit:
> >
> https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=commit;h=b30f5d782d2936d99f83f91806a4e134dd39b16a
> >
> >> Pausing and Resuming breaks subsequent deviceready events
> >> ---------------------------------------------------------
> >>
> >>                 Key: CB-1272
> >>                 URL: https://issues.apache.org/jira/browse/CB-1272
> >>             Project: Apache Cordova
> >>          Issue Type: Bug
> >>          Components: Android
> >>    Affects Versions: 2.1.0
> >>         Environment: Galaxy Nexus
> >>            Reporter: Andrew Grieve
> >>            Assignee: Andrew Grieve
> >>             Fix For: 2.1.0
> >>
> >>
> >> Repro steps:
> >> 1. Run the mobile spec
> >> 2. Click on a sub-page link (any one)
> >> 3. Sleep phone
> >> 4. Resume phone (no waiting necessary)
> >> 5. Click the back button to go to the main mobile-spec page.
> >> 6. Notice that the device info does not get populated.
> >> Take away the sleep step, and I can go back and forth forever. For some
> reason throwing a sleep in there messes things up.
> >
> > --
> > This message is automatically generated by JIRA.
> > If you think it was sent incorrectly, please contact your JIRA
> administrators:
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> > For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >
> >
>

Re: [jira] [Commented] (CB-1272) Pausing and Resuming breaks subsequent deviceready events

Posted by Joe Bowser <bo...@gmail.com>.
Good catch! How hard would it be to write an automated test to capture
this use case.  I know it didn't actually get released, but it'd be
good to test.

On Thu, Aug 23, 2012 at 12:36 PM, Andrew Grieve (JIRA) <ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/CB-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440587#comment-13440587 ]
>
> Andrew Grieve commented on CB-1272:
> -----------------------------------
>
> Looks like the bug was the result of a failed refactoring :(
>
> In:
> https://github.com/apache/incubator-cordova-android/commit/b234b0bded73cf878fdc8521a337bef6b2f8fb62
>
> the if (!keepRunning) in onPause got copy & pasted into: if (keepRunning)
>
> And so timers were being disabled and never re-enabled.
>
> Fix commit:
> https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=commit;h=b30f5d782d2936d99f83f91806a4e134dd39b16a
>
>> Pausing and Resuming breaks subsequent deviceready events
>> ---------------------------------------------------------
>>
>>                 Key: CB-1272
>>                 URL: https://issues.apache.org/jira/browse/CB-1272
>>             Project: Apache Cordova
>>          Issue Type: Bug
>>          Components: Android
>>    Affects Versions: 2.1.0
>>         Environment: Galaxy Nexus
>>            Reporter: Andrew Grieve
>>            Assignee: Andrew Grieve
>>             Fix For: 2.1.0
>>
>>
>> Repro steps:
>> 1. Run the mobile spec
>> 2. Click on a sub-page link (any one)
>> 3. Sleep phone
>> 4. Resume phone (no waiting necessary)
>> 5. Click the back button to go to the main mobile-spec page.
>> 6. Notice that the device info does not get populated.
>> Take away the sleep step, and I can go back and forth forever. For some reason throwing a sleep in there messes things up.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>