From: <rb...@us...> - 2013-10-04 14:59:05
|
Revision: 8589 http://sourceforge.net/p/htmlunit/code/8589 Author: rbri Date: 2013-10-04 14:59:02 +0000 (Fri, 04 Oct 2013) Log Message: ----------- add expectations for ie10 (frank danek) retest with IE8 and adapt some exptectations (frank danek) fix for document mode regarding the updated tests Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2013-10-04 14:57:55 UTC (rev 8588) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocument.java 2013-10-04 14:59:02 UTC (rev 8589) @@ -833,7 +833,7 @@ final float version = browserVersion.getBrowserVersionNumeric(); if (version == 8) { - documentMode_ = 7; + documentMode_ = 8; return documentMode_; } documentMode_ = 9; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2013-10-04 14:57:55 UTC (rev 8588) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLDocumentTest.java 2013-10-04 14:59:02 UTC (rev 8589) @@ -17,6 +17,9 @@ import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.FF; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.FF3_6; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE; +import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE10; +import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE6; +import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.IE8; import static com.gargoylesoftware.htmlunit.BrowserRunner.Browser.NONE; import static com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument.EMPTY_COOKIE_NAME; import static com.gargoylesoftware.htmlunit.util.StringUtils.parseHttpDate; @@ -55,6 +58,7 @@ * @author Ahmed Ashour * @author Marc Guillemot * @author Ronald Brill + * @author Frank Danek */ @RunWith(BrowserRunner.class) public class HTMLDocumentTest extends WebDriverTestCase { @@ -97,8 +101,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "function", "div1", "span2", "span3", "2", "1", "1", "0", "0", "0" }, - IE = { "undefined", "exception" }) + @Alerts(DEFAULT = { "function", "div1", "span2", "span3", "2", "1", "1", "0", "0", "0" }, + IE6 = { "undefined", "exception" }, + IE8 = { "undefined", "exception" }) public void getElementsByClassName() throws Exception { final String html = "<html><head><title>First</title><script>\n" @@ -143,7 +148,7 @@ */ @Test @Alerts("CSS1Compat") - public void compatMode_doctype_html() throws Exception { + public void compatMode_html() throws Exception { compatMode("<!DOCTYPE html>"); } @@ -152,7 +157,7 @@ */ @Test @Alerts("BackCompat") - public void compatMode_no_url() throws Exception { + public void compatMode_html_transitional_40_noUrl() throws Exception { compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"); } @@ -160,27 +165,30 @@ * @throws Exception if the test fails */ @Test - @Alerts("CSS1Compat") - public void compatMode_strict() throws Exception { - compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"); + @Alerts("BackCompat") + public void compatMode_html_transitional_noUrl() throws Exception { + compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); } /** * @throws Exception if the test fails */ @Test - @Alerts("CSS1Compat") - public void compatMode_strict_40() throws Exception { - compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"); + @Alerts(DEFAULT = "BackCompat", + IE6 = "CSS1Compat", + IE8 = "CSS1Compat") + public void compatMode_html_transitional_40() throws Exception { + compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" " + + "\"http://www.w3.org/TR/html4/loose.dtd\">"); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE = "CSS1Compat", FF = "BackCompat") - public void compatMode_loose_40() throws Exception { - compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" " + @Alerts("CSS1Compat") + public void compatMode_html_transitional() throws Exception { + compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" " + "\"http://www.w3.org/TR/html4/loose.dtd\">"); } @@ -189,9 +197,8 @@ */ @Test @Alerts("CSS1Compat") - public void compatMode_loose() throws Exception { - compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" " - + "\"http://www.w3.org/TR/html4/loose.dtd\">"); + public void compatMode_html_strict_40() throws Exception { + compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"); } /** @@ -199,7 +206,16 @@ */ @Test @Alerts("CSS1Compat") - public void compatMode_xhtml_traditional() throws Exception { + public void compatMode_html_strict() throws Exception { + compatMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("CSS1Compat") + public void compatMode_xhtml_transitional() throws Exception { compatMode("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); } @@ -243,7 +259,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = "true", FF = "false") + @Alerts(DEFAULT = "false", + IE = "true") public void uniqueID() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -265,7 +282,7 @@ * @throws Exception if the test fails */ @Test - @Browsers(FF) + @Browsers({ FF, IE10 }) @Alerts({ "[object HTMLDivElement]", "[object HTMLUnknownElement]", "[object Element]" }) public void createDocumentNS() throws Exception { final String html = "<html>\n" @@ -293,7 +310,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "[object SVGSVGElement]", IE = "exception") + @Alerts(DEFAULT = "[object SVGSVGElement]", + IE6 = "exception", + IE8 = "exception") public void createDocumentNS_svg() throws Exception { final String html = "<html><body>\n" + "<script>\n" @@ -310,7 +329,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", FF3_6 = "Hello", FF = "exception") + @Alerts(DEFAULT = "exception", + FF3_6 = "Hello") public void createDocumentNS_xul() throws Exception { final String html = "<html><body>\n" + "<script>\n" @@ -334,7 +354,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "[object HTMLCollection]", "0" }, IE = { "[object]", "0" }) + @Alerts(DEFAULT = { "[object HTMLCollection]", "0" }, + IE6 = { "[object]", "0" }, + IE8 = { "[object]", "0" }) public void applets() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -357,8 +379,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "imported: [object HTMLScriptElement]", "replaced" }, - IE = "exception") + @Alerts(DEFAULT = { "imported: [object HTMLScriptElement]", "replaced" }, + IE6 = "exception", + IE8 = "exception") public void importNode_script() throws Exception { final String html = "<html><head><title>foo</title><script>\n" + "function test() {\n" @@ -388,8 +411,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "imported: [object HTMLDivElement]", "replaced" }, - IE = "exception") + @Alerts(DEFAULT = { "imported: [object HTMLDivElement]", "replaced" }, + IE6 = "exception", + IE8 = "exception") public void importNode_scriptChild() throws Exception { final String html = "<html><head><title>foo</title><script>\n" + "function test() {\n" @@ -417,7 +441,7 @@ * @throws Exception if an error occurs */ @Test - @Browsers(FF) + @Browsers({ FF, IE10 }) @Alerts("clicked") public void dispatchEvent() throws Exception { final String html = @@ -442,8 +466,9 @@ * @throws Exception if an error occurs */ @Test - @Alerts(FF = { "undefined", "exception" }, - IE = { "[object]", "0", "1", "f", "f", "f", "f", "urn:f", "urn:f", "true" }) + @Alerts(DEFAULT = { "undefined", "exception" }, + IE6 = { "[object]", "0", "1", "f", "f", "f", "f", "urn:f", "urn:f", "true" }, + IE8 = { "[object]", "0", "1", "f", "f", "f", "f", "urn:f", "urn:f", "true" }) public void namespaces() throws Exception { final String html = "<body><script>\n" @@ -471,7 +496,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = "exception", IE = { "d", "1" }) + @Alerts(DEFAULT = "exception", + IE6 = { "d", "1" }, + IE8 = { "d", "1" }) public void documentMethodsWithoutDocument() throws Exception { final String html = "<div id='d' name='d'>d</div>\n" @@ -488,7 +515,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = "[object]", FF = "null") + @Alerts(DEFAULT = "null", + IE6 = "[object]", + IE8 = "[object]") public void getElementById_caseSensitivity() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -512,10 +541,11 @@ * @throws Exception if an error occurs */ @Test - @Alerts(IE = {"#ffffff", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + @Alerts(DEFAULT = {"", "", "#0000aa", "#0000aa", "x", "x" }, + FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + IE = {"#ffffff", "", "#0000aa", "#0000aa", "#000000", "#000000" }, // IE9 = {"#ffffff", "", "#0000aa", "#0000aa", "#000000", "#0" }, - FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, - DEFAULT = {"", "", "#0000aa", "#0000aa", "x", "x" }) + IE10 = {"#ffffff", "", "#0000aa", "#0000aa", "#000000", "#0" }) public void bgColor() throws Exception { final String html = "<html>\n" @@ -543,8 +573,9 @@ * @throws Exception if an error occurs */ @Test - @Alerts(FF = { "[object HTMLCollection]", "4", "red" }, - IE = { "[object]", "4", "red" }) + @Alerts(DEFAULT = { "[object HTMLCollection]", "4", "red" }, + IE6 = { "[object]", "4", "red" }, + IE8 = { "[object]", "4", "red" }) public void identicalIDs() throws Exception { final String html = "<html>\n" @@ -678,21 +709,31 @@ /** * Warning: this test works fine in real FF8 when started manually but fails through WebDriver. + * Warning: opens a modal panel when run through IEDriver which needs to be closed MANUALLY. + * If not all following test will fail. * @throws Exception if an error occurs */ @Test @BuggyWebDriver // tested with FF8, FF17, FF18 - @Alerts(FF = { "1", "[object HTMLBodyElement]" }, CHROME = { "0", "exception" }, IE = "exception") + @Alerts(CHROME = { "0", "exception" }, + FF = { "1", "[object HTMLBodyElement]" }, + IE = "exception") + // TODO [IE10]MODALPANEL real IE10 opens a modal panel which webdriver cannot handle public void designMode_selectionRange_empty() throws Exception { designMode_selectionRange(""); } /** + * Warning: opens a modal panel when run through IEDriver which needs to be closed MANUALLY. + * If not all following test will fail. * @throws Exception if an error occurs */ @Test @BuggyWebDriver // tested with FF8, FF17, FF18 - @Alerts(FF = { "1", "[object Text]" }, CHROME = { "0", "exception" }, IE = "exception") + @Alerts(CHROME = { "0", "exception" }, + FF = { "1", "[object Text]" }, + IE = "exception") + // TODO [IE10]MODALPANEL real IE10 opens a modal panel which webdriver cannot handle public void designMode_selectionRange_text() throws Exception { designMode_selectionRange("hello"); } @@ -720,7 +761,9 @@ */ @Test @Alerts(FF = "not defined", - IE = { "true", "1", "about:blank", "about:blank" }) + IE = { "false", "1", "about:blank", "about:blank" }, + IE10 = { "true", "1" }) + @NotYetImplemented(IE) public void frames() throws Exception { final String html = "<html><head><script>\n" + "function test(){\n" @@ -747,7 +790,8 @@ */ @Test @Alerts(FF = { "undefined", "false" }, - IE = { "[object]", "true" }) + IE = { "[object]", "true" }, + IE10 = { "[object Window]", "true" }) public void frameAccessByName() throws Exception { final String html = "<html><head><script>\n" + "function test(){\n" @@ -765,7 +809,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "2", "2" }, IE = { "0", "0" }) + @Alerts(FF = { "2", "2" }, + IE = { "0", "0" }, + IE10 = { "2", "0" }) public void getElementsByName() throws Exception { final String html = "<html><head><title>Test</title><script>\n" @@ -848,9 +894,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF3_6 = { "exception", "0 commands supported" }, - FF17 = { "32 commands supported", "not supported: foo, 123" }, - IE = { "32 commands supported", "not supported: foo, 123" }) + @Alerts(DEFAULT = { "32 commands supported", "not supported: foo, 123" }, + FF3_6 = { "exception", "0 commands supported" }) public void queryCommandSupported_common() throws Exception { final String[] commands = {"BackColor", "Bold", "Copy", "CreateLink", "Cut", "Delete", @@ -869,8 +914,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF3_6 = { "exception", "0 commands supported" }, - DEFAULT = { "0 commands supported" }, + @Alerts(DEFAULT = { "0 commands supported" }, + FF3_6 = { "exception", "0 commands supported" }, IE = { "46 commands supported" }) public void queryCommandSupported_disctinct() throws Exception { final String[] commands = {"2D-Position", "AbsolutePosition", @@ -923,7 +968,8 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = { "3", "div1" }, IE8 = "undefined") + @Alerts(DEFAULT = { "3", "div1" }, + IE6 = "undefined") public void querySelectorAll() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>Test</title>\n" + "<style>\n" @@ -999,8 +1045,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "3", "div1" }, - IE = "undefined") + @Alerts(DEFAULT = { "3", "div1" }, + IE6 = "undefined", + IE8 = "undefined") public void querySelectorAll_quirks() throws Exception { final String html = "<html><head><title>Test</title>\n" + "<style>\n" @@ -1032,7 +1079,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = "3", IE = "undefined") + @Alerts(DEFAULT = "3", + IE6 = "undefined", + IE8 = "undefined") public void querySelectorAll_implicitAttribute() throws Exception { final String html = "<html><head><title>Test</title>\n" + "<script>\n" @@ -1064,7 +1113,8 @@ */ @Test @Alerts(DEFAULT = { "div1", "null" }, - IE6 = "undefined", IE7 = "undefined", IE8 = "undefined") + IE6 = "undefined", + IE7 = "undefined") public void querySelector() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html><head><title>Test</title>\n" + "<style>\n" @@ -1095,7 +1145,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = { "1", "0" }, IE = { "0", "1" }) + @Alerts(DEFAULT = { "1", "0" }, + IE6 = { "0", "1" }, + IE8 = { "0", "1" }) public void getElementsByTagName2() throws Exception { final String html = "<html xmlns:ns1='http://example.com'>\n" + "<head>\n" @@ -1119,7 +1171,7 @@ */ @Test @Alerts({ "1", "0" }) - @NotYetImplemented(IE) + @NotYetImplemented({ IE6, IE8 }) public void getElementsByTagName3() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1159,6 +1211,7 @@ */ @Test @Alerts({ "true", "", "foo=bar", "foo=hello world" }) + // TODO [IE10]SINGLE-VS-BULK test runs when executed as single but breaks as bulk public void cookie_write_cookiesEnabled() throws Exception { loadPageWithAlerts2(getCookieWriteHtmlCode()); } @@ -1271,7 +1324,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", IE = "INPUT") + @Alerts(DEFAULT = "exception", + IE6 = "INPUT", + IE8 = "INPUT") public void createElement_notOnlyTagName() throws Exception { final String html = "<html><body>\n" + "<script>\n" @@ -1291,7 +1346,8 @@ * @throws Exception if the test fails */ @Test - @Alerts("null") + @Alerts(DEFAULT = "null", + IE6 = "") public void getElementById_strict() throws Exception { getElementById_strict(true); } @@ -1300,7 +1356,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "null", IE = "") + @Alerts(DEFAULT = "null", + IE6 = "", + IE8 = "") public void getElementById_quirks() throws Exception { getElementById_strict(false); } @@ -1324,9 +1382,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(FF = "[object HTMLHeadElement]", + @Alerts(DEFAULT = "[object HTMLHeadElement]", FF3_6 = "undefined", - IE = "undefined") + IE6 = "undefined", + IE8 = "undefined") public void head() throws Exception { final String html = "<html><body>\n" + "<script>\n" @@ -1340,10 +1399,11 @@ * @throws Exception if an error occurs */ @Test - @Alerts(IE = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + @Alerts(FF = {"", "", "#0000aa", "#0000aa", "x", "x" }, + FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + IE = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#000000" }, // IE9 = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#0" }, - FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, - FF = {"", "", "#0000aa", "#0000aa", "x", "x" }) + IE10 = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#0" }) public void alinkColor() throws Exception { final String html = "<html>\n" @@ -1371,10 +1431,11 @@ * @throws Exception if an error occurs */ @Test - @Alerts(IE = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + @Alerts(FF = {"", "", "#0000aa", "#0000aa", "x", "x" }, + FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + IE = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#000000" }, // IE9 = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#0" }, - FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, - FF = {"", "", "#0000aa", "#0000aa", "x", "x" }) + IE10 = {"#0000ff", "", "#0000aa", "#0000aa", "#000000", "#0" }) public void linkColor() throws Exception { final String html = "<html>\n" @@ -1402,11 +1463,12 @@ * @throws Exception if an error occurs */ @Test - @Alerts(IE = {"#800080", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + @Alerts(FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + FF10 = {"#800080", "", "#0000aa", "#0000aa", "x", "x" }, + FF17 = {"", "", "#0000aa", "#0000aa", "x", "x" }, + IE = {"#800080", "", "#0000aa", "#0000aa", "#000000", "#000000" }, // IE9 = {"#800080", "", "#0000aa", "#0000aa", "#000000", "#0" }, - FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, - FF10 = {"#800080", "", "#0000aa", "#0000aa", "x", "x" }, - FF17 = {"", "", "#0000aa", "#0000aa", "x", "x" }) + IE10 = {"#800080", "", "#0000aa", "#0000aa", "#000000", "#0" }) public void vlinkColor() throws Exception { final String html = "<html>\n" @@ -1434,10 +1496,11 @@ * @throws Exception if an error occurs */ @Test - @Alerts(IE = {"#000000", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + @Alerts(FF = {"", "", "#0000aa", "#0000aa", "x", "x" }, + FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, + IE = {"#000000", "", "#0000aa", "#0000aa", "#000000", "#000000" }, // IE9 = {"#000000", "", "#0000aa", "#0000aa", "#000000", "#0" }, - FF3_6 = {"", "", "#0000aa", "#0000aa", "#000000", "#000000" }, - FF = {"", "", "#0000aa", "#0000aa", "x", "x" }) + IE10 = {"#000000", "", "#0000aa", "#0000aa", "#000000", "#0" }) public void fgColor() throws Exception { final String html = "<html>\n" @@ -1465,9 +1528,12 @@ * @throws Exception if an error occurs */ @Test - @Alerts(FF = { "", "true" }, FF3_6 = { "", "false" }, IE = { }) + @Alerts(DEFAULT = { "", "true" }, + FF3_6 = { "", "false" }, + IE6 = { }, + IE8 = { }) +// IE9 = {"", "true" } @NotYetImplemented(FF3_6) -// IE9 = {"", "true" } public void getSelection() throws Exception { final String html = "<html>\n" @@ -1490,8 +1556,9 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "true", "[object]", "true" }, - DEFAULT = { "true", "undefined", "false" }) + @Alerts(DEFAULT = { "true", "undefined", "false" }, + IE = { "true", "[object]", "true" }, + IE10 = { "true", "[object HTMLFormElement]", "true" }) public void document_xxx_formAccess() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1516,9 +1583,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "undefined", "undefined", "iso-8859-1", "windows-1252" }, + @Alerts(CHROME = { "ISO-8859-1", "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" }, FF = { "ISO-8859-1", "ISO-8859-1", "undefined", "undefined" }, - CHROME = { "ISO-8859-1", "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" }) + IE = { "undefined", "undefined", "iso-8859-1", "windows-1252" }, + IE10 = { "ISO-8859-1", "iso-8859-1", "iso-8859-1", "windows-1252" }) public void encoding() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1540,9 +1608,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "undefined", "undefined", "iso-8859-1", "windows-1252" }, + @Alerts(CHROME = { "ISO-8859-1", "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" }, FF = { "ISO-8859-1", "ISO-8859-1", "undefined", "undefined" }, - CHROME = { "ISO-8859-1", "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" }) + IE = { "undefined", "undefined", "iso-8859-1", "windows-1252" }, + IE10 = { "ISO-8859-1", "iso-8859-1", "iso-8859-1", "windows-1252" }) public void encoding2() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1565,9 +1634,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "undefined", "undefined", "iso-8859-1", "windows-1252" }, + @Alerts(CHROME = { "ISO-8859-1", "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" }, FF = { "ISO-8859-1", "ISO-8859-1", "undefined", "undefined" }, - CHROME = { "ISO-8859-1", "ISO-8859-1", "ISO-8859-1", "ISO-8859-1" }) + IE = { "undefined", "undefined", "iso-8859-1", "windows-1252" }, + IE10 = { "ISO-8859-1", "iso-8859-1", "iso-8859-1", "windows-1252" }) public void encoding3() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1592,9 +1662,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "undefined", "undefined", "utf-8", "windows-1252" }, + @Alerts(CHROME = { "UTF-8", "UTF-8", "UTF-8", "ISO-8859-1" }, FF = { "UTF-8", "UTF-8", "undefined", "undefined" }, - CHROME = { "UTF-8", "UTF-8", "UTF-8", "ISO-8859-1" }) + IE = { "undefined", "undefined", "utf-8", "windows-1252" }, + IE10 = { "UTF-8", "utf-8", "utf-8", "windows-1252" }) public void encoding4() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1619,9 +1690,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "undefined", "undefined", "utf-8", "windows-1252" }, + @Alerts(CHROME = { "UTF-8", "UTF-8", "UTF-8", "ISO-8859-1" }, FF = { "UTF-8", "UTF-8", "undefined", "undefined" }, - CHROME = { "UTF-8", "UTF-8", "UTF-8", "ISO-8859-1" }) + IE = { "undefined", "undefined", "utf-8", "windows-1252" }, + IE10 = { "UTF-8", "utf-8", "utf-8", "windows-1252" }) public void encoding5() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1646,9 +1718,10 @@ * @throws Exception if the test fails */ @Test - @Alerts(IE = { "undefined", "undefined", "utf-8", "windows-1252" }, + @Alerts(CHROME = { "UTF-8", "UTF-8", "UTF-8", "ISO-8859-1" }, FF = { "UTF-8", "UTF-8", "undefined", "undefined" }, - CHROME = { "UTF-8", "UTF-8", "UTF-8", "ISO-8859-1" }) + IE = { "undefined", "undefined", "utf-8", "windows-1252" }, + IE10 = { "UTF-8", "utf-8", "utf-8", "windows-1252" }) public void encoding6() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1674,6 +1747,8 @@ * @throws Exception if the test fails */ @Test + @Alerts(DEFAULT = "?%C3%A8=%C3%A8", + IE = "?\u00E8=\u00E8") public void encoding7() throws Exception { final String html = "<html>\n" + "<head>\n" @@ -1686,149 +1761,159 @@ driver.findElement(By.id("myId")).click(); String actualQuery = driver.getCurrentUrl(); actualQuery = actualQuery.substring(actualQuery.indexOf('?')); - final String expectedQuery; - if (getBrowserVersion().isIE()) { - expectedQuery = "?\u00E8=\u00E8"; - } - else { - expectedQuery = "?%C3%A8=%C3%A8"; - } - assertTrue(actualQuery.endsWith(expectedQuery)); + assertTrue(actualQuery.endsWith(getExpectedAlerts()[0])); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE = { "5", "BackCompat", "undefined", "undefined" }, - DEFAULT = { "undefined", "BackCompat", "function", "function" }) + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE6 = { "undefined", "BackCompat", "undefined", "undefined" }, + IE8 = { "5", "BackCompat", "undefined", "undefined" }, + IE10 = { "10", "BackCompat", "function", "function" }) public void documentMode() throws Exception { - final String html = "<html>\n" - + "<head>\n" - + " <script>\n" - + " function test() {\n" - + " alert(document.documentMode);\n" - + " alert(document.compatMode);\n" - + " alert(typeof document.querySelectorAll);\n" - + " alert(typeof document.createElement('div').querySelector);\n" - + " }\n" - + " </script>\n" - + "</head><body onload='test()'>\n" - + "</body></html>"; - - loadPageWithAlerts2(html); + documentMode("", ""); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE8 = { "7", "CSS1Compat", "undefined", "undefined" }, + @Alerts(DEFAULT = { "undefined", "CSS1Compat", "function", "function" }, + IE6 = { "undefined", "CSS1Compat", "undefined", "undefined" }, + IE8 = { "8", "CSS1Compat", "object", "object" }, IE9 = { "9", "CSS1Compat", "function", "function" }, - DEFAULT = { "undefined", "CSS1Compat", "function", "function" }) - public void documentMode_standards() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html>\n" - + "<head>\n" - + " <script>\n" - + " function test() {\n" - + " alert(document.documentMode);\n" - + " alert(document.compatMode);\n" - + " alert(typeof document.querySelectorAll);\n" - + " alert(typeof document.createElement('div').querySelector);\n" - + " }\n" - + " </script>\n" - + "</head><body onload='test()'>\n" - + "</body></html>"; + IE10 = { "10", "CSS1Compat", "function", "function" }) + @NotYetImplemented(IE8) + public void documentMode_doctypeStrict() throws Exception { + documentMode(HtmlPageTest.STANDARDS_MODE_PREFIX_, ""); + } - loadPageWithAlerts2(html); + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE6 = { "undefined", "CSS1Compat", "undefined", "undefined" }, + IE8 = { "8", "CSS1Compat", "object", "object" }, + IE9 = { "9", "BackCompat", "function", "function" }, + IE10 = { "10", "BackCompat", "function", "function" }) + @NotYetImplemented(IE8) + public void documentMode_doctypeTransitional() throws Exception { + documentMode("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"" + + " \"http://www.w3.org/TR/html4/loose.dtd\">\n", ""); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE8 = { "8", "CSS1Compat", "false", "false" }, - IE9 = { "9", "CSS1Compat", "false", "false" }, - DEFAULT = { "undefined", "BackCompat", "false", "false" }) - public void documentMode_standards_8() throws Exception { - final String html = "<html>\n" - + "<head>\n" - + " <meta http-equiv='X-UA-Compatible' content='IE=8'>\n" - + " <script>\n" - + " function test() {\n" - + " alert(document.documentMode);\n" - + " alert(document.compatMode);\n" - + " alert(!document.querySelectorAll);\n" - + " alert(!document.createElement('div').querySelector);\n" - + " }\n" - + " </script>\n" - + "</head><body onload='test()'>\n" - + "</body></html>"; + @Alerts(DEFAULT = { "undefined", "CSS1Compat", "function", "function" }, + IE6 = { "undefined", "CSS1Compat", "undefined", "undefined" }, + IE8 = { "8", "CSS1Compat", "object", "object" }, + IE9 = { "9", "CSS1Compat", "function", "function" }, + IE10 = { "10", "CSS1Compat", "function", "function" }) + @NotYetImplemented(IE8) + public void documentMode_doctypeHTML5() throws Exception { + documentMode("<!DOCTYPE html>\n", ""); + } - loadPageWithAlerts2(html); + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE = { "5", "BackCompat", "undefined", "undefined" }, + IE6 = { "undefined", "BackCompat", "undefined", "undefined" }) + public void documentMode_metaIE5() throws Exception { + documentMode("", " <meta http-equiv='X-UA-Compatible' content='IE=5'>\n"); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE8 = { "8", "CSS1Compat", "false", "false" }, - IE9 = { "9", "CSS1Compat", "false", "false" }, - DEFAULT = { "undefined", "CSS1Compat", "false", "false" }) - public void documentMode_standards_8_prefix() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "<html>\n" - + "<head>\n" - + " <meta http-equiv='X-UA-Compatible' content='IE=8'>\n" - + " <script>\n" - + " function test() {\n" - + " alert(document.documentMode);\n" - + " alert(document.compatMode);\n" - + " alert(!document.querySelectorAll);\n" - + " alert(!document.createElement('div').querySelector);\n" - + " }\n" - + " </script>\n" - + "</head><body onload='test()'>\n" - + "</body></html>"; + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE = { "8", "CSS1Compat", "object", "object" }, + IE6 = { "undefined", "BackCompat", "undefined", "undefined" }) + @NotYetImplemented(IE8) + public void documentMode_metaIE8() throws Exception { + documentMode("", " <meta http-equiv='X-UA-Compatible' content='IE=8'>\n"); + } - loadPageWithAlerts2(html); + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "undefined", "CSS1Compat", "function", "function" }, + IE = { "8", "CSS1Compat", "object", "object" }, + IE6 = { "undefined", "CSS1Compat", "undefined", "undefined" }) + @NotYetImplemented(IE8) + public void documentMode_metaIE8_doctypeStrict() throws Exception { + documentMode(HtmlPageTest.STANDARDS_MODE_PREFIX_, " <meta http-equiv='X-UA-Compatible' content='IE=8'>\n"); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE8 = { "8", "CSS1Compat", "false", "false" }, - IE9 = { "9", "CSS1Compat", "false", "false" }, - DEFAULT = { "undefined", "BackCompat", "false", "false" }) - public void documentMode_standards_9() throws Exception { - final String html = "<html>\n" - + "<head>\n" - + " <meta http-equiv='X-UA-Compatible' content='IE=9'>\n" - + " <script>\n" - + " function test() {\n" - + " alert(document.documentMode);\n" - + " alert(document.compatMode);\n" - + " alert(!document.querySelectorAll);\n" - + " alert(!document.createElement('div').querySelector);\n" - + " }\n" - + " </script>\n" - + "</head><body onload='test()'>\n" - + "</body></html>"; + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE6 = { "undefined", "BackCompat", "undefined", "undefined" }, + IE8 = { "5", "BackCompat", "undefined", "undefined" }, + IE9 = { "9", "BackCompat", "function", "function" }, + IE10 = { "10", "BackCompat", "function", "function" }) + public void documentMode_metaEmulateIE8() throws Exception { + documentMode("", " <meta http-equiv='X-UA-Compatible' content='IE=Emulate8'>\n"); + } - loadPageWithAlerts2(html); + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "undefined", "CSS1Compat", "function", "function" }, + IE6 = { "undefined", "CSS1Compat", "undefined", "undefined" }, + IE8 = { "8", "CSS1Compat", "object", "object" }, + IE9 = { "9", "CSS1Compat", "function", "function" }, + IE10 = { "10", "CSS1Compat", "function", "function" }) + @NotYetImplemented(IE8) + public void documentMode_metaEmulateIE8_doctypeStrict() throws Exception { + documentMode(HtmlPageTest.STANDARDS_MODE_PREFIX_, + " <meta http-equiv='X-UA-Compatible' content='IE=Emulate8'>\n"); } /** * @throws Exception if the test fails */ @Test - @Alerts(IE8 = { "7", "CSS1Compat", "undefined", "undefined" }, + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE = { "9", "CSS1Compat", "function", "function" }, + IE6 = { "undefined", "BackCompat", "undefined", "undefined" }, + IE8 = { "8", "CSS1Compat", "object", "object" }) + @NotYetImplemented(IE8) + public void documentMode_metaIE9() throws Exception { + documentMode("", " <meta http-equiv='X-UA-Compatible' content='IE=9'>\n"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = { "undefined", "BackCompat", "function", "function" }, + IE6 = { "undefined", "BackCompat", "undefined", "undefined" }, + IE8 = { "8", "CSS1Compat", "object", "object" }, IE9 = { "9", "CSS1Compat", "function", "function" }, - DEFAULT = { "undefined", "CSS1Compat", "function", "function" }) - public void documentMode_html5() throws Exception { - final String html = "<!DOCTYPE html>\n" + IE10 = { "10", "CSS1Compat", "function", "function" }) + @NotYetImplemented(IE8) + public void documentMode_metaIEEdge() throws Exception { + documentMode("", " <meta http-equiv='X-UA-Compatible' content='IE=edge'>\n"); + } + + private void documentMode(final String doctype, final String meta) throws Exception { + final String html = doctype + "<html>\n" + "<head>\n" + + meta + " <script>\n" + " function test() {\n" + " alert(document.documentMode);\n" |