This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>HTML Imports Dynamic</title> | ||
<script src="../../../tools/test/htmltest.js"></script> | ||
<script src="../../../tools/test/chai/chai.js"></script> | ||
<script src="../../html-imports.js"></script> | ||
</head> | ||
<body> | ||
|
||
<script> | ||
document.addEventListener('DOMContentLoaded', function() { | ||
// some time later | ||
setTimeout(function() { | ||
var div = document.createElement('div'); | ||
div.innerHTML = '<link rel="import" href="imports/load-1.html">' + | ||
'<link rel="import" href="imports/load-2.html">'; | ||
document.body.appendChild(div); | ||
// TODO(sorvell): workaround for missing support for dynamic imports. | ||
HTMLImports.importer.load(div, function() { | ||
HTMLImports.parser.parse(div); | ||
chai.assert.ok(load1, 'dynamic import loaded'); | ||
chai.assert.ok(load2, 'dynamic import loaded'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |