tests: Updating tests to have correct include path for ndn-js
Now all test cases include ndn-js.js directly. Helper.js has been
removed from the source.
Status:
- there is some problem with tests/test-PIT-matching.html
In Chrome it complains about missing to_ccnb call on Object,
In Firefox it is doing something, but not everything
diff --git a/tests/test-publish-async.html b/tests/test-publish-async.html
index 70b60a9..e3844e6 100644
--- a/tests/test-publish-async.html
+++ b/tests/test-publish-async.html
@@ -1,7 +1,7 @@
<?xml version = "1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
-<!--
+<!--
See COPYING for copyright and distribution information.
-->
<html xmlns = "http://www.w3.org/1999/xhtml">
@@ -10,17 +10,17 @@
<head>
<title>NDN Put via WebSocket</title>
-
- <script type="text/javascript" src="../tools/build/ndn-js.js"></script>
-
+
+ <script type="text/javascript" src="../build/ndn-js.js"></script>
+
<script type="text/javascript">
var ndn = new NDN();
-
+
var AsyncPutClosure = function AsyncPutClosure() {
// Inherit from Closure.
Closure.call(this);
};
-
+
AsyncPutClosure.prototype.upcall = function(kind, upcallInfo) {
if (kind == Closure.UPCALL_FINAL) {
// Do nothing.
@@ -30,49 +30,49 @@
var content = document.getElementById('content').value;
var interest = upcallInfo.interest;
var nameStr = interest.name.getName();
-
+
var si = new SignedInfo();
-
+
var co = new ContentObject(new Name(nameStr), si, content, new Signature());
co.sign();
-
+
upcallInfo.contentObject = co;
return Closure.RESULT_INTEREST_CONSUMED;
}
return Closure.RESULT_OK;
};
-
-
+
+
function run() {
- var contentName = document.getElementById('contentname').value;
-
+ var contentName = document.getElementById('contentname').value;
+
ndn.registerPrefix(new Name(contentName), new AsyncPutClosure());
-
- document.getElementById('result').innerHTML = 'Content name \'' + contentName
+
+ document.getElementById('result').innerHTML = 'Content name \'' + contentName
+'\' published.';
}
-
+
</script>
-
+
</head>
<body >
<form>
<div>
<p>Please Enter a Content Name:</p>
-
- <input id="contentname" type="text" name="CONTENTNAME" value="/wentao.shang/regtest001" />
-
+
+ <input id="contentname" type="text" name="CONTENTNAME" value="/wentao.shang/regtest001" />
+
<p>Please Enter the Content:</p>
-
- <textarea id="content" cols="40" rows="5" name="CONTENT" >This works!</textarea>
-
+
+ <textarea id="content" cols="40" rows="5" name="CONTENT" >This works!</textarea>
+
<br />
</div>
</form>
<div>
<button id="testBtn" onclick="run()">Publish Content</button>
</div>
-
+
<p id="result"></p>
</body>