Last Comment Bug 776724 - test_voicemail_statuschanged.py loads ril_consts.js from arbitrary in-tree location
: test_voicemail_statuschanged.py loads ril_consts.js from arbitrary in-tree lo...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla17
Assigned To: Marshall Culpepper [:marshall_law]
:
Mentors:
Depends on:
Blocks: 736710
  Show dependency treegraph
 
Reported: 2012-07-23 15:15 PDT by Jonathan Griffin (:jgriffin)
Modified: 2012-07-26 05:09 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
vm test pathing fix - v1 (7.27 KB, patch)
2012-07-25 10:08 PDT, Marshall Culpepper [:marshall_law]
philipp: review+
Details | Diff | Review

Description Jonathan Griffin (:jgriffin) 2012-07-23 15:15:22 PDT
The Marionette test test_voicemail_statuschanged.py loads the file 'ril_consts.js' from the relative path '../../../system/gonk'.

This works fine when running the test in-tree, but in continuous integration, we don't run tests that way...we will run them via packaged tests, and that file will not be available.

We should update this test to include the needed constants within the test's .js file.
Comment 1 Marshall Culpepper [:marshall_law] 2012-07-23 21:55:42 PDT
There is a large chunk of constants needed by this test (specifically the language tables for translating the PDUs). Maybe the test could import the ril_consts module from Components.utils instead..
Comment 2 Philipp von Weitershausen [:philikon] 2012-07-24 11:26:21 PDT
There should be no need for test_voicemail_statuschanged.py. If the test needs to load a file that ships with Gecko, it can do something like:

  var Cu = SpecialPowers.unwrap(Components).utils;
  var RIL = {};
  Cu.import("resource://gre/modules/ril_consts.js, RIL);

I'm not 100% sure what we can for loading pdu_builder.js. We could have Marionette map the current test's location to a resource alias, or we could provide a file:/// URI as a global variable in the test scope. jgriffin?
Comment 3 Jonathan Griffin (:jgriffin) 2012-07-24 11:43:28 PDT
(In reply to Philipp von Weitershausen [:philikon] from comment #2)
> There should be no need for test_voicemail_statuschanged.py. If the test
> needs to load a file that ships with Gecko, it can do something like:
> 
>   var Cu = SpecialPowers.unwrap(Components).utils;
>   var RIL = {};
>   Cu.import("resource://gre/modules/ril_consts.js, RIL);
> 
> I'm not 100% sure what we can for loading pdu_builder.js. We could have
> Marionette map the current test's location to a resource alias, or we could
> provide a file:/// URI as a global variable in the test scope. jgriffin?

It's probably a good idea to add dyanmic resource url mappings for cases like this.  I'll file another bug for that.
Comment 4 Marshall Culpepper [:marshall_law] 2012-07-25 10:08:38 PDT
Created attachment 645801 [details] [diff] [review]
vm test pathing fix - v1
Comment 5 Marshall Culpepper [:marshall_law] 2012-07-25 14:25:56 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/bc9be59cca93
Comment 6 Ed Morley [:emorley] 2012-07-26 05:09:47 PDT
https://hg.mozilla.org/mozilla-central/rev/bc9be59cca93

Note You need to log in before you can comment on or make changes to this bug.