react-native/Libraries/RCTTest
Albert Brand 420c07ef6f Add UIGraphicsPush/PopContext to prevent lost reference during snapshot testing
Summary:
We're seeing sporadic "CGContext...: invalid context 0x..." error messages during snapshot runs of our product build. This also seems to happen sometimes when building RN, see for instance: https://www.google.nl/search?q=site%3Atravis-ci.org%2Ffacebook%2Freact-native%20CGContextSaveGState%20invalid%20context

Our guess is that at some point, the CGContextRef is autoreleased. We tried retaining the ref first, but eventually settled for pushing/popping the context as it never fails in our tests (retaining still causes seemingly unrelated failures).

We're not sure if we can provide a testplan for this change, as the FBSnapshotTestController is not tested separately.
Closes https://github.com/facebook/react-native/pull/8098

Differential Revision: D3431043

fbshipit-source-id: 61b9a7a849a020f6b8671d63781eed9418d409dc
2016-06-14 09:58:41 -07:00
..
FBSnapshotTestCase Add UIGraphicsPush/PopContext to prevent lost reference during snapshot testing 2016-06-14 09:58:41 -07:00
RCTTest.xcodeproj Introduce SnapshotView which wraps Renderable content and will verify the snapshot 2015-10-02 12:15:24 -07:00
RCTSnapshotManager.h Introduce SnapshotView which wraps Renderable content and will verify the snapshot 2015-10-02 12:15:24 -07:00
RCTSnapshotManager.m RCTImagePicker now uses main thread 2015-11-16 03:17:29 -08:00
RCTTestModule.h Migrate unit tests from FBReactKitModules to FBReactKit 2015-07-07 16:39:35 -08:00
RCTTestModule.m Updated AppState module to use new emitter system 2016-05-23 09:13:37 -07:00
RCTTestRunner.h Move JS integration tests to root folder 2015-11-18 09:35:19 -08:00
RCTTestRunner.m Changed RUNNING_ON_CI to CI_USE_PACKAGER environment variable. 2016-05-23 04:44:11 -07:00
SnapshotViewIOS.android.js Move SnapshotView to SnapshotViewIOS and create an unimplemented android version 2015-10-13 11:48:38 -07:00
SnapshotViewIOS.ios.js Replace direct access of NativeModules.UIManager with require('UIManager') 2016-01-30 07:36:34 -08:00