New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 651274 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

ImeTest fails locally due to file read permission

Project Member Reported by yabinh@chromium.org, Sep 29 2016

Issue description

ImeTest needs to load an HTML file (INPUT_FORM_HTML = "content/test/data/android/input/input_forms.html";) on the external storage. It may not have the permission to read files when content shell is installed on the phone for the first time. In that case, the test fails. 

To reproduce this bug locally, we can go to Settings->Apps->Content Shell->Permissions->Storage, disable the permission, and run the test.

I encountered it locally when I reinstalled Android System and ran the test for the first time. I've never seen it on trybot.
 

Comment 1 by yabinh@chromium.org, Sep 29 2016

Cc: amaralp@chromium.org

Comment 2 Deleted

Comment 3 by aelias@chromium.org, Sep 29 2016

Cc: rnep...@chromium.org
Status: Assigned (was: Untriaged)
+cc rnephew@ who wrote https://cs.chromium.org/chromium/src/third_party/catapult/devil/devil/android/device_utils.py?q=GrantPermissions&l=739 which I think is the code involved in setting the permissions.  Maybe it's a race condition between setting the permission and starting the test activity?

Note yabinh@ has a patch to more clearly report the error at https://codereview.chromium.org/2380593002/ (though not a fix for underlying problem yet).
Owner: rnep...@chromium.org
rnephew@, can you take a look at this bug?
Cc: yabinh@chromium.org
Output would be nice. Logcat from the fail would be even better. I'm remote this week so wont be able to run it locally easily until next week. 

How are you installing the apk? How are you running the test (test runner or the wrapper scripts)?

When the test runner installs the apk it sets all permissions that are set in the manifest. Usually when there are problems with permissions it means somewhere the app data is getting cleared and the permissions are not being regranted. 
The script I used to build and run the test is:

. build/android/envsetup.sh &&
gn gen out_android_gn/Debug --args='target_os="android" is_component_build=true symbol_level=1 use_goma=true enable_incremental_javac=true google_play_services_type="public"  is_debug=true disable_incremental_isolated_processes=true ' && ninja -C out_android_gn/Debug -j1000 -l20 content_shell_apk_incremental content_shell_test_apk_incremental && out_android_gn/Debug/bin/install_content_shell_apk_incremental && out_android_gn/Debug/bin/run_content_shell_test_apk_incremental  --num_retries=0 --test-filter ImeTest.testImeCopy 
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment