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 'T' to 'V'.
29   *
30   * @author Ahmed Ashour
31   * @author Ronald Brill
32   */
33  @RunWith(BrowserParameterizedRunner.class)
34  public class HostParentOfTTest 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 >= 'T' && ch <= 'V';
46          });
47      }
48  
49      /**
50       * @throws Exception if the test fails
51       */
52      @Test
53      @Alerts("true/true")
54      public void _Text_CDATASection() throws Exception {
55          test("Text", "CDATASection");
56      }
57  
58      /**
59       * @throws Exception if the test fails
60       */
61      @Test
62      @Alerts("true/false")
63      public void _Text_Text() throws Exception {
64          test("Text", "Text");
65      }
66  
67      /**
68       * @throws Exception if the test fails
69       */
70      @Test
71      @Alerts("true/false")
72      public void _TextDecoder_TextDecoder() throws Exception {
73          test("TextDecoder", "TextDecoder");
74      }
75  
76      /**
77       * @throws Exception if the test fails
78       */
79      @Test
80      @Alerts("true/false")
81      public void _TextEncoder_TextEncoder() throws Exception {
82          test("TextEncoder", "TextEncoder");
83      }
84  
85      /**
86       * @throws Exception if the test fails
87       */
88      @Test
89      @Alerts(DEFAULT = "true/false",
90              FF_ESR = "false/false")
91      public void _TextEvent_TextEvent() throws Exception {
92          test("TextEvent", "TextEvent");
93      }
94  
95      /**
96       * @throws Exception if the test fails
97       */
98      @Test
99      @Alerts("true/false")
100     public void _TextMetrics_TextMetrics() throws Exception {
101         test("TextMetrics", "TextMetrics");
102     }
103 
104     /**
105      * @throws Exception if the test fails
106      */
107     @Test
108     @Alerts("false/false")
109     public void _TextRange_TextRange() throws Exception {
110         test("TextRange", "TextRange");
111     }
112 
113     /**
114      * @throws Exception if the test fails
115      */
116     @Test
117     @Alerts("true/false")
118     public void _TextTrack_TextTrack() throws Exception {
119         test("TextTrack", "TextTrack");
120     }
121 
122     /**
123      * @throws Exception if the test fails
124      */
125     @Test
126     @Alerts("true/false")
127     public void _TextTrackCue_TextTrackCue() throws Exception {
128         test("TextTrackCue", "TextTrackCue");
129     }
130 
131     /**
132      * @throws Exception if the test fails
133      */
134     @Test
135     @Alerts("true/true")
136     public void _TextTrackCue_VTTCue() throws Exception {
137         test("TextTrackCue", "VTTCue");
138     }
139 
140     /**
141      * @throws Exception if the test fails
142      */
143     @Test
144     @Alerts("true/false")
145     public void _TextTrackCueList_TextTrackCueList() throws Exception {
146         test("TextTrackCueList", "TextTrackCueList");
147     }
148 
149     /**
150      * @throws Exception if the test fails
151      */
152     @Test
153     @Alerts("true/false")
154     public void _TextTrackList_TextTrackList() throws Exception {
155         test("TextTrackList", "TextTrackList");
156     }
157 
158     /**
159      * @throws Exception if the test fails
160      */
161     @Test
162     @Alerts(DEFAULT = "false/false",
163             FF = "true/false",
164             FF_ESR = "true/false")
165     public void _TimeEvent_TimeEvent() throws Exception {
166         test("TimeEvent", "TimeEvent");
167     }
168 
169     /**
170      * @throws Exception if the test fails
171      */
172     @Test
173     @Alerts("true/false")
174     public void _TimeRanges_TimeRanges() throws Exception {
175         test("TimeRanges", "TimeRanges");
176     }
177 
178     /**
179      * @throws Exception if the test fails
180      */
181     @Test
182     @Alerts(DEFAULT = "false/false",
183             CHROME = "true/false",
184             EDGE = "true/false")
185     public void _Touch_Touch() throws Exception {
186         test("Touch", "Touch");
187     }
188 
189     /**
190      * @throws Exception if the test fails
191      */
192     @Test
193     @Alerts(DEFAULT = "false/false",
194             CHROME = "true/false",
195             EDGE = "true/false")
196     public void _TouchEvent_TouchEvent() throws Exception {
197         test("TouchEvent", "TouchEvent");
198     }
199 
200     /**
201      * @throws Exception if the test fails
202      */
203     @Test
204     @Alerts(DEFAULT = "false/false",
205             CHROME = "true/false",
206             EDGE = "true/false")
207     public void _TouchList_TouchList() throws Exception {
208         test("TouchList", "TouchList");
209     }
210 
211     /**
212      * @throws Exception if the test fails
213      */
214     @Test
215     @Alerts("true/false")
216     public void _TrackEvent_TrackEvent() throws Exception {
217         test("TrackEvent", "TrackEvent");
218     }
219 
220     /**
221      * @throws Exception if the test fails
222      */
223     @Test
224     @Alerts("true/false")
225     public void _TransitionEvent_TransitionEvent() throws Exception {
226         test("TransitionEvent", "TransitionEvent");
227     }
228 
229     /**
230      * @throws Exception if the test fails
231      */
232     @Test
233     @Alerts("true/false")
234     public void _TreeWalker_TreeWalker() throws Exception {
235         test("TreeWalker", "TreeWalker");
236     }
237 
238     /**
239      * @throws Exception if the test fails
240      */
241     @Test
242     @Alerts("true/true")
243     public void _UIEvent_CompositionEvent() throws Exception {
244         test("UIEvent", "CompositionEvent");
245     }
246 
247     /**
248      * @throws Exception if the test fails
249      */
250     @Test
251     @Alerts("true/false")
252     public void _UIEvent_DragEvent() throws Exception {
253         test("UIEvent", "DragEvent");
254     }
255 
256     /**
257      * @throws Exception if the test fails
258      */
259     @Test
260     @Alerts("true/true")
261     public void _UIEvent_FocusEvent() throws Exception {
262         test("UIEvent", "FocusEvent");
263     }
264 
265     /**
266      * @throws Exception if the test fails
267      */
268     @Test
269     @Alerts("true/true")
270     public void _UIEvent_InputEvent() throws Exception {
271         test("UIEvent", "InputEvent");
272     }
273 
274     /**
275      * @throws Exception if the test fails
276      */
277     @Test
278     @Alerts("true/true")
279     public void _UIEvent_KeyboardEvent() throws Exception {
280         test("UIEvent", "KeyboardEvent");
281     }
282 
283     /**
284      * @throws Exception if the test fails
285      */
286     @Test
287     @Alerts("true/true")
288     public void _UIEvent_MouseEvent() throws Exception {
289         test("UIEvent", "MouseEvent");
290     }
291 
292     /**
293      * @throws Exception if the test fails
294      */
295     @Test
296     @Alerts(DEFAULT = "false/false",
297             FF = "true/false",
298             FF_ESR = "true/false")
299     public void _UIEvent_MouseScrollEvent() throws Exception {
300         test("UIEvent", "MouseScrollEvent");
301     }
302 
303     /**
304      * @throws Exception if the test fails
305      */
306     @Test
307     @Alerts("false/false")
308     public void _UIEvent_MouseWheelEvent() throws Exception {
309         test("UIEvent", "MouseWheelEvent");
310     }
311 
312     /**
313      * @throws Exception if the test fails
314      */
315     @Test
316     @Alerts("false/false")
317     public void _UIEvent_MSGestureEvent() throws Exception {
318         test("UIEvent", "MSGestureEvent");
319     }
320 
321     /**
322      * @throws Exception if the test fails
323      */
324     @Test
325     @Alerts("true/false")
326     public void _UIEvent_PointerEvent() throws Exception {
327         test("UIEvent", "PointerEvent");
328     }
329 
330     /**
331      * @throws Exception if the test fails
332      */
333     @Test
334     @Alerts("false/false")
335     public void _UIEvent_SVGZoomEvent() throws Exception {
336         test("UIEvent", "SVGZoomEvent");
337     }
338 
339     /**
340      * @throws Exception if the test fails
341      */
342     @Test
343     @Alerts(DEFAULT = "true/true",
344             FF_ESR = "false/false")
345     public void _UIEvent_TextEvent() throws Exception {
346         test("UIEvent", "TextEvent");
347     }
348 
349     /**
350      * @throws Exception if the test fails
351      */
352     @Test
353     @Alerts(DEFAULT = "false/false",
354             CHROME = "true/true",
355             EDGE = "true/true")
356     public void _UIEvent_TouchEvent() throws Exception {
357         test("UIEvent", "TouchEvent");
358     }
359 
360     /**
361      * @throws Exception if the test fails
362      */
363     @Test
364     @Alerts("true/false")
365     public void _UIEvent_UIEvent() throws Exception {
366         test("UIEvent", "UIEvent");
367     }
368 
369     /**
370      * @throws Exception if the test fails
371      */
372     @Test
373     @Alerts("true/false")
374     public void _UIEvent_WheelEvent() throws Exception {
375         test("UIEvent", "WheelEvent");
376     }
377 
378     /**
379      * @throws Exception if the test fails
380      */
381     @Test
382     @Alerts("true/false")
383     public void _Uint16Array_Uint16Array() throws Exception {
384         test("Uint16Array", "Uint16Array");
385     }
386 
387     /**
388      * @throws Exception if the test fails
389      */
390     @Test
391     @Alerts("true/false")
392     public void _Uint32Array_Uint32Array() throws Exception {
393         test("Uint32Array", "Uint32Array");
394     }
395 
396     /**
397      * @throws Exception if the test fails
398      */
399     @Test
400     @Alerts("true/false")
401     public void _Uint8Array_Uint8Array() throws Exception {
402         test("Uint8Array", "Uint8Array");
403     }
404 
405     /**
406      * @throws Exception if the test fails
407      */
408     @Test
409     @Alerts("true/false")
410     public void _Uint8ClampedArray_Uint8ClampedArray() throws Exception {
411         test("Uint8ClampedArray", "Uint8ClampedArray");
412     }
413 
414     /**
415      * @throws Exception if the test fails
416      */
417     @Test
418     @Alerts("true/false")
419     public void _URIError_URIError() throws Exception {
420         test("URIError", "URIError");
421     }
422 
423     /**
424      * @throws Exception if the test fails
425      */
426     @Test
427     @Alerts("true/false")
428     public void _URL_URL() throws Exception {
429         test("URL", "URL");
430     }
431 
432     /**
433      * @throws Exception if the test fails
434      */
435     @Test
436     @Alerts("true/false")
437     public void _URL_webkitURL() throws Exception {
438         test("URL", "webkitURL");
439     }
440 
441     /**
442      * @throws Exception if the test fails
443      */
444     @Test
445     @Alerts("true/false")
446     public void _URLSearchParams_URLSearchParams() throws Exception {
447         test("URLSearchParams", "URLSearchParams");
448     }
449 
450     /**
451      * @throws Exception if the test fails
452      */
453     @Test
454     @Alerts("false/false")
455     public void _UserProximityEvent_UserProximityEvent() throws Exception {
456         test("UserProximityEvent", "UserProximityEvent");
457     }
458 
459     /**
460      * @throws Exception if the test fails
461      */
462     @Test
463     @Alerts("true/false")
464     public void _ValidityState_ValidityState() throws Exception {
465         test("ValidityState", "ValidityState");
466     }
467 
468     /**
469      * @throws Exception if the test fails
470      */
471     @Test
472     @Alerts("true/false")
473     public void _VideoPlaybackQuality_VideoPlaybackQuality() throws Exception {
474         test("VideoPlaybackQuality", "VideoPlaybackQuality");
475     }
476 
477     /**
478      * @throws Exception if the test fails
479      */
480     @Test
481     @Alerts("true/false")
482     public void _VTTCue_VTTCue() throws Exception {
483         test("VTTCue", "VTTCue");
484     }
485 }