Download Word - Crosswalk

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
[XWALK-99] Internal extensions js files are not injected with instrumentation
test Created: 30/Oct/13 Updated: 31/Aug/14 Resolved: 31/Aug/14
Status:
Project:
Component/s:
Affects
Version/s:
Fix Version/s:
Resolved
Crosswalk Project
Crosswalk Project for Android
Crosswalk 2
Type:
Reporter:
Resolution:
Labels:
Remaining
Estimate:
Time Spent:
Original
Estimate:
Bug
Halton Huo
Fixed
None
Not Specified
OS:
Reporter
Domain:
Android
intel.com (Find related issues)
Crosswalk 9
Priority:
Assignee:
Votes:
P2
Shawn Gao (Inactive)
0
Not Specified
Not Specified
Description
This bug is copied from https://github.com/crosswalk-project/crosswalk/issues/1004
ninja -C out/Debug xwalk_runtime_lib_apk xwalk_runtime_client_test_apk
adb install -r out/Debug/apks/XWalkRuntimeLib.apk
adb install -r out/Debug/apks/XWalkRuntimeClientShell.apk
python build/android/test_runner.py instrumentation --testapk=XWalkRuntimeClientTest -f testDeviceCapabilities
Expected result:
Pass
Actual result:
Test failed without any information filled in.
At the same time, XWalkRuntimeClientShell test pass:
adb push test/android/data/device_capabilities.html /sdcard/
Launch XWalkRuntimeClientShell to access
file:///sdcard/device_capabilities.html
Root cause identify:
1. Add line console.log("Test injection"); in very first of
sysapps/device_capabilities/device_capabilities_api.js
2. Run above XWalkRuntimeClientShell test and adb logcat|grep CONSOLE, it shows me
desired log message
3. Run above instrumentation and adb logcat|grep CONSOLE, no desired log message but
the errors like Uncaught SyntaxError, it means the .js does not injected correctly.
Comments
Comment by Halton Huo [ 30/Oct/13 ]
With my debugging on runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionManager.java, th
getAssetsFileContent(mContext.getAssets(), DeviceCapabilities.JS_API_PATH) contain correct string of
sysapps/device_capabilities/device_capabilities_api.js. It is weired that the jsapi does not exposed correctly.
Comment by DonnaWu (Inactive) [ 13/Nov/13 ]
I have tested DeviceCapabilities test with embedded runtime shell(with PR https://github.com/crosswalk-project
runtime shell. The situation is:
1. On both embedded and shared shell, the case can pass by accessing file:///sdcard/device_capabilities.html
2. On both embedded and shared shell, the case failed with instrumentation test, and the common error message
E/dalvikvm(17564): Could not find class 'org.xwalk.runtime.extension.api.DisplayManagerJBMR1', refe
org.xwalk.runtime.extension.api.XWalkDisplayManager.getInstance
They are in the same package, but DisplayManagerJBMR1 can not be found. I don't know why.
Hongbo Min, Halton Huo any comments?
Comment by DonnaWu (Inactive) [ 13/Nov/13 ]
The whole error reports for instrumentation test on shared runtime client shell:
11-13 17:26:33.689: E/SharedPreferencesImpl(17564): Couldn't create directory for SharedPreferences f
/data/data/org.xwalk.runtime.lib/shared_prefs/org.xwalk.runtime.lib_preferences.xml
11-13 17:26:33.779: E/dalvikvm(17564): Could not find class 'org.xwalk.runtime.extension.api.DisplayM
from method org.xwalk.runtime.extension.api.XWalkDisplayManager.getInstance
11-13 17:26:49.459: E/ActivityThread(17564): Activity org.xwalk.runtime.client.test.XWalkRuntimeCli
leaked IntentReceiver org.xwalk.runtime.extension.api.device_capabilities.DeviceCapabilitiesStorage$1@
originally registered here. Are you missing a call to unregisterReceiver()?
11-13 17:26:49.459: E/ActivityThread(17564): android.app.IntentReceiverLeaked: Activity
org.xwalk.runtime.client.test.XWalkRuntimeClientTestRunnerActivity has leaked IntentReceiver
org.xwalk.runtime.extension.api.device_capabilities.DeviceCapabilitiesStorage$1@21368cf0 that was or
Are you missing a call to unregisterReceiver()?
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.LoadedApk$ReceiverDispatcher.<init>(Lo
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.LoadedApk.getReceiverDispatcher(Loade
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.ContextImpl.registerReceiverInternal(Con
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.ContextImpl.registerReceiver(ContextImp
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.ContextImpl.registerReceiver(ContextImp
11-13 17:26:49.459: E/ActivityThread(17564): at android.content.ContextWrapper.registerReceiver(Con
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.extension.api.device_capabilities.DeviceCapabilitiesStorage.registerListener(DeviceC
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.extension.api.device_capabilities.DeviceCapabilitiesStorage.onResume(DeviceCapab
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.extension.api.device_capabilities.DeviceCapabilities.onResume(DeviceCapabilities.ja
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.extension.XWalkExtensionManager.onResume(XWalkExtensionManager.java:84)
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.XWalkRuntimeViewProviderBase.onResume(XWalkRuntimeViewProviderBase.java
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.XWalkCoreProviderImpl.onResume(XWalkCoreProviderImpl.java:56)
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.runtime.XWalkRuntimeView.onResume(XWalkRuntimeView.java:106)
11-13 17:26:49.459: E/ActivityThread(17564): at java.lang.reflect.Method.invokeNative(Native Method
11-13 17:26:49.459: E/ActivityThread(17564): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.app.runtime.CrossPackageWrapper.invokeMethod(CrossPackageWrapper.java:103)
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.app.runtime.XWalkRuntimeClient.onResume(XWalkRuntimeClient.java:165)
11-13 17:26:49.459: E/ActivityThread(17564): at
org.xwalk.test.util.XWalkRuntimeClientTestGeneric$1.run(XWalkRuntimeClientTestGeneric.java:32)
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.Instrumentation$SyncRunnable.run(Instru
11-13 17:26:49.459: E/ActivityThread(17564): at android.os.Handler.handleCallback(Handler.java:615)
11-13 17:26:49.459: E/ActivityThread(17564): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 17:26:49.459: E/ActivityThread(17564): at android.os.Looper.loop(Looper.java:150)
11-13 17:26:49.459: E/ActivityThread(17564): at android.app.ActivityThread.main(ActivityThread.java:
11-13 17:26:49.459: E/ActivityThread(17564): at java.lang.reflect.Method.invokeNative(Native Method
11-13 17:26:49.459: E/ActivityThread(17564): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 17:26:49.459: E/ActivityThread(17564): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-13 17:26:49.459: E/ActivityThread(17564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.jav
11-13 17:26:49.459: E/ActivityThread(17564): at dalvik.system.NativeStart.main(Native Method)
Comment by Yuejianhui (Inactive) [ 27/Dec/13 ]
Hongbo Min, any update about this issue? Thanks.
Comment by Balestrieri, Francesco [ 10/Mar/14 ]
Any update? Halton Huo Hongbo Min
Comment by Yongsheng Zhu (Inactive) [ 19/Mar/14 ]
Hongbo Min any update?
Comment by Hongbo Min (Inactive) [ 19/Mar/14 ]
I think it is invalid now. So suggest to close it.
Comment by Halton Huo [ 11/Jun/14 ]
This bug was closed wrongly because some of instrumentation tests including DeviceCapabilities are disable in c
of this bug existence.
I remove the @DisabledTest tag and run test again, it shows still fail, so reopen it.
I 129s 5554 {'class': 'org.xwalk.runtime.client.embedded.test.DeviceCapabilitiesTest#tes
# 06/11/14 18:17:11: am instrument -e class
'org.xwalk.runtime.client.embedded.test.DeviceCapabilitiesTest#testDeviceCapabilities' -r
org.xwalk.runtime.client.embedded.test/android.test.InstrumentationTestRunner
I 145s 5554 [5554]> dumpsys window windows
I 145s 5554 [host]> /home/halton/work/projects/github/crosswalk-project/crosswalkandroid/src/out/Debug/host_forwarder --serial-id=emulator-5554 --unmap 8000
C 146s Main ****************************************************************************
C 146s Main Detailed Logs
C 146s Main ****************************************************************************
C 146s Main [FAIL] org.xwalk.runtime.client.embedded.test.DeviceCapabilitiesTest#testDev
C 146s Main java.util.concurrent.TimeoutException: waitForCallback timed out!
C 146s Main
at org.chromium.content.browser.test.util.CallbackHelper.waitForCallback(Ca
C 146s Main
at org.xwalk.test.util.XWalkTestUtilBase.loadAssetFileAndWaitForTitle(XWalk
C 146s Main
at
org.xwalk.test.util.RuntimeClientApiTestBase.testDeviceCapabilities(RuntimeClientApiTestBa
C 146s Main
at
org.xwalk.runtime.client.embedded.test.DeviceCapabilitiesTest.testDeviceCapabilities(Devic
C 146s Main
at java.lang.reflect.Method.invokeNative(Native Method)
C 146s Main
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.j
C 146s Main
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.jav
C 146s Main
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrument
C 146s Main
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
C 146s Main
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
C 146s Main
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner
C 146s Main
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.ja
Comment by Github Bot [ 16/Jul/14 ]
shawngao5 referenced this issue in project crosswalk:
Pull Request 2203 "[Android] Fix Internal extensions js files are not injected with instrumentation test"
Comment by Github Bot [ 10/Aug/14 ]
shawngao5 referenced this issue in project crosswalk:
Pull Request 2295 "[Android] Re-enable NativeFileSystem instrumentation test"
Generated at Fri May 12 17:11:27 PDT 2017 using JIRA 7.2.7#72009sha1:68b7d86b7e8716f76c1f28a5095acccf67bb75b1.
Related documents