Skip to content

Commit

Permalink
[REV] reverting xmo@openerp.com-20140310115334-vjh7gx5oizdm6s67
Browse files Browse the repository at this point in the history
This api change breaks jsfile tests (example test_ui_load.js). The api is broken
but the proper fix would be to avoid accessing phantom.args from PhantomTest

bzr revid: al@openerp.com-20140310184636-8r9x81xi1zqhcsek
  • Loading branch information
antonylesuisse committed Mar 10, 2014
1 parent 5e036bb commit 096432f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions openerp/tests/phantomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ function PhantomTest() {
// ----------------------------------------------------
// run test
// ----------------------------------------------------
this.run = function() {
var url_path = this.options.url_path,
code = this.options.code,
ready = this.options.ready;
this.run = function(url_path, code, ready) {
if(self.options.login) {
var qp = [];
qp.push('db=' + self.options.db);
Expand All @@ -116,12 +113,15 @@ function PhantomTest() {
console.log('loaded', url, status);
// process ready
waitFor(function() {
console.log("waiting for: calling page evaluate");
return self.page.evaluate(function (ready) {
console.log("waiting for", ready);
var r = false;
try {
console.log("waiting for: page evaluating ", ready);
r = !!eval(ready);
} catch(ex) { }
console.log("waiting for: returning from page evaluate");
return r;
}, ready);
// run test
Expand All @@ -135,7 +135,8 @@ function PhantomTest() {

// js mode or jsfile mode
if(phantom.args.length === 1) {
new PhantomTest().run();
pt = new PhantomTest();
pt.run(pt.options.url_path, pt.options.code, pt.options.ready);
}

// vim:et:

0 comments on commit 096432f

Please sign in to comment.