Skip to content

Commit

Permalink
add plugin/mimeType
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Nov 20, 2024
1 parent 02cc4d4 commit 4104d0a
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 0 deletions.
56 changes: 56 additions & 0 deletions src/test/java/org/htmlunit/general/ElementOwnPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18070,4 +18070,60 @@ public void fileList() throws Exception {
public void fileList2() throws Exception {
testString("", "document.getElementById('fileItem').files");
}

/**
* Test {@link org.htmlunit.javascript.host.PluginArray}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "constructor(),item(),length[GCE],namedItem(),refresh()",
EDGE = "constructor(),item(),length[GCE],namedItem(),refresh()",
FF = "constructor(),item(),length[GCE],namedItem(),refresh()",
FF_ESR = "constructor(),item(),length[GCE],namedItem(),refresh()")
public void pluginArray() throws Exception {
testString("", "navigator.plugins");
}

/**
* Test {@link org.htmlunit.javascript.host.Plugin}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "constructor(),description[GCE],filename[GCE],item(),length[GCE],name[GCE],namedItem()",
EDGE = "constructor(),description[GCE],filename[GCE],item(),length[GCE],name[GCE],namedItem()",
FF = "constructor(),description[GCE],filename[GCE],item(),length[GCE],name[GCE],namedItem()",
FF_ESR = "constructor(),description[GCE],filename[GCE],item(),length[GCE],name[GCE],namedItem()")
public void plugin() throws Exception {
testString("", "navigator.plugins[0]");
}

/**
* Test {@link org.htmlunit.javascript.host.MimeTypeArray}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "constructor(),item(),length[GCE],namedItem()",
EDGE = "constructor(),item(),length[GCE],namedItem()",
FF = "constructor(),item(),length[GCE],namedItem()",
FF_ESR = "constructor(),item(),length[GCE],namedItem()")
public void mimeTypeArray() throws Exception {
testString("", "navigator.mimeTypes");
}

/**
* Test {@link org.htmlunit.javascript.host.MimeType}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "constructor(),description[GCE],enabledPlugin[GCE],suffixes[GCE],type[GCE]",
EDGE = "constructor(),description[GCE],enabledPlugin[GCE],suffixes[GCE],type[GCE]",
FF = "constructor(),description[GCE],enabledPlugin[GCE],suffixes[GCE],type[GCE]",
FF_ESR = "constructor(),description[GCE],enabledPlugin[GCE],suffixes[GCE],type[GCE]")
public void mimeType() throws Exception {
testString("", "navigator.mimeTypes[0]");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3215,4 +3215,60 @@ public void fileList() throws Exception {
public void fileList2() throws Exception {
testString("", "document.getElementById('fileItem').files");
}

/**
* Test {@link org.htmlunit.javascript.host.PluginArray}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [PluginArray]",
EDGE = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [PluginArray]",
FF = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [PluginArray]",
FF_ESR = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [PluginArray]")
public void pluginArray() throws Exception {
testString("", "navigator.plugins");
}

/**
* Test {@link org.htmlunit.javascript.host.Plugin}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [Plugin]",
EDGE = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [Plugin]",
FF = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [Plugin]",
FF_ESR = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [Plugin]")
public void plugin() throws Exception {
testString("", "navigator.plugins[0]");
}

/**
* Test {@link org.htmlunit.javascript.host.MimeTypeArray}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeTypeArray]",
EDGE = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeTypeArray]",
FF = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeTypeArray]",
FF_ESR = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeTypeArray]")
public void mimeTypeArray() throws Exception {
testString("", "navigator.mimeTypes");
}

/**
* Test {@link org.htmlunit.javascript.host.MimeType}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeType]",
EDGE = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeType]",
FF = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeType]",
FF_ESR = "Symbol(Symbol.iterator) [WC] [function],Symbol(Symbol.toStringTag) [C] [MimeType]")
public void mimeType() throws Exception {
testString("", "navigator.mimeTypes[0]");
}
}
56 changes: 56 additions & 0 deletions src/test/java/org/htmlunit/general/ElementPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9181,4 +9181,60 @@ public void fileList() throws Exception {
public void fileList2() throws Exception {
testString("", "document.getElementById('fileItem').files");
}

/**
* Test {@link org.htmlunit.javascript.host.PluginArray}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "0,1,2,3,4,item(),length,namedItem(),refresh()",
EDGE = "0,1,2,3,4,item(),length,namedItem(),refresh()",
FF = "0,1,2,3,4,item(),length,namedItem(),refresh()",
FF_ESR = "0,1,2,3,4,item(),length,namedItem(),refresh()")
public void pluginArray() throws Exception {
testString("", "navigator.plugins");
}

/**
* Test {@link org.htmlunit.javascript.host.Plugin}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "0,1,description,filename,item(),length,name,namedItem()",
EDGE = "0,1,description,filename,item(),length,name,namedItem()",
FF = "0,1,description,filename,item(),length,name,namedItem()",
FF_ESR = "0,1,description,filename,item(),length,name,namedItem()")
public void plugin() throws Exception {
testString("", "navigator.plugins[0]");
}

/**
* Test {@link org.htmlunit.javascript.host.MimeTypeArray}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "0,1,item(),length,namedItem()",
EDGE = "0,1,item(),length,namedItem()",
FF = "0,1,item(),length,namedItem()",
FF_ESR = "0,1,item(),length,namedItem()")
public void mimeTypeArray() throws Exception {
testString("", "navigator.mimeTypes");
}

/**
* Test {@link org.htmlunit.javascript.host.MimeType}.
*
* @throws Exception if an error occurs
*/
@Test
@Alerts(CHROME = "description,enabledPlugin,suffixes,type",
EDGE = "description,enabledPlugin,suffixes,type",
FF = "description,enabledPlugin,suffixes,type",
FF_ESR = "description,enabledPlugin,suffixes,type")
public void mimeType() throws Exception {
testString("", "navigator.mimeTypes[0]");
}
}

0 comments on commit 4104d0a

Please sign in to comment.