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.htmlunit.junit.annotation.HtmlUnitNYI;
22  import org.junit.Test;
23  import org.junit.runner.RunWith;
24  import org.junit.runners.Parameterized.Parameters;
25  
26  /**
27   * Tests two Host classes, if one prototype is parent of another.
28   *
29   * This class handles all host names which starts by character 'C'.
30   *
31   * @author Ahmed Ashour
32   * @author Ronald Brill
33   */
34  @RunWith(BrowserParameterizedRunner.class)
35  public class HostParentOfCTest extends HostParentOf {
36  
37      /**
38       * Returns the parameterized data.
39       * @return the parameterized data
40       * @throws Exception if an error occurs
41       */
42      @Parameters
43      public static Collection<Object[]> data() throws Exception {
44          return HostParentOf.data(input -> {
45              final char ch = Character.toUpperCase(input.charAt(0));
46              return ch == 'C';
47          });
48      }
49  
50      /**
51       * @throws Exception if the test fails
52       */
53      @Test
54      @Alerts("true/false")
55      public void _Cache_Cache() throws Exception {
56          test("Cache", "Cache");
57      }
58  
59      /**
60       * @throws Exception if the test fails
61       */
62      @Test
63      @Alerts("true/false")
64      public void _CacheStorage_CacheStorage() throws Exception {
65          test("CacheStorage", "CacheStorage");
66      }
67  
68      /**
69       * @throws Exception if the test fails
70       */
71      @Test
72      @Alerts(DEFAULT = "false/false",
73              FF = "true/false",
74              FF_ESR = "true/false")
75      public void _CanvasCaptureMediaStream_CanvasCaptureMediaStream() throws Exception {
76          test("CanvasCaptureMediaStream", "CanvasCaptureMediaStream");
77      }
78  
79      /**
80       * @throws Exception if the test fails
81       */
82      @Test
83      @Alerts(DEFAULT = "false/false",
84              CHROME = "true/false",
85              EDGE = "true/false")
86      public void _CanvasCaptureMediaStreamTrack_CanvasCaptureMediaStreamTrack() throws Exception {
87          test("CanvasCaptureMediaStreamTrack", "CanvasCaptureMediaStreamTrack");
88      }
89  
90      /**
91       * @throws Exception if the test fails
92       */
93      @Test
94      @Alerts("true/false")
95      public void _CanvasGradient_CanvasGradient() throws Exception {
96          test("CanvasGradient", "CanvasGradient");
97      }
98  
99      /**
100      * @throws Exception if the test fails
101      */
102     @Test
103     @Alerts("true/false")
104     public void _CanvasPattern_CanvasPattern() throws Exception {
105         test("CanvasPattern", "CanvasPattern");
106     }
107 
108     /**
109      * @throws Exception if the test fails
110      */
111     @Test
112     @Alerts("true/false")
113     public void _CanvasRenderingContext2D_CanvasRenderingContext2D() throws Exception {
114         test("CanvasRenderingContext2D", "CanvasRenderingContext2D");
115     }
116 
117     /**
118      * @throws Exception if the test fails
119      */
120     @Test
121     @Alerts("true/false")
122     public void _CaretPosition_CaretPosition() throws Exception {
123         test("CaretPosition", "CaretPosition");
124     }
125 
126     /**
127      * @throws Exception if the test fails
128      */
129     @Test
130     @Alerts("true/false")
131     public void _CDATASection_CDATASection() throws Exception {
132         test("CDATASection", "CDATASection");
133     }
134 
135     /**
136      * @throws Exception if the test fails
137      */
138     @Test
139     @Alerts("true/false")
140     public void _ChannelMergerNode_ChannelMergerNode() throws Exception {
141         test("ChannelMergerNode", "ChannelMergerNode");
142     }
143 
144     /**
145      * @throws Exception if the test fails
146      */
147     @Test
148     @Alerts("true/false")
149     public void _ChannelSplitterNode_ChannelSplitterNode() throws Exception {
150         test("ChannelSplitterNode", "ChannelSplitterNode");
151     }
152 
153     /**
154      * @throws Exception if the test fails
155      */
156     @Test
157     @Alerts("true/false")
158     public void _CharacterData_CDATASection() throws Exception {
159         test("CharacterData", "CDATASection");
160     }
161 
162     /**
163      * @throws Exception if the test fails
164      */
165     @Test
166     @Alerts("true/false")
167     public void _CharacterData_CharacterData() throws Exception {
168         test("CharacterData", "CharacterData");
169     }
170 
171     /**
172      * @throws Exception if the test fails
173      */
174     @Test
175     @Alerts("true/true")
176     public void _CharacterData_Comment() throws Exception {
177         test("CharacterData", "Comment");
178     }
179 
180     /**
181      * @throws Exception if the test fails
182      */
183     @Test
184     @Alerts("true/true")
185     public void _CharacterData_ProcessingInstruction() throws Exception {
186         test("CharacterData", "ProcessingInstruction");
187     }
188 
189     /**
190      * @throws Exception if the test fails
191      */
192     @Test
193     @Alerts("true/true")
194     public void _CharacterData_Text() throws Exception {
195         test("CharacterData", "Text");
196     }
197 
198     /**
199      * @throws Exception if the test fails
200      */
201     @Test
202     @Alerts("true/false")
203     public void _ClipboardEvent_ClipboardEvent() throws Exception {
204         test("ClipboardEvent", "ClipboardEvent");
205     }
206 
207     /**
208      * @throws Exception if the test fails
209      */
210     @Test
211     @Alerts("true/false")
212     public void _CloseEvent_CloseEvent() throws Exception {
213         test("CloseEvent", "CloseEvent");
214     }
215 
216     /**
217      * @throws Exception if the test fails
218      */
219     @Test
220     @Alerts("true/false")
221     public void _Comment_Comment() throws Exception {
222         test("Comment", "Comment");
223     }
224 
225     /**
226      * @throws Exception if the test fails
227      */
228     @Test
229     @Alerts("true/false")
230     public void _CompositionEvent_CompositionEvent() throws Exception {
231         test("CompositionEvent", "CompositionEvent");
232     }
233 
234     /**
235      * @throws Exception if the test fails
236      */
237     @Test
238     @Alerts("false/false")
239     public void _Console_Console() throws Exception {
240         test("Console", "Console");
241     }
242 
243     /**
244      * @throws Exception if the test fails
245      */
246     @Test
247     @Alerts("true/false")
248     public void _ConstantSourceNode_ConstantSourceNode() throws Exception {
249         test("ConstantSourceNode", "ConstantSourceNode");
250     }
251 
252     /**
253      * @throws Exception if the test fails
254      */
255     @Test
256     @Alerts("true/false")
257     public void _ConvolverNode_ConvolverNode() throws Exception {
258         test("ConvolverNode", "ConvolverNode");
259     }
260 
261     /**
262      * @throws Exception if the test fails
263      */
264     @Test
265     @Alerts("false/false")
266     public void _Coordinates_Coordinates() throws Exception {
267         test("Coordinates", "Coordinates");
268     }
269 
270     /**
271      * @throws Exception if the test fails
272      */
273     @Test
274     @Alerts("true/false")
275     public void _Credential_Credential() throws Exception {
276         test("Credential", "Credential");
277     }
278 
279     /**
280      * @throws Exception if the test fails
281      */
282     @Test
283     @Alerts(DEFAULT = "false/false",
284             CHROME = "true/true",
285             EDGE = "true/true")
286     public void _Credential_FederatedCredential() throws Exception {
287         test("Credential", "FederatedCredential");
288     }
289 
290     /**
291      * @throws Exception if the test fails
292      */
293     @Test
294     @Alerts(DEFAULT = "false/false",
295             CHROME = "true/true",
296             EDGE = "true/true")
297     public void _Credential_PasswordCredential() throws Exception {
298         test("Credential", "PasswordCredential");
299     }
300 
301     /**
302      * @throws Exception if the test fails
303      */
304     @Test
305     @Alerts("true/false")
306     public void _CredentialsContainer_CredentialsContainer() throws Exception {
307         test("CredentialsContainer", "CredentialsContainer");
308     }
309 
310     /**
311      * @throws Exception if the test fails
312      */
313     @Test
314     @Alerts("true/false")
315     public void _Crypto_Crypto() throws Exception {
316         test("Crypto", "Crypto");
317     }
318 
319     /**
320      * @throws Exception if the test fails
321      */
322     @Test
323     @Alerts("true/false")
324     public void _CryptoKey_CryptoKey() throws Exception {
325         test("CryptoKey", "CryptoKey");
326     }
327 
328     /**
329      * @throws Exception if the test fails
330      */
331     @Test
332     @Alerts("false/false")
333     public void _CSS_CSS() throws Exception {
334         test("CSS", "CSS");
335     }
336 
337     /**
338      * @throws Exception if the test fails
339      */
340     @Test
341     @Alerts(DEFAULT = "false/false",
342             FF = "true/false",
343             FF_ESR = "true/false")
344     public void _CSS2Properties_CSS2Properties() throws Exception {
345         test("CSS2Properties", "CSS2Properties");
346     }
347 
348     /**
349      * @throws Exception if the test fails
350      */
351     @Test
352     @Alerts("true/false")
353     public void _CSSConditionRule_CSSConditionRule() throws Exception {
354         test("CSSConditionRule", "CSSConditionRule");
355     }
356 
357     /**
358      * @throws Exception if the test fails
359      */
360     @Test
361     @Alerts("true/true")
362     public void _CSSConditionRule_CSSMediaRule() throws Exception {
363         test("CSSConditionRule", "CSSMediaRule");
364     }
365 
366     /**
367      * @throws Exception if the test fails
368      */
369     @Test
370     @Alerts("true/true")
371     public void _CSSConditionRule_CSSSupportsRule() throws Exception {
372         test("CSSConditionRule", "CSSSupportsRule");
373     }
374 
375     /**
376      * @throws Exception if the test fails
377      */
378     @Test
379     @Alerts("true/false")
380     public void _CSSCounterStyleRule_CSSCounterStyleRule() throws Exception {
381         test("CSSCounterStyleRule", "CSSCounterStyleRule");
382     }
383 
384     /**
385      * @throws Exception if the test fails
386      */
387     @Test
388     @Alerts("true/false")
389     public void _CSSFontFaceRule_CSSFontFaceRule() throws Exception {
390         test("CSSFontFaceRule", "CSSFontFaceRule");
391     }
392 
393     /**
394      * @throws Exception if the test fails
395      */
396     @Test
397     @Alerts("true/true")
398     public void _CSSGroupingRule_CSSConditionRule() throws Exception {
399         test("CSSGroupingRule", "CSSConditionRule");
400     }
401 
402     /**
403      * @throws Exception if the test fails
404      */
405     @Test
406     @Alerts("true/false")
407     public void _CSSGroupingRule_CSSGroupingRule() throws Exception {
408         test("CSSGroupingRule", "CSSGroupingRule");
409     }
410 
411     /**
412      * @throws Exception if the test fails
413      */
414     @Test
415     @Alerts("true/false")
416     public void _CSSGroupingRule_CSSMediaRule() throws Exception {
417         test("CSSGroupingRule", "CSSMediaRule");
418     }
419 
420     /**
421      * @throws Exception if the test fails
422      */
423     @Test
424     @Alerts("true/true")
425     @HtmlUnitNYI(CHROME = "false/false",
426             EDGE = "false/false",
427             FF = "false/false",
428             FF_ESR = "false/false")
429     public void _CSSGroupingRule_CSSPageRule() throws Exception {
430         test("CSSGroupingRule", "CSSPageRule");
431     }
432 
433     /**
434      * @throws Exception if the test fails
435      */
436     @Test
437     @Alerts(DEFAULT = "false/false",
438             FF = "true/true",
439             FF_ESR = "true/true")
440     @HtmlUnitNYI(FF = "false/false",
441             FF_ESR = "false/false")
442     public void _CSSGroupingRule_CSSStyleRule() throws Exception {
443         test("CSSGroupingRule", "CSSStyleRule");
444     }
445 
446     /**
447      * @throws Exception if the test fails
448      */
449     @Test
450     @Alerts("true/false")
451     public void _CSSGroupingRule_CSSSupportsRule() throws Exception {
452         test("CSSGroupingRule", "CSSSupportsRule");
453     }
454 
455     /**
456      * @throws Exception if the test fails
457      */
458     @Test
459     @Alerts("true/false")
460     public void _CSSImportRule_CSSImportRule() throws Exception {
461         test("CSSImportRule", "CSSImportRule");
462     }
463 
464     /**
465      * @throws Exception if the test fails
466      */
467     @Test
468     @Alerts("true/false")
469     public void _CSSKeyframeRule_CSSKeyframeRule() throws Exception {
470         test("CSSKeyframeRule", "CSSKeyframeRule");
471     }
472 
473     /**
474      * @throws Exception if the test fails
475      */
476     @Test
477     @Alerts("true/false")
478     public void _CSSKeyframesRule_CSSKeyframesRule() throws Exception {
479         test("CSSKeyframesRule", "CSSKeyframesRule");
480     }
481 
482     /**
483      * @throws Exception if the test fails
484      */
485     @Test
486     @Alerts("true/false")
487     public void _CSSMediaRule_CSSMediaRule() throws Exception {
488         test("CSSMediaRule", "CSSMediaRule");
489     }
490 
491     /**
492      * @throws Exception if the test fails
493      */
494     @Test
495     @Alerts("true/false")
496     public void _CSSNamespaceRule_CSSNamespaceRule() throws Exception {
497         test("CSSNamespaceRule", "CSSNamespaceRule");
498     }
499 
500     /**
501      * @throws Exception if the test fails
502      */
503     @Test
504     @Alerts("true/false")
505     public void _CSSPageRule_CSSPageRule() throws Exception {
506         test("CSSPageRule", "CSSPageRule");
507     }
508 
509     /**
510      * @throws Exception if the test fails
511      */
512     @Test
513     @Alerts("false/false")
514     public void _CSSPrimitiveValue_CSSPrimitiveValue() throws Exception {
515         test("CSSPrimitiveValue", "CSSPrimitiveValue");
516     }
517 
518     /**
519      * @throws Exception if the test fails
520      */
521     @Test
522     @Alerts("true/false")
523     public void _CSSRule_CSSConditionRule() throws Exception {
524         test("CSSRule", "CSSConditionRule");
525     }
526 
527     /**
528      * @throws Exception if the test fails
529      */
530     @Test
531     @Alerts("true/true")
532     public void _CSSRule_CSSCounterStyleRule() throws Exception {
533         test("CSSRule", "CSSCounterStyleRule");
534     }
535 
536     /**
537      * @throws Exception if the test fails
538      */
539     @Test
540     @Alerts("true/true")
541     public void _CSSRule_CSSFontFaceRule() throws Exception {
542         test("CSSRule", "CSSFontFaceRule");
543     }
544 
545     /**
546      * @throws Exception if the test fails
547      */
548     @Test
549     @Alerts("true/true")
550     public void _CSSRule_CSSGroupingRule() throws Exception {
551         test("CSSRule", "CSSGroupingRule");
552     }
553 
554     /**
555      * @throws Exception if the test fails
556      */
557     @Test
558     @Alerts("true/true")
559     public void _CSSRule_CSSImportRule() throws Exception {
560         test("CSSRule", "CSSImportRule");
561     }
562 
563     /**
564      * @throws Exception if the test fails
565      */
566     @Test
567     @Alerts("true/true")
568     public void _CSSRule_CSSKeyframeRule() throws Exception {
569         test("CSSRule", "CSSKeyframeRule");
570     }
571 
572     /**
573      * @throws Exception if the test fails
574      */
575     @Test
576     @Alerts("true/true")
577     public void _CSSRule_CSSKeyframesRule() throws Exception {
578         test("CSSRule", "CSSKeyframesRule");
579     }
580 
581     /**
582      * @throws Exception if the test fails
583      */
584     @Test
585     @Alerts("true/false")
586     public void _CSSRule_CSSMediaRule() throws Exception {
587         test("CSSRule", "CSSMediaRule");
588     }
589 
590     /**
591      * @throws Exception if the test fails
592      */
593     @Test
594     @Alerts("true/true")
595     public void _CSSRule_CSSNamespaceRule() throws Exception {
596         test("CSSRule", "CSSNamespaceRule");
597     }
598 
599     /**
600      * @throws Exception if the test fails
601      */
602     @Test
603     @Alerts("true/false")
604     @HtmlUnitNYI(CHROME = "true/true",
605             EDGE = "true/true",
606             FF = "true/true",
607             FF_ESR = "true/true")
608     public void _CSSRule_CSSPageRule() throws Exception {
609         test("CSSRule", "CSSPageRule");
610     }
611 
612     /**
613      * @throws Exception if the test fails
614      */
615     @Test
616     @Alerts("true/false")
617     public void _CSSRule_CSSRule() throws Exception {
618         test("CSSRule", "CSSRule");
619     }
620 
621     /**
622      * @throws Exception if the test fails
623      */
624     @Test
625     @Alerts(DEFAULT = "true/true",
626             FF = "true/false",
627             FF_ESR = "true/false")
628     @HtmlUnitNYI(FF = "true/true",
629             FF_ESR = "true/true")
630     public void _CSSRule_CSSStyleRule() throws Exception {
631         test("CSSRule", "CSSStyleRule");
632     }
633 
634     /**
635      * @throws Exception if the test fails
636      */
637     @Test
638     @Alerts("true/false")
639     public void _CSSRule_CSSSupportsRule() throws Exception {
640         test("CSSRule", "CSSSupportsRule");
641     }
642 
643     /**
644      * @throws Exception if the test fails
645      */
646     @Test
647     @Alerts("true/false")
648     public void _CSSRuleList_CSSRuleList() throws Exception {
649         test("CSSRuleList", "CSSRuleList");
650     }
651 
652     /**
653      * @throws Exception if the test fails
654      */
655     @Test
656     @Alerts(DEFAULT = "false/false",
657             FF = "true/true",
658             FF_ESR = "true/true")
659     public void _CSSStyleDeclaration_CSS2Properties() throws Exception {
660         test("CSSStyleDeclaration", "CSS2Properties");
661     }
662 
663     /**
664      * @throws Exception if the test fails
665      */
666     @Test
667     @Alerts("true/false")
668     public void _CSSStyleDeclaration_CSSStyleDeclaration() throws Exception {
669         test("CSSStyleDeclaration", "CSSStyleDeclaration");
670     }
671 
672     /**
673      * @throws Exception if the test fails
674      */
675     @Test
676     @Alerts("true/false")
677     public void _CSSStyleRule_CSSStyleRule() throws Exception {
678         test("CSSStyleRule", "CSSStyleRule");
679     }
680 
681     /**
682      * @throws Exception if the test fails
683      */
684     @Test
685     @Alerts("true/false")
686     public void _CSSStyleSheet_CSSStyleSheet() throws Exception {
687         test("CSSStyleSheet", "CSSStyleSheet");
688     }
689 
690     /**
691      * @throws Exception if the test fails
692      */
693     @Test
694     @Alerts("true/false")
695     public void _CSSSupportsRule_CSSSupportsRule() throws Exception {
696         test("CSSSupportsRule", "CSSSupportsRule");
697     }
698 
699     /**
700      * @throws Exception if the test fails
701      */
702     @Test
703     @Alerts("false/false")
704     public void _CSSValue_CSSPrimitiveValue() throws Exception {
705         test("CSSValue", "CSSPrimitiveValue");
706     }
707 
708     /**
709      * @throws Exception if the test fails
710      */
711     @Test
712     @Alerts("false/false")
713     public void _CSSValue_CSSValue() throws Exception {
714         test("CSSValue", "CSSValue");
715     }
716 
717     /**
718      * @throws Exception if the test fails
719      */
720     @Test
721     @Alerts("false/false")
722     public void _CSSValue_CSSValueList() throws Exception {
723         test("CSSValue", "CSSValueList");
724     }
725 
726     /**
727      * @throws Exception if the test fails
728      */
729     @Test
730     @Alerts("false/false")
731     public void _CSSValueList_CSSValueList() throws Exception {
732         test("CSSValueList", "CSSValueList");
733     }
734 
735     /**
736      * @throws Exception if the test fails
737      */
738     @Test
739     @Alerts("true/false")
740     public void _CustomElementRegistry_CustomElementRegistry() throws Exception {
741         test("CustomElementRegistry", "CustomElementRegistry");
742     }
743 
744     /**
745      * @throws Exception if the test fails
746      */
747     @Test
748     @Alerts("true/false")
749     public void _CustomEvent_CustomEvent() throws Exception {
750         test("CustomEvent", "CustomEvent");
751     }
752 }