Prevent tests from ever opening Chrome
The test is commented out for now.
This commit is contained in:
parent
6d4b8d1e7b
commit
a2cd949e09
|
@ -26,7 +26,7 @@
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "NO">
|
||||||
<Testables>
|
<Testables>
|
||||||
<TestableReference
|
<TestableReference
|
||||||
skipped = "NO">
|
skipped = "NO">
|
||||||
|
@ -53,6 +53,12 @@
|
||||||
ReferencedContainer = "container:RealmJS.xcodeproj">
|
ReferencedContainer = "container:RealmJS.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</MacroExpansion>
|
</MacroExpansion>
|
||||||
|
<CommandLineArguments>
|
||||||
|
<CommandLineArgument
|
||||||
|
argument = "-RealmReactEnableChromeDebugging NO"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</CommandLineArgument>
|
||||||
|
</CommandLineArguments>
|
||||||
<AdditionalOptions>
|
<AdditionalOptions>
|
||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "NO">
|
||||||
<Testables>
|
<Testables>
|
||||||
<TestableReference
|
<TestableReference
|
||||||
skipped = "NO">
|
skipped = "NO">
|
||||||
|
@ -62,6 +62,12 @@
|
||||||
ReferencedContainer = "container:ReactTests.xcodeproj">
|
ReferencedContainer = "container:ReactTests.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</MacroExpansion>
|
</MacroExpansion>
|
||||||
|
<CommandLineArguments>
|
||||||
|
<CommandLineArgument
|
||||||
|
argument = "-RealmReactEnableChromeDebugging NO"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</CommandLineArgument>
|
||||||
|
</CommandLineArguments>
|
||||||
<AdditionalOptions>
|
<AdditionalOptions>
|
||||||
</AdditionalOptions>
|
</AdditionalOptions>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
|
|
|
@ -19,8 +19,30 @@
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
#import "RCTRootView.h"
|
#import "RCTRootView.h"
|
||||||
|
|
||||||
|
static NSString * const RealmReactEnableChromeDebuggingKey = @"RealmReactEnableChromeDebugging";
|
||||||
|
static NSString * const RCTDevMenuKey = @"RCTDevMenu";
|
||||||
|
|
||||||
@implementation AppDelegate
|
@implementation AppDelegate
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||||
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
|
// Check if this default is explicitly set, otherwise just leave the settings as is.
|
||||||
|
if ([defaults objectForKey:RealmReactEnableChromeDebuggingKey]) {
|
||||||
|
NSMutableDictionary *settings = [([defaults dictionaryForKey:RCTDevMenuKey] ?: @{}) mutableCopy];
|
||||||
|
NSMutableDictionary *domain = [[defaults volatileDomainForName:NSArgumentDomain] mutableCopy];
|
||||||
|
|
||||||
|
settings[@"executorClass"] = [defaults boolForKey:RealmReactEnableChromeDebuggingKey] ? @"RCTWebSocketExecutor" : @"RCTContextExecutor";
|
||||||
|
domain[RCTDevMenuKey] = settings;
|
||||||
|
|
||||||
|
// Re-register the arguments domain (highest precedent and volatile) with our new overridden settings.
|
||||||
|
[defaults removeVolatileDomainForName:NSArgumentDomain];
|
||||||
|
[defaults setVolatileDomain:domain forName:NSArgumentDomain];
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||||
NSURL *jsCodeLocation;
|
NSURL *jsCodeLocation;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
|
|
||||||
extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx, bool includesNativeCallStack);
|
extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx, bool includesNativeCallStack);
|
||||||
|
|
||||||
|
@interface RCTDevMenu () <RCTInvalidating>
|
||||||
|
@end
|
||||||
|
|
||||||
@interface RealmReactTests : RealmJSTests
|
@interface RealmReactTests : RealmJSTests
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -34,12 +37,6 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
||||||
|
|
||||||
@implementation RealmReactTests
|
@implementation RealmReactTests
|
||||||
|
|
||||||
+ (void)load {
|
|
||||||
// Swap the [RCTDevMenu init] method with [NSObject init] in order to disable RCTDevMenu completely.
|
|
||||||
IMP init = class_getMethodImplementation([NSObject class], @selector(init));
|
|
||||||
class_replaceMethod([RCTDevMenu class], @selector(init), init, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (Class)executorClass {
|
+ (Class)executorClass {
|
||||||
return NSClassFromString(@"RCTContextExecutor");
|
return NSClassFromString(@"RCTContextExecutor");
|
||||||
}
|
}
|
||||||
|
@ -56,14 +53,23 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
||||||
}
|
}
|
||||||
|
|
||||||
static RCTBridge *s_bridge;
|
static RCTBridge *s_bridge;
|
||||||
|
if (!s_bridge) {
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:nil];
|
||||||
|
}
|
||||||
|
|
||||||
if (!s_bridge.valid) {
|
if (!s_bridge.valid) {
|
||||||
NSNotification *notification = [self waitForNotification:RCTJavaScriptDidLoadNotification];;
|
NSNotification *notification = [self waitForNotification:RCTDidCreateNativeModules];
|
||||||
s_bridge = notification.userInfo[@"bridge"];
|
s_bridge = notification.object;
|
||||||
|
|
||||||
if (!s_bridge) {
|
if (!s_bridge) {
|
||||||
NSLog(@"No RCTBridge provided by RCTJavaScriptDidLoadNotification");
|
NSLog(@"No RCTBridge provided by RCTJavaScriptDidLoadNotification");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We don't want the RCTDevMenu from switching the executor class from underneath us.
|
||||||
|
[s_bridge.devMenu invalidate];
|
||||||
|
|
||||||
|
[self waitForNotification:RCTJavaScriptDidLoadNotification];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_bridge.executorClass != executorClass) {
|
if (s_bridge.executorClass != executorClass) {
|
||||||
|
@ -190,6 +196,7 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/* TODO: Re-enable once this works in CI
|
||||||
@implementation RealmReactChromeTests
|
@implementation RealmReactChromeTests
|
||||||
|
|
||||||
+ (Class)executorClass {
|
+ (Class)executorClass {
|
||||||
|
@ -201,3 +208,4 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
*/
|
||||||
|
|
Loading…
Reference in New Issue