Browse Source

added Browser.supported check, maybe that helps?

mockey 11 years ago
parent
commit
e7f07e4646
1 changed files with 8 additions and 6 deletions
  1. 8 6
      tests/unit/issues/Issue2857.hx

+ 8 - 6
tests/unit/issues/Issue2857.hx

@@ -3,12 +3,14 @@ package unit.issues;
 class Issue2857 extends unit.Test {
 #if js
 	function testElement() {
-		var vid = js.Browser.document.createVideoElement();
-		t(Std.is(vid, js.html.VideoElement));
-		t(Std.is(vid, js.html.Element));
-		f(Std.is(vid, haxe.Http));
-		f(Std.is(vid, js.html.ArrayBuffer));
-		//eq(Type.getClass(vid), js.html.VideoElement);
+		if (js.Browser.supported) {
+			var vid = js.Browser.document.createVideoElement();
+			t(Std.is(vid, js.html.VideoElement));
+			t(Std.is(vid, js.html.Element));
+			f(Std.is(vid, haxe.Http));
+			f(Std.is(vid, js.html.ArrayBuffer));
+			eq(Type.getClass(vid), js.html.VideoElement);
+		}
 	}
 #end
 }