Commit 70a72128 authored by Robert Knight's avatar Robert Knight

Fix iframe test in Chrome

The previous method of setting the `__hypothesis_frame` property on the
Window did not work. I haven't investigated in detail why, but the
alternate method of setting this property used here works instead.
parent 5c29bd9b
......@@ -124,15 +124,15 @@ describe('CrossFrame multi-frame scenario', function () {
it('excludes injection from already injected frames', function () {
var frame = document.createElement('iframe');
frame.setAttribute('enable-annotation', '');
frame.srcdoc = '<script>window.__hypothesis_frame = true;</script>';
container.appendChild(frame);
frame.contentWindow.eval('window.__hypothesis_frame = true');
crossFrame.pluginInit();
return new Promise(function (resolve) {
isLoaded(frame, function () {
var scriptElement = frame.contentDocument.querySelector('script[src]');
assert(!scriptElement, 'expected embed script to not be injected');
assert.isNull(scriptElement, 'expected embed script to not be injected');
resolve();
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment