Skip to content

Commit 67f6832

Browse files
chore: remove automation mode
1 parent 0937f2c commit 67f6832

File tree

4 files changed

+12
-73
lines changed

4 files changed

+12
-73
lines changed

Source/Immutable/Private/Immutable/Mac/ImmutableMac.cpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "Immutable/ImmutablePassport.h"
33
#include "Immutable/ImmutableSubsystem.h"
44
#include "Engine/GameEngine.h"
5+
#include "Misc/AutomationTest.h"
56

67
#if WITH_EDITOR
78
#include "Editor.h"
@@ -11,8 +12,7 @@
1112

1213
ASWebAuthenticationSession *_authSession;
1314

14-
// Global variable to track if we're in automation mode
15-
static BOOL g_isInAutomationMode = NO;
15+
// Remove the global automation mode variable
1616
static NSString* _pendingRedirectScheme = nil;
1717

1818
@implementation ImmutableMac
@@ -65,9 +65,9 @@ static NSString* _pendingRedirectScheme = nil;
6565

6666
- (void)launchUrl:(const char *)url forRedirectUri:(const char *)redirectUri {
6767
// For automation, use the browser-based method
68-
if (g_isInAutomationMode) {
69-
NSLog(@"Using automation mode for authentication");
70-
[self launchUrlInBrowser:url forRedirectUri:redirectUri forAutomation:YES];
68+
if (GIsAutomationTesting) {
69+
NSLog(@"Using automation mode for authentication (GIsAutomationTesting is true)");
70+
[self launchUrlInBrowser:url forRedirectUri:redirectUri];
7171
return;
7272
}
7373

@@ -108,11 +108,12 @@ static NSString* _pendingRedirectScheme = nil;
108108
}
109109
}
110110

111-
- (void)launchUrlInBrowser:(const char *)url forRedirectUri:(const char *)redirectUri forAutomation:(BOOL)forAutomation {
112-
// Set automation mode
113-
g_isInAutomationMode = forAutomation;
114-
NSLog(@"Setting automation mode: %@", g_isInAutomationMode ? @"YES" : @"NO");
115-
111+
- (void)launchUrlInBrowser:(const char *)url forRedirectUri:(const char *)redirectUri {
112+
// Add redundant check to ensure this only runs for automated testing
113+
if (!GIsAutomationTesting) {
114+
return;
115+
}
116+
116117
// Create URL object
117118
NSURL *URL = [NSURL URLWithString:[[NSString alloc] initWithUTF8String:url]];
118119

@@ -149,15 +150,4 @@ static NSString* _pendingRedirectScheme = nil;
149150
return [[[NSApplication sharedApplication] windows] firstObject];
150151
}
151152

152-
// Helper method to enable automation mode
153-
+ (void)setAutomationMode:(BOOL)enabled {
154-
g_isInAutomationMode = enabled;
155-
NSLog(@"setAutomationMode called with: %@", enabled ? @"YES" : @"NO");
156-
}
157-
158-
// Helper method to check if we're in automation mode
159-
+ (BOOL)isInAutomationMode {
160-
return g_isInAutomationMode;
161-
}
162-
163153
@end

Source/Immutable/Private/Immutable/Mac/ImmutableMac.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,5 @@
77
: NSObject <ASWebAuthenticationPresentationContextProviding>
88
+ (ImmutableMac *)instance;
99
- (void)launchUrl:(const char *)url forRedirectUri:(const char *)redirectUri;
10-
- (void)launchUrlInBrowser:(const char *)url forRedirectUri:(const char *)redirectUri forAutomation:(BOOL)forAutomation;
11-
12-
// Helper methods for automation
13-
+ (void)setAutomationMode:(BOOL)enabled;
14-
+ (BOOL)isInAutomationMode;
10+
- (void)launchUrlInBrowser:(const char *)url forRedirectUri:(const char *)redirectUri;
1511
@end

Source/Immutable/Private/Immutable/Mac/ImmutableMacHelper.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

Source/Immutable/Public/Immutable/Mac/ImmutableMacHelper.h

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)