testsuite.js revision 0689f4ed62fe223408b1b4a26bd7d1699df51d1c
name : "Callback in URL",
"callback in URL should be executed": function () {
var self = this;
});
};
Y.jsonp("server/service.php?callback=globalFunction");
}
}));
name : "Callback function",
"callback function as second arg should be success handler": function () {
var self = this;
});
});
},
"inline callback should be replaced if function passed": function () {
var self = this;
});
};
});
});
}
}));
name : "Callback object",
"success handler in callback object should execute": function () {
var self = this;
Y.jsonp("server/service.php?callback={callback}", {
on: {
});
}
}
});
},
"inline callback should be replaced if success function provided in config": function () {
var self = this;
});
};
Y.jsonp("server/service.php?callback=globalFunction", {
on: {
});
}
}
});
}
}));
name : "Complex callback path in URL (jsonp-url)",
"complex nested callback in URL should be executed": function () {
var self = this;
null,
null,
{
nested: {
global: {
func: {
});
}
}
}
}
}
];
Y.jsonp('server/service.php?callback=deeply[2].nested["global"].func["tion"]');
},
"callback relative to Y should be executed": function () {
var self = this;
Y.callbackFunction = function (json) {
delete Y.callbackFunction;
});
};
Y.jsonp("server/service.php?callback=callbackFunction");
},
"nested inline callback relative to Y should be executed": function () {
var self = this;
Y.deeply = [
null,
null,
{
nested: {
global: {
func: {
delete Y.deeply;
});
}
}
}
}
}
];
Y.jsonp('server/service.php?callback=deeply[2].nested["global"].func["tion"]');
},
"inline callback including 'Y.' should be executed": function () {
var self = this;
Y.callbackFunction = function (json) {
delete Y.callbackFunction;
});
};
Y.jsonp("server/service.php?callback=Y.callbackFunction");
},
"inline callback should be replaced if function passed": function () {
var self = this;
Y.deeply = [
null,
null,
{
nested: {
global: {
func: {
delete Y.deeply;
});
}
}
}
}
}
];
delete Y.deeply;
});
});
},
"inline callback should be replaced if success function provided in config": function () {
var self = this;
Y.deeply = [
null,
null,
{
nested: {
global: {
func: {
delete Y.deeply;
});
}
}
}
}
}
];
Y.jsonp('server/service.php?callback=deeply[2].nested["global"].func["tion"]', {
on: {
delete Y.deeply;
});
}
}
});
},
"allowCache should preserve the same callback": function () {
var test = this,
remaining = 2,
allowCache: true,
on: {
if (callback) {
});
} else if (--remaining) {
} else {
// Pass
});
}
} else {
}
}
}
});
this.wait();
},
"allowCache should not clear proxy if another send() is pending response":
function () {
var test = this,
callbacks = [],
allowCache: true,
on: {
});
});
}
}
}
});
this.wait();
}
}));