Use setting via setStrictTemplatePolicy export.

This commit is contained in:
Kevin Schaaf
2018-07-06 18:11:21 -07:00
parent 625372ea8c
commit 8667b8955a
7 changed files with 42 additions and 12 deletions

View File

@@ -15,8 +15,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script src="wct-browser-config.js"></script>
<script src="../../node_modules/wct-browser-legacy/browser.js"></script>
<script type="module">
import {Debouncer} from '../../lib/utils/debounce.js';
window.strictTemplatePolicy = true;
import { setStrictTemplatePolicy } from '../../lib/utils/settings.js';
import { Debouncer } from '../../lib/utils/debounce.js';
setStrictTemplatePolicy(true);
// Errors thrown in custom element reactions are not thrown up
// the call stack to the dom methods that provoked them, so need
// to catch them here and prevent mocha from complaining about them
@@ -88,6 +89,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
throw new Error(window.globalError.message);
}
}, re);
if (HTMLTemplateElement.bootstrap) {
HTMLTemplateElement.bootstrap();
}
}
test('dom-bind', function() {
@@ -128,11 +132,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('dom-module never used', function() {
var el = document.createElement('trusted-element');
document.getElementById('target').appendChild(el);
assert.notOk(el.shadowRoot);
});
test('dom-module never used (legacy)', function() {
var el = document.createElement('trusted-element-legacy');
document.getElementById('target').appendChild(el);
assert.notOk(el.shadowRoot);
});