SF.net SVN: htmlunit: [1255] trunk/htmlunit/src

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SF.net SVN: htmlunit: [1255] trunk/htmlunit/src

mguillem
Revision: 1255
          http://svn.sourceforge.net/htmlunit/?rev=1255&view=rev
Author:   mguillem
Date:     2006-10-30 01:48:31 -0800 (Mon, 30 Oct 2006)

Log Message:
-----------
JavaScript: added minimal support for navigator.mimeTypes (Firefox).

Modified Paths:
--------------
    trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java
    trunk/htmlunit/src/xdocs/changes.xml

Modified: trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java
===================================================================
--- trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java 2006-10-27 16:47:34 UTC (rev 1254)
+++ trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Navigator.java 2006-10-30 09:48:31 UTC (rev 1255)
@@ -182,10 +182,17 @@
      * Return an empty array because HtmlUnit does not support embedded objects.
      * @return an empty array.
      */
-    public Object jsxFunction_plugins() {
+    public Object jsxGet_plugins() {
         return new NativeArray(0);
     }
 
+    /**
+     * Return an empty array because HtmlUnit does not support embedded objects.
+     * @return an empty array.
+     */
+    public Object jsxGet_mimeTypes() {
+        return new NativeArray(0);
+    }
 
     /**
      * Return <tt>false</tt> always as Java support is not enabled in HtmlUnit.

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2006-10-27 16:47:34 UTC (rev 1254)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/NavigatorTest.java 2006-10-30 09:48:31 UTC (rev 1255)
@@ -263,4 +263,31 @@
         final List expectedAlerts = Arrays.asList(new String[]{ BrowserVersion.MOZILLA_1_0.getBrowserLanguage() });
         assertEquals(expectedAlerts, collectedAlerts);
     }    
+
+    /**
+     * Test some Mozilla properties (minimal tests are support is not completed)
+     * @throws Exception if the test fails.
+     */
+    public void testMozilla() throws Exception {
+
+        final String content
+            = "<html><head><title>First</title></head>"
+            + "<script>"
+            + "function test()"
+            + "{"
+            + "  alert(typeof window.navigator.mimeTypes.length);"
+            + "  alert(typeof window.navigator.plugins.length);"
+            + "}"
+            + "</script>"
+            + "<body onload='test()'></body>"
+            + "</html>";
+
+        final String[] expectedAlerts = { "number", "number"};
+        createTestPageForRealBrowserIfNeeded(content, expectedAlerts);
+
+        final List collectedAlerts = new ArrayList();
+        loadPage(BrowserVersion.MOZILLA_1_0, content, collectedAlerts);
+
+        assertEquals(expectedAlerts, collectedAlerts);
+    }    
 }

Modified: trunk/htmlunit/src/xdocs/changes.xml
===================================================================
--- trunk/htmlunit/src/xdocs/changes.xml 2006-10-27 16:47:34 UTC (rev 1254)
+++ trunk/htmlunit/src/xdocs/changes.xml 2006-10-30 09:48:31 UTC (rev 1255)
@@ -7,6 +7,9 @@
 
     <body>
         <release version="1.10-prerelease">
+            <action type="update" dev="mguillem">
+                JavaScript: added minimal support for navigator.mimeTypes (Firefox).
+            </action>
             <action type="update" dev="mguillem" id="1570484">
                 Fixed select's faked selections are ignored, if select is empty.
             </action>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop