diff --git a/tests/ios/App/AppDelegate.swift b/tests/ios/App/AppDelegate.swift index 079d56c..dbc2bda 100644 --- a/tests/ios/App/AppDelegate.swift +++ b/tests/ios/App/AppDelegate.swift @@ -19,4 +19,18 @@ import Cordova @UIApplicationMain class AppDelegate: CDVAppDelegate { + var _window : UIWindow?; + + override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + let bounds = UIScreen.main.bounds; + + let window = UIWindow(frame: bounds); + window.autoresizesSubviews = true; + window.rootViewController = CDVViewController(); + window.makeKeyAndVisible(); + + self._window = window; + + return true; + } } diff --git a/tests/ios/OAuthPluginTests.xcodeproj/DeviceTests.xctestplan b/tests/ios/OAuthPluginTests.xcodeproj/DeviceTests.xctestplan index 19e1b2f..8affa16 100644 --- a/tests/ios/OAuthPluginTests.xcodeproj/DeviceTests.xctestplan +++ b/tests/ios/OAuthPluginTests.xcodeproj/DeviceTests.xctestplan @@ -10,11 +10,13 @@ ], "defaultOptions" : { "codeCoverage" : false, + "repeatInNewRunnerProcess" : true, "targetForVariableExpansion" : { "containerPath" : "container:OAuthPluginTests.xcodeproj", "identifier" : "905131B827F1631300AC00FC", "name" : "OAuthPluginTest" - } + }, + "testRepetitionMode" : "retryOnFailure" }, "testTargets" : [ { diff --git a/tests/ios/OAuthPluginTests.xcodeproj/UnitTests.xctestplan b/tests/ios/OAuthPluginTests.xcodeproj/UnitTests.xctestplan index 4c74c03..a5cf1de 100644 --- a/tests/ios/OAuthPluginTests.xcodeproj/UnitTests.xctestplan +++ b/tests/ios/OAuthPluginTests.xcodeproj/UnitTests.xctestplan @@ -10,11 +10,13 @@ ], "defaultOptions" : { "codeCoverage" : true, + "repeatInNewRunnerProcess" : true, "targetForVariableExpansion" : { "containerPath" : "container:OAuthPluginTests.xcodeproj", "identifier" : "905131B827F1631300AC00FC", "name" : "OAuthPluginTest" - } + }, + "testRepetitionMode" : "retryOnFailure" }, "testTargets" : [ { diff --git a/tests/ios/OAuthPluginTests.xcodeproj/project.pbxproj b/tests/ios/OAuthPluginTests.xcodeproj/project.pbxproj index 6e1151b..0f7cc97 100644 --- a/tests/ios/OAuthPluginTests.xcodeproj/project.pbxproj +++ b/tests/ios/OAuthPluginTests.xcodeproj/project.pbxproj @@ -309,6 +309,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; @@ -341,6 +342,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -370,6 +372,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; @@ -402,6 +405,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/tests/ios/Tests/Tests.swift b/tests/ios/Tests/Tests.swift index 38321e5..e0a3b65 100644 --- a/tests/ios/Tests/Tests.swift +++ b/tests/ios/Tests/Tests.swift @@ -78,13 +78,13 @@ class OAuthPluginTests: XCTestCase { var plugin: OAuthPlugin! var cmdDlg: MockCommandDelegate! var webEngine: MockWebViewEngine! - var vc: UIViewController! + var vc: CDVViewController! override func setUpWithError() throws { // Always reset this to the default OAuthPlugin.forcedVersion = UInt32.max - vc = UIViewController() + vc = CDVViewController() cmdDlg = MockCommandDelegate() webEngine = MockWebViewEngine(frame: CGRect(x: 0, y: 0, width: 0, height: 0))