Skip to content

Commit 2907037

Browse files
committed
get rid of NotYetImplemented
1 parent ddf3f39 commit 2907037

File tree

4 files changed

+40
-21
lines changed

4 files changed

+40
-21
lines changed

src/test/java/org/htmlunit/javascript/host/crypto/SubtleCryptoTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.htmlunit.junit.BrowserRunner;
1919
import org.htmlunit.junit.annotation.Alerts;
2020
import org.htmlunit.junit.annotation.HtmlUnitNYI;
21-
import org.htmlunit.junit.annotation.NotYetImplemented;
2221
import org.junit.Test;
2322
import org.junit.runner.RunWith;
2423

@@ -100,8 +99,11 @@ public void unsupportedCall() throws Exception {
10099
"publicExponent 1,0,1",
101100
"private", "false", "sign",
102101
"name RSASSA-PKCS1-v1_5", "hash [object Object]", "modulusLength 2048",
103-
"publicExponent 1,0,1"})
104-
@NotYetImplemented
102+
"publicExponent 1,0,1", "done"})
103+
@HtmlUnitNYI(CHROME = {"[object Crypto]", "[object DOMException]"},
104+
EDGE = {"[object Crypto]", "[object DOMException]"},
105+
FF = {"[object Crypto]", "[object DOMException]"},
106+
FF_ESR = {"[object Crypto]", "[object DOMException]"})
105107
public void rsassa() throws Exception {
106108
final String html = DOCTYPE_HTML
107109
+ "<html><head><script>\n"
@@ -132,18 +134,17 @@ public void rsassa() throws Exception {
132134
+ " for(var x in key.privateKey.algorithm) {\n"
133135
+ " log(x + ' ' + key.publicKey.algorithm[x]);\n"
134136
+ " }\n"
135-
+ " alert('done');\n"
137+
+ " log('done');\n"
136138
+ " })\n"
137139
+ " .catch(function(err) {\n"
138140
+ " log(err);\n"
139141
+ " });\n"
140-
+ " } else { alert('done'); }\n"
142+
+ " } else { log('no window.crypto'); }\n"
141143
+ " }\n"
142144
+ "</script></head><body onload='test()'>\n"
143145
+ "</body></html>";
144146

145147
loadPage2(html);
146-
verifyAlerts(getWebDriver(), "done");
147-
verifyTitle2(getWebDriver(), getExpectedAlerts());
148+
verifyTitle2(DEFAULT_WAIT_TIME, getWebDriver(), getExpectedAlerts());
148149
}
149150
}

