Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Move polymer-gestures and polymer-expressions from platform into polymer
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Apr 17, 2014
1 parent c6cc7f4 commit ade4f83
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build.json
@@ -1,4 +1,6 @@
[
"../polymer-gestures/build.json",
"../polymer-expressions/build.json",
"src/polymer.js",
"src/boot.js",
"src/lib/lang.js",
Expand Down
4 changes: 3 additions & 1 deletion polymer.html
Expand Up @@ -3,6 +3,8 @@
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<link rel="import" href="../polymer-expressions/polymer-expressions.html">
<link rel="import" href="../polymer-gestures/polymer-gestures.html">
<script src="src/polymer.js"></script>
<script src="src/boot.js"></script>
<script src="src/lib/lang.js"></script>
Expand All @@ -29,4 +31,4 @@
<script src="src/declaration/queue.js"></script>
<script src="src/declaration/import.js"></script>
<script src="src/declaration/polymer-element.js"></script>
<link rel="import" href="src/polymer-body.html">
<link rel="import" href="src/polymer-body.html">
57 changes: 57 additions & 0 deletions test/html/mdv-shadow.html
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MDV + ShadowDOM Polyfill Integration Tests</title>
<link rel="stylesheet" href="../../../tools/test/mocha/mocha.css">
<script src="../../../platform/platform.js" shadow="polyfill"></script>
<script>
var parserHasNativeTemplate = function() {
var div = document.createElement('div');
div.innerHTML = '<table><template>';
return div.firstChild.firstChild &&
div.firstChild.firstChild.tagName == 'TEMPLATE';
}();

var forceCollectObservers = true;
var exposeGetExpression = true;
</script>
<link rel="import" href="../../polymer.html">
<script src="../../../tools/test/mocha/mocha.js"></script>
<script src="../../../tools/test/chai/chai.js"></script>
<script src="../../../tools/test/htmltest.js"></script>
<script>

mocha.setup({
ignoreLeaks: true,
ui: 'tdd'
});

var assert = chai.assert;

</script>
<script src="../../../polymer-expressions/tests/tests.js"></script>
<script src="../../../TemplateBinding/tests/tests.js"></script>
</head>
<body>
<div id="mocha"></div>
<script>
addEventListener('polymer-ready', function() {
// mocha stomps window.onerror, save for failure case
var htmlsuite_fail = window.onerror;
var runner = mocha.run();
runner.on('fail', function(test, err) {
htmlsuite_fail(err.toString());
});
runner.on('end', function() {
runner.failures || done();
});
});
</script>
</body>
</html>
42 changes: 42 additions & 0 deletions test/html/template-repeat-wrappers.html
@@ -0,0 +1,42 @@
<!doctype html>
<script src="../../../platform/platform.js"></script>
<link rel="import" href="../../polymer.html">
<script src="../../../tools/test/htmltest.js"></script>
<script src="../../../tools/test/chai/chai.js"></script>

<template id="template">
<div id="list">
<template id="t" repeat>
<div>{{label}}</div>
</template>
</div>
</template>

<div id="foo"></div>

<script>
document.addEventListener('DOMContentLoaded', function() {
var template = document.querySelector('#template');

var host = document.querySelector('#foo');
var root = host.createShadowRoot();
root.appendChild(template.content);

var m = [
{label: 'item1'},
{label: 'item2'}
];

host.shadowRoot.querySelector('#t').model = m;

// TODO(sjmiles): forcing SD to render at this point is not necessary,
// except to understand why it causes a failure at the assertion
host.offsetHeight;
var list = host.shadowRoot.querySelector('#list');

new MutationObserver(function() {
chai.assert.equal(list.children.length, 3, 'list.children.length (should be 3 but returns 1)');
done();
}).observe(list, {childList: true});
});
</script>
2 changes: 2 additions & 0 deletions test/js/mdv-syntax.js
Expand Up @@ -7,4 +7,6 @@
htmlSuite('MDV syntax', function() {
// TODO(dfreedm): Disable this test until polymer-expressions#19 is resolved
// htmlTest('html/mdv-syntax.html');
htmlTest('html/template-repeat-wrappers.html');
htmlTest('html/mdv-shadow.html');
});
2 changes: 1 addition & 1 deletion test/runner.html
Expand Up @@ -19,7 +19,7 @@
<body>
<div id="mocha"></div>
<script>
mocha.setup({ui: 'tdd', slow: 1000, timeout: 5000, htmlbase: ''});
mocha.setup({ui: 'tdd', slow: 1000, timeout: 10000, htmlbase: ''});
</script>
<!-- -->
<script src="js/marshall.js"></script>
Expand Down

0 comments on commit ade4f83

Please sign in to comment.