Skip to content

Commit 39d8616

Browse files
Add Cross-Origin Iframe Fixture
1 parent daeda44 commit 39d8616

File tree

3 files changed

+3624
-2303
lines changed

3 files changed

+3624
-2303
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import TestCase from '../../TestCase';
2+
const React = window.React;
3+
4+
export default class CrossOriginFrameTestCase extends React.Component {
5+
state = {count: 0};
6+
7+
componentDidMount() {
8+
this.interval = setInterval(() => {
9+
this.setState(state => ({count: state.count + 1}));
10+
}, 2000);
11+
}
12+
13+
componentWillUnmount() {
14+
clearInterval(this.interval);
15+
}
16+
17+
render() {
18+
return (
19+
<TestCase
20+
title="Selection within cross-origin iframes work"
21+
description=""
22+
affectedBrowsers="Safari"
23+
relatedIssues="14002">
24+
<TestCase.Steps>
25+
<li>Select text in the iframe below</li>
26+
<li>Open DevTools</li>
27+
<li>Wait for the counter to tick: {this.state.count}</li>
28+
</TestCase.Steps>
29+
<TestCase.ExpectedResult>
30+
No error is logged to the console.
31+
</TestCase.ExpectedResult>
32+
<iframe src="https://example.com/" />
33+
</TestCase>
34+
);
35+
}
36+
}

fixtures/dom/src/components/fixtures/selection-events/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import FixtureSet from '../../FixtureSet';
22
import ReorderedInputsTestCase from './ReorderedInputsTestCase';
33
import OnSelectEventTestCase from './OnSelectEventTestCase';
4+
import CrossOriginFrameTestCase from './CrossOriginFrameTestCase';
45
const React = window.React;
56

67
export default function SelectionEvents() {
@@ -14,6 +15,7 @@ export default function SelectionEvents() {
1415
">
1516
<ReorderedInputsTestCase />
1617
<OnSelectEventTestCase />
18+
<CrossOriginFrameTestCase />
1719
</FixtureSet>
1820
);
1921
}

0 commit comments

Comments
 (0)