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 'I' to 'L'.
29   *
30   * @author Ahmed Ashour
31   * @author Ronald Brill
32   */
33  @RunWith(BrowserParameterizedRunner.class)
34  public class HostParentOfITest extends HostParentOf {
35  
36      /**
37       * Returns the parameterized data.
38       *
39       * @return the parameterized data
40       * @throws Exception
41       *             if an error occurs
42       */
43      @Parameters
44      public static Collection<Object[]> data() throws Exception {
45          return HostParentOf.data(input -> {
46              final char ch = Character.toUpperCase(input.charAt(0));
47              return ch >= 'I' && ch <= 'L';
48          });
49      }
50  
51      /**
52       * @throws Exception
53       *             if the test fails
54       */
55      @Test
56      @Alerts("true/false")
57      public void _IDBCursor_IDBCursor() throws Exception {
58          test("IDBCursor", "IDBCursor");
59      }
60  
61      /**
62       * @throws Exception
63       *             if the test fails
64       */
65      @Test
66      @Alerts("true/true")
67      public void _IDBCursor_IDBCursorWithValue() throws Exception {
68          test("IDBCursor", "IDBCursorWithValue");
69      }
70  
71      /**
72       * @throws Exception
73       *             if the test fails
74       */
75      @Test
76      @Alerts("true/false")
77      public void _IDBCursorWithValue_IDBCursorWithValue() throws Exception {
78          test("IDBCursorWithValue", "IDBCursorWithValue");
79      }
80  
81      /**
82       * @throws Exception
83       *             if the test fails
84       */
85      @Test
86      @Alerts("true/false")
87      public void _IDBDatabase_IDBDatabase() throws Exception {
88          test("IDBDatabase", "IDBDatabase");
89      }
90  
91      /**
92       * @throws Exception
93       *             if the test fails
94       */
95      @Test
96      @Alerts("true/false")
97      public void _IDBFactory_IDBFactory() throws Exception {
98          test("IDBFactory", "IDBFactory");
99      }
100 
101     /**
102      * @throws Exception
103      *             if the test fails
104      */
105     @Test
106     @Alerts("true/false")
107     public void _IDBIndex_IDBIndex() throws Exception {
108         test("IDBIndex", "IDBIndex");
109     }
110 
111     /**
112      * @throws Exception
113      *             if the test fails
114      */
115     @Test
116     @Alerts("true/false")
117     public void _IDBKeyRange_IDBKeyRange() throws Exception {
118         test("IDBKeyRange", "IDBKeyRange");
119     }
120 
121     /**
122      * @throws Exception if the test fails
123      */
124     @Test
125     @Alerts("false/false")
126     public void _IDBMutableFile_IDBMutableFile() throws Exception {
127         test("IDBMutableFile", "IDBMutableFile");
128     }
129 
130     /**
131      * @throws Exception
132      *             if the test fails
133      */
134     @Test
135     @Alerts("true/false")
136     public void _IDBObjectStore_IDBObjectStore() throws Exception {
137         test("IDBObjectStore", "IDBObjectStore");
138     }
139 
140     /**
141      * @throws Exception
142      *             if the test fails
143      */
144     @Test
145     @Alerts("true/false")
146     public void _IDBOpenDBRequest_IDBOpenDBRequest() throws Exception {
147         test("IDBOpenDBRequest", "IDBOpenDBRequest");
148     }
149 
150     /**
151      * @throws Exception
152      *             if the test fails
153      */
154     @Test
155     @Alerts("true/true")
156     public void _IDBRequest_IDBOpenDBRequest() throws Exception {
157         test("IDBRequest", "IDBOpenDBRequest");
158     }
159 
160     /**
161      * @throws Exception
162      *             if the test fails
163      */
164     @Test
165     @Alerts("true/false")
166     public void _IDBRequest_IDBRequest() throws Exception {
167         test("IDBRequest", "IDBRequest");
168     }
169 
170     /**
171      * @throws Exception
172      *             if the test fails
173      */
174     @Test
175     @Alerts("true/false")
176     public void _IDBTransaction_IDBTransaction() throws Exception {
177         test("IDBTransaction", "IDBTransaction");
178     }
179 
180     /**
181      * @throws Exception
182      *             if the test fails
183      */
184     @Test
185     @Alerts("true/false")
186     public void _IDBVersionChangeEvent_IDBVersionChangeEvent() throws Exception {
187         test("IDBVersionChangeEvent", "IDBVersionChangeEvent");
188     }
189 
190     /**
191      * @throws Exception if the test fails
192      */
193     @Test
194     @Alerts("true/false")
195     public void _IdleDeadline_IdleDeadline() throws Exception {
196         test("IdleDeadline", "IdleDeadline");
197     }
198 
199     /**
200      * @throws Exception if the test fails
201      */
202     @Test
203     @Alerts("true/false")
204     public void _IIRFilterNode_IIRFilterNode() throws Exception {
205         test("IIRFilterNode", "IIRFilterNode");
206     }
207 
208     /**
209      * @throws Exception
210      *             if the test fails
211      */
212     @Test
213     @Alerts("true/false")
214     public void _Image_HTMLImageElement() throws Exception {
215         // although Image != HTMLImageElement, they seem to be synonyms!!!
216         test("Image", "HTMLImageElement");
217     }
218 
219     /**
220      * @throws Exception
221      *             if the test fails
222      */
223     @Test
224     @Alerts("true/false")
225     public void _Image_Image() throws Exception {
226         test("Image", "Image");
227     }
228 
229     /**
230      * @throws Exception
231      *             if the test fails
232      */
233     @Test
234     @Alerts("true/false")
235     public void _ImageBitmap_ImageBitmap() throws Exception {
236         test("ImageBitmap", "ImageBitmap");
237     }
238 
239     /**
240      * @throws Exception if the test fails
241      */
242     @Test
243     @Alerts("true/false")
244     public void _ImageBitmapRenderingContext_ImageBitmapRenderingContext() throws Exception {
245         test("ImageBitmapRenderingContext", "ImageBitmapRenderingContext");
246     }
247 
248     /**
249      * @throws Exception
250      *             if the test fails
251      */
252     @Test
253     @Alerts("true/false")
254     public void _ImageData_ImageData() throws Exception {
255         test("ImageData", "ImageData");
256     }
257 
258     /**
259      * @throws Exception if the test fails
260      */
261     @Test
262     @Alerts(DEFAULT = "false/false",
263             CHROME = "true/false",
264             EDGE = "true/false")
265     public void _InputDeviceCapabilities_InputDeviceCapabilities() throws Exception {
266         test("InputDeviceCapabilities", "InputDeviceCapabilities");
267     }
268 
269     /**
270      * @throws Exception
271      *             if the test fails
272      */
273     @Test
274     @Alerts("true/false")
275     public void _InputEvent_InputEvent() throws Exception {
276         test("InputEvent", "InputEvent");
277     }
278 
279     /**
280      * @throws Exception if the test fails
281      */
282     @Test
283     @Alerts("false/false")
284     public void _InstallTrigger_InstallTrigger() throws Exception {
285         test("InstallTrigger", "InstallTrigger");
286     }
287 
288     /**
289      * @throws Exception
290      *             if the test fails
291      */
292     @Test
293     @Alerts("true/false")
294     public void _Int16Array_Int16Array() throws Exception {
295         test("Int16Array", "Int16Array");
296     }
297 
298     /**
299      * @throws Exception
300      *             if the test fails
301      */
302     @Test
303     @Alerts("true/false")
304     public void _Int32Array_Int32Array() throws Exception {
305         test("Int32Array", "Int32Array");
306     }
307 
308     /**
309      * @throws Exception
310      *             if the test fails
311      */
312     @Test
313     @Alerts("true/false")
314     public void _Int8Array_Int8Array() throws Exception {
315         test("Int8Array", "Int8Array");
316     }
317 
318     /**
319      * @throws Exception if the test fails
320      */
321     @Test
322     @Alerts("true/false")
323     public void _IntersectionObserver_IntersectionObserver() throws Exception {
324         test("IntersectionObserver", "IntersectionObserver");
325     }
326 
327     /**
328      * @throws Exception if the test fails
329      */
330     @Test
331     @Alerts("true/false")
332     public void _IntersectionObserverEntry_IntersectionObserverEntry() throws Exception {
333         test("IntersectionObserverEntry", "IntersectionObserverEntry");
334     }
335 
336     /**
337      * @throws Exception
338      *             if the test fails
339      */
340     @Test
341     @Alerts("true/false")
342     public void _KeyboardEvent_KeyboardEvent() throws Exception {
343         test("KeyboardEvent", "KeyboardEvent");
344     }
345 
346     /**
347      * @throws Exception
348      *             if the test fails
349      */
350     @Test
351     @Alerts("true/false")
352     public void _KeyframeEffect_KeyframeEffect() throws Exception {
353         test("KeyframeEffect", "KeyframeEffect");
354     }
355 
356     /**
357      * @throws Exception
358      *             if the test fails
359      */
360     @Test
361     @Alerts("false/false")
362     public void _LocalMediaStream_LocalMediaStream() throws Exception {
363         test("LocalMediaStream", "LocalMediaStream");
364     }
365 
366     /**
367      * @throws Exception
368      *             if the test fails
369      */
370     @Test
371     @Alerts("true/false")
372     public void _Location_Location() throws Exception {
373         test("Location", "Location");
374     }
375 }