View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.general.huge;
16  
17  import java.util.Collection;
18  
19  import org.htmlunit.junit.BrowserParameterizedRunner;
20  import org.htmlunit.junit.annotation.Alerts;
21  import org.junit.Test;
22  import org.junit.runner.RunWith;
23  import org.junit.runners.Parameterized.Parameters;
24  
25  /**
26   * Tests two Host classes, if one prototype is parent of another.
27   *
28   * This class handles all host names which starts by character 'W' to 'Z'.
29   *
30   * @author Ahmed Ashour
31   * @author Ronald Brill
32   */
33  @RunWith(BrowserParameterizedRunner.class)
34  public class HostParentOfWTest extends HostParentOf {
35  
36      /**
37       * Returns the parameterized data.
38       * @return the parameterized data
39       * @throws Exception if an error occurs
40       */
41      @Parameters
42      public static Collection<Object[]> data() throws Exception {
43          return HostParentOf.data(input -> {
44              final char ch = Character.toUpperCase(input.charAt(0));
45              return ch >= 'W' && ch <= 'Z';
46          });
47      }
48  
49      /**
50       * @throws Exception if the test fails
51       */
52      @Test
53      @Alerts("true/false")
54      public void _WaveShaperNode_WaveShaperNode() throws Exception {
55          test("WaveShaperNode", "WaveShaperNode");
56      }
57  
58      /**
59       * @throws Exception if the test fails
60       */
61      @Test
62      @Alerts("true/false")
63      public void _WeakMap_WeakMap() throws Exception {
64          test("WeakMap", "WeakMap");
65      }
66  
67      /**
68       * @throws Exception if the test fails
69       */
70      @Test
71      @Alerts("true/false")
72      public void _WeakSet_WeakSet() throws Exception {
73          test("WeakSet", "WeakSet");
74      }
75  
76      /**
77       * @throws Exception if the test fails
78       */
79      @Test
80      @Alerts("false/false")
81      public void _WEBGL_compressed_texture_s3tc_WEBGL_compressed_texture_s3tc() throws Exception {
82          test("WEBGL_compressed_texture_s3tc", "WEBGL_compressed_texture_s3tc");
83      }
84  
85      /**
86       * @throws Exception if the test fails
87       */
88      @Test
89      @Alerts("false/false")
90      public void _WEBGL_debug_renderer_info_WEBGL_debug_renderer_info() throws Exception {
91          test("WEBGL_debug_renderer_info", "WEBGL_debug_renderer_info");
92      }
93  
94      /**
95       * @throws Exception if the test fails
96       */
97      @Test
98      @Alerts("true/false")
99      public void _WebGL2RenderingContext_WebGL2RenderingContext() throws Exception {
100         test("WebGL2RenderingContext", "WebGL2RenderingContext");
101     }
102 
103     /**
104      * @throws Exception if the test fails
105      */
106     @Test
107     @Alerts("true/false")
108     public void _WebGLActiveInfo_WebGLActiveInfo() throws Exception {
109         test("WebGLActiveInfo", "WebGLActiveInfo");
110     }
111 
112     /**
113      * @throws Exception if the test fails
114      */
115     @Test
116     @Alerts("true/false")
117     public void _WebGLBuffer_WebGLBuffer() throws Exception {
118         test("WebGLBuffer", "WebGLBuffer");
119     }
120 
121     /**
122      * @throws Exception if the test fails
123      */
124     @Test
125     @Alerts("true/false")
126     public void _WebGLContextEvent_WebGLContextEvent() throws Exception {
127         test("WebGLContextEvent", "WebGLContextEvent");
128     }
129 
130     /**
131      * @throws Exception if the test fails
132      */
133     @Test
134     @Alerts("true/false")
135     public void _WebGLFramebuffer_WebGLFramebuffer() throws Exception {
136         test("WebGLFramebuffer", "WebGLFramebuffer");
137     }
138 
139     /**
140      * @throws Exception if the test fails
141      */
142     @Test
143     @Alerts("true/false")
144     public void _WebGLProgram_WebGLProgram() throws Exception {
145         test("WebGLProgram", "WebGLProgram");
146     }
147 
148     /**
149      * @throws Exception if the test fails
150      */
151     @Test
152     @Alerts("true/false")
153     public void _WebGLQuery_WebGLQuery() throws Exception {
154         test("WebGLQuery", "WebGLQuery");
155     }
156 
157     /**
158      * @throws Exception if the test fails
159      */
160     @Test
161     @Alerts("true/false")
162     public void _WebGLRenderbuffer_WebGLRenderbuffer() throws Exception {
163         test("WebGLRenderbuffer", "WebGLRenderbuffer");
164     }
165 
166     /**
167      * @throws Exception if the test fails
168      */
169     @Test
170     @Alerts("true/false")
171     public void _WebGLRenderingContext_WebGLRenderingContext() throws Exception {
172         test("WebGLRenderingContext", "WebGLRenderingContext");
173     }
174 
175     /**
176      * @throws Exception if the test fails
177      */
178     @Test
179     @Alerts("true/false")
180     public void _WebGLSampler_WebGLSampler() throws Exception {
181         test("WebGLSampler", "WebGLSampler");
182     }
183 
184     /**
185      * @throws Exception if the test fails
186      */
187     @Test
188     @Alerts("true/false")
189     public void _WebGLShader_WebGLShader() throws Exception {
190         test("WebGLShader", "WebGLShader");
191     }
192 
193     /**
194      * @throws Exception if the test fails
195      */
196     @Test
197     @Alerts("true/false")
198     public void _WebGLShaderPrecisionFormat_WebGLShaderPrecisionFormat() throws Exception {
199         test("WebGLShaderPrecisionFormat", "WebGLShaderPrecisionFormat");
200     }
201 
202     /**
203      * @throws Exception if the test fails
204      */
205     @Test
206     @Alerts("true/false")
207     public void _WebGLSync_WebGLSync() throws Exception {
208         test("WebGLSync", "WebGLSync");
209     }
210 
211     /**
212      * @throws Exception if the test fails
213      */
214     @Test
215     @Alerts("true/false")
216     public void _WebGLTexture_WebGLTexture() throws Exception {
217         test("WebGLTexture", "WebGLTexture");
218     }
219 
220     /**
221      * @throws Exception if the test fails
222      */
223     @Test
224     @Alerts("true/false")
225     public void _WebGLTransformFeedback_WebGLTransformFeedback() throws Exception {
226         test("WebGLTransformFeedback", "WebGLTransformFeedback");
227     }
228 
229     /**
230      * @throws Exception if the test fails
231      */
232     @Test
233     @Alerts("true/false")
234     public void _WebGLUniformLocation_WebGLUniformLocation() throws Exception {
235         test("WebGLUniformLocation", "WebGLUniformLocation");
236     }
237 
238     /**
239      * @throws Exception if the test fails
240      */
241     @Test
242     @Alerts("true/false")
243     public void _WebGLVertexArrayObject_WebGLVertexArrayObject() throws Exception {
244         test("WebGLVertexArrayObject", "WebGLVertexArrayObject");
245     }
246 
247     /**
248      * @throws Exception if the test fails
249      */
250     @Test
251     @Alerts("true/false")
252     public void _WebKitCSSMatrix_DOMMatrix() throws Exception {
253         test("WebKitCSSMatrix", "DOMMatrix");
254     }
255 
256     /**
257      * @throws Exception if the test fails
258      */
259     @Test
260     @Alerts("true/false")
261     public void _WebKitCSSMatrix_WebKitCSSMatrix() throws Exception {
262         test("WebKitCSSMatrix", "WebKitCSSMatrix");
263     }
264 
265     /**
266      * @throws Exception if the test fails
267      */
268     @Test
269     @Alerts(DEFAULT = "false/false",
270             CHROME = "true/false",
271             EDGE = "true/false")
272     public void _webkitMediaStream_MediaStream() throws Exception {
273         test("webkitMediaStream", "MediaStream");
274     }
275 
276     /**
277      * @throws Exception if the test fails
278      */
279     @Test
280     @Alerts(DEFAULT = "false/false",
281             CHROME = "true/false",
282             EDGE = "true/false")
283     public void _webkitMediaStream_webkitMediaStream() throws Exception {
284         test("webkitMediaStream", "webkitMediaStream");
285     }
286 
287     /**
288      * @throws Exception if the test fails
289      */
290     @Test
291     @Alerts(DEFAULT = "false/false",
292             CHROME = "true/false",
293             EDGE = "true/false")
294     public void _WebKitMutationObserver_MutationObserver() throws Exception {
295         test("WebKitMutationObserver", "MutationObserver");
296     }
297 
298     /**
299      * @throws Exception if the test fails
300      */
301     @Test
302     @Alerts(DEFAULT = "false/false",
303             CHROME = "true/false",
304             EDGE = "true/false")
305     public void _WebKitMutationObserver_WebKitMutationObserver() throws Exception {
306         test("WebKitMutationObserver", "WebKitMutationObserver");
307     }
308 
309     /**
310      * @throws Exception if the test fails
311      */
312     @Test
313     @Alerts(DEFAULT = "false/false",
314             CHROME = "true/false",
315             EDGE = "true/false")
316     public void _webkitRTCPeerConnection_RTCPeerConnection() throws Exception {
317         test("webkitRTCPeerConnection", "RTCPeerConnection");
318     }
319 
320     /**
321      * @throws Exception if the test fails
322      */
323     @Test
324     @Alerts(DEFAULT = "false/false",
325             CHROME = "true/false",
326             EDGE = "true/false")
327     public void _webkitRTCPeerConnection_webkitRTCPeerConnection() throws Exception {
328         test("webkitRTCPeerConnection", "webkitRTCPeerConnection");
329     }
330 
331     /**
332      * @throws Exception if the test fails
333      */
334     @Test
335     @Alerts(DEFAULT = "false/false",
336             CHROME = "true/false",
337             EDGE = "true/false")
338     public void _webkitSpeechGrammar_webkitSpeechGrammar() throws Exception {
339         test("webkitSpeechGrammar", "webkitSpeechGrammar");
340     }
341 
342     /**
343      * @throws Exception if the test fails
344      */
345     @Test
346     @Alerts(DEFAULT = "false/false",
347             CHROME = "true/false",
348             EDGE = "true/false")
349     public void _webkitSpeechGrammarList_webkitSpeechGrammarList() throws Exception {
350         test("webkitSpeechGrammarList", "webkitSpeechGrammarList");
351     }
352 
353     /**
354      * @throws Exception if the test fails
355      */
356     @Test
357     @Alerts(DEFAULT = "false/false",
358             CHROME = "true/false",
359             EDGE = "true/false")
360     public void _webkitSpeechRecognition_webkitSpeechRecognition() throws Exception {
361         test("webkitSpeechRecognition", "webkitSpeechRecognition");
362     }
363 
364     /**
365      * @throws Exception if the test fails
366      */
367     @Test
368     @Alerts(DEFAULT = "false/false",
369             CHROME = "true/false",
370             EDGE = "true/false")
371     public void _webkitSpeechRecognitionError_webkitSpeechRecognitionError() throws Exception {
372         test("webkitSpeechRecognitionError", "webkitSpeechRecognitionError");
373     }
374 
375     /**
376      * @throws Exception if the test fails
377      */
378     @Test
379     @Alerts(DEFAULT = "false/false",
380             CHROME = "true/false",
381             EDGE = "true/false")
382     public void _webkitSpeechRecognitionEvent_webkitSpeechRecognitionEvent() throws Exception {
383         test("webkitSpeechRecognitionEvent", "webkitSpeechRecognitionEvent");
384     }
385 
386     /**
387      * @throws Exception if the test fails
388      */
389     @Test
390     @Alerts("true/false")
391     public void _webkitURL_URL() throws Exception {
392         test("webkitURL", "URL");
393     }
394 
395     /**
396      * @throws Exception if the test fails
397      */
398     @Test
399     @Alerts("true/false")
400     public void _webkitURL_webkitURL() throws Exception {
401         test("webkitURL", "webkitURL");
402     }
403 
404     /**
405      * @throws Exception if the test fails
406      */
407     @Test
408     @Alerts("true/false")
409     public void _WebSocket_WebSocket() throws Exception {
410         test("WebSocket", "WebSocket");
411     }
412 
413     /**
414      * @throws Exception if the test fails
415      */
416     @Test
417     @Alerts("true/false")
418     public void _WheelEvent_WheelEvent() throws Exception {
419         test("WheelEvent", "WheelEvent");
420     }
421 
422     /**
423      * @throws Exception if the test fails
424      */
425     @Test
426     @Alerts("true/false")
427     public void _Window_Window() throws Exception {
428         test("Window", "Window");
429     }
430 
431     /**
432      * @throws Exception if the test fails
433      */
434     @Test
435     @Alerts("true/false")
436     public void _Worker_Worker() throws Exception {
437         test("Worker", "Worker");
438     }
439 
440     /**
441      * @throws Exception if the test fails
442      */
443     @Test
444     @Alerts("true/false")
445     public void _XMLDocument_XMLDocument() throws Exception {
446         test("XMLDocument", "XMLDocument");
447     }
448 
449     /**
450      * @throws Exception if the test fails
451      */
452     @Test
453     @Alerts("true/false")
454     public void _XMLHttpRequest_XMLHttpRequest() throws Exception {
455         test("XMLHttpRequest", "XMLHttpRequest");
456     }
457 
458     /**
459      * @throws Exception if the test fails
460      */
461     @Test
462     @Alerts("true/true")
463     public void _XMLHttpRequestEventTarget_XMLHttpRequest() throws Exception {
464         test("XMLHttpRequestEventTarget", "XMLHttpRequest");
465     }
466 
467     /**
468      * @throws Exception if the test fails
469      */
470     @Test
471     @Alerts("true/false")
472     public void _XMLHttpRequestEventTarget_XMLHttpRequestEventTarget() throws Exception {
473         test("XMLHttpRequestEventTarget", "XMLHttpRequestEventTarget");
474     }
475 
476     /**
477      * @throws Exception if the test fails
478      */
479     @Test
480     @Alerts("true/true")
481     public void _XMLHttpRequestEventTarget_XMLHttpRequestUpload() throws Exception {
482         test("XMLHttpRequestEventTarget", "XMLHttpRequestUpload");
483     }
484 
485     /**
486      * @throws Exception if the test fails
487      */
488     @Test
489     @Alerts("true/false")
490     public void _XMLHttpRequestUpload_XMLHttpRequestUpload() throws Exception {
491         test("XMLHttpRequestUpload", "XMLHttpRequestUpload");
492     }
493 
494     /**
495      * @throws Exception if the test fails
496      */
497     @Test
498     @Alerts("true/false")
499     public void _XMLSerializer_XMLSerializer() throws Exception {
500         test("XMLSerializer", "XMLSerializer");
501     }
502 
503     /**
504      * @throws Exception if the test fails
505      */
506     @Test
507     @Alerts("true/false")
508     public void _XPathEvaluator_XPathEvaluator() throws Exception {
509         test("XPathEvaluator", "XPathEvaluator");
510     }
511 
512     /**
513      * @throws Exception if the test fails
514      */
515     @Test
516     @Alerts("true/false")
517     public void _XPathExpression_XPathExpression() throws Exception {
518         test("XPathExpression", "XPathExpression");
519     }
520 
521     /**
522      * @throws Exception if the test fails
523      */
524     @Test
525     @Alerts("true/false")
526     public void _XPathResult_XPathResult() throws Exception {
527         test("XPathResult", "XPathResult");
528     }
529 
530     /**
531      * @throws Exception if the test fails
532      */
533     @Test
534     @Alerts("true/false")
535     public void _XSLTProcessor_XSLTProcessor() throws Exception {
536         test("XSLTProcessor", "XSLTProcessor");
537     }
538 }