Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e0ca919
[Perf] Migrate unswizzle-based unit tests to SPM (#11903)
JesusRojass Jun 12, 2026
5fa92f2
Fix update_firebase_spm_dependency.sh for branch names containing '#'
JesusRojass Jun 12, 2026
b7db9aa
Merge branch 'firebase:main' into JesusRojass/#11903
JesusRojass Jun 15, 2026
3464205
Merge branch 'firebase:main' into JesusRojass/#11903
JesusRojass Jun 15, 2026
6bb625d
Merge remote-tracking branch 'upstream/main' into JesusRojass/#11903
JesusRojass Jun 22, 2026
2710b35
[Perf] Stabilize SPM unswizzle tests and pin quickstart to PR head SHA
JesusRojass Jun 22, 2026
d6f1c64
[Perf] Apply clang-format to NSURLSession instrument tests
JesusRojass Jun 22, 2026
0c59896
[Perf] Stabilize NSURLSession instrument tests
JesusRojass Jun 23, 2026
be7b3be
[Perf] Use NSOperationQueue mainQueue in NSURLSession instrument tests
JesusRojass Jun 23, 2026
b313654
Merge remote-tracking branch 'upstream/main' into JesusRojass/#11903
JesusRojass Jun 23, 2026
cc31e93
Merge remote-tracking branch 'upstream/main' into JesusRojass/#11903
JesusRojass Jun 25, 2026
5e3515e
[Perf] Recreate temp dir before NSURLSession download tests
JesusRojass Jun 25, 2026
8f4bef8
Update FPRUIViewControllerInstrumentTest.m
JesusRojass Jun 25, 2026
f687eee
Update quickstart_build_spm.sh
JesusRojass Jun 25, 2026
60aab7e
Merge remote-tracking branch 'upstream/main' into JesusRojass/#11903
JesusRojass Jun 29, 2026
b456bd8
Merge remote-tracking branch 'upstream/main' into JesusRojass/#11903
JesusRojass Jun 29, 2026
539733b
Merge remote-tracking branch 'upstream/main' into JesusRojass/#11903
JesusRojass Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions FirebasePerformance.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ Firebase Performance library to measure performance of Mobile and Web Apps.

preprocessor_definitions = 'FIRPerformance_LIB_VERSION=' + String(s.version)
preprocessor_definitions += ' PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1'
if ENV['FPR_UNSWIZZLE_AVAILABLE'] && ENV['FPR_UNSWIZZLE_AVAILABLE'] == '1' then
preprocessor_definitions += ' UNSWIZZLE_AVAILABLE=1'
end

s.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
#import "FirebasePerformance/Sources/Common/FPRDiagnostics.h"

#import <GoogleUtilities/GULSwizzler.h>
#ifdef UNSWIZZLE_AVAILABLE
#import <GoogleUtilities/GULSwizzler+Unswizzle.h>
#endif

#import <objc/message.h>

@implementation FPRSelectorInstrumentor {
// The class this instrumentor operates on.
Expand Down Expand Up @@ -76,11 +75,15 @@ - (void)swizzle {

- (void)unswizzle {
_swizzled = NO;
#ifdef UNSWIZZLE_AVAILABLE
[GULSwizzler unswizzleClass:_class selector:_selector isClassSelector:_isClassSelector];
#else
NSAssert(NO, @"Unswizzling is disabled.");
#endif
// Unswizzling is provided by GoogleUtilities' GULSwizzlerTestHelpers category on GULSwizzler,
// which is only present at runtime when the hosting target links it (e.g. unit tests).
SEL unswizzleSelector = NSSelectorFromString(@"unswizzleClass:selector:isClassSelector:");
if ([GULSwizzler respondsToSelector:unswizzleSelector]) {
((void (*)(Class, SEL, Class, SEL, BOOL))objc_msgSend)([GULSwizzler class], unswizzleSelector,
_class, _selector, _isClassSelector);
} else {
NSAssert(NO, @"Unswizzling is disabled.");
}
}

- (IMP)currentIMP {
Expand Down
4 changes: 0 additions & 4 deletions FirebasePerformance/Tests/Unit/FPRClassInstrumentorTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ - (void)testCannotInstrumentSameSelectorTwice {

#pragma mark - Unswizzle based tests

#if !SWIFT_PACKAGE

/** Tests swizzling an instance selector. */
- (void)testSwizzleInstanceSelector {
FPRClassInstrumentor *classInstrumentor =
Expand Down Expand Up @@ -158,6 +156,4 @@ - (void)testVoidReturnClassSelector {
[classInstrumentor unswizzle];
}

#endif // SWIFT_PACKAGE

@end
4 changes: 0 additions & 4 deletions FirebasePerformance/Tests/Unit/FPRInstrumentTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ - (void)testRegisterAlreadyRegisteredClassInstrumentor {

#pragma mark - Unswizzle based tests

#if !SWIFT_PACKAGE

- (void)testDeregisterInstrumentors {
FPRInstrument *instrument = [[FPRInstrument alloc] init];
FPRClassInstrumentor *classInstrumentor =
Expand All @@ -86,6 +84,4 @@ - (void)testDeregisterInstrumentors {
[classInstrumentor unswizzle];
}

#endif // SWIFT_PACKAGE

@end
4 changes: 0 additions & 4 deletions FirebasePerformance/Tests/Unit/FPRInstrumentationTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ - (void)testInit {

#pragma mark - Unswizzle based tests

#ifndef SWIFT_PACKAGE

- (void)testRegisterInstrumentGroup {
FPRInstrumentation *instrumentation = [[FPRInstrumentation alloc] init];
NSUInteger numberOfInstrumentsInGroup =
Expand All @@ -53,6 +51,4 @@ - (void)testDeregisterInstrumentGroup {
XCTAssertTrue([instrumentation deregisterInstrumentGroup:kFPRInstrumentationGroupNetworkKey]);
}

#endif // SWIFT_PACKAGE

@end
4 changes: 0 additions & 4 deletions FirebasePerformance/Tests/Unit/FPRSelectorInstrumentorTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ - (void)testInitWithSelector {

#pragma mark - Unswizzle based tests

#ifndef SWIFT_PACKAGE

- (void)testInstanceMethodSwizzle {
NSString *expectedDescription = @"Not the description you expected!";
FPRSelectorInstrumentor *instrumentor =
Expand Down Expand Up @@ -329,8 +327,6 @@ typedef void (^DataTaskCompletionHandler)(NSData *_Nullable, NSURLResponse *_Nul
}
}

#endif // SWIFT_PACKAGE

/** Tests attempting to swizzle non-existent/unimplemented method (like @dynamic) returns nil. */
- (void)testNonexistentMethodReturnsNil {
FPRSelectorInstrumentor *instrumentor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#pragma mark - Unswizzle based tests

#if !SWIFT_PACKAGE

#import "FirebasePerformance/Tests/Unit/Instruments/FPRNSURLConnectionInstrumentTestDelegates.h"

#import <XCTest/XCTest.h>
Expand Down Expand Up @@ -519,5 +517,3 @@ - (void)testDownloadDelegateCompletionAPIGetsCalledEvenIfDataDelegateIsImplement
}

@end

#endif // SWIFT_PACKAGE
Loading
Loading