Skip to content

TESP.04-Solution-AddIdlingResourceMenuActivityTest #26

@HasanElHefnawy

Description

@HasanElHefnawy

In TESP.04-Solution-AddIdlingResourceMenuActivityTest, MenuActivityScreenTest doesn't pass any more!!!
Also, in MenuActivity, there is a comment saying "We call ImageDownloader.downloadImage from onStart or onResume instead of in onCreate to ensure there is enougth time to register IdlingResource if the download is done too early (i.e. in onCreate)". This comment makes a feeling that mIdlingResource should be assigned and registered @before registerIdlingResource() before calling ImageDownloader.downloadImage() in onStart(). And in this case (similar to IdlingResourceSample), there would be no need to call getIdlingResource() in onCreate(). However, when using Logs, it is clear that all of onCreate(), onStart(), and onResume() in MenuActivity are actually called before @before registerIdlingResource() in IdlingResourceMenuActivityTest. That's why we must call getIdlingResource() in onCreate() to initialize mIdlingResource before using it in ImageDownloader.downloadImage().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions