|
101 | 101 | // test shadowdom/custom elements polyfills together
|
102 | 102 | // preferring both if possible.
|
103 | 103 | var matrix = [''];
|
104 |
| - var webcomponents = ''; |
105 | 104 | if (window.customElements) {
|
106 |
| - webcomponents = 'wc-ce=true'; |
| 105 | + matrix.push('wc-ce=true'); |
107 | 106 | }
|
108 | 107 | // if native is available, make sure to test polyfill
|
109 | 108 | if (Element.prototype.attachShadow && Node.prototype.getRootNode) {
|
110 |
| - webcomponents = addUrlOption(webcomponents, 'wc-shadydom=true'); |
| 109 | + matrix.push('wc-shadydom=true'); |
111 | 110 | }
|
112 |
| - // ce + sd becomes a single test iteration. |
113 |
| - if (webcomponents) { |
114 |
| - matrix.push(webcomponents); |
| 111 | + // Both sd and ce are supported, force both polyfills |
| 112 | + if (matrix.length === 3) { |
| 113 | + // ce + sd becomes a single test iteration. |
| 114 | + matrix.push('wc-ce=true&wc-shadydom=true'); |
115 | 115 | }
|
| 116 | + |
116 | 117 | // economize testing by testing css shimming
|
117 | 118 | // only against 1 environment (native or polyfill).
|
118 | 119 | if (window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)')) {
|
119 |
| - var last = matrix[matrix.length-1]; |
| 120 | + var last = matrix.length === 1 ? '' : matrix[matrix.length - 1]; |
120 | 121 | matrix.push(addUrlOption(last, 'wc-shimcssproperties=true'));
|
121 | 122 | }
|
122 | 123 | suites = combinations(suites, [matrix]);
|
123 |
| - |
124 | 124 | console.log('Testing suites:\n\t' + suites.join('\n\t'));
|
125 | 125 |
|
126 | 126 | WCT.loadSuites(suites);
|
|
0 commit comments