Skip to content

Commit 0701d8c

Browse files
committed
Merge pull request google#373 from katz/fix-PercentLoaded-error
check existence of PercentLoaded function in other way
2 parents a0a4fb8 + 34d698b commit 0701d8c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

closure/goog/ui/media/flashobject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ goog.ui.media.FlashObject.prototype.isLoaded = function() {
623623
return true;
624624
}
625625

626-
if (this.getFlashElement().PercentLoaded &&
626+
if ('PercentLoaded' in this.getFlashElement() &&
627627
this.getFlashElement().PercentLoaded() == 100) {
628628
return true;
629629
}

closure/goog/ui/media/flashobject_test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,17 @@ function testThrowsRequiredVersionOfFlashNotAvailable() {
281281
flash.dispose();
282282
}
283283

284+
function testIsLoadedForIE() {
285+
control.$replayAll();
286+
287+
var flash = new goog.ui.media.FlashObject(FLASH_URL, domHelper);
288+
flash.render();
289+
assertNotThrows('isLoaded() should not throw exception', function() {
290+
flash.isLoaded();
291+
})
292+
flash.dispose();
293+
}
294+
284295
function testIsLoadedAfterDispose() {
285296
control.$replayAll();
286297

0 commit comments

Comments
 (0)