Add Module and Application interfaces

These interfaces are currently unused by the engine, but they are
constructable.  See apis.md for details.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/697873007
This commit is contained in:
Adam Barth 2014-11-10 14:16:56 -08:00
parent 58030f3a78
commit 04122dbd21
4 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,5 @@
Running 1 tests
ok 1 Application should have a constructor
1 tests
1 pass
0 fail

View File

@ -0,0 +1,14 @@
<html>
<import src="../resources/chai.sky" />
<import src="../resources/mocha.sky" />
<script>
describe('Application', function() {
it('should have a constructor', function() {
var doc = new Document();
var app = new Application(doc, "http://www.example.com/app");
assert.equal(app.document, doc);
assert.equal(app.url, "http://www.example.com/app");
});
});
</script>
</html>

View File

@ -0,0 +1,5 @@
Running 1 tests
ok 1 Module should be constructable
1 tests
1 pass
0 fail

View File

@ -0,0 +1,18 @@
<html>
<import src="../resources/chai.sky" />
<import src="../resources/mocha.sky" />
<script>
describe('Module', function() {
it('should be constructable', function() {
var doc1 = new Document();
var app = new Application(doc1, "http://www.example.com/app");
var doc2 = new Document();
var module = new Module(app, doc2, "http://www.example.com/module");
assert.equal(module.application, app);
assert.equal(module.document, doc2);
assert.equal(module.url, "http://www.example.com/module");
});
});
</script>
</html>