Skip to content

Commit

Permalink
Merge pull request #5200 from Polymer/3.x-tests
Browse files Browse the repository at this point in the history
3.x tests
  • Loading branch information
Steve Orvell authored Apr 26, 2018
2 parents 22fd724 + e8c4997 commit b1a523c
Show file tree
Hide file tree
Showing 92 changed files with 499 additions and 716 deletions.
2 changes: 1 addition & 1 deletion lib/elements/custom-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
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
*/
import '../../../../@webcomponents/shadycss/entrypoints/custom-style-interface.js';
import '@webcomponents/shadycss/entrypoints/custom-style-interface.js';

import { cssFromModules } from '../utils/style-gather.js';

Expand Down
2 changes: 1 addition & 1 deletion lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
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
*/
import '../../../../@webcomponents/shadycss/entrypoints/apply-shim.js';
import '@webcomponents/shadycss/entrypoints/apply-shim.js';

import { ElementMixin } from '../mixins/element-mixin.js';
import { GestureEventListeners } from '../mixins/gesture-event-listeners.js';
Expand Down
8 changes: 6 additions & 2 deletions lib/legacy/polymer-fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ import '../utils/boot.js';
* @return {function(new: HTMLElement)} Generated class
* @suppress {duplicate, invalidCasts, checkTypes}
*/
export const Polymer = function(info) {
const Polymer = function(info) {
// if input is a `class` (aka a function with a prototype), use the prototype
// remember that the `constructor` will never be called
let klass;
if (typeof info === 'function') {
klass = info;
} else {
klass = Class(info);
klass = Polymer.Class(info);
}
customElements.define(klass.is, /** @type {!HTMLElement} */(klass));
return klass;
};

Polymer.Class = Class;

export { Polymer };
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@polymer/gen-typescript-declarations": "^1.2.0",
"@polymer/iron-component-page": "3.0.0-pre.12",
"@polymer/test-fixture": "3.0.0-pre.12",
"@webcomponents/shadycss": "^1.1.0",
"@webcomponents/webcomponentsjs": "^1.1.0",
"@webcomponents/shadycss": "^1.2.0-0",
"@webcomponents/webcomponentsjs": "^2.0.0-0",
"babel-preset-minify": "^0.2.0",
"del": "^3.0.0",
"dom5": "^3.0.0",
Expand Down Expand Up @@ -63,7 +63,7 @@
"type-detect": "1.0.0"
},
"dependencies": {
"@webcomponents/shadycss": "^1.0.0",
"@webcomponents/webcomponentsjs": "^1.0.0"
"@webcomponents/shadycss": "^1.2.0-0",
"@webcomponents/webcomponentsjs": "^2.0.0-0"
}
}
6 changes: 2 additions & 4 deletions polymer-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*/

import { LegacyElementMixin } from './lib/legacy/legacy-element-mixin.js';
export {Polymer} from './lib/legacy/polymer-fn.js';
export { Polymer } from './lib/legacy/polymer-fn.js';
/* template elements */
import './lib/legacy/templatizer-behavior.js';
import './lib/elements/dom-bind.js';
Expand All @@ -21,9 +21,7 @@ import './lib/elements/custom-style.js';
/* bc behaviors */
import './lib/legacy/mutable-data-behavior.js';
/* import html-tag to export html */
import { html as html$0 } from './lib/utils/html-tag.js';
export { html } from './lib/utils/html-tag.js';

// bc
export const Base = LegacyElementMixin(HTMLElement).prototype;

export { html$0 as html };
3 changes: 1 addition & 2 deletions test/perf/binding-expressions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src="../../../../perf-tester/perf.js"></script>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
<script type="module" src="../../lib/mixins/strict-binding-parser.js"></script>
</head>
Expand Down Expand Up @@ -57,7 +57,6 @@
</template>

<script type="module">
import '../../polymer-legacy.js';
import { StrictBindingParser } from '../../lib/mixins/strict-binding-parser.js';
import { PolymerElement } from '../../polymer-element.js';
var COUNT = 1000;
Expand Down
3 changes: 1 addition & 2 deletions test/perf/perf-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>

<meta charset="utf-8">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../../../perf-tester/perf-tester.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
<style>
Expand All @@ -19,7 +19,6 @@
<perf-tester runs="25"></perf-tester>

<script type="module">
import '../../polymer-legacy.js';
document.querySelector('perf-tester').tests = [
'binding-expressions.html'
];
Expand Down
8 changes: 5 additions & 3 deletions test/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
}
}
</script>
<script src="../../../wct-browser-legacy/browser.js"></script>
<script src="unit/wct-browser-config.js"></script>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>
</head>
<body>
<script>
Expand Down Expand Up @@ -69,8 +70,9 @@
'unit/polymer-dom.html',
'unit/polymer-dom-observeNodes.html',
'unit/flattened-nodes-observer.html',
'unit/importHref.html',
'unit/dynamic-import.html',
// TODO: substitute for equivalent es6 import tests
// 'unit/importHref.html',
// 'unit/dynamic-import.html',
'unit/gestures.html',
'unit/logging.html',
'unit/mixin-utils.html',
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/alacarte-property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../lib/mixins/property-accessors.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/alacarte-property-effects-ordering.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-element.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/alacarte-property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../lib/mixins/property-effects.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/alacarte-template-stamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../lib/mixins/property-accessors.js"></script>
<script type="module" src="../../lib/mixins/template-stamp.js"></script>
</head>
Expand Down
5 changes: 2 additions & 3 deletions test/smoke/behavior-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
</head>
<body>
Expand All @@ -22,8 +22,7 @@
</template>
</dom-module>
<script type="module">
import '../../polymer-legacy.js';
import { Polymer } from '../../lib/legacy/polymer-fn.js';
import { Polymer } from '../../polymer-legacy.js';
import { DomModule } from '../../lib/elements/dom-module.js';
import { mixinBehaviors } from '../../lib/legacy/class.js';
/** @polymerBehavior */
Expand Down
13 changes: 4 additions & 9 deletions test/smoke/data-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
<title>data-table</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
</head>
<body>

