michael@0: SimpleTest.waitForExplicitFinish(); michael@0: michael@0: function frameLoaded() { michael@0: var testframe = document.getElementById('testframe'); michael@0: var embed = document.getElementsByTagName('embed')[0]; michael@0: if (undefined === embed) michael@0: embed = document.getElementsByTagName('object')[0]; michael@0: michael@0: // In the file:// URI case, this ends up being cross-origin. michael@0: // Skip these checks in that case. michael@0: if (testframe.contentDocument) { michael@0: var content = testframe.contentDocument.body.innerHTML; michael@0: if (!content.length) michael@0: return; michael@0: michael@0: var filename = embed.getAttribute("src") || michael@0: embed.getAttribute("geturl") || michael@0: embed.getAttribute("geturlnotify") || michael@0: embed.getAttribute("data"); michael@0: michael@0: var req = new XMLHttpRequest(); michael@0: req.open('GET', filename, false); michael@0: req.overrideMimeType('text/plain; charset=x-user-defined'); michael@0: req.send(null); michael@0: is(req.status, 200, "bad XMLHttpRequest status"); michael@0: is(content, req.responseText.replace(/\r\n/g, "\n"), michael@0: "content doesn't match"); michael@0: } michael@0: michael@0: is(embed.getError(), "pass", "plugin reported error"); michael@0: SimpleTest.finish(); michael@0: }