This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move polymer-gestures and polymer-expressions from platform into polymer
- Loading branch information
Showing
6 changed files
with
107 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
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,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> |
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,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> |
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