|
@@ -17,8 +17,17 @@ import Downloads from './examples/Downloads';
|
17
|
17
|
import Uploads from './examples/Uploads';
|
18
|
18
|
import Injection from './examples/Injection';
|
19
|
19
|
import LocalPageLoad from './examples/LocalPageLoad';
|
|
20
|
+import Messaging from './examples/Messaging';
|
20
|
21
|
|
21
|
22
|
const TESTS = {
|
|
23
|
+ Messaging: {
|
|
24
|
+ title: 'Messaging',
|
|
25
|
+ testId: 'messaging',
|
|
26
|
+ description: 'js-webview postMessage messaging test',
|
|
27
|
+ render() {
|
|
28
|
+ return <Messaging />;
|
|
29
|
+ },
|
|
30
|
+ },
|
22
|
31
|
Alerts: {
|
23
|
32
|
title: 'Alerts',
|
24
|
33
|
testId: 'alerts',
|
|
@@ -78,7 +87,7 @@ const TESTS = {
|
78
|
87
|
};
|
79
|
88
|
|
80
|
89
|
type Props = {};
|
81
|
|
-type State = {restarting: boolean, currentTest: Object};
|
|
90
|
+type State = {restarting: boolean; currentTest: Object};
|
82
|
91
|
|
83
|
92
|
export default class App extends Component<Props, State> {
|
84
|
93
|
state = {
|
|
@@ -90,7 +99,7 @@ export default class App extends Component<Props, State> {
|
90
|
99
|
this.setState({restarting: true}, () => this.setState({restarting: false}));
|
91
|
100
|
};
|
92
|
101
|
|
93
|
|
- _changeTest = testName => {
|
|
102
|
+ _changeTest = (testName) => {
|
94
|
103
|
this.setState({currentTest: TESTS[testName]});
|
95
|
104
|
};
|
96
|
105
|
|
|
@@ -138,16 +147,25 @@ export default class App extends Component<Props, State> {
|
138
|
147
|
title="LocalPageLoad"
|
139
|
148
|
onPress={() => this._changeTest('PageLoad')}
|
140
|
149
|
/>
|
141
|
|
- {Platform.OS == "ios" && <Button
|
142
|
|
- testID="testType_downloads"
|
143
|
|
- title="Downloads"
|
144
|
|
- onPress={() => this._changeTest('Downloads')}
|
145
|
|
- />}
|
146
|
|
- {Platform.OS === 'android' && <Button
|
147
|
|
- testID="testType_uploads"
|
148
|
|
- title="Uploads"
|
149
|
|
- onPress={() => this._changeTest('Uploads')}
|
150
|
|
- />}
|
|
150
|
+ {Platform.OS == 'ios' && (
|
|
151
|
+ <Button
|
|
152
|
+ testID="testType_downloads"
|
|
153
|
+ title="Downloads"
|
|
154
|
+ onPress={() => this._changeTest('Downloads')}
|
|
155
|
+ />
|
|
156
|
+ )}
|
|
157
|
+ {Platform.OS === 'android' && (
|
|
158
|
+ <Button
|
|
159
|
+ testID="testType_uploads"
|
|
160
|
+ title="Uploads"
|
|
161
|
+ onPress={() => this._changeTest('Uploads')}
|
|
162
|
+ />
|
|
163
|
+ )}
|
|
164
|
+ <Button
|
|
165
|
+ testID="testType_messaging"
|
|
166
|
+ title="Messaging"
|
|
167
|
+ onPress={() => this._changeTest('Messaging')}
|
|
168
|
+ />
|
151
|
169
|
</View>
|
152
|
170
|
|
153
|
171
|
{restarting ? null : (
|