Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / custom / testutils.js
index f9d64de..3b267c4 100644 (file)
@@ -34,8 +34,12 @@ if (!isParentFrame()) {
     };
 
     destroyContext = function () {
-        parent.document.querySelector('iframe').remove();
-        log('PASS destroyed context');
+        // This function can be called more than once so we need to check whether the iframe exists.
+        var frame = parent.document.querySelector('iframe');
+        if (frame) {
+            frame.remove();
+            log('PASS destroyed context');
+        }
     };
 }