mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Update
This commit is contained in:
parent
4f6ba2c2d0
commit
7171441b96
7 changed files with 199 additions and 213 deletions
|
|
@ -999,7 +999,35 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||
|
||||
telegramUIDeclareEncodables()
|
||||
initializeAccountManagement()
|
||||
|
||||
|
||||
if isUITest,
|
||||
let deleteIdx = CommandLine.arguments.firstIndex(of: "--delete-test-account"),
|
||||
deleteIdx + 1 < CommandLine.arguments.count
|
||||
{
|
||||
let phone = CommandLine.arguments[deleteIdx + 1]
|
||||
let digits = phone.hasPrefix("+") ? String(phone.dropFirst()) : phone
|
||||
guard digits.count == 10, digits.hasPrefix("99966") else {
|
||||
preconditionFailure("--delete-test-account phone must match 99966XYYYY")
|
||||
}
|
||||
let dcDigit = digits[digits.index(digits.startIndex, offsetBy: 5)]
|
||||
let phoneCode = String(repeating: dcDigit, count: 5)
|
||||
|
||||
let _ = test_loginAndDeleteAccount(
|
||||
rootPath: rootPath,
|
||||
accountManager: accountManager,
|
||||
networkArguments: networkArguments,
|
||||
encryptionParameters: encryptionParameters,
|
||||
phoneNumber: "+\(digits)",
|
||||
phoneCode: phoneCode
|
||||
).start(error: { _ in
|
||||
preconditionFailure("test_loginAndDeleteAccount failed")
|
||||
}, completed: { [weak self] in
|
||||
self?.window?.accessibilityIdentifier = "DeleteAccount.Success"
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
let pushRegistry = PKPushRegistry(queue: .main)
|
||||
if #available(iOS 9.0, *) {
|
||||
pushRegistry.desiredPushTypes = Set([.voIP])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue