[TIMOB-6451] Android: Drillbit: Unable to run any test suites, error in harness (app.js:45).
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-12-03T22:45:02.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | Sprint 2011-48, Release 1.8.0.1 |
Components | Drillbit |
Labels | branch-v8 |
Reporter | Josh Roesslein |
Assignee | Josh Roesslein |
Created | 2011-12-03T16:50:45.000+0000 |
Updated | 2017-03-06T19:01:53.000+0000 |
Description
Drillbit fails to run any tests. Get the follow error w/ Rhino (also occurs w/ v8):
{quote}
E/ScriptsModule(22261): org.mozilla.javascript.EcmaError: TypeError: Cannot find function addEventListener in object [object Object]. (Resources/app.js#45)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3790)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3809)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3880)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2359)
E/ScriptsModule(22261): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2326)
E/ScriptsModule(22261): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1514)
E/ScriptsModule(22261): at script(Resources/app.js:45)
...
{quote}
This regression in Drillbit occurred after TIMOB-6090 was merged. Window.activity not longer references an ActivityProxy before open. It is only when a HW is opened that this becomes a true ActivityProxy.
Drillbit uses window.activity to get a reference to the root activity to listen for "instrumentationReady" event. Changing this to use Ti.Android.currentActivity instead appears to fix the issue.
Closing ticket due to time passed.