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:
parent
58030f3a78
commit
04122dbd21
@ -0,0 +1,5 @@
|
|||||||
|
Running 1 tests
|
||||||
|
ok 1 Application should have a constructor
|
||||||
|
1 tests
|
||||||
|
1 pass
|
||||||
|
0 fail
|
14
engine/src/flutter/tests/modules/application.sky
Normal file
14
engine/src/flutter/tests/modules/application.sky
Normal 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>
|
5
engine/src/flutter/tests/modules/modules-expected.txt
Normal file
5
engine/src/flutter/tests/modules/modules-expected.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Running 1 tests
|
||||||
|
ok 1 Module should be constructable
|
||||||
|
1 tests
|
||||||
|
1 pass
|
||||||
|
0 fail
|
18
engine/src/flutter/tests/modules/modules.sky
Normal file
18
engine/src/flutter/tests/modules/modules.sky
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user