src/test/java/org/htmlunit/javascript/host/css/property/ElementOffsetHeight2Test.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.htmlunit.junit.BrowserRunner;
1919
import org.htmlunit.junit.annotation.Alerts;
2020
import org.htmlunit.junit.annotation.HtmlUnitNYI;
21-
import org.htmlunit.junit.annotation.NotYetImplemented;
2221
import org.junit.Test;
2322
import org.junit.runner.RunWith;
2423
import org.openqa.selenium.By;
@@ -69,7 +68,10 @@ public void offsetHeight() throws Exception {
6968
@Alerts(DEFAULT = "12, 27, 44, 60, 80, 108, 126, 161, 208, 216, 270, 288, 340, 407",
7069
FF = "14, 30, 48, 60, 80, 108, 126, 161, 208, 224, 279, 297, 350, 418",
7170
FF_ESR = "14, 30, 48, 60, 80, 108, 126, 161, 208, 224, 279, 297, 350, 418")
72-
@NotYetImplemented // we will see other results on unix
71+
@HtmlUnitNYI(CHROME = "12, 27, 44, 60, 80, 108, 126, 161, 208, 216, 270, 320, 374, 407",
72+
EDGE = "12, 27, 44, 60, 80, 108, 126, 161, 208, 216, 270, 320, 374, 407",
73+
FF = "14, 30, 48, 60, 80, 108, 126, 161, 208, 224, 279, 330, 385, 418",
74+
FF_ESR = "14, 30, 48, 60, 80, 108, 126, 161, 208, 224, 279, 330, 385, 418")
7375
public void offsetHeightLineBreaks() throws Exception {
7476
final String html = DOCTYPE_HTML
7577
+ "<html><head><body>\n"

src/test/java/org/htmlunit/javascript/host/html/HTMLCanvasElementTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.htmlunit.WebDriverTestCase;
1818
import org.htmlunit.junit.BrowserRunner;
1919
import org.htmlunit.junit.annotation.Alerts;
20-
import org.htmlunit.junit.annotation.NotYetImplemented;
20+
import org.htmlunit.junit.annotation.HtmlUnitNYI;
2121
import org.junit.Test;
2222
import org.junit.runner.RunWith;
2323

@@ -220,7 +220,10 @@ public void toDataUrlPng() throws Exception {
220220
@Test
221221
@Alerts({"[object CanvasRenderingContext2D]", "[object WebGLRenderingContext]",
222222
"[object WebGLRenderingContext]", "[object WebGL2RenderingContext]", "null", "null"})
223-
@NotYetImplemented
223+
@HtmlUnitNYI(CHROME = {"[object CanvasRenderingContext2D]", "null", "null", "null", "null", "null"},
224+
EDGE = {"[object CanvasRenderingContext2D]", "null", "null", "null", "null", "null"},
225+
FF = {"[object CanvasRenderingContext2D]", "null", "null", "null", "null", "null"},
226+
FF_ESR = {"[object CanvasRenderingContext2D]", "null", "null", "null", "null", "null"})
224227
public void getContext() throws Exception {
225228
final String html = DOCTYPE_HTML
226229
+ "<html>\n"

src/test/java/org/htmlunit/javascript/host/html/HTMLFrameElement2Test.java

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222
import org.htmlunit.WebDriverTestCase;
2323
import org.htmlunit.junit.BrowserRunner;
2424
import org.htmlunit.junit.annotation.Alerts;
25-
import org.htmlunit.junit.annotation.NotYetImplemented;
25+
import org.htmlunit.junit.annotation.HtmlUnitNYI;
2626
import org.htmlunit.util.MimeType;
2727
import org.htmlunit.util.NameValuePair;
2828
import org.junit.Test;
2929
import org.junit.runner.RunWith;
3030
import org.openqa.selenium.By;
31+
import org.openqa.selenium.NoSuchElementException;
3132
import org.openqa.selenium.WebDriver;
3233

3334
/**
@@ -649,7 +650,14 @@ public void windowLocationAssignOnload() throws Exception {
649650
"content\nClick for new frame content with onload",
650651
"header -> content -> frameSet -> onloadFrame",
651652
"onloadFrame\nNew content loaded..."})
652-
@NotYetImplemented
653+
@HtmlUnitNYI(CHROME = {"OnloadTest", "header -> frameSet", "content.html",
654+
"Element named 'onloadFrameAnchor' not found."},
655+
EDGE = {"OnloadTest", "header -> frameSet", "content.html",
656+
"Element named 'onloadFrameAnchor' not found."},
657+
FF = {"OnloadTest", "header -> frameSet", "content.html",
658+
"Element named 'onloadFrameAnchor' not found."},
659+
FF_ESR = {"OnloadTest", "header -> frameSet", "content.html",
660+
"Element named 'onloadFrameAnchor' not found."})
653661
public void windowLocationSetOnload() throws Exception {
654662
final String html = DOCTYPE_HTML
655663
+ "<html><head><title>OnloadTest</title></head>\n"
@@ -706,14 +714,19 @@ public void windowLocationSetOnload() throws Exception {
706714
driver.switchTo().frame("content");
707715
assertEquals(getExpectedAlerts()[2], driver.findElement(By.tagName("body")).getText());
708716

709-
driver.findElement(By.name("onloadFrameAnchor")).click();
710-
driver.switchTo().defaultContent();
711-
driver.switchTo().frame("header");
712-
assertEquals(getExpectedAlerts()[3], driver.findElement(By.id("frameOrder")).getText());
713-
714-
driver.switchTo().defaultContent();
715-
driver.switchTo().frame("content");
716-
assertEquals(getExpectedAlerts()[4], driver.findElement(By.tagName("body")).getText());
717+
try {
718+
driver.findElement(By.name("onloadFrameAnchor")).click();
719+
driver.switchTo().defaultContent();
720+
driver.switchTo().frame("header");
721+
assertEquals(getExpectedAlerts()[3], driver.findElement(By.id("frameOrder")).getText());
722+
723+
driver.switchTo().defaultContent();
724+
driver.switchTo().frame("content");
725+
assertEquals(getExpectedAlerts()[4], driver.findElement(By.tagName("body")).getText());
726+
}
727+
catch (final NoSuchElementException e) {
728+
assertEquals(getExpectedAlerts()[3], "Element named 'onloadFrameAnchor' not found.");
729+
}
717730
}
718731

719732
/**

0 commit comments

Comments
 (0)