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.annotation.Alerts;
20  import org.junit.jupiter.params.provider.Arguments;
21  
22  /**
23   * Tests two Host classes, if one prototype is parent of another.
24   *
25   * This class handles all host names which starts by character 'B'.
26   *
27   * @author Ahmed Ashour
28   * @author Ronald Brill
29   */
30  public class HostParentOfBTest extends HostParentOf {
31  
32      /**
33       * Returns the parameterized data.
34       * @return the parameterized data
35       * @throws Exception if an error occurs
36       */
37      public static Collection<Arguments> data() throws Exception {
38          return HostParentOf.data(input -> {
39              final char ch = Character.toUpperCase(input.charAt(0));
40              return ch == 'B';
41          });
42      }
43  
44      @Alerts("true/false")
45      void _BarProp_BarProp() throws Exception {
46          test("BarProp", "BarProp");
47      }
48  
49      @Alerts("true/true")
50      void _BaseAudioContext_AudioContext() throws Exception {
51          test("BaseAudioContext", "AudioContext");
52      }
53  
54      @Alerts("true/false")
55      void _BaseAudioContext_BaseAudioContext() throws Exception {
56          test("BaseAudioContext", "BaseAudioContext");
57      }
58  
59      @Alerts("true/true")
60      void _BaseAudioContext_OfflineAudioContext() throws Exception {
61          test("BaseAudioContext", "OfflineAudioContext");
62      }
63  
64      @Alerts(DEFAULT = "true/false",
65              FF = "false/false",
66              FF_ESR = "false/false")
67      void _BatteryManager_BatteryManager() throws Exception {
68          test("BatteryManager", "BatteryManager");
69      }
70  
71      @Alerts(DEFAULT = "false/false",
72              CHROME = "true/false",
73              EDGE = "true/false")
74      void _BeforeInstallPromptEvent_BeforeInstallPromptEvent() throws Exception {
75          test("BeforeInstallPromptEvent", "BeforeInstallPromptEvent");
76      }
77  
78      @Alerts("true/false")
79      void _BeforeUnloadEvent_BeforeUnloadEvent() throws Exception {
80          test("BeforeUnloadEvent", "BeforeUnloadEvent");
81      }
82  
83      @Alerts("true/false")
84      void _BiquadFilterNode_BiquadFilterNode() throws Exception {
85          test("BiquadFilterNode", "BiquadFilterNode");
86      }
87  
88      @Alerts("true/false")
89      void _Blob_Blob() throws Exception {
90          test("Blob", "Blob");
91      }
92  
93      @Alerts("true/true")
94      void _Blob_File() throws Exception {
95          test("Blob", "File");
96      }
97  
98      @Alerts("true/false")
99      void _BlobEvent_BlobEvent() throws Exception {
100         test("BlobEvent", "BlobEvent");
101     }
102 
103     @Alerts("true/false")
104     void _BroadcastChannel_BroadcastChannel() throws Exception {
105         test("BroadcastChannel", "BroadcastChannel");
106     }
107 }