mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
2c3ca4c058
Summary: More instrumentation tests in OSS means less work for FB engineers to investigate if a PR breaks some internal tests. + increased timeouts and retries for OSS tests runner Reviewed By: andreicoman11 Differential Revision: D3292582 fbshipit-source-id: 3f8aa4d3536450ea3af7acff044b9bb62be0f9db
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule DatePickerDialogTestModule
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var BatchedBridge = require('BatchedBridge');
|
|
var DatePickerAndroid = require('DatePickerAndroid');
|
|
var React = require('React');
|
|
var RecordingModule = require('NativeModules').DatePickerDialogRecordingModule;
|
|
var View = require('View');
|
|
|
|
var DatePickerDialogTestApp = React.createClass({
|
|
render: function() {
|
|
return (<View />);
|
|
},
|
|
});
|
|
|
|
var DatePickerDialogTestModule = {
|
|
DatePickerDialogTestApp: DatePickerDialogTestApp,
|
|
showDatePickerDialog: function(options) {
|
|
DatePickerAndroid.open(options).then(
|
|
({action, year, month, day}) => {
|
|
if (action === DatePickerAndroid.dateSetAction) {
|
|
RecordingModule.recordDate(year, month, day);
|
|
} else if (action === DatePickerAndroid.dismissedAction) {
|
|
RecordingModule.recordDismissed();
|
|
}
|
|
},
|
|
({code, message}) => RecordingModule.recordError()
|
|
);
|
|
},
|
|
};
|
|
|
|
BatchedBridge.registerCallableModule(
|
|
'DatePickerDialogTestModule',
|
|
DatePickerDialogTestModule
|
|
);
|
|
|
|
module.exports = DatePickerDialogTestModule;
|