[
{ name => 'API 1', cgi_url => 'http://localhost/cgi-bin/api1.cgi',
plack_url => '/api', method => 'GET', input_content => undef,
plack_input => [ api_path => '/api', debug => 1, no_polling => 1,
router_path => '/extdirectrouter', ],
http_status => 200, content_type => qr|^application/javascript\b|,
expected_content => q~
Ext.app.REMOTING_API = {
"actions":{
"Bar": [
{ "len":5, "name":"bar_bar" },
{ "formHandler":true, "len":0, "name":"bar_baz" },
{ "len":4, "name":"bar_foo" }
],
"Foo": [
{ "len":2, "name":"foo_bar" },
{ "name":"foo_baz", "params":["foo","bar","baz"] },
{ "len":1, "name":"foo_foo" }
],
"Qux": [
{ "len":5, "name":"bar_bar" },
{ "formHandler":true, "len":0, "name":"bar_baz" },
{ "len":4, "name":"bar_foo" },
{ "len":2, "name":"foo_bar" },
{ "name":"foo_baz", "params":["foo","bar","baz"] },
{ "len":1, "name":"foo_foo" }
]
},
"type":"remoting",
"url":"/extdirectrouter"
};
~,
},
{ name => 'API 2', cgi_url => 'http://localhost/cgi-bin/api2.cgi',
plack_url => '/api', method => 'GET', input_content => undef,
plack_input => [ api_path => '/api', namespace => 'myApp.ns',
auto_connect => 1, router_path => '/router.cgi',
debug => 1, remoting_var => 'Ext.app.REMOTE_CALL',
no_polling => 1 ],
http_status => 200, content_type => qr|^application/javascript\b|,
expected_content => q~
Ext.app.REMOTE_CALL = {
"actions":{
"Bar": [
{ "len":5, "name":"bar_bar" },
{ "formHandler":true, "len":0, "name":"bar_baz" },
{ "len":4, "name":"bar_foo" }
],
"Foo": [
{ "len":2, "name":"foo_bar" },
{ "name":"foo_baz", "params":["foo","bar","baz"] },
{ "len":1, "name":"foo_foo" }
],
"Qux": [
{ "len":5, "name":"bar_bar" },
{ "formHandler":true, "len":0, "name":"bar_baz" },
{ "len":4, "name":"bar_foo" },
{ "len":2, "name":"foo_bar" },
{ "name":"foo_baz", "params":["foo","bar","baz"] },
{ "len":1, "name":"foo_foo" }
]
},
"namespace":"myApp.ns",
"type":"remoting",
"url":"/router.cgi"
};
Ext.direct.Manager.addProvider(Ext.app.REMOTE_CALL);
~,
},
{ name => 'API 3', cgi_url => 'http://localhost/cgi-bin/api3.cgi',
plack_url => '/api', method => 'GET', input_content => undef,
plack_input => [ remoting_var => 'Ext.app.CALL', debug => 1,
polling_var => 'Ext.app.POLL', auto_connect => 0,
router_path => '/cgi-bin/router.cgi',
poll_path => '/cgi-bin/events.cgi',
namespace => 'Namespace', api_path => '/api', ],
http_status => 200, content_type => qr|^application/javascript\b|,
expected_content => q~
Ext.app.CALL = {
"actions":{
"Bar": [
{ "len":5, "name":"bar_bar" },
{ "formHandler":true, "len":0, "name":"bar_baz" },
{ "len":4, "name":"bar_foo" }
],
"Foo": [
{ "len":2, "name":"foo_bar" },
{ "name":"foo_baz", "params":["foo","bar","baz"] },
{ "len":1, "name":"foo_foo" }
],
"Qux": [
{ "len":5, "name":"bar_bar" },
{ "formHandler":true, "len":0, "name":"bar_baz" },
{ "len":4, "name":"bar_foo" },
{ "len":2, "name":"foo_bar" },
{ "name":"foo_baz", "params":["foo","bar","baz"] },
{ "len":1, "name":"foo_foo" }
]
},
"namespace":"Namespace",
"type":"remoting",
"url":"/cgi-bin/router.cgi"
};
Ext.app.POLL = {
"type":"polling",
"url":"/cgi-bin/events.cgi"
};
~,
},
]