blob: fc376ff64b9489940d0941728309a6370a0e8e3a [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../../requirejs/require.js"></script>
<script>
/*global require orion window console*/
require({
baseUrl: '../..',
paths: {
domReady: 'requirejs/domReady'
}
});
require(["orion/Deferred", "orion/EventTarget", "orion/plugin", "domReady!"], function(Deferred, EventTarget, PluginProvider) {
var headers = {
name: "test plugin",
description: "This is a test plugin",
license: "http://eclipse.org/org/documents/edl-v10.php",
website: "http://eclipse.org/orion"
};
var provider = new PluginProvider(headers);
var returnReason;
var impl = {
test: function(echo) {
return echo;
},
testPromise: function(echo) {
var d = new Deferred();
window.setTimeout(function() {
d.progress("progress");
d.resolve(echo);
},0);
return d;
},
testEvent: function(name) {
this.dispatchEvent({
type: name,
result: name + "test"
});
},
testCancel: function(resolve) {
console.log("--" +resolve);
var d = new Deferred(function(reason) {
returnReason = reason;
});
if(resolve) {
d.resolve(returnReason);
}
return d;
}
};
EventTarget.attach(impl);
provider.registerService("test", impl, {name : "echotest", change: "tested"});
provider.connect();
});
</script>
</head>
<body>
</body>
</html>