[NC Apple coverage] Refactor GNSPeripheralManager tests to use fake objects. III

PiperOrigin-RevId: 831259501
This commit is contained in:
Edwin Wu
2025-11-12 00:45:50 -08:00
committed by Copybara-Service
parent 935096779d
commit d92eae1535
3 changed files with 482 additions and 652 deletions
@@ -445,7 +445,6 @@ static NSTimeInterval gKBTCrashLoopMaxTimeBetweenResetting = 15.f;
return;
}
NSAssert(peripheral.isAdvertising, @"Peripheral should be advertising.");
GNCLoggerInfo(@"Peripheral did start advertising %@", _advertisementData);
// Once an advertisment operation is over, check if the advertised data is up-to-date.
@@ -47,13 +47,13 @@ objc_library(
srcs = [
"Peripheral/GNSFakePeripheralManager.m",
"Peripheral/GNSFakePeripheralServiceManager.m",
"Peripheral/GNSPeripheralManagerTest.m",
],
hdrs = [
"Peripheral/GNSFakePeripheralManager.h",
"Peripheral/GNSFakePeripheralServiceManager.h",
],
deps = [
"//internal/platform/implementation/apple/Log:GNCLogger",
"//internal/platform/implementation/apple/Mediums/BLE/Sockets:Peripheral",
"//internal/platform/implementation/apple/Mediums/BLE/Sockets:Shared",
"//third_party/apple_frameworks:CoreBluetooth",
@@ -63,6 +63,14 @@ objc_library(
],
)
ios_unit_test(
name = "PeripheralTests",
google_create_srl_bindings_module = False,
minimum_os_version = IOS_MINIMUM_OS,
runner = "//testing/utp/ios:IOS_LATEST",
deps = [":PeripheralTestsLib"],
)
objc_library(
name = "SharedTestsLib",
testonly = 1,