mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
tests: load and dev-loaders
This commit is contained in:
30
tests/WebComponents/dev-loader-swizzled.html
Normal file
30
tests/WebComponents/dev-loader-swizzled.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../web-component-tester/browser.js"></script>
|
||||
<script src="../../webcomponents-lite.js?0.13513513" log="foo,boo" squid="never" spoo></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test('loader swizzeled', function() {
|
||||
assert(window.WebComponents, 'Platform scope missing');
|
||||
assert.equal(WebComponents.flags.squid, 'never', '"squid" flag missing');
|
||||
assert(WebComponents.flags.spoo, '"spoo" flag missing');
|
||||
assert(WebComponents.flags.log, 'flags.log missing');
|
||||
assert(WebComponents.flags.log.foo, 'flags.log.foo missing');
|
||||
assert(WebComponents.flags.log.boo, 'flags.log.foo missing');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
30
tests/WebComponents/dev-loader.html
Normal file
30
tests/WebComponents/dev-loader.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../web-component-tester/browser.js"></script>
|
||||
<script src="../../webcomponents-lite.js" log="foo,boo" squid="never" spoo></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test('loader', function() {
|
||||
assert(window.WebComponents, 'WebComponents scope missing');
|
||||
assert.equal(WebComponents.flags.squid, 'never', '"squid" flag missing');
|
||||
assert(WebComponents.flags.spoo, '"spoo" flag missing');
|
||||
assert(WebComponents.flags.log, 'flags.log missing');
|
||||
assert(WebComponents.flags.log.foo, 'flags.log.foo missing');
|
||||
assert(WebComponents.flags.log.boo, 'flags.log.foo missing');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,8 +13,7 @@
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../../web-component-tester/browser.js"></script>
|
||||
|
||||
<script src="../../../webcomponents.js"></script>
|
||||
<script src="../../../webcomponents-lite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<x-foo></x-foo>
|
||||
@@ -26,15 +25,15 @@
|
||||
return;
|
||||
}
|
||||
var xfoo = document.querySelector('x-foo');
|
||||
chai.assert.isUndefined(xfoo.isCreated);
|
||||
assert.isUndefined(xfoo.isCreated);
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'import';
|
||||
link.href = 'element-import.html';
|
||||
document.head.appendChild(link);
|
||||
HTMLImports.whenReady(function() {
|
||||
chai.assert.isTrue(xfoo.isCreated, 'element in main document, registered in dynamic import is upgraded');
|
||||
assert.isTrue(xfoo.isCreated, 'element in main document, registered in dynamic import is upgraded');
|
||||
var ix = link.import.querySelector('x-foo');
|
||||
chai.assert.isTrue(ix.isCreated, 'element in import, registered in dynamic import is upgraded');
|
||||
assert.isTrue(ix.isCreated, 'element in import, registered in dynamic import is upgraded');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
order.push(this.id);
|
||||
}
|
||||
document.registerElement('x-foo', {prototype: proto});
|
||||
chai.assert.deepEqual(order, ['import', 'main'], 'elements are upgraded in imports before main document');
|
||||
assert.deepEqual(order, ['import', 'main'], 'elements are upgraded in imports before main document');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
CustomElements.ready = false;
|
||||
register();
|
||||
chai.assert.equal(created, 0, 'no elements created when ready explicitly set to false');
|
||||
assert.equal(created, 0, 'no elements created when ready explicitly set to false');
|
||||
CustomElements.upgradeDocumentTree(document);
|
||||
chai.assert.equal(created, 3, 'elements in document tree upgraded via CustomElements.upgradeDocumentTree');
|
||||
assert.equal(created, 3, 'elements in document tree upgraded via CustomElements.upgradeDocumentTree');
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../../web-component-tester/browser.js"></script>
|
||||
|
||||
<script src="../../../webcomponents.js?0.13513513" log="foo,boo" squid="never" spoo></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test('loader swizzeled', function() {
|
||||
chai.assert(window.WebComponents, 'Platform scope missing');
|
||||
chai.assert.equal(WebComponents.flags.squid, 'never', '"squid" flag missing');
|
||||
chai.assert(WebComponents.flags.spoo, '"spoo" flag missing');
|
||||
chai.assert(WebComponents.flags.log, 'flags.log missing');
|
||||
chai.assert(WebComponents.flags.log.foo, 'flags.log.foo missing');
|
||||
chai.assert(WebComponents.flags.log.boo, 'flags.log.foo missing');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,30 +0,0 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../../web-component-tester/browser.js"></script>
|
||||
<script src="../../../webcomponents.js" log="foo,boo" squid="never" spoo></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test('loader', function() {
|
||||
chai.assert(window.WebComponents, 'WebComponents scope missing');
|
||||
chai.assert.equal(WebComponents.flags.squid, 'never', '"squid" flag missing');
|
||||
chai.assert(WebComponents.flags.spoo, '"spoo" flag missing');
|
||||
chai.assert(WebComponents.flags.log, 'flags.log missing');
|
||||
chai.assert(WebComponents.flags.log.foo, 'flags.log.foo missing');
|
||||
chai.assert(WebComponents.flags.log.boo, 'flags.log.foo missing');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,7 +15,7 @@
|
||||
<script>
|
||||
window.addEventListener('message', function(e) {
|
||||
if (e.data.type === 'test') {
|
||||
chai.assert.equal(e.data.data, 'hello!');
|
||||
assert.equal(e.data.data, 'hello!');
|
||||
done();
|
||||
} else {
|
||||
e.source.postMessage({
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<body>
|
||||
<script>
|
||||
test('force poly', function() {
|
||||
chai.assert(window.WebComponents, 'WebComponents scope missing');
|
||||
chai.assert.equal(WebComponents.flags.shadow, true, 'improper "shadow" flag');
|
||||
chai.assert(window.ShadowDOMPolyfill, 'ShadowDOMPolyfill missing');
|
||||
assert(window.WebComponents, 'WebComponents scope missing');
|
||||
assert.equal(WebComponents.flags.shadow, true, 'improper "shadow" flag');
|
||||
assert(window.ShadowDOMPolyfill, 'ShadowDOMPolyfill missing');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</element>
|
||||
<script>
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
var assert = chai.assert;
|
||||
var assert = assert;
|
||||
var elt = document.querySelector('x-foo');
|
||||
assert.ok(elt, 'x-foo not found');
|
||||
assert.equal(elt.textContent, 'cordon bleu',
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../../web-component-tester/browser.js"></script>
|
||||
|
||||
<script src="../../../webcomponents.js"></script>
|
||||
<link rel="import" href="includes/import-file.html">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener('HTMLImportsLoaded', function() {
|
||||
window.importsOk = true;
|
||||
});
|
||||
test('expected boot', function() {
|
||||
chai.assert.ok(window.importsOk, 'WebComponentsReady without HTMLImportsLoaded');
|
||||
chai.assert.ok(window.importTest, 'import failed to set global value');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
30
tests/WebComponents/load.html
Normal file
30
tests/WebComponents/load.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<script src="../../../web-component-tester/browser.js"></script>
|
||||
<script src="../../webcomponents-lite.js"></script>
|
||||
<link rel="import" href="includes/import-file.html">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener('HTMLImportsLoaded', function() {
|
||||
window.importsOk = true;
|
||||
});
|
||||
test('expected boot', function() {
|
||||
assert.ok(window.importsOk, 'WebComponentsReady without HTMLImportsLoaded');
|
||||
assert.ok(window.importTest, 'import failed to set global value');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,18 +14,18 @@
|
||||
<script src="../../../web-component-tester/browser.js"></script>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'html/dev-loader.html',
|
||||
'html/dev-loader-swizzled.html',
|
||||
'html/loader-forcepoly.html',
|
||||
'html/web-components.html',
|
||||
'html/smoke.html',
|
||||
'html/smoke.html?shadow=native',
|
||||
'html/ce-import.html',
|
||||
'html/ce-import.html?shadow=native',
|
||||
'html/ce-upgradedocumenttree.html',
|
||||
'html/ce-upgrade-order.html',
|
||||
'html/ce-import-upgrade.html',
|
||||
'html/ce-import-upgrade-async.html',
|
||||
'html/jquery-shadowdom-polyfill.html'
|
||||
'load.html',
|
||||
'dev-loader.html',
|
||||
'dev-loader-swizzled.html',
|
||||
// 'html/loader-forcepoly.html',
|
||||
// 'html/smoke.html',
|
||||
// 'html/smoke.html?shadow=native',
|
||||
// 'html/ce-import.html',
|
||||
// 'html/ce-import.html?shadow=native',
|
||||
// 'html/ce-upgradedocumenttree.html',
|
||||
// 'html/ce-upgrade-order.html',
|
||||
// 'html/ce-import-upgrade.html',
|
||||
// 'html/ce-import-upgrade-async.html',
|
||||
// 'html/jquery-shadowdom-polyfill.html'
|
||||
]);
|
||||
</script>
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
// 'template-and-CE.html',
|
||||
'template-and-CE.html',
|
||||
// 'template-and-imports.html',
|
||||
'basic-integration.html'
|
||||
// 'WebComponents/runner.html'
|
||||
'basic-integration.html',
|
||||
'WebComponents/runner.html'
|
||||
]);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user