<script type="module">
import '../../polymer-legacy.js';
window.emojiByType = {
a: '😎',
b: '💰',
Expand Down Expand Up @@ -47,8 +46,7 @@
<slot></slot>
</template>
<script type="module">
import '../../polymer-legacy.js';
import { Polymer } from '../../lib/legacy/polymer-fn.js';
import { Polymer } from '../../polymer-legacy.js';
Polymer({
is: 'data-popup'
});
Expand Down Expand Up @@ -97,8 +95,7 @@
<data-popup>{{value}}</data-popup>
</template>
<script type="module">
import '../../polymer-legacy.js';
import { Polymer } from '../../lib/legacy/polymer-fn.js';
import { Polymer } from '../../polymer-legacy.js';
Polymer({
is: 'data-cell',
properties: {
Expand Down Expand Up @@ -159,8 +156,7 @@
</template>
</template>
<script type="module">
import '../../polymer-legacy.js';
import { Polymer } from '../../lib/legacy/polymer-fn.js';
import { Polymer } from '../../polymer-legacy.js';
Polymer({
is: 'data-row',
properties: {
Expand Down Expand Up @@ -218,7 +214,6 @@ <h3>Table {{index}}:</h3>
</div>
</template>
<script type="module">
import '../../polymer-legacy.js';
import { Polymer, version as version$0 } from '../../lib/utils/boot.js';
var params = document.location.search.substring(1).split('&').map(p=>p.split('='))
.reduce((m, p)=>{return m[p[0]] = p[1], m;}, {});
Expand Down
4 changes: 1 addition & 3 deletions test/smoke/dirty-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
</head>
<body>
Expand All @@ -22,7 +22,6 @@ <h1>1 + [[foo]] = [[bar]]</h1>
</template>

<script type="module">
import '../../polymer-legacy.js';
import { PolymerElement } from '../../polymer-element.js';
class XHost extends PolymerElement {
static get config() {
Expand Down Expand Up @@ -54,7 +53,6 @@ <h1>1 + [[foo]] = [[bar]]</h1>
<x-host id="host"></x-host>

<script type="module">
import '../../polymer-legacy.js';
var obj = {foo: true};
host.obj = obj;
host.obj = obj;
Expand Down
3 changes: 0 additions & 3 deletions test/smoke/disable-upgrade.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</head>
<body>
<script type="module">
import '../../polymer-legacy.js';
import { DisableUpgradeMixin } from '../../lib/mixins/disable-upgrade-mixin.js';
const ogDefine = window.customElements.ogDefine = window.customElements.define;
window.customElements.defineWithDisabled = function(name, constructor) {
Expand All @@ -32,7 +31,6 @@ <h2>[[prop]]</h2>
</template>

<script type="module">
import '../../polymer-legacy.js';
import '../../lib/mixins/disable-upgrade-mixin.js';
import { PolymerElement } from '../../polymer-element.js';
class Disabled extends PolymerElement {
Expand Down Expand Up @@ -76,7 +74,6 @@ <h3>x-disabled with disable-upgrade</h3>
</template>

<script type="module">
import '../../polymer-legacy.js';
import '../../lib/mixins/disable-upgrade-mixin.js';
import { PolymerElement } from '../../polymer-element.js';

Expand Down
3 changes: 1 addition & 2 deletions test/smoke/disabled-attr-gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<html>
<head>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
Expand All @@ -23,7 +23,6 @@
</div>
</template>
<script type="module">
import '../../polymer-legacy.js';
import { GestureEventListeners } from '../../lib/mixins/gesture-event-listeners.js';
import { PolymerElement } from '../../polymer-element.js';
class XDisabled extends GestureEventListeners(PolymerElement) {
Expand Down
1 change: 0 additions & 1 deletion test/smoke/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

<!-- Uncomment for class syntax -->
<script type="module">
import '../../polymer-legacy.js';
import { PolymerElement } from '../../polymer-element.js';
class MyElement extends PolymerElement {
static get is() { return 'my-element'; }
Expand Down
3 changes: 1 addition & 2 deletions test/smoke/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-->
<html>
<head>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
<link rel="import" href="https://cdn.rawgit.com/PolymerElements/iron-selector/2.0-preview/iron-selector.html">
</head>
Expand All @@ -41,7 +41,6 @@
<button onclick="console.log('This is working after a few clicks')">Click last</button>

<script type="module">
import '../../polymer-legacy.js';
import { version } from '../../lib/utils/boot.js';
console.log("Using: " + version);
console.log("Ready to start bug demo");
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/html-tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<html>
<head>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-element.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/label-click.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
</head>

Expand Down
3 changes: 1 addition & 2 deletions test/smoke/ordering-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
</head>
<body>

<script type="module">
import '../../polymer-legacy.js';
import { PolymerElement } from '../../polymer-element.js';
class XA extends PolymerElement {
static get template() {
Expand Down
6 changes: 2 additions & 4 deletions test/smoke/passive-gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
-->
<html>
<head>
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="../../polymer-legacy.js"></script>
<script type="module">
import '../../polymer-legacy.js';
import { setPassiveTouchGestures } from '../../lib/utils/settings.js';
setPassiveTouchGestures(true);
</script>
Expand All @@ -40,8 +39,7 @@
</template>
</dom-module>
<script type="module">
import '../../polymer-legacy.js';
import { Polymer } from '../../lib/legacy/polymer-fn.js';
import { Polymer } from '../../polymer-legacy.js';
Polymer({
is: 'x-passive',
listeners: {
Expand Down
Loading

0 comments on commit b1a523c

Please sign in to comment.