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 'B'.
29   *
30   * @author Ahmed Ashour
31   * @author Ronald Brill
32   */
33  @RunWith(BrowserParameterizedRunner.class)
34  public class HostParentOfBTest 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 == 'B';
46          });
47      }
48  
49      /**
50       * @throws Exception if the test fails
51       */
52      @Test
53      @Alerts("true/false")
54      public void _BarProp_BarProp() throws Exception {
55          test("BarProp", "BarProp");
56      }
57  
58      /**
59       * @throws Exception if the test fails
60       */
61      @Test
62      @Alerts("true/true")
63      public void _BaseAudioContext_AudioContext() throws Exception {
64          test("BaseAudioContext", "AudioContext");
65      }
66  
67      /**
68       * @throws Exception if the test fails
69       */
70      @Test
71      @Alerts("true/false")
72      public void _BaseAudioContext_BaseAudioContext() throws Exception {
73          test("BaseAudioContext", "BaseAudioContext");
74      }
75  
76      /**
77       * @throws Exception if the test fails
78       */
79      @Test
80      @Alerts("true/true")
81      public void _BaseAudioContext_OfflineAudioContext() throws Exception {
82          test("BaseAudioContext", "OfflineAudioContext");
83      }
84  
85      /**
86       * @throws Exception if the test fails
87       */
88      @Test
89      @Alerts(DEFAULT = "true/false",
90              FF = "false/false",
91              FF_ESR = "false/false")
92      public void _BatteryManager_BatteryManager() throws Exception {
93          test("BatteryManager", "BatteryManager");
94      }
95  
96      /**
97       * @throws Exception if the test fails
98       */
99      @Test
100     @Alerts(DEFAULT = "false/false",
101             CHROME = "true/false",
102             EDGE = "true/false")
103     public void _BeforeInstallPromptEvent_BeforeInstallPromptEvent() throws Exception {
104         test("BeforeInstallPromptEvent", "BeforeInstallPromptEvent");
105     }
106 
107     /**
108      * @throws Exception if the test fails
109      */
110     @Test
111     @Alerts("true/false")
112     public void _BeforeUnloadEvent_BeforeUnloadEvent() throws Exception {
113         test("BeforeUnloadEvent", "BeforeUnloadEvent");
114     }
115 
116     /**
117      * @throws Exception if the test fails
118      */
119     @Test
120     @Alerts("true/false")
121     public void _BiquadFilterNode_BiquadFilterNode() throws Exception {
122         test("BiquadFilterNode", "BiquadFilterNode");
123     }
124 
125     /**
126      * @throws Exception if the test fails
127      */
128     @Test
129     @Alerts("true/false")
130     public void _Blob_Blob() throws Exception {
131         test("Blob", "Blob");
132     }
133 
134     /**
135      * @throws Exception if the test fails
136      */
137     @Test
138     @Alerts("true/true")
139     public void _Blob_File() throws Exception {
140         test("Blob", "File");
141     }
142 
143     /**
144      * @throws Exception if the test fails
145      */
146     @Test
147     @Alerts("true/false")
148     public void _BlobEvent_BlobEvent() throws Exception {
149         test("BlobEvent", "BlobEvent");
150     }
151 
152     /**
153      * @throws Exception if the test fails
154      */
155     @Test
156     @Alerts("true/false")
157     public void _BroadcastChannel_BroadcastChannel() throws Exception {
158         test("BroadcastChannel", "BroadcastChannel");
159     }
160 }