aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/core.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2014-12-10 09:48:55 -0500
committerTimmy Willison <timmywillisn@gmail.com>2014-12-10 09:51:30 -0500
commitcfe468f29c4cbe1a457d0feb17dec90dcfd7c280 (patch)
tree95ee702e8f3be147f0bb7f5f7f34226cac435927 /test/unit/core.js
parent8653068dd6b8a515f5c1d8a0fda4479e9534103e (diff)
downloadjquery-cfe468f29c4cbe1a457d0feb17dec90dcfd7c280.tar.gz
jquery-cfe468f29c4cbe1a457d0feb17dec90dcfd7c280.zip
Core: re-introduce createHTMLDocument in parseHTML; Safari 8 left out
Close gh-1505
Diffstat (limited to 'test/unit/core.js')
-rw-r--r--test/unit/core.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 17006a8ab..034473b5c 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -235,7 +235,7 @@ test( "globalEval execution after script injection (#7862)", 1, function() {
});
// This is not run in AMD mode
-if (jQuery.noConflict) {
+if ( jQuery.noConflict ) {
test("noConflict", function() {
expect(7);
@@ -1370,6 +1370,22 @@ test("jQuery.parseHTML", function() {
ok( jQuery.parseHTML("<#if><tr><p>This is a test.</p></tr><#/if>") || true, "Garbage input should not cause error" );
});
+if ( jQuery.support.createHTMLDocument ) {
+ asyncTest("jQuery.parseHTML", function() {
+ expect ( 1 );
+
+ Globals.register("parseHTMLError");
+
+ jQuery.globalEval("parseHTMLError = false;");
+ jQuery.parseHTML( "<img src=x onerror='parseHTMLError = true'>" );
+
+ window.setTimeout(function() {
+ start();
+ equal( window.parseHTMLError, false, "onerror eventhandler has not been called." );
+ }, 2000);
+ });
+}
+
test("jQuery.parseJSON", function() {
expect( 20 );