diff options
author | Philip Chimento <philip@endlessm.com> | 2013-10-09 10:57:21 -0700 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2013-10-09 10:59:46 -0700 |
commit | fdefcc5ccd619443742276cc144d66622a942f05 (patch) | |
tree | 468346febf4705201eeac53b2e674ae7b7544b10 /test | |
parent | 71eaf58db28a7276703640f5c330ae94191018b7 (diff) |
Use a fake PID in Javascript tests' app IDs
The Posix module is not available yet in our current version of GJS,
so there is no way to get a real PID in the Javascript tests. Fake it
with a random number (GLib.random_int(), uniformly distributed between
0..2^32-1)
Diffstat (limited to 'test')
-rw-r--r-- | test/webhelper/testTranslate.js | 4 | ||||
-rw-r--r-- | test/webhelper/testWebActions.js | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/webhelper/testTranslate.js b/test/webhelper/testTranslate.js index 651ddf5..009efaf 100644 --- a/test/webhelper/testTranslate.js +++ b/test/webhelper/testTranslate.js @@ -40,7 +40,9 @@ let app; function setUp() { // Generate a unique ID for each app instance that we test - let id_string = 'com.endlessm.webhelper.test' + GLib.get_real_time(); + let fake_pid = GLib.random_int(); + // FIXME In this version of GJS there is no Posix module, so fake the PID + let id_string = 'com.endlessm.webhelper.test' + GLib.get_real_time() + fake_pid; app = new TestClass({ application_id: id_string }); diff --git a/test/webhelper/testWebActions.js b/test/webhelper/testWebActions.js index 0ecc235..8c790b2 100644 --- a/test/webhelper/testWebActions.js +++ b/test/webhelper/testWebActions.js @@ -37,7 +37,9 @@ let app; function setUp() { // Generate a unique ID for each app instance that we test - let id_string = 'com.endlessm.webhelper.test' + GLib.get_real_time(); + let fake_pid = GLib.random_int(); + // FIXME In this version of GJS there is no Posix module, so fake the PID + let id_string = 'com.endlessm.webhelper.test' + GLib.get_real_time() + fake_pid; app = new TestClass({ application_id: id_string }); |