[HtmlUnit] SVN: [15534] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ javascript/host/event/EventTest.java

rbri--- via HtmlUnit-develop <[email protected]> Mon, 20 Aug 2018 18:12:08 +0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15534
          http://sourceforge.net/p/htmlunit/code/15534
Author:   rbri
Date:     2018-08-20 18:12:06 +0000 (Mon, 20 Aug 2018)
Log Message:
-----------
fix test

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTest.java	2018-08-20 17:57:58 UTC (rev 15533)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/event/EventTest.java	2018-08-20 18:12:06 UTC (rev 15534)
@@ -392,20 +392,20 @@
      * @throws Exception if the test fails
      */
     @Test
-    @Alerts(DEFAULT = "frame1",
-            CHROME = {})
+    @Alerts("frame1")
     public void thisInEventHandler() throws Exception {
         final String html
-            = "<html><head></head>\n"
+            = "<html>\n"
             + "<body>\n"
-            + "<button name='button1' id='button1' onclick='alert(this.name)'>1</button>\n"
-            + "<iframe src='about:blank' name='frame1' id='frame1'></iframe>\n"
-            + "<script>\n"
-            + "  var e = document.getElementById('frame1');\n"
-            + "  e.onload = document.getElementById('button1').onclick;\n"
-            + "</script>\n"
+            + "  <button name='button1' id='button1' onclick='alert(this.name)'>1</button>\n"
+            + "  <iframe src='default' name='frame1' id='frame1'></iframe>\n"
+            + "  <script>\n"
+            + "    var e = document.getElementById('frame1');\n"
+            + "    e.onload = document.getElementById('button1').onclick;\n"
+            + "  </script>\n"
             + "</body></html>";
 
+        getMockWebConnection().setDefaultResponse("<html><body></body></html>");
         loadPageWithAlerts2(html);
     }
 
@@ -413,8 +413,7 @@
      * @throws Exception if the test fails
      */
     @Test
-    @Alerts(DEFAULT = "called",
-            CHROME = {})
+    @Alerts("called")
     public void iframeOnload() throws Exception {
         final String html
             = "<html><head>\n"
@@ -425,7 +424,7 @@
             + "</script>\n"
             + "</head>\n"
             + "<body>\n"
-            + "<iframe src='about:blank' name='frame1' id='frame1'></iframe>\n"
+            + "<iframe src='default' name='frame1' id='frame1'></iframe>\n"
             + "<script>\n"
             + "  var e = document.getElementById('frame1');\n"
             + "  e.onload = test;\n"
@@ -432,6 +431,7 @@
             + "</script>\n"
             + "</body></html>";
 
+        getMockWebConnection().setDefaultResponse("<html><body></body></html>");
         loadPageWithAlerts2(html);
     }
 
@@ -506,7 +506,8 @@
     @Test
     @Alerts("null")
     public void nullEventHandler() throws Exception {
-        final String html = "<html><head><title>foo</title><script>\n"
+        final String html = "<html><head>\n"
+            + "<script>\n"
             + "  function test() {\n"
             + "    var div = document.getElementById('myDiv');\n"
             + "    alert(div.onclick);\n"


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot