Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Also this should be handled like Activities with results. Some stubbing of intent should be possible and then checking permission result. just like the espresso intents are done.
be...@upactivity.com <be...@upactivity.com> #3
I've implemented a solution which leverages wrapper classes, overriding and build variant configuration. The solution is quite long to explain and is found over here: https://github.com/ahasbini/AndroidTestMockPermissionUtils .
It is not yet packed in an sdk but the main idea is to override the functionalities of ContextWrapper.checkSelfPermission and ActivityCompat.requestPermissions to be manipulated and return mocked results tricking the app into the different scenarios to be tested like: permission was denied hence the app requested it and ended with granted permission. This scenario will occur even if the app had the permission all along but the idea is that it was tricked by the mocked results from the overriding implementation.
It is not yet packed in an sdk but the main idea is to override the functionalities of ContextWrapper.checkSelfPermission and ActivityCompat.requestPermissions to be manipulated and return mocked results tricking the app into the different scenarios to be tested like: permission was denied hence the app requested it and ended with granted permission. This scenario will occur even if the app had the permission all along but the idea is that it was tricked by the mocked results from the overriding implementation.
yb...@google.com <yb...@google.com>
be...@google.com <be...@google.com>
ko...@google.com <ko...@google.com>
be...@google.com <be...@google.com>
ko...@google.com <ko...@google.com>
ko...@google.com <ko...@google.com> #4
This bug has not been updated in over a year. Please reopen if this is still an issue or requires addition inspection.
Description
Version used: 2.0.0-rc01
Devices/Android versions reproduced on: it's an IDE issue
This is a simple DAO with the following query:
@Dao
abstract class MyDao {
@Query("""
SELECT p.`rowId`,
CASE
WHEN p.parent IS NULL THEN
ELSE '— ' ||
END AS name,
COUNT(
CASE
WHEN p.parent IS NULL THEN
ELSE
END AS sort_column
FROM projects p
LEFT JOIN projects p2 ON
LEFT JOIN issues i ON i.project =
WHERE p.status IN (:statuses)
GROUP BY i.project
ORDER BY sort_column
""")
abstract fun projectsSpinnerInfo(vararg statuses: ProjectEntity.Status = arrayOf(ProjectEntity.Status.STATUS_ACTIVE)):
LiveData<List<ProjectInformation>>
}
The compiler complains about not being able to resolve `sort_column` in the `ORDER BY` statement (see attn).
However said query works perfectly fine. Tested on a Pixel 3 XL through stetho (see 2nd attn).