diff --git a/AppNexusSDK.podspec b/AppNexusSDK.podspec index 6fc436b00..89c441e31 100644 --- a/AppNexusSDK.podspec +++ b/AppNexusSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppNexusSDK" - s.version = "7.3.2" + s.version = "7.4" s.platform = :ios, "9.0" s.summary = "AppNexus iOS Mobile Advertising SDK" @@ -45,7 +45,7 @@ DESC s.subspec 'FacebookCSRAdapter' do |subspec| subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}" - subspec.dependency 'FBAudienceNetwork', '5.5.1' + subspec.dependency 'FBAudienceNetwork', '5.9.0' subspec.source_files = "csr/Facebook/*.{h,m}" subspec.public_header_files = "csr/Facebook/ANFBSettings.h" subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/FBAudienceNetwork/**' } @@ -53,7 +53,7 @@ DESC s.subspec 'FacebookAdapter' do |subspec| subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}" - subspec.dependency 'FBAudienceNetwork', '5.5.1' + subspec.dependency 'FBAudienceNetwork', '5.9.0' subspec.source_files = "mediation/mediatedviews/Facebook/*.{h,m}" subspec.public_header_files = "mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.h" subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/FBAudienceNetwork/**' } diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index cfb22fa42..c33058425 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,18 @@ +## 7.4 +### New Feature ++ MS-4214: Added support for loading the Ad lazily (Lazy Load) [https://wiki.xandr.com/x/VJFlBg] + +### Mediation partner upgrade ++ FacebookAd SDK v5.9.0 + +### Improvements/Bug Fixes ++ MS-4231: Added support to respect timeout set in Console ++ MS-4284: Implemented support for MRAID v3.0 audioVolumeChange event ++ MS-4290: Added support to get Custom Keywords in the JavaScript layer via ANJAM ++ MS-4319: Added support to disable Banner demand for BannerAdView ++ MS-4335: Improved Banner Ad performance + + ## 7.3.2 ### Improvements/Bug Fixes + MS-4352: Fixed NSHTTPCookieStorage setting diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/BannerAd/BannerAdViewController.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/BannerAd/BannerAdViewController.m index bc4881949..8f223eee1 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/BannerAd/BannerAdViewController.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/BannerAd/BannerAdViewController.m @@ -34,7 +34,7 @@ - (void)viewDidLoad int adWidth = 300; int adHeight = 250; - NSString *adID = @"1281482"; + NSString *adID = @"19212468"; // We want to center our ad on the screen. CGRect screenRect = [[UIScreen mainScreen] bounds]; diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/InterstitialAd/InterstitialAdViewController.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/InterstitialAd/InterstitialAdViewController.m index f298f8824..b9f55e627 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/InterstitialAd/InterstitialAdViewController.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/InterstitialAd/InterstitialAdViewController.m @@ -29,7 +29,7 @@ @implementation InterstitialAdViewController - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Interstitial Ad"; - self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"1281482"]; + self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"19212468"]; self.interstitialAd.delegate = self; self.interstitialAd.clickThroughAction = ANClickThroughActionReturnURL; [self.interstitialAd loadAd]; diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m index 3b94d7cae..ff483fcb3 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m @@ -61,7 +61,7 @@ - (void)viewDidLoad { // Create Banner Ad Object - (ANBannerAdView *)createBannerAd:(UIView *) adView { - self.bannerAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"17982237" adSize:CGSizeMake(300, 250)]; + self.bannerAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"19212468" adSize:CGSizeMake(300, 250)]; self.bannerAd.rootViewController =self; self.bannerAd.delegate =self; self.bannerAd.shouldResizeAdToFitContainer = YES; @@ -73,7 +73,7 @@ - (ANBannerAdView *)createBannerAd:(UIView *) adView // Create Interstitial Ad Object - (ANInterstitialAd *)createInterstitialAd { - self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"17982237"]; + self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"19212468"]; self.interstitialAd.delegate =self; return self.interstitialAd; @@ -83,7 +83,7 @@ - (ANInterstitialAd *)createInterstitialAd // Create InstreamVideo Ad Object - (ANInstreamVideoAd *)createVideoAd { - self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:@"17982237"]; + self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:@"19212468"]; self.videoAd.loadDelegate =self; return self.videoAd; } @@ -92,7 +92,7 @@ - (ANInstreamVideoAd *)createVideoAd - (ANNativeAdRequest *)createNativeAd { self.nativeAdRequest = [[ANNativeAdRequest alloc] init]; - self.nativeAdRequest.placementId = @"17982237"; + self.nativeAdRequest.placementId = @"19212468"; self.nativeAdRequest.shouldLoadIconImage = YES; self.nativeAdRequest.shouldLoadMainImage = YES; self.nativeAdRequest.delegate = self; diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/NativeAd/NativeAdViewController.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/NativeAd/NativeAdViewController.m index 13ec05eeb..e66a5709e 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/NativeAd/NativeAdViewController.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/NativeAd/NativeAdViewController.m @@ -32,7 +32,7 @@ - (void)viewDidLoad { [ANLogManager setANLogLevel:ANLogLevelAll]; self.nativeAdRequest= [[ANNativeAdRequest alloc] init]; - self.nativeAdRequest.placementId = @"1281482"; + self.nativeAdRequest.placementId = @"19212468"; self.nativeAdRequest.gender = ANGenderMale; self.nativeAdRequest.shouldLoadIconImage = YES; self.nativeAdRequest.shouldLoadMainImage = YES; diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/VideoAd/VideoAdViewController.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/VideoAd/VideoAdViewController.m index b89b9a997..786ed6fbc 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/VideoAd/VideoAdViewController.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/VideoAd/VideoAdViewController.m @@ -23,7 +23,7 @@ NSString *const videoContent = @"https://acdn.adnxs.com/mobile/video_test/content/Scenario.mp4"; -NSString *const placementId = @"9924001"; +NSString *const placementId = @"19212468"; @@ -73,8 +73,8 @@ - (void)viewDidLoad { } [self setupContentPlayer]; -// self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:placementId]; - self.videoAd = [[ANInstreamVideoAd alloc] initWithMemberId:958 inventoryCode:@"trucksmash"]; + self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:placementId]; +// self.videoAd = [[ANInstreamVideoAd alloc] initWithMemberId:958 inventoryCode:@"trucksmash"]; [self.videoAd loadAdWithDelegate:self]; self.videoAd.clickThroughAction = ANClickThroughActionOpenSDKBrowser; diff --git a/sdk/AppNexusSDK.xcodeproj/project.pbxproj b/sdk/AppNexusSDK.xcodeproj/project.pbxproj index fb5777c9f..c64f6d2a6 100644 --- a/sdk/AppNexusSDK.xcodeproj/project.pbxproj +++ b/sdk/AppNexusSDK.xcodeproj/project.pbxproj @@ -88,6 +88,8 @@ 0ECF336622D79A62007DB185 /* AppNexusSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ECF336022D79A62007DB185 /* AppNexusSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0ED85345208A94F200A5FFA0 /* ANGDPRSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E35D4AC2088F67E000A6C27 /* ANGDPRSettings.m */; }; 0EF636D322D7726000D3320F /* ANProxyViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ABC03D21C5AD3E100D7C789 /* ANProxyViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 381A0183245B17850093EBB2 /* ANAudioVolumeChangeListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 381A0181245B17850093EBB2 /* ANAudioVolumeChangeListener.h */; }; + 381A0184245B17850093EBB2 /* ANAudioVolumeChangeListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 381A0182245B17850093EBB2 /* ANAudioVolumeChangeListener.m */; }; 4F06400823A2E7D700E7920A /* ANAdFetcherBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 006F6B992295F70E003D2DF0 /* ANAdFetcherBase.m */; }; 4F06400923A2E7DC00E7920A /* ANAdFetcherBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 006F6B9D2295F72A003D2DF0 /* ANAdFetcherBase.h */; }; 4F5758B12303A8CB00AFF4B6 /* ANMultiAdRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F5758B02303A8CB00AFF4B6 /* ANMultiAdRequest.m */; }; @@ -97,6 +99,10 @@ 4F8EBCD4235E2F6200256BFB /* ANMultiAdRequest+PrivateMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F8EBCD3235E2F6200256BFB /* ANMultiAdRequest+PrivateMethods.h */; }; 4F8EBCD5235E2F6200256BFB /* ANMultiAdRequest+PrivateMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F8EBCD3235E2F6200256BFB /* ANMultiAdRequest+PrivateMethods.h */; }; 4F99240E2357BEC1008E31B6 /* ANMultiAdRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F61C690231F0C0C00678DB8 /* ANMultiAdRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 60165D262464823E00E8E07C /* ANHTTPNetworkSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 60165D242464823D00E8E07C /* ANHTTPNetworkSession.m */; }; + 60165D272464823E00E8E07C /* ANHTTPNetworkSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 60165D242464823D00E8E07C /* ANHTTPNetworkSession.m */; }; + 60165D282464823E00E8E07C /* ANHTTPNetworkSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 60165D252464823E00E8E07C /* ANHTTPNetworkSession.h */; }; + 60165D292464823E00E8E07C /* ANHTTPNetworkSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 60165D252464823E00E8E07C /* ANHTTPNetworkSession.h */; }; 60183FD52293482700CFDE33 /* ANWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 60183FD222933E9500CFDE33 /* ANWebView.h */; settings = {ATTRIBUTES = (Private, ); }; }; 60183FD622934AB500CFDE33 /* ANWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 60183FD322933E9500CFDE33 /* ANWebView.m */; }; 602ADF6720178BAF00BEF101 /* ANProxyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ABC03D31C5AD3E100D7C789 /* ANProxyViewController.m */; }; @@ -384,6 +390,8 @@ 0ECF336022D79A62007DB185 /* AppNexusSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppNexusSDK.h; sourceTree = ""; }; 0ECF336122D79A62007DB185 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0EEE97DA21764ACD007DADE6 /* omsdk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = omsdk.js; sourceTree = ""; }; + 381A0181245B17850093EBB2 /* ANAudioVolumeChangeListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANAudioVolumeChangeListener.h; sourceTree = ""; }; + 381A0182245B17850093EBB2 /* ANAudioVolumeChangeListener.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANAudioVolumeChangeListener.m; sourceTree = ""; }; 4F131E8A1F71CCE50019FDAC /* ANAdFetcherResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdFetcherResponse.h; sourceTree = ""; }; 4F131E8B1F71CCE50019FDAC /* ANAdFetcherResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdFetcherResponse.m; sourceTree = ""; }; 4F403A6D2043C8CF00EF75A2 /* vastVideo.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = vastVideo.html; sourceTree = ""; }; @@ -396,6 +404,8 @@ 4FA566E81F4B94D3004652AB /* ANTrackerInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANTrackerInfo.m; sourceTree = ""; }; 4FA566E91F4B94D3004652AB /* ANTrackerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTrackerManager.h; sourceTree = ""; }; 4FA566EA1F4B94D3004652AB /* ANTrackerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANTrackerManager.m; sourceTree = ""; }; + 60165D242464823D00E8E07C /* ANHTTPNetworkSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANHTTPNetworkSession.m; sourceTree = ""; }; + 60165D252464823E00E8E07C /* ANHTTPNetworkSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANHTTPNetworkSession.h; sourceTree = ""; }; 60183FD222933E9500CFDE33 /* ANWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANWebView.h; sourceTree = ""; }; 60183FD322933E9500CFDE33 /* ANWebView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANWebView.m; sourceTree = ""; }; 602E0E221FE46571002C0F1C /* WKWebView+ANCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WKWebView+ANCategory.h"; sourceTree = ""; }; @@ -836,6 +846,8 @@ 8AC7C5371A3B5CEF00AA5548 /* ANAdWebViewController.m */, 8AD618A81981C11F00AC0780 /* ANANJAMImplementation.h */, 8AD618A91981C11F00AC0780 /* ANANJAMImplementation.m */, + 381A0181245B17850093EBB2 /* ANAudioVolumeChangeListener.h */, + 381A0182245B17850093EBB2 /* ANAudioVolumeChangeListener.m */, 8AD618AA1981C11F00AC0780 /* ANBannerAdView.m */, 8AD618AC1981C11F00AC0780 /* ANBrowserViewController.h */, 8AD618AD1981C11F00AC0780 /* ANBrowserViewController.m */, @@ -843,6 +855,8 @@ 8AD618AF1981C11F00AC0780 /* ANClickOverlayView.m */, 8AD618B01981C11F00AC0780 /* ANGlobal.h */, 8AD618B11981C11F00AC0780 /* ANGlobal.m */, + 60165D252464823E00E8E07C /* ANHTTPNetworkSession.h */, + 60165D242464823D00E8E07C /* ANHTTPNetworkSession.m */, 8AD618B21981C11F00AC0780 /* ANInterstitialAd.m */, 8AD618B31981C11F00AC0780 /* ANInterstitialAdViewController.h */, 8AD618B41981C11F00AC0780 /* ANInterstitialAdViewController.m */, @@ -1012,6 +1026,7 @@ 8A9AEDB31A1BE8C200C58BDA /* ANAdView.h in Headers */, 8A9AEDCE1A1BF88200C58BDA /* ANAdViewInternalDelegate.h in Headers */, 8A9AEDD01A1BF88200C58BDA /* ANANJAMImplementation.h in Headers */, + 381A0183245B17850093EBB2 /* ANAudioVolumeChangeListener.h in Headers */, 8A9AEDC61A1BF88200C58BDA /* ANBannerAdView+ANContentViewTransitions.h in Headers */, 8A9AEDB41A1BE8C200C58BDA /* ANBannerAdView.h in Headers */, FCC5DA612034AD3E003DC7B2 /* ANBaseAdObject.h in Headers */, @@ -1026,6 +1041,7 @@ 8A9AEDB51A1BE8C200C58BDA /* ANCustomAdapter.h in Headers */, 0EBE633A208F765E0008F4CC /* ANGDPRSettings.h in Headers */, 8A9AEDD41A1BF88200C58BDA /* ANGlobal.h in Headers */, + 60165D282464823E00E8E07C /* ANHTTPNetworkSession.h in Headers */, 609732B41E42E7910061EC0A /* ANInstreamVideoAd.h in Headers */, 8A9AEDB61A1BE8C200C58BDA /* ANInterstitialAd.h in Headers */, 8A9AEDD51A1BF88200C58BDA /* ANInterstitialAdViewController.h in Headers */, @@ -1113,6 +1129,7 @@ 0E02F07124336D590073A226 /* ANCSRNativeAdResponse.h in Headers */, F5731BC2228C9A4C0012B134 /* ANGDPRSettings.h in Headers */, F5731B72228C8FD60012B134 /* ANGlobal.h in Headers */, + 60165D292464823E00E8E07C /* ANHTTPNetworkSession.h in Headers */, F5731B74228C900E0012B134 /* ANLocation.h in Headers */, F5731B78228C90310012B134 /* ANLogging.h in Headers */, F5731B75228C90240012B134 /* ANLogManager.h in Headers */, @@ -1316,6 +1333,7 @@ 8A9AEDF01A1BF99D00C58BDA /* ANAdView.m in Sources */, 8AE7AD9F1A7AC4F6009E2F2F /* ANAdWebViewController.m in Sources */, 8A9AEDF21A1BF99D00C58BDA /* ANANJAMImplementation.m in Sources */, + 381A0184245B17850093EBB2 /* ANAudioVolumeChangeListener.m in Sources */, 8A9AEDE81A1BF99D00C58BDA /* ANBannerAdView+ANContentViewTransitions.m in Sources */, 8A9AEDF31A1BF99D00C58BDA /* ANBannerAdView.m in Sources */, FCC5DA5F2034AD35003DC7B2 /* ANBaseAdObject.m in Sources */, @@ -1328,6 +1346,7 @@ 0E3E3E64241FB73500823D66 /* ANCSRNativeAdResponse.m in Sources */, 0ED85345208A94F200A5FFA0 /* ANGDPRSettings.m in Sources */, 8A9AEDF61A1BF99D00C58BDA /* ANGlobal.m in Sources */, + 60165D262464823E00E8E07C /* ANHTTPNetworkSession.m in Sources */, 609733061E42EAFF0061EC0A /* ANInstreamVideoAd.m in Sources */, 8A9AEDF71A1BF99D00C58BDA /* ANInterstitialAd.m in Sources */, 8A9AEDF81A1BF99D00C58BDA /* ANInterstitialAdViewController.m in Sources */, @@ -1406,6 +1425,7 @@ 0E02F07024336D570073A226 /* ANCSRNativeAdResponse.m in Sources */, F5731B6C228C8E430012B134 /* ANGDPRSettings.m in Sources */, F5731B71228C8FD20012B134 /* ANGlobal.m in Sources */, + 60165D272464823E00E8E07C /* ANHTTPNetworkSession.m in Sources */, F5731B73228C900B0012B134 /* ANLocation.m in Sources */, F5731B77228C902D0012B134 /* ANLogging.m in Sources */, F5731B76228C902A0012B134 /* ANLogManager.m in Sources */, @@ -1493,7 +1513,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ""; - MARKETING_VERSION = 7.3.2; + MARKETING_VERSION = 7.4; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "corp.appnexus.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1529,7 +1549,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ""; - MARKETING_VERSION = 7.3.2; + MARKETING_VERSION = 7.4; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "corp.appnexus.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1681,7 +1701,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ""; - MARKETING_VERSION = 7.3.2; + MARKETING_VERSION = 7.4; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.appnexus.AppNexusNativeSDK; @@ -1726,7 +1746,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ""; - MARKETING_VERSION = 7.3.2; + MARKETING_VERSION = 7.4; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.appnexus.AppNexusNativeSDK; diff --git a/sdk/sourcefiles/ANAdConstants.h b/sdk/sourcefiles/ANAdConstants.h index 751bc724a..f72d1a402 100644 --- a/sdk/sourcefiles/ANAdConstants.h +++ b/sdk/sourcefiles/ANAdConstants.h @@ -72,7 +72,7 @@ typedef NS_ENUM(NSUInteger, ANClickThroughAction) { * */ typedef NS_ENUM(NSUInteger, ANVideoOrientation) { ANUnknown, - ANPortraint, + ANPortrait, ANLandscape, ANSquare }; diff --git a/sdk/sourcefiles/ANAdProtocol.h b/sdk/sourcefiles/ANAdProtocol.h index dccc63c61..ad89c89fb 100644 --- a/sdk/sourcefiles/ANAdProtocol.h +++ b/sdk/sourcefiles/ANAdProtocol.h @@ -257,20 +257,20 @@ */ - (void)removeAllOpenMeasurementFriendlyObstructions; - - @end + @protocol ANNativeAdRequestProtocol -//EMPTY + //EMPTY @end @protocol ANNativeAdResponseProtocol -//EMPTY + //EMPTY @end + @protocol ANVideoAdProtocol /** * Get the Orientation of the Video rendered using the BannerAdView @@ -300,6 +300,7 @@ ad:didReceivNativeAd: used to receive ANNativeAdReponse when that is returned from an ANBannerAdView request. */ - (void)adDidReceiveAd:(nonnull id)ad; +- (void)lazyAdDidReceiveAd:(nonnull id)ad; - (void)ad:(nonnull id)loadInstance didReceiveNativeAd:(nonnull id)responseInstance; diff --git a/sdk/sourcefiles/ANBannerAdView.h b/sdk/sourcefiles/ANBannerAdView.h index 51c746b1c..69cb992f5 100644 --- a/sdk/sourcefiles/ANBannerAdView.h +++ b/sdk/sourcefiles/ANBannerAdView.h @@ -220,6 +220,7 @@ typedef NS_ENUM(NSUInteger, ANBannerViewAdAlignment) { */ @property (nonatomic, readwrite, assign) BOOL shouldResizeAdToFitContainer; + /** Set whether impression should be counted when the creative is loaded. This feature is disabled by default. @@ -238,21 +239,36 @@ typedef NS_ENUM(NSUInteger, ANBannerViewAdAlignment) { @property (nonatomic, readwrite) BOOL shouldAllowNativeDemand; +/** + * Sets whether or not banner Ads(AppNexus Media Type:1) can serve on this Ad object. + * If shouldAllowBannerDemand is not set, the default is true. +*/ +@property (nonatomic, readwrite) BOOL shouldAllowBannerDemand; + + + /** * If enableNativeRendering is not set, the default is false. * Rendering NativeAd to behave as BannerAd */ @property (nonatomic, readwrite) BOOL enableNativeRendering; - /** * nativeAdRendererId : Native Assembly renderer_id that is associated with the placement. * If rendererId is not set, the default is zero (0). * A value of zero indicates that renderer_id will not be sent in the UT Request. -*/ + */ @property (nonatomic, readonly) NSInteger nativeAdRendererId DEPRECATED_MSG_ATTRIBUTE("nativeAdRendererId is deprecated."); +/** + * If enableLazyLoad is not set, the default is NO. + * Generate AdUnit without loading webview automatically. + * Host app must complete load with [self loadLazyAd]. + */ +@property (nonatomic, readwrite) BOOL enableLazyLoad; + + /** * Sets whether or not Native Ads(AppNexus Media Type:12) can serve on this Ad object with nativeRendererId. @@ -305,6 +321,8 @@ typedef NS_ENUM(NSUInteger, ANBannerViewAdAlignment) { */ - (void) loadAd; +- (BOOL) loadLazyAd; + @end diff --git a/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js b/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js index fb0fb1af2..8534813d6 100644 --- a/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js +++ b/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js @@ -40,6 +40,7 @@ listeners['viewableChange'] = []; listeners['sizeChange'] = []; listeners['exposureChange'] = []; + listeners['audioVolumeChange'] = []; var state = 'loading'; //Can be loading, default, expanded, hidden, or resized var placement_type = 'inline'; var is_viewable = false; @@ -107,6 +108,9 @@ */ mraid.addEventListener = function(event_name, method) { if (listeners[event_name].indexOf(method) > -1) return; // Listener is already registered + if(event_name == 'audioVolumeChange'){ + mraid.audioVolumeChange(); + } listeners[event_name].push(method); }; @@ -146,6 +150,10 @@ mraid.enable = function() { mraid.util.nativeCall("mraid://enable/"); }; + + mraid.audioVolumeChange = function() { + mraid.util.nativeCall("mraid://audioVolumeChange/"); + }; //Closes an expanded ad or hides an ad in default state mraid.close = function() { @@ -477,6 +485,12 @@ if (state === 'loading') return; mraid.util.fireEvent('exposureChange', exposureObject.exposedPercentage,exposureObject.visibleRectangle,exposureObject.occlusionRectangles); }; + + + mraid.util.audioVolumeChangeEvent = function(audioVolumeObject) { + if (state === 'loading') return; + mraid.util.fireEvent('audioVolumeChange', audioVolumeObject.volumePercentage); + }; mraid.util.validateResizeProperties = function(properties, callingFunctionName) { diff --git a/sdk/sourcefiles/Resources/anjam.js b/sdk/sourcefiles/Resources/anjam.js index 0f1688a2f..a58bf8f6c 100644 --- a/sdk/sourcefiles/Resources/anjam.js +++ b/sdk/sourcefiles/Resources/anjam.js @@ -34,6 +34,7 @@ var CALL_DISPATCHAPPEVENT = "DispatchAppEvent"; var CALL_GETVERSION = "GetVersion"; var CALL_GETDEVICEID = "GetDeviceID"; + var CALL_GETCUSTOMKEYWORDS = "GetCustomKeywords"; var CALL_SETMRAIDREFRESHFREQUENCY = "SetMRAIDRefreshFrequency"; var CALL_READY = "ready"; var CALL_RESULT = "result"; @@ -587,6 +588,18 @@ anjam.fireMessage(CALL_GETDEVICEID, [new anjam.pair( "cb", callbacksCounter)]); } + + // required: callback + anjam.GetCustomKeywords = function (callback) { + if (typeof callback !== "function") { + anjam.anlog("GetCustomKeywords error: callback parameter should be a function"); + return; + } + anjam.addCallback(callback); + + anjam.fireMessage(CALL_GETCUSTOMKEYWORDS, [new anjam.pair( + "cb", callbacksCounter)]); + } anjam.SetMRAIDRefreshFrequency = function(milliseconds) { if (isNaN(milliseconds)) { diff --git a/sdk/sourcefiles/Resources/errors.strings b/sdk/sourcefiles/Resources/errors.strings index 48c54a792..ae4a61ebd 100644 --- a/sdk/sourcefiles/Resources/errors.strings +++ b/sdk/sourcefiles/Resources/errors.strings @@ -39,3 +39,4 @@ "native_adapter_error"="Could not register with mediated SDK adapter, it does not implement the required methods."; "native_adapter_native_ad_delegate_missing"="The native mediated adapter has not synthesized the nativeAdDelegate property"; "native_invalid_clickable_views"="A non-view object was passed in clickableViews. Ignoring."; +"lazy_ad_load_failed %@"="Lazy ad load FAILED TO INSTANTIATE WEBVIEW. (ANAdResponseCode: %@"; diff --git a/sdk/sourcefiles/Resources/nativeRenderer.html b/sdk/sourcefiles/Resources/nativeRenderer.html index c798dbb69..840fca624 100644 --- a/sdk/sourcefiles/Resources/nativeRenderer.html +++ b/sdk/sourcefiles/Resources/nativeRenderer.html @@ -65,8 +65,8 @@ // function handleEventCallback(targetId, eventType, message) - //FIX -- trigger delegate response to mobile plaform code - //FIX -- should handleEventCallback be passed in from HTML? + //TBD -- trigger delegate response to mobile plaform code + //TBD -- should handleEventCallback be passed in from HTML? { console.log('Apntag: targetId=' +targetId+ ' eventType=' +eventType); diff --git a/sdk/sourcefiles/Resources/sdkjs.js b/sdk/sourcefiles/Resources/sdkjs.js index b99911ba0..bbb7332e2 100644 --- a/sdk/sourcefiles/Resources/sdkjs.js +++ b/sdk/sourcefiles/Resources/sdkjs.js @@ -32,6 +32,7 @@ var CALL_RECORDEVENT = "RecordEvent"; var CALL_DISPATCHAPPEVENT = "DispatchAppEvent"; var CALL_GETDEVICEID = "GetDeviceID"; + var CALL_GETCUSTOMKEYWORDS = "GetCustomKeywords"; var CALL_SETMRAIDREFRESHFREQUENCY = "SetMRAIDRefreshFrequency"; var CALL_READY = "ready"; var CALL_RESULT = "result"; @@ -93,6 +94,8 @@ sdkjs.callDispatchAppEvent(queryParameters); } else if (path === CALL_GETDEVICEID) { sdkjs.callGetDeviceID(queryParameters); + } else if (path === CALL_GETCUSTOMKEYWORDS) { + sdkjs.callGetCustomKeywords(queryParameters); } else if (path === CALL_MRAID) { sdkjs.callMraid(queryParameters); } else if (path === CALL_SETMRAIDREFRESHFREQUENCY) { @@ -219,6 +222,12 @@ sdkjs.makeNativeCall("GetDeviceID?cb=" + cb); } + + sdkjs.callGetCustomKeywords = function (queryParameters) { + var cb = queryParameters.cb; + + sdkjs.makeNativeCall("GetCustomKeywords?cb=" + cb); + } sdkjs.callSetMraidRefreshFrequency = function (queryParameters) { var ms = queryParameters.ms; @@ -265,6 +274,8 @@ "exposureChange"); sdkjs.mraidSizeChangeEventHandler = new sdkjs.mraidEventHandler( "sizeChange"); + sdkjs.mraidAudioVolumeChangeEventHandler = new sdkjs.mraidEventHandler( + "audioVolumeChange"); if ((typeof mraid) !== "undefined") { // add mraid event listeners to pass to anjam @@ -278,6 +289,8 @@ sdkjs.mraidExposureChangeEventHandler.call); mraid.addEventListener("sizeChange", sdkjs.mraidSizeChangeEventHandler .call); + mraid.addEventListener("audioVolumeChange", + sdkjs.mraidAudioVolumeChangeEventHandler.call); } sdkjs.mraidUpdateProperty = function (propertyName, value) { diff --git a/sdk/sourcefiles/internal/ANANJAMImplementation.m b/sdk/sourcefiles/internal/ANANJAMImplementation.m index 1cd936f96..2147fb23f 100644 --- a/sdk/sourcefiles/internal/ANANJAMImplementation.m +++ b/sdk/sourcefiles/internal/ANANJAMImplementation.m @@ -27,6 +27,7 @@ NSString *const kANCallDispatchAppEvent = @"DispatchAppEvent"; NSString *const kANCallGetDeviceID = @"GetDeviceID"; NSString *const kANCallSetMraidRefreshFrequency = @"SetMRAIDRefreshFrequency"; +NSString *const kANCallGetCustomKeywords = @"GetCustomKeywords"; NSString *const kANKeyCaller = @"caller"; @@ -58,7 +59,9 @@ + (void)handleURL:(NSURL *)URL withWebViewController:(ANAdWebViewController *)co [ANANJAMImplementation callGetDeviceID:controller query:queryComponents]; } else if ([call isEqualToString:kANCallSetMraidRefreshFrequency]) { [ANANJAMImplementation callSetMraidRefreshFrequency:controller query:queryComponents]; - } else { + } else if ([call isEqualToString:kANCallGetCustomKeywords]) { + [ANANJAMImplementation callGetCustomKeywords:controller query:queryComponents]; + }else { ANLogWarn(@"ANJAM called with unsupported function: %@", call); } } @@ -108,7 +111,7 @@ + (void)callExternalBrowser:(ANAdWebViewController *)controller query:(NSDiction if (ANHasHttpPrefix([url scheme]) && [[UIApplication sharedApplication] canOpenURL:url]) { //added as the test case was failing due to unavailability of a delegate. - [controller.adViewANJAMDelegate adWillLeaveApplication]; + [controller.adViewANJAMInternalDelegate adWillLeaveApplication]; [ANGlobal openURL:[url absoluteString]]; } } @@ -141,7 +144,7 @@ + (void)callDispatchAppEvent:(ANAdWebViewController *)controller query:(NSDictio NSString *event = [query valueForKey:@"event"]; NSString *data = [query valueForKey:@"data"]; - [controller.adViewANJAMDelegate adDidReceiveAppEvent:event withData:data]; + [controller.adViewANJAMInternalDelegate adDidReceiveAppEvent:event withData:data]; } // Get Device ID @@ -158,6 +161,16 @@ + (void)callGetDeviceID:(ANAdWebViewController *)controller query:(NSDictionary [ANANJAMImplementation loadResult:controller cb:cb paramsList:paramsList]; } +// Get Custom Keywords + ++ (void)callGetCustomKeywords:(ANAdWebViewController *)controller query:(NSDictionary *)query { + NSString *cb = [query valueForKey:@"cb"]; + + NSMutableDictionary *customKeywordsAsStrings = [ANGlobal convertCustomKeywordsAsMapToStrings: controller.adViewANJAMInternalDelegate.customkeywordsForANJAM + withSeparatorString: @"," ]; + [ANANJAMImplementation loadResult:controller cb:cb paramsList:customKeywordsAsStrings]; +} + + (void)callSetMraidRefreshFrequency:(ANAdWebViewController *)controller query:(NSDictionary *)query { NSString *milliseconds = [query valueForKey:@"ms"]; controller.checkViewableTimeInterval = [milliseconds doubleValue] / 1000; diff --git a/sdk/sourcefiles/internal/ANAdFetcherBase.m b/sdk/sourcefiles/internal/ANAdFetcherBase.m index 53b8ad4bb..e0896f159 100644 --- a/sdk/sourcefiles/internal/ANAdFetcherBase.m +++ b/sdk/sourcefiles/internal/ANAdFetcherBase.m @@ -31,13 +31,13 @@ #import "ANUniversalTagAdServerResponse.h" #import "ANAdView+PrivateMethods.h" #import "ANGDPRSettings.h" - +#import "ANHTTPNetworkSession.h" #import "ANMultiAdRequest+PrivateMethods.h" #pragma mark - @interface ANAdFetcherBase() - //EMPTY + @end @@ -109,17 +109,14 @@ - (void)requestAd { if (self.isFetcherLoading) { return; } - - // - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; NSURLRequest *request = nil; if (self.fetcherMARManager) { - request = [ANUniversalTagRequestBuilder buildRequestWithMultiAdRequestManager:self.fetcherMARManager baseUrlString:urlString]; + request = [ANUniversalTagRequestBuilder buildRequestWithMultiAdRequestManager:self.fetcherMARManager]; } else if (self.adunitMARManager) { - request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:self.delegate adunitMultiAdRequestManager:self.adunitMARManager baseUrlString:urlString]; + request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:self.delegate adunitMultiAdRequestManager:self.adunitMARManager]; } else { - request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:self.delegate baseUrlString:urlString]; + request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:self.delegate]; } if (!request){ @@ -127,64 +124,54 @@ - (void)requestAd return; } - - // - NSString *requestContent = [NSString stringWithFormat:@"%@ /n %@", urlString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] ]; - - NSURLSessionDataTask *requestAdTask = nil; - ANAdFetcherBase *__weak weakSelf = self; - + NSString *requestContent = [NSString stringWithFormat:@"%@ /n %@", [request URL],[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] ]; ANPostNotifications(kANUniversalAdFetcherWillRequestAdNotification, self, @{kANUniversalAdFetcherAdRequestURLKey: requestContent}); - - requestAdTask = [[NSURLSession sharedSession] dataTaskWithRequest: request - completionHandler: ^(NSData *data, NSURLResponse *response, NSError *error) - { - ANAdFetcherBase * __strong strongSelf = weakSelf; - - if (!strongSelf) { - ANLogError(@"FAILED to establish strongSelf."); - return; - } - - NSInteger statusCode = -1; - - if (!self.fetcherMARManager) { - [strongSelf restartAutoRefreshTimer]; - } - - if ([response isKindOfClass:[NSHTTPURLResponse class]]) { - NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - statusCode = [httpResponse statusCode]; - } - - if (statusCode >= 400 || statusCode == -1) - { - strongSelf.isFetcherLoading = NO; - dispatch_async(dispatch_get_main_queue(), ^{ - [strongSelf requestFailedWithError:error.localizedDescription]; - }); - - } else { - strongSelf.isFetcherLoading = YES; - - dispatch_async(dispatch_get_main_queue(), ^{ - NSString *responseString = [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]; - if (! strongSelf.fetcherMARManager) { - ANLogDebug(@"Response JSON (for single tag requests ONLY)... %@", responseString); - } - - ANPostNotifications(kANUniversalAdFetcherDidReceiveResponseNotification, strongSelf, - @{kANUniversalAdFetcherAdResponseKey: (responseString ? responseString : @"")}); - - [strongSelf handleAdServerResponse:data]; - }); - } // ENDIF -- statusCode - } ]; - - [requestAdTask resume]; + + __weak __typeof__(self) weakSelf = self; + [ANHTTPNetworkSession startTaskWithHttpRequest:request responseHandler:^(NSData * _Nonnull data, NSHTTPURLResponse * _Nonnull response) { + __typeof__(self) strongSelf = weakSelf; + + if (!strongSelf) { + ANLogError(@"COULD NOT ACQUIRE strongSelf."); + return; + } + + if (!strongSelf.fetcherMARManager) { + [strongSelf restartAutoRefreshTimer]; + } + strongSelf.isFetcherLoading = YES; + + NSString *responseString = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; + if (! strongSelf.fetcherMARManager) { + ANLogDebug(@"Response JSON (for single tag requests ONLY)... %@", responseString); + } + + ANPostNotifications(kANUniversalAdFetcherDidReceiveResponseNotification, strongSelf, + @{kANUniversalAdFetcherAdResponseKey: (responseString ? responseString : @"")}); + + [strongSelf handleAdServerResponse:data]; + + } errorHandler:^(NSError * _Nonnull error) { + NSError *sessionError = nil; + __typeof__(self) strongSelf = weakSelf; + + if (!strongSelf) { + ANLogError(@"COULD NOT ACQUIRE strongSelf."); + return; + } + + strongSelf.isFetcherLoading = NO; + + if (!strongSelf.fetcherMARManager) { + [strongSelf restartAutoRefreshTimer]; + } + + [strongSelf requestFailedWithError:error.localizedDescription]; + ANLogError(@"%@", sessionError); + }]; } diff --git a/sdk/sourcefiles/internal/ANAdFetcherResponse.h b/sdk/sourcefiles/internal/ANAdFetcherResponse.h index 7185214c8..e0171ef6b 100644 --- a/sdk/sourcefiles/internal/ANAdFetcherResponse.h +++ b/sdk/sourcefiles/internal/ANAdFetcherResponse.h @@ -13,7 +13,7 @@ limitations under the License. */ -#import +#import #import "ANAdResponseInfo.h" @@ -22,25 +22,34 @@ @interface ANAdFetcherResponse : NSObject -@property (nonatomic, readonly, assign, getter=isSuccessful) BOOL successful; -@property (nonatomic, readonly, strong, nonnull) id adObject; -@property (nonatomic, readonly, strong, nullable) id adObjectHandler; -@property (nonatomic, readonly, strong, nullable) NSError *error; +/** + * There are two successful cases: 1) AdUnit loaded normally; 2) AdUnit loaded lazily. + * All other cases are error cases, including the return of nobid instead of an ad object. + */ +@property (nonatomic, readonly, assign, getter=isSuccessful) BOOL successful; + +/** + * Set to YES when an AdUnit is being lazy loaded. This happens during the first return to the AdUnit from processing UT Response. + * NOTE The second return to the AdUnit, when the lazy AdUnit loads the webview, the ANFetcherResponse instance is new and isLazy will be NO. + */ +@property (nonatomic, readonly) BOOL isLazy; + +@property (nonatomic, readwrite, strong, nullable) id adObject; +@property (nonatomic, readonly, strong, nullable) id adObjectHandler; @property (nonatomic, readwrite, strong, nullable) ANAdResponseInfo *adResponseInfo; +@property (nonatomic, readonly, strong, nullable) NSError *error; + // + (nonnull ANAdFetcherResponse *)responseWithError:(nonnull NSError *)error; + (nonnull ANAdFetcherResponse *)responseWithAdObject: (nonnull id)adObject - andAdObjectHandler: (nullable id)adObjectHandler; - -// -- (nonnull instancetype)initAdResponseFailWithError:(nonnull NSError *)error; + andAdObjectHandler: (nullable id)adObjectHandler; -- (nonnull instancetype)initAdResponseSuccessWithAdObject: (nonnull id)adObject - andAdObjectHandler: (nullable id)adObjectHandler; ++ (nonnull ANAdFetcherResponse *)lazyResponseWithAdObject: (nonnull id)adObject + andAdObjectHandler: (nonnull id)adObjectHandler; @end diff --git a/sdk/sourcefiles/internal/ANAdFetcherResponse.m b/sdk/sourcefiles/internal/ANAdFetcherResponse.m index ec161c4ab..496a73d54 100644 --- a/sdk/sourcefiles/internal/ANAdFetcherResponse.m +++ b/sdk/sourcefiles/internal/ANAdFetcherResponse.m @@ -13,26 +13,40 @@ limitations under the License. */ +#import + #import "ANAdFetcherResponse.h" #import "ANLogging.h" + +#pragma mark - + @interface ANAdFetcherResponse () -@property (nonatomic, readwrite, assign, getter=isSuccessful) BOOL successful; -@property (nonatomic, readwrite, strong, nonnull) id adObject; +@property (nonatomic, readwrite, assign, getter=isSuccessful) BOOL successful; +@property (nonatomic, readwrite) BOOL isLazy; + @property (nonatomic, readwrite, strong, nullable) id adObjectHandler; + +@property (nonatomic, readwrite, strong, nullable) NSString *adContent; +@property (nonatomic, readwrite) CGSize sizeOfWebview; +@property (nonatomic, readwrite, strong, nullable) NSURL *baseURL; +@property (nonatomic, readwrite, strong, nullable) id anjamDelegate; + @property (nonatomic, readwrite, strong, nullable) NSError *error; @end +#pragma mark - + @implementation ANAdFetcherResponse -#pragma mark - Lifecycle. +#pragma mark Lifecycle. - (nonnull instancetype)initAdResponseFailWithError:(nonnull NSError *)error { self = [super init]; @@ -42,15 +56,39 @@ - (nonnull instancetype)initAdResponseFailWithError:(nonnull NSError *)error { return self; } -- (nonnull instancetype)initAdResponseSuccessWithAdObject: (nonnull id)adObject - andAdObjectHandler: (nullable id)adObjectHandler + +- (nonnull instancetype)initAdResponseWithAdObject: (nonnull id)adObject + andAdObjectHandler: (nullable id)adObjectHandler { self = [super init]; - if (self) { - _successful = YES; - _adObject = adObject; - _adObjectHandler = adObjectHandler; - } + + if (!self) { return nil; } + + + // + _successful = YES; + + _adObject = adObject; + _adObjectHandler = adObjectHandler; + + return self; +} + +- (nonnull ANAdFetcherResponse *)initLazyResponseWithAdObject: (nonnull id)adObject + andAdObjectHandler: (nonnull id)adObjectHandler +{ + self = [super init]; + + if (!self) { return nil; } + + + // + _successful = YES; + _isLazy = YES; + + _adObject = adObject; + _adObjectHandler = adObjectHandler; + return self; } @@ -62,11 +100,18 @@ + (nonnull ANAdFetcherResponse *)responseWithError:(nonnull NSError *)error { return [[ANAdFetcherResponse alloc] initAdResponseFailWithError:error]; } + + (nonnull ANAdFetcherResponse *)responseWithAdObject: (nonnull id)adObject - andAdObjectHandler: (nullable id)adObjectHandler + andAdObjectHandler: (nullable id)adObjectHandler +{ + return [[ANAdFetcherResponse alloc] initAdResponseWithAdObject: adObject + andAdObjectHandler: adObjectHandler ]; +} + ++ (nonnull ANAdFetcherResponse *)lazyResponseWithAdObject: (nonnull id)adObject + andAdObjectHandler: (nonnull id)adObjectHandler { - return [[ANAdFetcherResponse alloc] initAdResponseSuccessWithAdObject: adObject - andAdObjectHandler: adObjectHandler]; + return [[ANAdFetcherResponse alloc] initLazyResponseWithAdObject:adObject andAdObjectHandler:adObjectHandler]; } diff --git a/sdk/sourcefiles/internal/ANAdView.m b/sdk/sourcefiles/internal/ANAdView.m index b628f6e63..6944b88d6 100644 --- a/sdk/sourcefiles/internal/ANAdView.m +++ b/sdk/sourcefiles/internal/ANAdView.m @@ -83,8 +83,11 @@ @implementation ANAdView @synthesize clickThroughAction = __clickThroughAction; @synthesize landingPageLoadsInBackground = __landingPageLoadsInBackground; -@synthesize adResponseInfo = __adResponseInfo; -@synthesize obstructionViews = __obstructionViews; +@synthesize adResponseInfo = __adResponseInfo; +@synthesize obstructionViews = __obstructionViews; + + + #pragma mark - Initialization @@ -407,9 +410,9 @@ - (void)setClickThroughAction:(ANClickThroughAction)clickThroughAction */ - (void)setMarManager:(ANMultiAdRequest *)marManager { - if (self.universalAdFetcher && (marManager != _marManager)) { - [self.universalAdFetcher stopAdLoad]; - self.universalAdFetcher = nil; + if (_universalAdFetcher && (marManager != _marManager)) { + [_universalAdFetcher stopAdLoad]; + _universalAdFetcher = nil; } _marManager = marManager; @@ -613,6 +616,15 @@ - (void)adDidReceiveAd:(id)adObject } } +- (void)lazyAdDidReceiveAd:(nonnull id)adObject +{ + if ([self.delegate respondsToSelector:@selector(lazyAdDidReceiveAd:)]) + { + [self.delegate lazyAdDidReceiveAd:adObject]; + } +} + + - (void)ad:(id)loadInstance didReceiveNativeAd:(id)responseInstance { if ([self.delegate respondsToSelector:@selector(ad:didReceiveNativeAd:)]) { @@ -622,7 +634,6 @@ - (void)ad:(id)loadInstance didReceiveNativeAd:(id)responseInstance - (void)adRequestFailedWithError:(NSError *)error andAdResponseInfo:(ANAdResponseInfo *)adResponseInfo { -ANLogMark(); [self setAdResponseInfo:adResponseInfo]; if ([self.delegate respondsToSelector:@selector(ad:requestFailedWithError:)]) { @@ -659,6 +670,10 @@ - (UIViewController *)displayController return nil; } +- (NSMutableDictionary *> *)customkeywordsForANJAM { + return __customKeywords; +} + @end diff --git a/sdk/sourcefiles/internal/ANAdViewInternalDelegate.h b/sdk/sourcefiles/internal/ANAdViewInternalDelegate.h index 06458929b..118d8e69f 100644 --- a/sdk/sourcefiles/internal/ANAdViewInternalDelegate.h +++ b/sdk/sourcefiles/internal/ANAdViewInternalDelegate.h @@ -17,6 +17,7 @@ #import "ANAdConstants.h" #import "ANAdProtocol.h" +#import "ANAdFetcherResponse.h" @@ -30,8 +31,13 @@ - (ANClickThroughAction)clickThroughAction; - (void)adWasClickedWithURL:(NSString *)urlString; + - (void)adDidReceiveAd:(id)adObject; - (void)ad:(id)loadInstance didReceiveNativeAd:(id)responseInstance; +- (void)lazyAdDidReceiveAd:(id)adObject; + +- (BOOL)valueOfEnableLazyLoad; +- (BOOL)valueOfIsLazySecondPassThroughAdUnit; @required - (void)adRequestFailedWithError:(NSError *)error andAdResponseInfo:(ANAdResponseInfo *)adResponseInfo; @@ -45,6 +51,7 @@ - (void)adDidReceiveAppEvent:(NSString *)name withData:(NSString *)data; - (NSString *)adTypeForMRAID; +- (NSMutableDictionary *> *)customkeywordsForANJAM; - (UIViewController *)displayController; - (BOOL)landingPageLoadsInBackground; diff --git a/sdk/sourcefiles/internal/ANAdWebViewController.h b/sdk/sourcefiles/internal/ANAdWebViewController.h index f63f3ce00..987dade09 100644 --- a/sdk/sourcefiles/internal/ANAdWebViewController.h +++ b/sdk/sourcefiles/internal/ANAdWebViewController.h @@ -40,7 +40,7 @@ @property (nonatomic, readonly, strong) ANAdWebViewControllerConfiguration *configuration; -@property (nonatomic, readwrite, weak) id adViewANJAMDelegate; +@property (nonatomic, readwrite, weak) id adViewANJAMInternalDelegate; @property (nonatomic, readwrite, weak) id adViewDelegate; @property (nonatomic, readwrite, weak) id anjamDelegate; diff --git a/sdk/sourcefiles/internal/ANAdWebViewController.m b/sdk/sourcefiles/internal/ANAdWebViewController.m index bc249784f..70f56c527 100644 --- a/sdk/sourcefiles/internal/ANAdWebViewController.m +++ b/sdk/sourcefiles/internal/ANAdWebViewController.m @@ -32,6 +32,7 @@ #import "ANOMIDImplementation.h" #import "ANWebView.h" #import "ANVideoPlayerSettings+ANCategory.h" +#import "ANAudioVolumeChangeListener.h" NSString *const kANWebViewControllerMraidJSFilename = @"mraid.js"; @@ -47,7 +48,7 @@ -@interface ANAdWebViewController () +@interface ANAdWebViewController () @property (nonatomic, readwrite, strong) UIView *contentView; @property (nonatomic, readwrite, strong) ANWebView *webView; @@ -71,6 +72,7 @@ @interface ANAdWebViewController () +#import +#import + +@protocol ANAudioVolumeChangeListenerDelegate; + +@interface ANAudioVolumeChangeListener : NSObject + +@property (nonatomic, readwrite, assign) BOOL isAudioSessionActive; +@property (nonatomic, readwrite, weak) id delegate; + +- (id)initWithDelegate:(id)delegate; +- (NSNumber *)getAudioVolumePercentage; + +@end + +@protocol ANAudioVolumeChangeListenerDelegate + +- (void)didUpdateAudioLevel:(NSNumber *)volumePercentage; + +@end diff --git a/sdk/sourcefiles/internal/ANAudioVolumeChangeListener.m b/sdk/sourcefiles/internal/ANAudioVolumeChangeListener.m new file mode 100644 index 000000000..4e9d41d6c --- /dev/null +++ b/sdk/sourcefiles/internal/ANAudioVolumeChangeListener.m @@ -0,0 +1,87 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import "ANAudioVolumeChangeListener.h" +#import "ANLogging.h" + +@interface ANAudioVolumeChangeListener () + +@property (nonatomic, readwrite, strong) UISlider *audioVolumeSlider; + +@end + +@implementation ANAudioVolumeChangeListener + +#pragma mark - Init + +- (id)initWithDelegate:(id)delegate { + self = [super init]; + if ( self ) { + self.delegate = delegate; + [self setupVolumeView]; + } + + return self; +} + + +#pragma mark - MPVolumeView Setup + +- (void)setupVolumeView +{ + MPVolumeView *viewVolume = [[MPVolumeView alloc] init]; + __block UISlider *slider = nil; + [viewVolume.subviews enumerateObjectsUsingBlock:^(UISlider *obj, NSUInteger idx, BOOL *stop) { + if ([obj isKindOfClass:[UISlider class]]){ + slider = obj; + *stop = YES; + } + }]; + if (slider == nil){ + self.isAudioSessionActive = NO; + ANLogDebug(@"Unable to find MPVolumeSlider in MPVolumeView"); + return; + } + self.isAudioSessionActive = YES; + self.audioVolumeSlider = [[UISlider alloc] initWithFrame:CGRectZero]; + self.audioVolumeSlider = slider; + [self.audioVolumeSlider addTarget:self action:@selector(volumeViewSliderValueChanged:) forControlEvents:UIControlEventValueChanged]; +} + +#pragma mark - Responding to Volume level change + +- (void)volumeViewSliderValueChanged:(UISlider *)slider{ + if (self.isAudioSessionActive) { + [self.delegate didUpdateAudioLevel:@(100.0 * slider.value)]; + }else{ + [self.delegate didUpdateAudioLevel:nil]; + } +} + +-(NSNumber *) getAudioVolumePercentage { + if (!self.isAudioSessionActive) { + return nil; + } + return @(100.0 * self.audioVolumeSlider.value); +} + +#pragma mark - Dealloc + +- (void)dealloc { + self.audioVolumeSlider = nil; +} + +@end diff --git a/sdk/sourcefiles/internal/ANBannerAdView.m b/sdk/sourcefiles/internal/ANBannerAdView.m index f281f1be0..aadb6f762 100644 --- a/sdk/sourcefiles/internal/ANBannerAdView.m +++ b/sdk/sourcefiles/internal/ANBannerAdView.m @@ -37,6 +37,9 @@ #import "ANNativeAdResponse+PrivateMethods.h" #import "ANNativeRenderingViewController.h" +#import "ANMRAIDContainerView.h" +#import "ANWebView.h" + @@ -52,7 +55,7 @@ #pragma mark - -@interface ANBannerAdView () +@interface ANBannerAdView() @property (nonatomic, readwrite, strong) UIView *contentView; @@ -68,7 +71,22 @@ @interface ANBannerAdView () @property (nonatomic, readwrite, assign) ANVideoOrientation videoAdOrientation; +/** + * This flag remembers whether the initial return of the ad object from UT Response processing + * indicated that the AdUnit was lazy loaded. + * + * NOTE: Because ANBannerAdView is a multi-format AdUnit, it may return an ad object that is NOT lazy loaded + * even if the feature flag is set for lazy loading (enableLazyLoad). + * For example when video or native ad is returnd to ANBannerAdView with enableLazyLoad=YES. + */ +@property (nonatomic, readwrite) BOOL didBecomeLazyAdUnit; +/** + * This flag is set by loadLazyAd before loading the webview. It allows the fetcher to distinguish + * whether the ad object is returned from UT Response processing (first pass), or is being handled + * only to load the webview of a lazy loaded AdUnit (second pass). + */ +@property (nonatomic, readwrite) BOOL isLazySecondPassThroughAdUnit; @end @@ -79,19 +97,21 @@ @interface ANBannerAdView () @implementation ANBannerAdView -@synthesize autoRefreshInterval = __autoRefreshInterval; -@synthesize contentView = _contentView; -@synthesize adSize = _adSize; -@synthesize loadedAdSize = _loadedAdSize; -@synthesize countImpressionOnAdReceived = _countImpressionOnAdReceived; -@synthesize shouldAllowVideoDemand = _shouldAllowVideoDemand; -@synthesize shouldAllowNativeDemand = _shouldAllowNativeDemand; -@synthesize nativeAdRendererId = _nativeAdRendererId; -@synthesize enableNativeRendering = _enableNativeRendering; -@synthesize adResponseInfo = _adResponseInfo; -@synthesize minDuration = __minDuration; -@synthesize maxDuration = __maxDuration; +@synthesize autoRefreshInterval = __autoRefreshInterval; +@synthesize contentView = _contentView; +@synthesize adSize = _adSize; +@synthesize loadedAdSize = _loadedAdSize; +@synthesize shouldAllowBannerDemand = _shouldAllowBannerDemand; +@synthesize shouldAllowVideoDemand = _shouldAllowVideoDemand; +@synthesize shouldAllowNativeDemand = _shouldAllowNativeDemand; +@synthesize nativeAdRendererId = _nativeAdRendererId; +@synthesize enableNativeRendering = _enableNativeRendering; +@synthesize adResponseInfo = _adResponseInfo; +@synthesize minDuration = __minDuration; +@synthesize maxDuration = __maxDuration; +@synthesize countImpressionOnAdReceived = _countImpressionOnAdReceived; +@synthesize enableLazyLoad = _enableLazyLoad; #pragma mark - Lifecycle. @@ -103,20 +123,30 @@ - (void)initialize { // Defaults. // - __autoRefreshInterval = kANBannerDefaultAutoRefreshInterval; - _transitionDuration = kAppNexusBannerAdTransitionDefaultDuration; - _loadedAdSize = APPNEXUS_SIZE_UNDEFINED; - _adSize = APPNEXUS_SIZE_UNDEFINED; - _adSizes = nil; - _countImpressionOnAdReceived = NO; - _shouldAllowNativeDemand = NO; + __autoRefreshInterval = kANBannerDefaultAutoRefreshInterval; + _transitionDuration = kAppNexusBannerAdTransitionDefaultDuration; + _loadedAdSize = APPNEXUS_SIZE_UNDEFINED; + _adSize = APPNEXUS_SIZE_UNDEFINED; + _adSizes = nil; + + _shouldAllowBannerDemand = YES; _shouldAllowVideoDemand = NO; - _nativeAdRendererId = 0; - _videoAdOrientation = ANUnknown; - self.allowSmallerSizes = NO; - self.loadAdHasBeenInvoked = NO; - self.enableNativeRendering = NO; + _shouldAllowNativeDemand = NO; + + _nativeAdRendererId = 0; + _videoAdOrientation = ANUnknown; + + self.allowSmallerSizes = NO; + self.loadAdHasBeenInvoked = NO; + self.enableNativeRendering = NO; + _countImpressionOnAdReceived = NO; + + _enableLazyLoad = NO; + _didBecomeLazyAdUnit = NO; + _isLazySecondPassThroughAdUnit = NO; + + // [[ANOMIDImplementation sharedInstance] activateOMIDandCreatePartner]; } @@ -186,10 +216,44 @@ - (nonnull instancetype)initWithFrame:(CGRect)frame memberId:(NSInteger)memberId - (void) loadAd { self.loadAdHasBeenInvoked = YES; + + self.didBecomeLazyAdUnit = NO; + self.isLazySecondPassThroughAdUnit = NO; + [super loadAd]; } +- (BOOL)loadLazyAd +{ + if (!self.didBecomeLazyAdUnit) { + ANLogWarn(@"AdUnit is NOT A CANDIDATE FOR LAZY LOADING."); + return NO; + } + + if (self.contentView) { + ANLogWarn(@"AdUnit LAZY LOAD IS ALREADY COMPLETED."); + return NO; + } + + + // + self.isLazySecondPassThroughAdUnit = YES; + + BOOL returnValue = [self.universalAdFetcher allocateAndSetWebviewFromCachedAdObjectHandler]; + + if (!returnValue) + { + NSError *error = ANError(@"lazy_ad_load_failed", ANAdResponseInternalError); + ANLogError(@"%@", error); + return NO; + } + + + return returnValue; +} + + #pragma mark - Getter and Setter methods @@ -286,6 +350,52 @@ - (NSTimeInterval)autoRefreshInterval { return __autoRefreshInterval; } +- (void)setEnableLazyLoad:(BOOL)booleanValue +{ + if (YES == _enableLazyLoad) { + ANLogWarn(@"enableLazyLoad is already ENABLED."); + return; + } + + if (NO == booleanValue) { + ANLogWarn(@"CANNOT DISABLE enableLazyLoad once it is set."); + return; + } + + // NB Best effort to set critical section around fetcher for enableLazyLoad property. + // + if (self.loadAdHasBeenInvoked && (YES == self.universalAdFetcher.isFetcherLoading)) { + ANLogWarn(@"CANNOT ENABLE enableLazyLoad while fetcher is loading."); + return; + } + + // + _enableLazyLoad = YES; +} + + + + +#pragma mark - Helper methods. + +- (void)fireTrackerAndOMID +{ + [ANTrackerManager fireTrackerURLArray:self.impressionURLs]; + self.impressionURLs = nil; + + // Fire OMID - Impression event only for AppNexus WKWebview TRUE for RTB and SSM + // + if ([self.contentView isKindOfClass:[ANMRAIDContainerView class]]) + { + ANMRAIDContainerView *standardAdView = (ANMRAIDContainerView *)self.contentView; + + if (standardAdView.webViewController.omidAdSession != nil) + { + [[ANOMIDImplementation sharedInstance] fireOMIDImpressionOccuredEvent:standardAdView.webViewController.omidAdSession]; + } + } + +} @@ -293,6 +403,11 @@ - (NSTimeInterval)autoRefreshInterval { - (void)setContentView:(UIView *)newContentView { + // Do not update lazy loaded webview unless the new webview candidate is defined. + // + if (!newContentView && self.isLazySecondPassThroughAdUnit) { return; } + + // if (newContentView != _contentView) { UIView *oldContentView = _contentView; @@ -396,26 +511,65 @@ - (void)loadAdFromHtml: (nonnull NSString *)html #pragma mark - ANUniversalAdFetcherDelegate +/** + * NOTE: How are flags used to distinguish lazy loading from regular loading of AdUnits? + * With the introduction of lazy loading, there are three different cases that call universalAdFetcher:didfinishRequestWithResponse:. + * + * AdUnit is lazy loaded -- first return to AdUnit from UT Response processing. + * response.isLazy==YES + * Lazy AdUnit is loading webview -- second return to AdUnit, initiated by the AdUnit itself (loadLazyAd) + * response.isLazy==NO && AdUnit.isLazySecondPassThroughAdUnit==YES + * AdUnit is NOT lazy loaded + * response.isLazy==NO && AdUnit.isLazySecondPassThroughAdUnit==NO + */ - (void)universalAdFetcher:(ANUniversalAdFetcher *)fetcher didFinishRequestWithResponse:(ANAdFetcherResponse *)response { - NSError *error; - - if ([response isSuccessful]) + id adObject = response.adObject; + id adObjectHandler = response.adObjectHandler; + + BOOL trackersShouldBeFired = NO; + + NSError *error = nil; + + + // Try to get ANAdResponseInfo from anything that comes through. + // + if (self.enableLazyLoad && adObjectHandler) { + _adResponseInfo = (ANAdResponseInfo *) [ANGlobal valueOfGetterProperty:kANAdResponseInfo forObject:adObjectHandler]; + if (_adResponseInfo) { + [self setAdResponseInfo:_adResponseInfo]; + } + } + + + // + if (!response.isSuccessful) { - - self.loadAdHasBeenInvoked = YES; + [self finishRequest:response withReponseError:response.error]; + + if (self.enableLazyLoad) { + [self.universalAdFetcher restartAutoRefreshTimer]; + [self.universalAdFetcher startAutoRefreshTimer]; + } - id adObject = response.adObject; - id adObjectHandler = response.adObjectHandler; + return; + } + + + // Capture state for all AdUnits. UNLESS this is the second pass of lazy AdUnit. + // + if ( (!response.isLazy && !self.isLazySecondPassThroughAdUnit) || response.isLazy ) + { + self.loadAdHasBeenInvoked = YES; self.contentView = nil; self.impressionURLs = nil; - - _adResponseInfo = (ANAdResponseInfo *) [ANGlobal valueOfGetterProperty:kANAdResponseInfo forObject:adObjectHandler]; + + _adResponseInfo = (ANAdResponseInfo *) [ANGlobal valueOfGetterProperty:kANAdResponseInfo forObject:adObjectHandler]; if (_adResponseInfo) { [self setAdResponseInfo:_adResponseInfo]; } - + NSString *creativeId = (NSString *) [ANGlobal valueOfGetterProperty:kANCreativeId forObject:adObjectHandler]; if (creativeId) { [self setCreativeId:creativeId]; @@ -425,100 +579,140 @@ - (void)universalAdFetcher:(ANUniversalAdFetcher *)fetcher didFinishRequestWithR if (adTypeString) { [self setAdType:[ANGlobal adTypeStringToEnum:adTypeString]]; } + } - if ([adObject isKindOfClass:[UIView class]]) + // Process AdUnit according to class type of UIView. + // + if ([adObject isKindOfClass:[UIView class]] || response.isLazy) + { + if ( (!response.isLazy && !self.isLazySecondPassThroughAdUnit) || response.isLazy ) { - - self.contentView = adObject; - NSString *width = (NSString *) [ANGlobal valueOfGetterProperty:kANBannerWidth forObject:adObjectHandler]; - NSString *height = (NSString *) [ANGlobal valueOfGetterProperty:kANBannerHeight forObject:adObjectHandler]; + NSString *width = (NSString *) [ANGlobal valueOfGetterProperty:kANBannerWidth forObject:adObjectHandler]; + NSString *height = (NSString *) [ANGlobal valueOfGetterProperty:kANBannerHeight forObject:adObjectHandler]; + - if(width && height){ + if (width && height) + { CGSize receivedSize = CGSizeMake([width floatValue], [height floatValue]); _loadedAdSize = receivedSize; - }else { + } else { _loadedAdSize = self.adSize; - } - if([adObjectHandler isKindOfClass:[ANNativeStandardAdResponse class]]){ - NSError *registerError; - self.nativeAdResponse = (ANNativeAdResponse *)response.adObjectHandler; - - - if(self.obstructionViews != nil && self.obstructionViews.count > 0){ - [self.nativeAdResponse registerViewForTracking: self.contentView - withRootViewController: self.displayController - clickableViews: @[] - openMeasurementFriendlyObstructions:self.obstructionViews - error: ®isterError]; - }else{ - [self.nativeAdResponse registerViewForTracking: self.contentView - withRootViewController: self.displayController - clickableViews: @[] - error: ®isterError]; - } - } - if(_adResponseInfo.adType == ANAdTypeBanner || _adResponseInfo.adType == ANAdTypeVideo){ - [self setFriendlyObstruction]; - } - - [self adDidReceiveAd:self]; if (_adResponseInfo.adType == ANAdTypeBanner && !([adObjectHandler isKindOfClass:[ANNativeStandardAdResponse class]])) { - self.impressionURLs = (NSArray *) [ANGlobal valueOfGetterProperty:kANImpressionUrls forObject:adObjectHandler]; - if (self.window || self.countImpressionOnAdReceived) { - [ANTrackerManager fireTrackerURLArray:self.impressionURLs]; - self.impressionURLs = nil; - - // Fire OMID - Impression event only for AppNexus WKWebview TRUE for RTB and SSM - if([self.contentView isKindOfClass:[ANMRAIDContainerView class]]) - { - ANMRAIDContainerView *standardAdView = (ANMRAIDContainerView *)self.contentView; - if(standardAdView.webViewController.omidAdSession != nil){ - [[ANOMIDImplementation sharedInstance] fireOMIDImpressionOccuredEvent:standardAdView.webViewController.omidAdSession]; - } - } + + // Fire trackers and OMID upon attaching to UIView hierarchy or if countImpressionOnAdReceived is enabled, + // but only when the AdUnit is not lazy. + // + if (!response.isLazy && (self.window || self.countImpressionOnAdReceived)) { + trackersShouldBeFired = YES; } } + } + - } else if ([adObject isKindOfClass:[ANNativeAdResponse class]]) { - ANNativeAdResponse *nativeAdResponse = (ANNativeAdResponse *)response.adObject; - - self.creativeId = nativeAdResponse.creativeId; - self.adType = ANAdTypeNative; + // Return early if AdUnit is lazy loaded. + // + if (response.isLazy) + { + self.didBecomeLazyAdUnit = YES; + self.isLazySecondPassThroughAdUnit = NO; - nativeAdResponse.clickThroughAction = self.clickThroughAction; - nativeAdResponse.landingPageLoadsInBackground = self.landingPageLoadsInBackground; + [self.universalAdFetcher stopAutoRefreshTimer]; - // - [self ad:self didReceiveNativeAd:nativeAdResponse]; + [self lazyAdDidReceiveAd:self]; + return; } else { - NSString *unrecognizedResponseErrorMessage = [NSString stringWithFormat:@"UNRECOGNIZED ad response. (%@)", [adObject class]]; + trackersShouldBeFired = YES; + } - NSDictionary *errorInfo = @{NSLocalizedDescriptionKey: NSLocalizedString( - unrecognizedResponseErrorMessage, - @"Error: UNKNOWN ad object returned as response to multi-format ad request." - ) - }; - error = [NSError errorWithDomain:AN_ERROR_DOMAIN - code:ANAdResponseNonViewResponse - userInfo:errorInfo]; + // Handle AdUnit that is NOT lazy loaded. + // + self.contentView = adObject; + + if ((_adResponseInfo.adType == ANAdTypeBanner) || (_adResponseInfo.adType == ANAdTypeVideo)) + { + [self setFriendlyObstruction]; } + if ([adObjectHandler isKindOfClass:[ANNativeStandardAdResponse class]]) + { + NSError *registerError = nil; + + self.nativeAdResponse = (ANNativeAdResponse *)response.adObjectHandler; + + if ((self.obstructionViews != nil) && (self.obstructionViews.count > 0)) + { + [self.nativeAdResponse registerViewForTracking: self.contentView + withRootViewController: self.displayController + clickableViews: @[] + openMeasurementFriendlyObstructions: self.obstructionViews + error: ®isterError]; + } else { + [self.nativeAdResponse registerViewForTracking: self.contentView + withRootViewController: self.displayController + clickableViews: @[] + error: ®isterError]; + } + } + + if (trackersShouldBeFired) { + [self fireTrackerAndOMID]; + } + + [self adDidReceiveAd:self]; + + + // Process AdUnit according to class type of ANNativeAdResponse. + // + } else if ([adObject isKindOfClass:[ANNativeAdResponse class]]) { + ANNativeAdResponse *nativeAdResponse = (ANNativeAdResponse *)response.adObject; + + self.creativeId = nativeAdResponse.creativeId; + self.adType = ANAdTypeNative; + + nativeAdResponse.clickThroughAction = self.clickThroughAction; + nativeAdResponse.landingPageLoadsInBackground = self.landingPageLoadsInBackground; + + // + [self ad:self didReceiveNativeAd:nativeAdResponse]; + + + // AdUnit class type is UNRECOGNIZED. + // } else { - error = response.error; - } + NSString *unrecognizedResponseErrorMessage = [NSString stringWithFormat:@"UNRECOGNIZED ad response. (%@)", [adObject class]]; + NSDictionary *errorInfo = @{NSLocalizedDescriptionKey: NSLocalizedString( + unrecognizedResponseErrorMessage, + @"Error: UNKNOWN ad object returned as response to multi-format ad request." + ) + }; - if (error) { - self.contentView = nil; - [self adRequestFailedWithError:error andAdResponseInfo:response.adResponseInfo]; + error = [NSError errorWithDomain:AN_ERROR_DOMAIN + code:ANAdResponseNonViewResponse + userInfo:errorInfo]; + + [self finishRequest:response withReponseError:error]; + } +} + +- (void)finishRequest:(ANAdFetcherResponse *)response withReponseError:(NSError *)error +{ + self.contentView = nil; + self.didBecomeLazyAdUnit = NO; + // Preserve existing ANAdResponseInfo whan AdUnit is lazy loaded. + // + if (self.enableLazyLoad && self.isLazySecondPassThroughAdUnit) { + response.adResponseInfo = self.adResponseInfo; } + + [self adRequestFailedWithError:error andAdResponseInfo:response.adResponseInfo]; } @@ -573,7 +767,9 @@ - (void)setAllowNativeDemand: (BOOL)nativeDemand - (NSArray *)adAllowedMediaTypes { NSMutableArray *mediaTypes = [[NSMutableArray alloc] init]; - [mediaTypes addObject:@(ANAllowedMediaTypeBanner)]; + if(_shouldAllowBannerDemand){ + [mediaTypes addObject:@(ANAllowedMediaTypeBanner)]; + } if(_shouldAllowNativeDemand){ [mediaTypes addObject:@(ANAllowedMediaTypeNative)]; } @@ -602,6 +798,16 @@ - (UIViewController *)displayController return displayController; } +- (BOOL)valueOfEnableLazyLoad +{ + return self.enableLazyLoad; +} + +- (BOOL)valueOfIsLazySecondPassThroughAdUnit +{ + return self.isLazySecondPassThroughAdUnit; +} + @@ -609,18 +815,9 @@ - (UIViewController *)displayController - (void)didMoveToWindow { - if (self.contentView && ( _adResponseInfo.adType == ANAdTypeBanner)) { - [ANTrackerManager fireTrackerURLArray:self.impressionURLs]; - self.impressionURLs = nil; - - // Fire OMID - Impression event only for AppNexus WKWebview TRUE for RTB and SSM - if([self.contentView isKindOfClass:[ANMRAIDContainerView class]]) - { - ANMRAIDContainerView *standardAdView = (ANMRAIDContainerView *)self.contentView; - if(standardAdView.webViewController.omidAdSession != nil){ - [[ANOMIDImplementation sharedInstance] fireOMIDImpressionOccuredEvent:standardAdView.webViewController.omidAdSession]; - } - } + if (self.contentView && (_adResponseInfo.adType == ANAdTypeBanner)) + { + [self fireTrackerAndOMID]; } } diff --git a/sdk/sourcefiles/internal/ANGlobal.h b/sdk/sourcefiles/internal/ANGlobal.h index 7450fc939..f945be9e4 100644 --- a/sdk/sourcefiles/internal/ANGlobal.h +++ b/sdk/sourcefiles/internal/ANGlobal.h @@ -27,7 +27,7 @@ #define AN_ERROR_TABLE @"errors" #define AN_DEFAULT_PLACEMENT_ID @"default_placement_id" -#define AN_SDK_VERSION @"7.3.2" +#define AN_SDK_VERSION @"7.4" #define APPNEXUS_BANNER_SIZE CGSizeMake(320, 50) @@ -50,7 +50,6 @@ #define kANAdSize1x1 CGSizeMake(1,1) - typedef NS_ENUM(NSUInteger, ANAllowedMediaType) { ANAllowedMediaTypeBanner = 1, ANAllowedMediaTypeInterstitial = 3, @@ -151,4 +150,6 @@ BOOL ANCanPresentFromViewController(UIViewController * __nullable viewController + (ANVideoOrientation) parseVideoOrientation:(nullable NSString *)aspectRatio; ++ (nullable NSMutableURLRequest *) adServerRequestURL; + @end diff --git a/sdk/sourcefiles/internal/ANGlobal.m b/sdk/sourcefiles/internal/ANGlobal.m index 21eafd824..4bb460cd0 100644 --- a/sdk/sourcefiles/internal/ANGlobal.m +++ b/sdk/sourcefiles/internal/ANGlobal.m @@ -16,13 +16,10 @@ #import #import - #import "ANGlobal.h" - #import "ANLogging.h" - -#import "ANSDKSettings.h" - +#import "ANSDKSettings+PrivateMethods.h" +#import "ANHTTPNetworkSession.h" NSString * __nonnull const ANInternalDelgateTagKeyPrimarySize = @"ANInternalDelgateTagKeyPrimarySize"; @@ -37,7 +34,7 @@ NSString * __nonnull const kANUniversalAdFetcherDidReceiveResponseNotification = @"kANUniversalAdFetcherDidReceiveResponseNotification"; NSString * __nonnull const kANUniversalAdFetcherAdResponseKey = @"kANUniversalAdFetcherAdResponseKey"; - +NSMutableURLRequest *utMutableRequest = nil; NSString *__nonnull ANDeviceModel() @@ -296,6 +293,35 @@ BOOL ANCanPresentFromViewController(UIViewController * __nullable viewController @implementation ANGlobal ++ (void)load { + + // No need for "dispatch once" since `load` is called only once during app launch. + [[ANSDKSettings sharedInstance] optionalSDKInitialization]; + [self constructAdServerRequestURL]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleUserAgentDidChangeNotification:) name:@"kUserAgentDidChangeNotification" object:nil]; + +} + ++(nullable NSMutableURLRequest *) adServerRequestURL { + return utMutableRequest; +} + ++ (void) constructAdServerRequestURL { + NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; + NSURL *URL = [NSURL URLWithString:urlString]; + + utMutableRequest = (NSMutableURLRequest *)ANBasicRequestWithURL(URL); + [utMutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; + [utMutableRequest setHTTPMethod:@"POST"]; + + [ANHTTPNetworkSession startTaskWithHttpRequest:utMutableRequest]; +} + ++ (void)handleUserAgentDidChangeNotification:(NSNotification *)notification { + [utMutableRequest setValue:[ANGlobal getUserAgent] forHTTPHeaderField:@"user-agent"]; + [[NSNotificationCenter defaultCenter] removeObserver:@"kUserAgentDidChangeNotification"]; +} + + (void) openURL: (nonnull NSString *)urlString { if (@available(iOS 10.0, *)) { @@ -408,10 +434,12 @@ + (nonnull NSString *) getUserAgent { ANLogDebug(@"userAgentString=%@", userAgentString); userAgent = userAgentString; + [webViewForUserAgent stopLoading]; [webViewForUserAgent removeFromSuperview]; - + + [[NSNotificationCenter defaultCenter] postNotificationName:@"kUserAgentDidChangeNotification" object:nil userInfo:nil]; @synchronized (self) { userAgentQueryIsActive = NO; } @@ -429,7 +457,7 @@ + (nonnull NSString *) getUserAgent + (ANVideoOrientation) parseVideoOrientation:(NSString *)aspectRatio { double aspectRatioValue = [aspectRatio doubleValue]; - return aspectRatio == 0? ANUnknown : (aspectRatioValue == 1)? ANSquare : (aspectRatioValue > 1)? ANLandscape : ANPortraint; + return aspectRatio == 0? ANUnknown : (aspectRatioValue == 1)? ANSquare : (aspectRatioValue > 1)? ANLandscape : ANPortrait; } @end diff --git a/sdk/sourcefiles/internal/ANHTTPNetworkSession.h b/sdk/sourcefiles/internal/ANHTTPNetworkSession.h new file mode 100644 index 000000000..736291cc9 --- /dev/null +++ b/sdk/sourcefiles/internal/ANHTTPNetworkSession.h @@ -0,0 +1,42 @@ +/* Copyright 2020 Xandr INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ANHTTPNetworkSession : NSObject + ++ (instancetype)sharedInstance; + +/** + Initializes a HTTP network request and immediately sends it. + @param request Request to send. + */ ++ (void)startTaskWithHttpRequest:(NSURLRequest *)request; + +/** + Initializes a HTTP network request and immediately sends it. + @param request Request to send. + @param responseHandler Optional response handler that will be invoked on the main thread. + @param errorHandler Optional error handler that will be invoked on the main thread. + */ ++ (void)startTaskWithHttpRequest:(NSURLRequest *)request + responseHandler:(void (^ _Nullable)(NSData * data, NSHTTPURLResponse * response))responseHandler + errorHandler:(void (^ _Nullable)(NSError * error))errorHandler; + +@end + +NS_ASSUME_NONNULL_END diff --git a/sdk/sourcefiles/internal/ANHTTPNetworkSession.m b/sdk/sourcefiles/internal/ANHTTPNetworkSession.m new file mode 100644 index 000000000..3ee87343b --- /dev/null +++ b/sdk/sourcefiles/internal/ANHTTPNetworkSession.m @@ -0,0 +1,256 @@ +/* Copyright 2020 Xandr INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#import "ANHTTPNetworkSession.h" +#import "ANGlobal.h" +#import "ANLogging.h" + + +@interface ANHTTPNetworkTaskData : NSObject + +@property (nonatomic, strong, nullable) NSMutableData * responseData; +@property (nonatomic, copy, nullable) void (^responseHandler)(NSData * data, NSHTTPURLResponse * response); +@property (nonatomic, copy, nullable) void (^errorHandler)(NSError * error); + +- (instancetype)initWithResponseHandler:(void (^ _Nullable)(NSData * data, NSHTTPURLResponse * response))responseHandler + errorHandler:(void (^ _Nullable)(NSError * error))errorHandler NS_DESIGNATED_INITIALIZER; + +@end + +@implementation ANHTTPNetworkTaskData + +- (instancetype)init { + return [self initWithResponseHandler:nil errorHandler:nil]; +} + +- (instancetype)initWithResponseHandler:(void (^ _Nullable)(NSData * data, NSHTTPURLResponse * response))responseHandler + errorHandler:(void (^ _Nullable)(NSError * error))errorHandler { + if (self = [super init]) { + _responseData = nil; + _responseHandler = responseHandler; + _errorHandler = errorHandler; + } + + return self; +} + + +@end + + + +@interface ANHTTPNetworkSession () + +@property (nonatomic, strong) NSURLSession * adServerSession; + +// Access to `NSMutableDictionary` is not thread-safe by default, so we will gate access +// to it using GCD to allow concurrent reads, but synchronous writes. +@property (nonatomic, strong) NSMutableDictionary * sessions; +@property (nonatomic, strong) dispatch_queue_t sessionsQueue; + +@end + +@implementation ANHTTPNetworkSession + ++ (instancetype)sharedInstance { + static dispatch_once_t once; + static id _sharedInstance; + dispatch_once(&once, ^{ + _sharedInstance = [[self alloc] init]; + }); + return _sharedInstance; +} + +- (instancetype)init { + if (self = [super init]) { + _adServerSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:nil]; + + // Dictionary of all sessions currently in flight. + _sessions = [NSMutableDictionary dictionary]; + _sessionsQueue = dispatch_queue_create("com.appnexus.mobile-ios-sdk.anhttpnetworksession.queue", DISPATCH_QUEUE_CONCURRENT); + } + + return self; +} + +#pragma mark - Session Access + +- (void)appendSessionData:(ANHTTPNetworkTaskData *)data forTask:(NSURLSessionTask *)task { + dispatch_barrier_sync(self.sessionsQueue, ^{ + self.sessions[task] = data; + }); +} + +/** + Retrieves the task data for the specified task. Accessing the data is thread + safe, but mutating the data is not thread safe. + @param task Task which needs a data retrieval. + @return The task data or @c nil + */ +- (ANHTTPNetworkTaskData *)sessionDataForTask:(NSURLSessionTask *)task { + __block ANHTTPNetworkTaskData * data = nil; + dispatch_sync(self.sessionsQueue, ^{ + data = self.sessions[task]; + }); + + return data; +} + +/** + Appends additional data to the @c responseData field of @c ANHTTPNetworkTaskData in + a thread safe manner. + @param data New data to append. + @param task Task to append the data to. + */ +- (void)appendData:(NSData *)data toSessionDataForTask:(NSURLSessionTask *)task { + // No data to append or task. + if (data == nil || task == nil) { + return; + } + + dispatch_barrier_sync(self.sessionsQueue, ^{ + // Do nothing if there is no task data entry. + ANHTTPNetworkTaskData * taskData = self.sessions[task]; + if (taskData == nil) { + return; + } + + // Append the new data to the task. + if (taskData.responseData == nil) { + taskData.responseData = [NSMutableData data]; + } + + [taskData.responseData appendData:data]; + }); +} + +#pragma mark - Manual Start Tasks + ++ (NSURLSessionTask *)taskWithHttpRequest:(NSURLRequest *)request + responseHandler:(void (^ _Nullable)(NSData * data, NSHTTPURLResponse * response))responseHandler + errorHandler:(void (^ _Nullable)(NSError * error))errorHandler { + // Networking task + NSURLSessionDataTask * task = [ANHTTPNetworkSession.sharedInstance.adServerSession dataTaskWithRequest:request]; + + // Initialize the task data + ANHTTPNetworkTaskData * taskData = [[ANHTTPNetworkTaskData alloc] initWithResponseHandler:responseHandler errorHandler:errorHandler]; + + // Update the sessions. + [ANHTTPNetworkSession.sharedInstance appendSessionData:taskData forTask:task]; + + return task; +} + +#pragma mark - Automatic Start Tasks + ++ (void)startTaskWithHttpRequest:(NSURLRequest *)request { + [ANHTTPNetworkSession startTaskWithHttpRequest:request responseHandler:nil errorHandler:nil]; +} + + ++ (void)startTaskWithHttpRequest:(NSURLRequest *)request + responseHandler:(void (^ _Nullable)(NSData * data, NSHTTPURLResponse * response))responseHandler + errorHandler:(void (^ _Nullable)(NSError * error))errorHandler { + + + // Generate a manual start task. + NSURLSessionTask * task = [ANHTTPNetworkSession taskWithHttpRequest:request responseHandler:^(NSData * _Nonnull data, NSHTTPURLResponse * _Nonnull response) { + if(responseHandler == nil){ + return; + } + dispatch_async(dispatch_get_main_queue(), ^{ + + responseHandler(data,response); + + }); + } errorHandler:^(NSError * _Nonnull error) { + if(errorHandler == nil){ + return; + } + dispatch_async(dispatch_get_main_queue(), ^{ + errorHandler(error); + }); + }]; + + // Immediately start the task. + [task resume]; +} + +#pragma mark - NSURLSessionDataDelegate + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask +didReceiveResponse:(NSURLResponse *)response + completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler { + // Allow all responses. + completionHandler(NSURLSessionResponseAllow); +} + +- (void)URLSession:(NSURLSession *)session + dataTask:(NSURLSessionDataTask *)dataTask + didReceiveData:(NSData *)data { + + // Append the new data to the task. + [self appendData:data toSessionDataForTask:dataTask]; +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didCompleteWithError:(nullable NSError *)error { + // Retrieve the task data. + ANHTTPNetworkTaskData * taskData = [self sessionDataForTask:task]; + if (taskData == nil) { + return; + } + + // Remove the task data from the currently in flight sessions. + [self appendSessionData:nil forTask:task]; + + // Validate that response is not an error. + if (error != nil) { + taskData.errorHandler(error); + return; + } + + // Validate response is a HTTP response. + NSHTTPURLResponse * httpResponse = [task.response isKindOfClass:[NSHTTPURLResponse class]] ? (NSHTTPURLResponse *)task.response : nil; + if (httpResponse == nil) { + NSError *responseError = ANError(@"Network response is not of type NSHTTPURLResponse", ANAdResponseNetworkError); + ANLogError(@"%@", responseError); + taskData.errorHandler(responseError); + return; + } + + // Validate response code is not an error (>= 400) + if (httpResponse.statusCode >= 400) { + NSError * responseError = ANError(@"connection_failed", ANAdResponseNetworkError); + ANLogError(@"%@", responseError); + taskData.errorHandler(responseError); + return; + } + + // Validate that there is data + if (taskData.responseData == nil) { + NSError * noDataError = ANError(@"The ad response does not contain data", ANAdResponseNetworkError); + ANLogError(@"%@", noDataError); + taskData.errorHandler(noDataError); + return; + } + + // By this point all of the fields have been validated. + taskData.responseHandler(taskData.responseData, httpResponse); +} +@end + diff --git a/sdk/sourcefiles/internal/ANMediatedAd.h b/sdk/sourcefiles/internal/ANMediatedAd.h index 926af5294..11c52a7d0 100644 --- a/sdk/sourcefiles/internal/ANMediatedAd.h +++ b/sdk/sourcefiles/internal/ANMediatedAd.h @@ -26,5 +26,6 @@ @property (nonatomic, readwrite, strong) NSString *auctionInfo; @property (nonatomic, readwrite) BOOL isAdTypeNative; @property (nonatomic, readwrite, strong) ANVerificationScriptResource *verificationScriptResource; +@property (nonatomic, readwrite) int networkTimeout; @end diff --git a/sdk/sourcefiles/internal/ANMediationAdViewController.m b/sdk/sourcefiles/internal/ANMediationAdViewController.m index e5c770579..ccc8909e9 100644 --- a/sdk/sourcefiles/internal/ANMediationAdViewController.m +++ b/sdk/sourcefiles/internal/ANMediationAdViewController.m @@ -392,8 +392,7 @@ - (void)startTimeout { if (self.timeoutCanceled) return; __weak ANMediationAdViewController *weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, - kAppNexusMediationNetworkTimeoutInterval - * NSEC_PER_SEC), + self.mediatedAd.networkTimeout * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ ANMediationAdViewController *strongSelf = weakSelf; if (!strongSelf || strongSelf.timeoutCanceled) return; diff --git a/sdk/sourcefiles/internal/ANNativeAdFetcher.m b/sdk/sourcefiles/internal/ANNativeAdFetcher.m index 3bc078f2f..ca6bef456 100644 --- a/sdk/sourcefiles/internal/ANNativeAdFetcher.m +++ b/sdk/sourcefiles/internal/ANNativeAdFetcher.m @@ -130,11 +130,20 @@ -(void) stopAdLoad { [super stopAdLoad]; } + +- (void)startAutoRefreshTimer +{ + // Implemented only by ANUniversalAdFetcher +} + - (void)restartAutoRefreshTimer { // Implemented only by ANUniversalAdFetcher } + + + #pragma mark - Ad handlers. - (void)handleCSRNativeAd:(ANCSRAd *)csrAd diff --git a/sdk/sourcefiles/internal/ANSSMMediationAdViewController.m b/sdk/sourcefiles/internal/ANSSMMediationAdViewController.m index 1a3ee9b36..5b535db0e 100644 --- a/sdk/sourcefiles/internal/ANSSMMediationAdViewController.m +++ b/sdk/sourcefiles/internal/ANSSMMediationAdViewController.m @@ -24,6 +24,7 @@ #import "ANMRAIDContainerView.h" #import "ANSDKSettings+PrivateMethods.h" #import "NSObject+ANCategory.h" +#import "ANHTTPNetworkSession.h" @interface ANSSMMediationAdViewController () @@ -80,50 +81,29 @@ - (BOOL)requestForAd:(ANSSMStandardAd *)ad { return NO; }else{ [self markLatencyStart]; - [self startTimeout]; self.ssmMediatedAd = ad; + [self startTimeout]; self.ssmHandlerURL = [NSURL URLWithString:ad.urlString]; ANLogDebug(@"requesting SSM mediated Ad from URL %@", self.ssmHandlerURL); NSURLRequest *request = ANBasicRequestWithURL(self.ssmHandlerURL); - NSURLSessionDataTask *task = [[NSURLSession sharedSession] - dataTaskWithRequest:request - completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - NSInteger statusCode = -1; - - if ([response isKindOfClass:[NSHTTPURLResponse class]]) { - NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - statusCode = [httpResponse statusCode]; - ANLogDebug(@"SSM httpResponse.allHeaderFields=%@", httpResponse.allHeaderFields); - ANLogDebug(@"SSM response.expectedContentLength=%@", @(response.expectedContentLength) ); - } - - - // Failure case - if (statusCode >= 400 || statusCode == -1) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self handleFailure:ANAdResponseNetworkError errorInfo:@"connection_failed"]; - }); - - } - //Success case - else{ - NSString *responseString = [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]; - ANLogDebug(@"Response JSON %@", responseString); - ANLogDebug(@"SSM Received response: %@", response); - - dispatch_async(dispatch_get_main_queue(), ^{ - [self didReceiveAd:responseString]; - }); - - } - - - }]; + __weak __typeof__(self) weakSelf = self; + [ANHTTPNetworkSession startTaskWithHttpRequest:request responseHandler:^(NSData * _Nonnull data, NSHTTPURLResponse * _Nonnull response) { + __typeof__(self) strongSelf = weakSelf; + NSString *responseString = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; + ANLogDebug(@"Response JSON %@", responseString); + ANLogDebug(@"SSM Received response: %@", response); + + [strongSelf didReceiveAd:responseString]; + + } errorHandler:^(NSError * _Nonnull error) { + __typeof__(self) strongSelf = weakSelf; + [strongSelf handleFailure:ANAdResponseNetworkError errorInfo:@"connection_failed"]; + + }]; - [task resume]; return YES; } @@ -194,7 +174,7 @@ - (void)didReceiveAd:(NSString *)adContent webViewBaseURL:[NSURL URLWithString:[[[ANSDKSettings sharedInstance] baseUrlConfig] webViewBaseUrl]]]; self.ssmAdView.loadingDelegate = self; // Allow ANJAM events to always be passed to the ANAdView - self.ssmAdView.webViewController.adViewANJAMDelegate = self.adViewDelegate; + self.ssmAdView.webViewController.adViewANJAMInternalDelegate = self.adViewDelegate; } @@ -242,9 +222,9 @@ - (void)didCompleteFirstLoadFromWebViewController:(ANAdWebViewController *)contr - (void)startTimeout { if (self.timeoutCanceled) return; __weak ANSSMMediationAdViewController *weakSelf = self; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, - kAppNexusMediationNetworkTimeoutInterval - * NSEC_PER_SEC), + self.ssmMediatedAd.networkTimeout * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ ANSSMMediationAdViewController *strongSelf = weakSelf; if (!strongSelf || strongSelf.timeoutCanceled) return; diff --git a/sdk/sourcefiles/internal/ANSSMStandardAd.h b/sdk/sourcefiles/internal/ANSSMStandardAd.h index 676c6405c..0af52e956 100644 --- a/sdk/sourcefiles/internal/ANSSMStandardAd.h +++ b/sdk/sourcefiles/internal/ANSSMStandardAd.h @@ -20,6 +20,7 @@ @property (nonatomic, readwrite, strong) NSString *urlString; @property (nonatomic, readwrite, strong) NSString *responseURL; +@property (nonatomic, readwrite) int networkTimeout; @end diff --git a/sdk/sourcefiles/internal/ANUniversalAdFetcher.h b/sdk/sourcefiles/internal/ANUniversalAdFetcher.h index 59e6b9e26..841f7ba3d 100644 --- a/sdk/sourcefiles/internal/ANUniversalAdFetcher.h +++ b/sdk/sourcefiles/internal/ANUniversalAdFetcher.h @@ -26,6 +26,9 @@ #import "ANGlobal.h" #import "ANAdFetcherBase+PrivateMethods.h" + + + #pragma mark - @protocol ANUniversalAdFetcherDelegate; @@ -41,8 +44,17 @@ - (CGSize)getWebViewSizeForCreativeWidth:(nonnull NSString *)width andHeight:(nonnull NSString *)height; +- (BOOL)allocateAndSetWebviewWithSize: (CGSize)webviewSize + content: (nonnull NSString *)webviewContent + isXMLForVideo: (BOOL)isContentXMLForVideo; + +- (BOOL)allocateAndSetWebviewFromCachedAdObjectHandler; + @end + + + #pragma mark - Ad Fetcher Delegates. @protocol ANUniversalRequestTagBuilderDelegate @@ -78,10 +90,16 @@ + +#pragma mark - + @protocol ANUniversalAdFetcherFoundationDelegate //EMPTY @end + + + #pragma mark - // NB ANUniversalAdFetcherDelegate is sufficient for Banner, Interstitial entry point. diff --git a/sdk/sourcefiles/internal/ANUniversalAdFetcher.m b/sdk/sourcefiles/internal/ANUniversalAdFetcher.m index b99cebdd5..1958bbe5c 100644 --- a/sdk/sourcefiles/internal/ANUniversalAdFetcher.m +++ b/sdk/sourcefiles/internal/ANUniversalAdFetcher.m @@ -34,10 +34,17 @@ #import "NSTimer+ANCategory.h" #import "ANNativeRenderingViewController.h" #import "ANRTBNativeAdResponse.h" + #import "ANAdView+PrivateMethods.h" #import "ANMultiAdRequest+PrivateMethods.h" -@interface ANUniversalAdFetcher () + + + +@interface ANUniversalAdFetcher() < ANVideoAdProcessorDelegate, + ANAdWebViewControllerLoadingDelegate, + ANNativeRenderingViewControllerLoadingDelegate + > @property (nonatomic, readwrite, strong) ANMRAIDContainerView *adView; @property (nonatomic, readwrite, strong) ANNativeRenderingViewController *nativeAdView; @@ -49,6 +56,9 @@ @interface ANUniversalAdFetcher () 0 && timeout != 500) ? timeout :kAppNexusMediationNetworkTimeoutInterval * 1000; return mediatedAd; } } @@ -619,6 +621,8 @@ + (ANSSMStandardAd *)standardSSMAdFromSSMObject:(NSDictionary *)ssmObject { standardAd.width = [banner[kANUniversalTagAdServerResponseKeyBannerWidth] description]; standardAd.height = [banner[kANUniversalTagAdServerResponseKeyBannerHeight] description]; standardAd.content = nil; + int timeout = [ssmObject[kANUniversalTagAdServerResponseKeyTimeout] intValue]; + standardAd.networkTimeout = (timeout > 0 && timeout != 500) ? timeout :kAppNexusMediationNetworkTimeoutInterval * 1000; return standardAd; } } diff --git a/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.h b/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.h index c25ab1c4b..d3cfb79d7 100644 --- a/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.h +++ b/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.h @@ -24,14 +24,11 @@ // NB Protocol type of adFetcherDelegate can be ANUniversalAdFetcherDelegate or ANUniversalNativeAdFetcherDelegate. // -+ (nullable NSURLRequest *)buildRequestWithAdFetcherDelegate: (nonnull id)adFetcherDelegate - baseUrlString: (nonnull NSString *)baseUrlString; ++ (nullable NSURLRequest *)buildRequestWithAdFetcherDelegate: (nonnull id)adFetcherDelegate; + (nullable NSURLRequest *)buildRequestWithAdFetcherDelegate: (nonnull id)adFetcherDelegate - adunitMultiAdRequestManager: (nonnull ANMultiAdRequest *)adunitMARManager - baseUrlString: (nonnull NSString *)baseUrlString; + adunitMultiAdRequestManager: (nonnull ANMultiAdRequest *)adunitMARManager; -+ (nullable NSURLRequest *)buildRequestWithMultiAdRequestManager: (nonnull ANMultiAdRequest *)marManager - baseUrlString: (nonnull NSString *)baseUrlString; ++ (nullable NSURLRequest *)buildRequestWithMultiAdRequestManager: (nonnull ANMultiAdRequest *)marManager; @end diff --git a/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.m b/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.m index 2c67d2d6c..17c77438d 100644 --- a/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.m +++ b/sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.m @@ -31,7 +31,7 @@ // This protocol definition meant for local use only, to simplify typecasting of MAR Manager objects. // -@protocol ANUniversalTagRequestBuilderFetcherDelegate < ANUniversalRequestTagBuilderDelegate, ANAdProtocolFoundation, +@protocol ANUniversalTagRequestBuilderFetcherDelegate //EMPTY @end @@ -50,8 +50,6 @@ @interface ANUniversalTagRequestBuilder() @property (nonatomic, readwrite, weak) ANMultiAdRequest *fetcherMARManager; @property (nonatomic, readwrite, weak) ANMultiAdRequest *adunitMARManager; -@property (nonatomic, readwrite, strong) NSString *baseURLString; - @end @@ -67,34 +65,28 @@ @implementation ANUniversalTagRequestBuilder // NB marManager is defined when this class is involed by MultiAdRequest, otherwise it is nil. // + (nullable NSURLRequest *)buildRequestWithAdFetcherDelegate: (nonnull id)adFetcherDelegate - baseUrlString: (nonnull NSString *)baseUrlString { ANUniversalTagRequestBuilder *requestBuilder = [[ANUniversalTagRequestBuilder alloc] initWithAdFetcherDelegate: adFetcherDelegate optionallyWithAdunitMultiAdRequestManager: nil - orMultiAdRequestManager: nil - baseUrlString: baseUrlString ]; + orMultiAdRequestManager: nil]; return [requestBuilder request]; } + (nullable NSURLRequest *)buildRequestWithAdFetcherDelegate: (nonnull id)adFetcherDelegate adunitMultiAdRequestManager: (nonnull ANMultiAdRequest *)adunitMARManager - baseUrlString: (nonnull NSString *)baseUrlString { ANUniversalTagRequestBuilder *requestBuilder = [[ANUniversalTagRequestBuilder alloc] initWithAdFetcherDelegate: adFetcherDelegate optionallyWithAdunitMultiAdRequestManager: adunitMARManager - orMultiAdRequestManager: nil - baseUrlString: baseUrlString ]; + orMultiAdRequestManager: nil]; return [requestBuilder request]; } + (nullable NSURLRequest *)buildRequestWithMultiAdRequestManager: (nonnull ANMultiAdRequest *)marManager - baseUrlString: (nonnull NSString *)baseUrlString { ANUniversalTagRequestBuilder *requestBuilder = [[ANUniversalTagRequestBuilder alloc] initWithAdFetcherDelegate: (id)marManager optionallyWithAdunitMultiAdRequestManager: nil - orMultiAdRequestManager: marManager - baseUrlString: baseUrlString ]; + orMultiAdRequestManager: marManager]; return [requestBuilder request]; } @@ -102,7 +94,6 @@ + (nullable NSURLRequest *)buildRequestWithMultiAdRequestManager: (nonnull ANMul - (instancetype)initWithAdFetcherDelegate: (nullable id)adFetcherDelegate optionallyWithAdunitMultiAdRequestManager: (nullable ANMultiAdRequest *)adunitMARManager orMultiAdRequestManager: (nullable ANMultiAdRequest *)fetcherMARManager - baseUrlString: (nonnull NSString *)baseUrlString { self = [super init]; if (!self) { return nil; } @@ -112,9 +103,6 @@ - (instancetype)initWithAdFetcherDelegate: (nullable id)adFetcherDelegate _adFetcherDelegate = adFetcherDelegate; _fetcherMARManager = fetcherMARManager; _adunitMARManager = adunitMARManager; - - _baseURLString = baseUrlString; - return self; } @@ -125,17 +113,7 @@ - (instancetype)initWithAdFetcherDelegate: (nullable id)adFetcherDelegate - (NSURLRequest *)request { - NSURL *URL = [NSURL URLWithString:self.baseURLString]; - NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL: URL - cachePolicy: NSURLRequestReloadIgnoringLocalCacheData - timeoutInterval: kAppNexusRequestTimeoutInterval]; - - // Set header fields for HTTP request. - // NB Content-Type needs to be set explicity else will default to "application/x-www-form-urlencoded". - // - [mutableRequest setValue:[ANGlobal getUserAgent] forHTTPHeaderField:@"User-Agent"]; - [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - [mutableRequest setHTTPMethod:@"POST"]; + NSMutableURLRequest *mutableRequest = [ANGlobal adServerRequestURL]; NSError *error = nil; NSData *postData = nil; diff --git a/sdk/sourcefiles/internal/ANWebView.m b/sdk/sourcefiles/internal/ANWebView.m index 4a49b79cb..f39a349d3 100644 --- a/sdk/sourcefiles/internal/ANWebView.m +++ b/sdk/sourcefiles/internal/ANWebView.m @@ -22,11 +22,12 @@ @implementation ANWebView - -(instancetype) initWithSize:(CGSize)size { - + -(instancetype) initWithSize:(CGSize)size + { WKWebViewConfiguration *configuration = [[self class] setDefaultWebViewConfiguration]; self = [super initWithFrame:CGRectMake(0, 0, size.width, size.height) configuration:configuration]; + if (!self) { return nil; } self.backgroundColor = [UIColor clearColor]; self.opaque = NO; @@ -36,14 +37,14 @@ -(instancetype) initWithSize:(CGSize)size { } return self; - - } - -(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL baseURL:(NSURL *)baseURL { - + -(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL baseURL:(NSURL *)baseURL + { self = [self initWithSize:size]; - + if (!self) { return nil; } + + // __weak WKWebView *weakWebView = self; [[[NSURLSession sharedSession] dataTaskWithRequest: ANBasicRequestWithURL(URL) @@ -64,20 +65,25 @@ -(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL baseURL:(NSURL *)base }); } ] resume]; - + + // return self; - } - -(instancetype) initWithSize:(CGSize)size content:(NSString *)htmlContent baseURL:(NSURL *)baseURL{ + -(instancetype) initWithSize:(CGSize)size content:(NSString *)htmlContent baseURL:(NSURL *)baseURL + { self = [self initWithSize:size]; - + if (!self) { return nil; } + [self loadHTMLString:htmlContent baseURL:baseURL]; return self; } - -(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL{ + -(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL + { self = [self initWithSize:size]; + if (!self) { return nil; } + NSURLRequest *request = [NSURLRequest requestWithURL:URL]; [self loadRequest:request]; diff --git a/sdk/sourcefiles/internal/MRAID/ANMRAIDContainerView.m b/sdk/sourcefiles/internal/MRAID/ANMRAIDContainerView.m index 906b15b3f..00651e0e9 100644 --- a/sdk/sourcefiles/internal/MRAID/ANMRAIDContainerView.m +++ b/sdk/sourcefiles/internal/MRAID/ANMRAIDContainerView.m @@ -201,9 +201,9 @@ - (void)setAdViewDelegate:(id)adViewDelegate { _adViewDelegate = adViewDelegate; self.webViewController.adViewDelegate = adViewDelegate; - self.webViewController.adViewANJAMDelegate = adViewDelegate; + self.webViewController.adViewANJAMInternalDelegate = adViewDelegate; self.expandWebViewController.adViewDelegate = adViewDelegate; - self.expandWebViewController.adViewANJAMDelegate = adViewDelegate; + self.expandWebViewController.adViewANJAMInternalDelegate = adViewDelegate; if ([adViewDelegate conformsToProtocol:@protocol(ANInterstitialAdViewInternalDelegate)]) { @@ -499,6 +499,7 @@ - (void)didCompleteFirstLoadFromWebViewController:(ANAdWebViewController *)contr dispatch_async(dispatch_get_main_queue(), ^{ __strong ANMRAIDContainerView *strongSelf = weakSelf; + if (!strongSelf) { ANLogError(@"COULD NOT ACQUIRE strongSelf."); return; diff --git a/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.h b/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.h index 4bca51bfc..47b4ec2b9 100644 --- a/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.h +++ b/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.h @@ -38,4 +38,5 @@ + (NSString *)setCurrentAppOrientation:(NSString *)orientation lockedOrientation:(BOOL)locked; ++ (NSString *)audioVolumeChange:(NSNumber *)volumePercentage; @end diff --git a/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.m b/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.m index a794ae903..d397606e2 100644 --- a/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.m +++ b/sdk/sourcefiles/internal/MRAID/ANMRAIDJavascriptUtil.m @@ -116,5 +116,13 @@ + (NSString *)setCurrentAppOrientation:(NSString *)orientation return [NSString stringWithFormat:@"window.mraid.util.setCurrentAppOrientation(%@);",orientationVal]; } - ++ (NSString *)audioVolumeChange:(NSNumber *)volumePercentage { + if(volumePercentage == nil ){ + NSString *audioVolume = [NSString stringWithFormat:@"{\"volumePercentage\":null}"]; + return [NSString stringWithFormat:@"window.mraid.util.audioVolumeChangeEvent(%@);",audioVolume]; + }else{ + NSString *audioVolume = [NSString stringWithFormat:@"{\"volumePercentage\":%@}",volumePercentage]; + return [NSString stringWithFormat:@"window.mraid.util.audioVolumeChangeEvent(%@);",audioVolume]; + } +} @end diff --git a/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.h b/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.h index 7a7a7a941..d5058bc25 100644 --- a/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.h +++ b/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.h @@ -53,6 +53,7 @@ typedef NS_ENUM(NSUInteger, ANMRAIDAction) { ANMRAIDActionSetOrientationProperties, ANMRAIDActionSetUseCustomClose, ANMRAIDActionOpenURI, + ANMRAIDActionAudioVolumeChange, ANMRAIDActionEnable }; diff --git a/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.m b/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.m index b6ea979ec..d9f656a43 100644 --- a/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.m +++ b/sdk/sourcefiles/internal/MRAID/ANMRAIDUtil.m @@ -84,6 +84,8 @@ + (ANMRAIDAction)actionForCommand:(NSString *)command { return ANMRAIDActionSetUseCustomClose; } else if ([command isEqualToString:@"open"]) { return ANMRAIDActionOpenURI; + }else if ([command isEqualToString:@"audioVolumeChange"]) { + return ANMRAIDActionAudioVolumeChange; } else if ([command isEqualToString:@"enable"]) { return ANMRAIDActionEnable; } diff --git a/sdk/sourcefiles/native/internal/ANCSRNativeAdController.m b/sdk/sourcefiles/native/internal/ANCSRNativeAdController.m index d051d72d9..aa5d0cbca 100644 --- a/sdk/sourcefiles/native/internal/ANCSRNativeAdController.m +++ b/sdk/sourcefiles/native/internal/ANCSRNativeAdController.m @@ -137,6 +137,21 @@ - (BOOL)validAdInstance:(id)adInstance { return YES; } +#pragma mark - Timeout handler + +- (void)startTimeout { + if (self.timeoutCanceled) return; + __weak ANCSRNativeAdController *weakSelf = self; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, + kAppNexusMediationNetworkTimeoutInterval + * NSEC_PER_SEC), + dispatch_get_main_queue(), ^{ + ANCSRNativeAdController *strongSelf = weakSelf; + if (!strongSelf || strongSelf.timeoutCanceled) return; + ANLogWarn(@"csr_timeout"); + [strongSelf didFailToReceiveAd:(ANAdResponseCode)ANAdResponseInternalError]; + }); +} #pragma mark - ANNativeCustomAdapterRequestDelegate diff --git a/sdk/sourcefiles/native/internal/ANNativeAdRequest.m b/sdk/sourcefiles/native/internal/ANNativeAdRequest.m index 494269635..da8fd98fa 100644 --- a/sdk/sourcefiles/native/internal/ANNativeAdRequest.m +++ b/sdk/sourcefiles/native/internal/ANNativeAdRequest.m @@ -21,6 +21,7 @@ #import "ANLogging.h" #import "ANOMIDImplementation.h" #import "ANMultiAdRequest+PrivateMethods.h" +#import "ANHTTPNetworkSession.h" @@ -291,37 +292,22 @@ - (dispatch_semaphore_t) setImageInBackgroundForImageURL: (NSURL *)imageURL NSURLRequest *request = [NSURLRequest requestWithURL: imageURL cachePolicy: NSURLRequestReloadIgnoringLocalCacheData timeoutInterval: kAppNexusNativeAdImageDownloadTimeoutInterval]; + + + [ANHTTPNetworkSession startTaskWithHttpRequest:request responseHandler:^(NSData * _Nonnull data, NSHTTPURLResponse * _Nonnull response) { + UIImage *image = [UIImage imageWithData:data]; - NSURLSessionDataTask *task = - [[NSURLSession sharedSession] dataTaskWithRequest: request - completionHandler: ^(NSData *data, NSURLResponse *response, NSError *error) - { - ANLogDebug(@"BEGIN NSURL session..."); - - NSInteger statusCode = -1; - - if ([response isKindOfClass:[NSHTTPURLResponse class]]) { - NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - statusCode = [httpResponse statusCode]; - } - - if ((statusCode >= 400) || (statusCode == -1)) { - ANLogError(@"Error downloading image: %@", error); - - } else { - UIImage *image = [UIImage imageWithData:data]; - - if (image) { - [ANNativeAdImageCache setImage:image forKey:imageURL]; - [object setValue:image forKeyPath:keyPath]; - } - } - - dispatch_semaphore_signal(semaphore); - } - ]; - [task resume]; - + if (image) { + [ANNativeAdImageCache setImage:image forKey:imageURL]; + [object setValue:image forKeyPath:keyPath]; + } + + dispatch_semaphore_signal(semaphore); + + } errorHandler:^(NSError * _Nonnull error) { + ANLogError(@"Error downloading image: %@", error); + dispatch_semaphore_signal(semaphore); + }]; // return semaphore; } diff --git a/sdk/sourcefiles/native/internal/ANNativeMediatedAdController.m b/sdk/sourcefiles/native/internal/ANNativeMediatedAdController.m index f90cd20fb..da389997c 100644 --- a/sdk/sourcefiles/native/internal/ANNativeMediatedAdController.m +++ b/sdk/sourcefiles/native/internal/ANNativeMediatedAdController.m @@ -252,8 +252,7 @@ - (void)startTimeout { if (self.timeoutCanceled) return; __weak ANNativeMediatedAdController *weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, - kAppNexusMediationNetworkTimeoutInterval - * NSEC_PER_SEC), + self.mediatedAd.networkTimeout * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ ANNativeMediatedAdController *strongSelf = weakSelf; if (!strongSelf || strongSelf.timeoutCanceled) return; diff --git a/sdk/sourcefiles/video/ANInstreamVideoAd.m b/sdk/sourcefiles/video/ANInstreamVideoAd.m index 87a859047..a38099ab0 100644 --- a/sdk/sourcefiles/video/ANInstreamVideoAd.m +++ b/sdk/sourcefiles/video/ANInstreamVideoAd.m @@ -205,7 +205,7 @@ - (nullable NSString *) getVastXML { } - (ANVideoOrientation) getVideoOrientation { - return [self.adPlayer getVideoAdOrientation]; + return [self.adPlayer getVideoOrientation]; } - (NSUInteger) getAdPlayElapsedTime { diff --git a/sdk/sourcefiles/video/ANVideoAdPlayer.h b/sdk/sourcefiles/video/ANVideoAdPlayer.h index e174aa36c..794dc2c9f 100644 --- a/sdk/sourcefiles/video/ANVideoAdPlayer.h +++ b/sdk/sourcefiles/video/ANVideoAdPlayer.h @@ -100,7 +100,7 @@ typedef NS_ENUM(NSUInteger, ANVideoAdPlayerEvent) { * * @return Default VideoOrientation value ANUnknown, which indicates that aspectRatio can't be retrieved for the video. */ -- (ANVideoOrientation) getVideoAdOrientation; +- (ANVideoOrientation) getVideoOrientation; @end diff --git a/sdk/sourcefiles/video/ANVideoAdPlayer.m b/sdk/sourcefiles/video/ANVideoAdPlayer.m index 6eccc7239..5340ee7ca 100644 --- a/sdk/sourcefiles/video/ANVideoAdPlayer.m +++ b/sdk/sourcefiles/video/ANVideoAdPlayer.m @@ -138,7 +138,7 @@ - (ANClickThroughAction) clickThroughAction return returnVal; } -- (ANVideoOrientation) getVideoAdOrientation { +- (ANVideoOrientation) getVideoOrientation { return _videoAdOrientation; } diff --git a/tests/UnitTestApp/FunctionalTests/ANBannerAdTestCase.m b/tests/UnitTestApp/FunctionalTests/ANBannerAdTestCase.m index 52af6292d..d11994422 100644 --- a/tests/UnitTestApp/FunctionalTests/ANBannerAdTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/ANBannerAdTestCase.m @@ -23,7 +23,7 @@ -@interface ANBannerAdTestCase : XCTestCase +@interface ANBannerAdTestCase : XCTestCase @property (nonatomic, readwrite, strong) ANBannerAdView *banner; @property (nonatomic, readwrite, strong) UIView *bannerSuperView; @@ -34,6 +34,8 @@ @interface ANBannerAdTestCase : XCTestCase @property (nonatomic, strong) XCTestExpectation *loadAdResponseReceivedExpectation; @property (nonatomic, strong) XCTestExpectation *loadAdResponseFailedExpectation; +@property (nonatomic, strong) XCTestExpectation *loadBannerAdResponseReceivedExpectation; + @property (nonatomic, readwrite) BOOL locationEnabledForCreative; @end @@ -71,6 +73,7 @@ - (void)tearDown { completion:nil]; self.loadAdResponseReceivedExpectation = nil; + self.loadBannerAdResponseReceivedExpectation = nil; } @@ -91,6 +94,63 @@ -(void) setupBannerWithPlacement:(NSString *)placement withFrame:(CGRect)frame a #pragma mark - Test methods. +- (void)testNoMediaTypeBannerAd +{ + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; + [self stubRequestWithResponse:@"ANAdResponseRTB_Banner"]; + + self.banner = [[ANBannerAdView alloc] initWithFrame: CGRectMake(50 , 50 , 300,250) + placementId: @"1" + adSize: CGSizeMake(300 , 250)]; + + self.banner.rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController; + self.banner.shouldAllowNativeDemand = NO; + self.banner.shouldAllowVideoDemand = NO; + self.banner.shouldAllowBannerDemand = NO; + + self.banner.delegate = self; + [self.banner loadAd]; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.banner]; + + self.loadBannerAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + XCTAssertEqual(self.banner.shouldAllowBannerDemand, NO); +} + + + +- (void)testDisabledBannerEnableNative +{ + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; + [self stubRequestWithResponse:@"SuccessfulDisabledBannerEnableNative"]; + + self.banner = [[ANBannerAdView alloc] initWithFrame: CGRectMake(50 , 50 , 300,250) + placementId: @"1" + adSize: CGSizeMake(300 , 250)]; + + self.banner.rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController; + self.banner.shouldAllowNativeDemand = YES; + self.banner.shouldAllowVideoDemand = NO; + self.banner.shouldAllowBannerDemand = NO; + + self.banner.delegate = self; + [self.banner loadAd]; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.banner]; + + self.loadBannerAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + XCTAssertEqual(self.banner.shouldAllowBannerDemand, NO); + XCTAssertEqual(self.banner.shouldAllowNativeDemand, YES); +} + - (void)testIncorrectWidth { self.bannerSuperView = [[UIView alloc]initWithFrame:CGRectMake(0, 0 , 320, 430)]; @@ -316,6 +376,7 @@ - (void)waitForTimeInterval:(NSTimeInterval)delay - (void)adDidReceiveAd:(id)ad { [self.loadAdResponseReceivedExpectation fulfill]; + [self.loadBannerAdResponseReceivedExpectation fulfill]; self.receiveAdSuccess = YES; } @@ -329,4 +390,8 @@ - (void)ad:(id)ad requestFailedWithError:(NSError *)error self.receiveAdFailure = YES; } +- (void)ad:(id)loadInstance didReceiveNativeAd:(id)responseInstance{ + [self.loadBannerAdResponseReceivedExpectation fulfill]; +} + @end diff --git a/tests/UnitTestApp/FunctionalTests/ANBannerAdViewVideoTestCase.m b/tests/UnitTestApp/FunctionalTests/ANBannerAdViewVideoTestCase.m index 69275a043..9f9af7c4c 100644 --- a/tests/UnitTestApp/FunctionalTests/ANBannerAdViewVideoTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/ANBannerAdViewVideoTestCase.m @@ -209,7 +209,7 @@ - (void) testBannerVideoVerticalOrientation }]; XCTAssertEqual(self.banner.adType , ANAdTypeVideo); - XCTAssertEqual(self.banner.getVideoOrientation, ANPortraint); + XCTAssertEqual(self.banner.getVideoOrientation, ANPortrait); } diff --git a/tests/UnitTestApp/FunctionalTests/ANBannerNativeTestCase.m b/tests/UnitTestApp/FunctionalTests/ANBannerNativeTestCase.m index fe83dce20..74c4fa672 100644 --- a/tests/UnitTestApp/FunctionalTests/ANBannerNativeTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/ANBannerNativeTestCase.m @@ -147,6 +147,63 @@ - (void)testIsBannerVideoEnabled } +- (void)testIsBannerDisabled +{ + TESTTRACE(); + + self.multiFormatAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"1"]; + self.multiFormatAd.shouldAllowBannerDemand = NO; + XCTAssertEqual(self.multiFormatAd.adAllowedMediaTypes.count , 0); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeBanner)]); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeVideo)]); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeNative)]); +} + + +- (void)testIsBannerDisabledNativeVideoEnabled +{ + TESTTRACE(); + + self.multiFormatAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"1"]; + self.multiFormatAd.shouldAllowBannerDemand = NO; + self.multiFormatAd.shouldAllowVideoDemand = YES; + self.multiFormatAd.shouldAllowNativeDemand = YES; + XCTAssertEqual(self.multiFormatAd.adAllowedMediaTypes.count , 2); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeBanner)]); + XCTAssertTrue([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeVideo)]); + XCTAssertTrue([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeNative)]); +} + + +- (void)testIsBannerNativeDisabledVideoEnabled +{ + TESTTRACE(); + + self.multiFormatAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"1"]; + self.multiFormatAd.shouldAllowBannerDemand = NO; + self.multiFormatAd.shouldAllowVideoDemand = YES; + self.multiFormatAd.shouldAllowNativeDemand = NO; + XCTAssertEqual(self.multiFormatAd.adAllowedMediaTypes.count , 1); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeBanner)]); + XCTAssertTrue([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeVideo)]); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeNative)]); +} + +- (void)testIsBannerVideoDisabledNativeEnabled +{ + TESTTRACE(); + + self.multiFormatAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"1"]; + self.multiFormatAd.shouldAllowBannerDemand = NO; + self.multiFormatAd.shouldAllowVideoDemand = NO; + self.multiFormatAd.shouldAllowNativeDemand = YES; + XCTAssertEqual(self.multiFormatAd.adAllowedMediaTypes.count , 1); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeBanner)]); + XCTAssertFalse([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeVideo)]); + XCTAssertTrue([self.multiFormatAd.adAllowedMediaTypes containsObject:@(ANAllowedMediaTypeNative)]); +} + + - (void)testIsBannerNativeEnabled { TESTTRACE(); diff --git a/tests/UnitTestApp/FunctionalTests/ANInstreamVideoAdTestCase.m b/tests/UnitTestApp/FunctionalTests/ANInstreamVideoAdTestCase.m index c607cd35b..9bde0b4a8 100644 --- a/tests/UnitTestApp/FunctionalTests/ANInstreamVideoAdTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/ANInstreamVideoAdTestCase.m @@ -228,7 +228,7 @@ - (void)testVerticalVideoOrientation [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval handler:nil]; // - XCTAssertEqual(instreamVideoAd.getVideoOrientation, ANPortraint); + XCTAssertEqual(instreamVideoAd.getVideoOrientation, ANPortrait); } diff --git a/tests/UnitTestApp/FunctionalTests/ANJAMTestCase.m b/tests/UnitTestApp/FunctionalTests/ANJAMTestCase.m index 448663a9b..96f0d30b3 100644 --- a/tests/UnitTestApp/FunctionalTests/ANJAMTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/ANJAMTestCase.m @@ -31,6 +31,7 @@ @interface ANJAMTestCase : XCTestCase @property (nonatomic, strong) ANBannerAdView *adView; @property (nonatomic, strong) XCTestExpectation *deviceIdExpectation; +@property (nonatomic, strong) XCTestExpectation *customKeywordsExpectation; @property (nonatomic, strong) XCTestExpectation *dispatchAppEventExpectation; @property (nonatomic, strong) XCTestExpectation *internalBrowserExpectation; @property (nonatomic, strong) XCTestExpectation *externalBrowserExpectation; @@ -70,6 +71,7 @@ - (void)tearDown { self.adView.appEventDelegate = nil; self.adView = nil; self.deviceIdExpectation = nil; + self.customKeywordsExpectation = nil; self.dispatchAppEventExpectation = nil; self.internalBrowserExpectation = nil; self.externalBrowserExpectation = nil; @@ -94,6 +96,20 @@ - (void)testANJAMDeviceIDResponse { self.deviceIdExpectation = nil; } + +- (void)testANJAMCustomKeywordsResponse { + [self tearDown]; + [self setUp]; + [self stubRequestWithResponse:@"ANJAMCustomKeywordsResponse"]; + self.customKeywordsExpectation = [self expectationWithDescription:@"Waiting for CustomKeywords app event to be received."]; + [self.adView addCustomKeywordWithKey:@"foo" value:@"bar1"]; + [self.adView addCustomKeywordWithKey:@"randomkey" value:@"randomvalue"]; + self.adView.autoRefreshInterval = 0; + [self.adView loadAd]; + [self waitForExpectationsWithTimeout:20.0 handler:nil]; + self.customKeywordsExpectation = nil; +} + - (void)testANJAMDispatchAppEvent { [self stubRequestWithResponse:@"ANJAMDispatchAppEventResponse"]; self.dispatchAppEventExpectation = [self expectationWithDescription:@"Waiting for app event to be received."]; @@ -189,6 +205,10 @@ - (void) ad: (id)ad XCTAssertEqualObjects(data, @"true"); [self.mayDeepLinkExpectation fulfill]; + } else if ([name isEqualToString:@"CustomKeywordsYes"]) { + XCTAssertNotNil(data); + XCTAssertEqualObjects(data, @"bar1randomvalue"); + [self.customKeywordsExpectation fulfill]; } else if ([name isEqualToString:@"DeepLinkNo"]) { XCTAssertNotNil(data); XCTAssertEqualObjects(data, @"false"); diff --git a/tests/UnitTestApp/FunctionalTests/ANUniversalTagRequestBuilderFunctionalTests.m b/tests/UnitTestApp/FunctionalTests/ANUniversalTagRequestBuilderFunctionalTests.m index ea3648197..ee1b5f111 100644 --- a/tests/UnitTestApp/FunctionalTests/ANUniversalTagRequestBuilderFunctionalTests.m +++ b/tests/UnitTestApp/FunctionalTests/ANUniversalTagRequestBuilderFunctionalTests.m @@ -56,9 +56,8 @@ - (void)testUTRequestForSetGDPRConsentTrue [ANGDPRSettings setConsentRequired:[NSNumber numberWithInt:1]]; [ANGDPRSettings setConsentString:@"a390129402948384453"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -93,9 +92,8 @@ - (void)testUTRequestForSetGDPRConsentFalse [ANGDPRSettings setConsentRequired:[NSNumber numberWithInt:0]]; [ANGDPRSettings setConsentString:@"a390129402948384453"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -135,9 +133,8 @@ - (void)testUTRequestForSetGDPRDefaultConsent [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"IABTCF_TCString"]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"IABTCF_gdprApplies"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -168,9 +165,8 @@ - (void)testUTRequestCheckConsentForGDPRIABConsentStringWithTrue [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:1] forKey:@"IABTCF_gdprApplies"]; [[NSUserDefaults standardUserDefaults] setObject:@"a390129402948384453" forKey:@"IABTCF_TCString"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -207,9 +203,8 @@ - (void)testUTRequestCheckConsentForTCFConsentStringWithTrue [[NSUserDefaults standardUserDefaults] setValue:@"1" forKey:@"IABTCF_gdprApplies"]; [[NSUserDefaults standardUserDefaults] setObject:@"a390129402948384453" forKey:@"IABTCF_TCString"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -246,9 +241,8 @@ - (void)testUTRequestCheckConsentForIABConsentStringWithFalse [[NSUserDefaults standardUserDefaults] setObject:@"a390129402948384453" forKey:@"IABConsent_ConsentString"]; [[NSUserDefaults standardUserDefaults] setObject:@"0" forKey:@"IABConsent_SubjectToGDPR"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -284,9 +278,8 @@ - (void)testUTRequestCheckConsentForTCFConsentStringWithFalse [[NSUserDefaults standardUserDefaults] setObject:@"a390129402948384453" forKey:@"IABTCF_TCString"]; [[NSUserDefaults standardUserDefaults] setValue:0 forKey:@"IABTCF_gdprApplies"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -320,9 +313,8 @@ - (void)testUTRequestForSetUSPrivacyString { [ANUSPrivacySettings setUSPrivacyString:@"1yn"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -353,9 +345,8 @@ - (void)testUTRequestForSetUSPrivacyDefaultString [ANUSPrivacySettings reset]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"IABUSPrivacy_String"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; @@ -384,9 +375,8 @@ - (void)testUTRequestCheckForIAB_USPrivacyString [ANUSPrivacySettings reset]; [[NSUserDefaults standardUserDefaults] setObject:@"1yn" forKey:@"IABUSPrivacy_String"]; - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; diff --git a/tests/UnitTestApp/FunctionalTests/CSM/ANAdMediationTimeoutTestCase.m b/tests/UnitTestApp/FunctionalTests/CSM/ANAdMediationTimeoutTestCase.m new file mode 100644 index 000000000..4405d4e0c --- /dev/null +++ b/tests/UnitTestApp/FunctionalTests/CSM/ANAdMediationTimeoutTestCase.m @@ -0,0 +1,342 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import +#import "ANBannerAdView.h" +#import "ANInterstitialAd.h" +#import "ANNativeAdRequest.h" +#import "ANNativeAdResponse.h" +#import "ANHTTPStubbingManager.h" +#import "NSURLRequest+HTTPBodyTesting.h" +#import "ANSDKSettings+PrivateMethods.h" + +#define kAppNexusCSMTimeoutInterval 6.0 + + +@interface ANAdMediationTimeoutTestCase : XCTestCase + +@property (nonatomic,readwrite,strong) ANNativeAdRequest *nativeAdRequest; +@property (nonatomic,readwrite,strong) ANNativeAdResponse *nativeAdResponse; + +@property (nonatomic, readwrite, strong) ANBannerAdView *banner; +@property (strong, nonatomic) ANInterstitialAd *interstitialAd; + + +@property (nonatomic, strong) XCTestExpectation *mediationBannerRespectTimeoutFail; +@property (nonatomic, strong) XCTestExpectation *mediationInterstitialRespectTimeoutFail; +@property (nonatomic, strong) XCTestExpectation *mediationNativeRespectTimeoutFail; + +@end + +@implementation ANAdMediationTimeoutTestCase + +- (void)setUp { + + [self clearObject]; + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; +} +-(void)loadNativeAd{ + + self.nativeAdRequest= [[ANNativeAdRequest alloc] init]; + self.nativeAdRequest.placementId = @"1"; + self.nativeAdRequest.delegate = self; + [self.nativeAdRequest loadAd]; +} + +- (void)loadBannerAd { + + // Make a banner ad view. + self.banner = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 320, 50) placementId:@"1" adSize:CGSizeMake(320, 50)]; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.banner]; + + self.banner.delegate = self; + [self.banner loadAd]; + +} + + +- (void)loadInterstitialAd { + + self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"1"]; + self.interstitialAd.delegate = self; + [self.interstitialAd loadAd]; + +} + +- (void)testCSMBannerRespectTimeoutFail{ + + __block BOOL isTimeoutOver = NO; + [self stubRequestWithResponse:@"timeout_banner"]; + self.mediationBannerRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive CSM Banner Ad Fail"]; + [self loadBannerAd]; + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval + 1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + isTimeoutOver = YES; + + }); + + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval + handler:^(NSError *error) { + + }]; + XCTAssertFalse(isTimeoutOver); + +} + +- (void)testCSMInterstitialRespectTimeoutFail{ + __block BOOL isTimeoutOver = NO; + + [self stubRequestWithResponse:@"timeout_interstiatal"]; + self.mediationInterstitialRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive CSM Interstitial Ad Fail"]; + [self loadInterstitialAd]; + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval +1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + + isTimeoutOver = YES; + + }); + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval + handler:^(NSError *error) { + + }]; + XCTAssertFalse(isTimeoutOver); + +} + +- (void)testCSMNativeRespectTimeoutFail{ + + __block BOOL isTimeoutOver = NO; + + [self stubRequestWithResponse:@"timeout_native"]; + self.mediationNativeRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive CSM Native Ad Fail"]; + [self loadNativeAd]; + + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval +1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + isTimeoutOver = YES; + + + }); + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval + handler:^(NSError *error) { + + }]; + + XCTAssertFalse(isTimeoutOver); +} + + +- (void)testCSMBannerRespectTimeoutFailOver{ + + __block BOOL isTimeoutOver = NO; + [self stubRequestWithResponse:@"timeout_banner_over"]; + self.mediationBannerRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive CSM Banner Ad Fail due to Timeout Over"]; + [self loadBannerAd]; + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval + 1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + isTimeoutOver = YES; + + }); + + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval*2 + handler:^(NSError *error) { + + }]; + XCTAssertTrue(isTimeoutOver); + +} + +- (void)testCSMInterstitialRespectTimeoutFailOver{ + __block BOOL isTimeoutOver = NO; + + [self stubRequestWithResponse:@"timeout_interstiatal_over"]; + self.mediationInterstitialRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive CSM Interstitial Ad Fail due to Timeout Over"]; + [self loadInterstitialAd]; + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval +1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + + isTimeoutOver = YES; + + }); + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval*2 + handler:^(NSError *error) { + + }]; + XCTAssertTrue(isTimeoutOver); + +} + + +- (void)testCSMNativeRespectTimeoutFailOver{ + + __block BOOL isTimeoutOver = NO; + + [self stubRequestWithResponse:@"timeout_native_over"]; + self.mediationNativeRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive CSM Native Ad Fail due to Timeout Over"]; + [self loadNativeAd]; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval +1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + isTimeoutOver = YES; + + + }); + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval*2 + handler:^(NSError *error) { + + }]; + + XCTAssertTrue(isTimeoutOver); +} + + +// SSM Ad + +- (void)testSSMBannerRespectTimeoutFail{ + + __block BOOL isTimeoutOver = NO; + [self stubRequestWithResponse:@"timeout_ssm"]; + self.mediationBannerRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive SSM Banner Ad Fail"]; + [self loadBannerAd]; + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval + 1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + isTimeoutOver = YES; + + }); + + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval + handler:^(NSError *error) { + + }]; + XCTAssertFalse(isTimeoutOver); + +} + + +- (void)testSSMBannerRespectTimeoutFailOver{ + + __block BOOL isTimeoutOver = NO; + [self stubRequestWithResponse:@"timeout_ssm_over"]; + self.mediationBannerRespectTimeoutFail = [self expectationWithDescription:@"Didn't receive SSM Banner Ad Fail due to Timeout Over"]; + [self loadBannerAd]; + + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, ((kAppNexusCSMTimeoutInterval + 1) * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + + isTimeoutOver = YES; + + }); + + + [self waitForExpectationsWithTimeout:kAppNexusCSMTimeoutInterval*2 + handler:^(NSError *error) { + + }]; + XCTAssertTrue(isTimeoutOver); + +} + +- (void)tearDown { + [self clearObject]; +} + +-(void)clearObject{ + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[UIApplication sharedApplication].keyWindow.rootViewController.presentedViewController dismissViewControllerAnimated:NO + completion:nil]; + + // Clear all expectations for next test + + self.banner = nil; + self.interstitialAd = nil; + self.nativeAdRequest = nil; + self.nativeAdResponse = nil; + + self.mediationBannerRespectTimeoutFail = nil; + self.mediationInterstitialRespectTimeoutFail = nil; + self.mediationNativeRespectTimeoutFail = nil; + + + +} + + +# pragma mark - Ad Server Response Stubbing + +- (void)stubRequestWithResponse:(NSString *)responseName +{ + NSBundle *currentBundle = [NSBundle bundleForClass:[self class]]; + + NSString *baseResponse = [NSString stringWithContentsOfFile: [currentBundle pathForResource:responseName ofType:@"json"] + encoding: NSUTF8StringEncoding + error: nil ]; + + ANURLConnectionStub *requestStub = [[ANURLConnectionStub alloc] init]; + + + requestStub.requestURL = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; + requestStub.responseCode = 200; + requestStub.responseBody = baseResponse; + + [[ANHTTPStubbingManager sharedStubbingManager] addStub:requestStub]; +} + +#pragma mark - ANAdDelegate + +- (void)adDidReceiveAd:(id)ad { + NSLog(@"Ad did receive ad"); + // No testcase to perfrom Receive Ad +} + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error { + NSLog(@"Ad failed to load: %@", error); + [self.mediationBannerRespectTimeoutFail fulfill]; + [self.mediationInterstitialRespectTimeoutFail fulfill]; + +} + + + +- (void)adRequest:(ANNativeAdRequest *)request didReceiveResponse:(ANNativeAdResponse *)response +{ + // No testcase to perfrom Receive Ad +} + +- (void)adRequest:(ANNativeAdRequest *)request didFailToLoadWithError:(NSError *)error withAdResponseInfo:(ANAdResponseInfo *)adResponseInfo{ + [self.mediationNativeRespectTimeoutFail fulfill]; +} + +@end diff --git a/tests/UnitTestApp/FunctionalTests/CSR/ANCSRUniversalTagRequestBuilderTests.m b/tests/UnitTestApp/FunctionalTests/CSR/ANCSRUniversalTagRequestBuilderTests.m index 067774249..b1ca77dea 100644 --- a/tests/UnitTestApp/FunctionalTests/CSR/ANCSRUniversalTagRequestBuilderTests.m +++ b/tests/UnitTestApp/FunctionalTests/CSR/ANCSRUniversalTagRequestBuilderTests.m @@ -97,10 +97,9 @@ -(void)clearObject{ - (void)testUTRequestWithtpuids { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANCSRUniversalFetcher *adFetcher = [[TestANCSRUniversalFetcher alloc] initWithPlacementId:PlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -128,10 +127,9 @@ - (void)testUTRequestWithtpuids - (void)testUTRequestForCSR { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANCSRUniversalFetcher *adFetcher = [[TestANCSRUniversalFetcher alloc] initWithPlacementId:PlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ diff --git a/tests/UnitTestApp/FunctionalTests/MARGeneralTests.m b/tests/UnitTestApp/FunctionalTests/MARGeneralTests.m index ce177dd5b..f4e6ba7b2 100644 --- a/tests/UnitTestApp/FunctionalTests/MARGeneralTests.m +++ b/tests/UnitTestApp/FunctionalTests/MARGeneralTests.m @@ -27,6 +27,9 @@ #import "ANInstreamVideoAd+Test.h" #import "ANUniversalAdFetcher+ANTest.h" +#import "ANAdViewInternalDelegate.h" + + #pragma mark - Global private constants. diff --git a/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.h b/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.h index ecb2e1b5e..a8c42cef5 100644 --- a/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.h +++ b/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.h @@ -21,6 +21,8 @@ @interface ANSSMMediationAdViewController (ANTest) @property (nonatomic, readwrite, strong) ANSSMStandardAd *ssmMediatedAd; @property (nonatomic, readwrite, strong) NSURL *ssmHandlerURL; +@property (nonatomic, readwrite, weak) id adViewDelegate; + - (void)markLatencyStart; - (void)handleFailure:(ANAdResponseCode)errorCode errorInfo:(NSString *)errorInfo; diff --git a/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.m b/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.m index f4c2fb52e..78552dfb3 100644 --- a/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.m +++ b/tests/UnitTestApp/FunctionalTests/MARTestCase/MARTestMockMediation/ANSSMMediationAdViewController+ANTest.m @@ -34,20 +34,24 @@ - (BOOL)requestForAd:(ANSSMStandardAd *)ad { [self handleFailure:errorCode errorInfo:errorInfo]; return NO; }else{ - - NSString *filepath = [[NSBundle mainBundle] pathForResource:@"ssmAd" ofType:@"txt"]; - NSError *error; - NSString *fileContents = [NSString stringWithContentsOfFile:filepath encoding:NSUTF8StringEncoding error:&error]; - - if (error) - NSLog(@"Error reading file: %@", error.localizedDescription); - - // maybe for debugging... - NSLog(@"contents: %@", fileContents); - - - [self didReceiveAd:fileContents]; - + if([ad.urlString containsString:@"https://donothing.adnxs.com"]){ + // ANAdMediationTimeoutTestCase is using this for SSM Timeout testing + self.ssmMediatedAd = ad; + [self startTimeout]; + }else { + NSString *filepath = [[NSBundle mainBundle] pathForResource:@"ssmAd" ofType:@"txt"]; + NSError *error; + NSString *fileContents = [NSString stringWithContentsOfFile:filepath encoding:NSUTF8StringEncoding error:&error]; + + if (error) + NSLog(@"Error reading file: %@", error.localizedDescription); + + // maybe for debugging... + NSLog(@"contents: %@", fileContents); + + + [self didReceiveAd:fileContents]; + } } return true; } diff --git a/tests/UnitTestApp/FunctionalTests/MRAIDTests.m b/tests/UnitTestApp/FunctionalTests/MRAIDTests.m index 55dec21b6..0c1b22c8a 100644 --- a/tests/UnitTestApp/FunctionalTests/MRAIDTests.m +++ b/tests/UnitTestApp/FunctionalTests/MRAIDTests.m @@ -1372,7 +1372,34 @@ - (void)testRemoveEventListener { [self clearTest]; } +#pragma mark - mraid.addEventListener AudioVolumeChange +- (void)testAudioVolumeChangeEventOnScreen { + [self loadMRAIDListenerBannerWithSelectorName:NSStringFromSelector(_cmd) + atOrigin:CGPointZero + withSize:CGSizeMake(320.0f, 50.0f)]; + [self addBannerAsSubview]; + [self audioVolumeChange]; + NSString *actualVolumePer = [self evaluateJavascript:@"testVolumePercentage"]; + XCTAssertTrue([self isVolumePercentageNumeric:actualVolumePer], @"expected volume percentage::numeric but actual::%@",actualVolumePer); + + [self clearTest]; + +} + +- (void)testAudioVolumeChangeEventOffScreen { + [self loadMRAIDListenerBannerWithSelectorName:NSStringFromSelector(_cmd) + atOrigin:CGPointZero + withSize:CGSizeMake(320.0f, 50.0f)]; + + [self addBannerAsSubview]; + [self moveBannerSubviewToOrigin:CGPointMake(1000.0f, 1000.0f)]; + [self audioVolumeChange]; + NSString *actualVolumePer = [self evaluateJavascript:@"testVolumePercentage"]; + XCTAssertTrue([actualVolumePer isEqualToString:@"0"], @"expected volume percentage::null but actual::%@",actualVolumePer); + + [self clearTest]; +} #pragma mark - mraid.supports() @@ -1677,6 +1704,16 @@ -(void) updatePositionOfBanner:(CGFloat) originY self.banner.frame = frame; } +-(bool) isVolumePercentageNumeric:(NSString*) volumePercentage{ + NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init]; + [numberFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]]; + NSNumber* number = [numberFormatter numberFromString:volumePercentage]; + if (number != nil) { + return true; + } + return false; +} + # pragma mark - MRAID Accessor Functions - (void)expand { @@ -1691,6 +1728,10 @@ - (void)resize { [self mraidNativeCall:@"resize()" withDelay:MRAID_TESTS_DEFAULT_DELAY]; } +- (void)audioVolumeChange { + [self mraidNativeCall:@"audioVolumeChange()" withDelay:MRAID_TESTS_DEFAULT_DELAY]; +} + - (NSString *)getState { return [self mraidNativeCall:@"getState()" withDelay:0]; } diff --git a/tests/UnitTestApp/FunctionalTests/MediationBannerAdResizeTestCase.m b/tests/UnitTestApp/FunctionalTests/MediationBannerAdResizeTestCase.m index a58835d19..89a101700 100644 --- a/tests/UnitTestApp/FunctionalTests/MediationBannerAdResizeTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/MediationBannerAdResizeTestCase.m @@ -64,7 +64,7 @@ - (void)tearDown { #pragma mark - Successful Banners -/* FIX +/* TBD No visible @interface for 'ViewController' declares the selector 'loadAdMobBannerResizeWithDelegate:shouldResize:' */ diff --git a/tests/UnitTestApp/FunctionalTests/NoNetworkAdFailTestCase.m b/tests/UnitTestApp/FunctionalTests/NoNetworkAdFailTestCase.m index bc8de8c80..15b1f73e1 100644 --- a/tests/UnitTestApp/FunctionalTests/NoNetworkAdFailTestCase.m +++ b/tests/UnitTestApp/FunctionalTests/NoNetworkAdFailTestCase.m @@ -97,7 +97,7 @@ - (void)tearDown { - (void)testBannerAd { - [self stubRequestWithResponse:@"PerformanceStatsRTBBannerAd"]; + [self stubRequestWithResponse:@"SuccessfulAllowMagicSizeBannerObjectResponse"]; CGRect rect = CGRectMake(0, 0, 300, 250); int adWidth = 300; @@ -121,7 +121,7 @@ - (void)testBannerAd { - (void)testVideoAd { - [self stubRequestWithResponse:@"PerformanceStatsRTBVideoAd"]; + [self stubRequestWithResponse:@""]; self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:@"19065996"]; [self.videoAd loadAdWithDelegate:self]; @@ -137,7 +137,7 @@ - (void)testVideoAd { - (void)testNativeAd { - [self stubRequestWithResponse:@"PerformanceStatsRTBNativeAd"]; + [self stubRequestWithResponse:@""]; self.adRequest = [[ANNativeAdRequest alloc] init]; self.adRequest.delegate = self; @@ -153,7 +153,7 @@ - (void)testNativeAd { - (void)testInterstitialAd { - [self stubRequestWithResponse:@"PerformanceStatsRTBInterstitialAd"]; + [self stubRequestWithResponse:@""]; self.interstitial = [[ANInterstitialAd alloc] init]; self.interstitial.placementId = @"19065996"; @@ -169,7 +169,7 @@ - (void)testInterstitialAd { -(void)testMAR{ - [self createAllMARCombination:@"PerformanceStatsRTBMARAd"]; + [self createAllMARCombination:@""]; self.failAdExpectationTestcase = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; [self waitForExpectationsWithTimeout:2 * kAppNexusRequestTimeoutInterval diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerAdTestCase.m new file mode 100644 index 000000000..53112abec --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerAdTestCase.m @@ -0,0 +1,158 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import +#import "ANBannerAdView.h" +#import "ANGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANTimeTracker.h" + +@interface AdPerformanceStatsBannerAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANBannerAdView *bannerAd; +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation AdPerformanceStatsBannerAdTestCase + +- (void)setUp { + [self clearAd]; +} + +- (void)tearDown { + [self clearAd]; +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + // + self.bannerAd.delegate = nil; + self.bannerAd.appEventDelegate = nil; + [self.bannerAd removeFromSuperview]; + self.bannerAd = nil; + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + [[UIApplication sharedApplication].keyWindow.rootViewController.presentedViewController dismissViewControllerAnimated:NO completion:nil]; + +} + +-(void) setupBannerWithPlacement:(NSString *)placement withFrame:(CGRect)frame andSize:(CGSize)size{ + self.bannerAd = [[ANBannerAdView alloc] initWithFrame:frame + placementId:placement + adSize:size]; + self.bannerAd.autoRefreshInterval = 0; + self.bannerAd.delegate = self; + +} + +- (void)testBannerAd { + + CGRect rect = CGRectMake(0, 0, 300, 250); + int adWidth = 300; + int adHeight = 250; + CGSize size = CGSizeMake(adWidth, adHeight); + [self setupBannerWithPlacement:BANNER_PLACEMENT withFrame:rect andSize:size]; + + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [self.bannerAd loadAd]; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + + }]; + + [self setupBannerWithPlacement:BANNER_PLACEMENT withFrame:rect andSize:size]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + [self.bannerAd loadAd]; + + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + + + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + + }]; +} +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + + +#pragma mark - ANAdDelegate + + +- (void)adDidReceiveAd:(id)ad +{ + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNER,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERAD_WEBVIEW_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNER,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERAD_WEBVIEW_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } +} + + + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + NSLog(@"Banner Ad Failed to Load"); +} + +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerNativeAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerNativeAdTestCase.m new file mode 100644 index 000000000..ea301b83e --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerNativeAdTestCase.m @@ -0,0 +1,169 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import +#import "ANBannerAdView.h" +#import "ANGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANTimeTracker.h" + +@interface AdPerformanceStatsBannerNativeAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANBannerAdView *bannerAd; +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation AdPerformanceStatsBannerNativeAdTestCase + +- (void)setUp { + [self clearAd]; +} + +- (void)tearDown { + [self clearAd]; +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + self.bannerAd.delegate = nil; + self.bannerAd.appEventDelegate = nil; + [self.bannerAd removeFromSuperview]; + self.bannerAd = nil; + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + +} + +-(void) setupBannerWithPlacement:(NSString *)placement withFrame:(CGRect)frame andSize:(CGSize)size{ + self.bannerAd = [[ANBannerAdView alloc] initWithFrame:frame + placementId:placement + adSize:size]; + self.bannerAd.autoRefreshInterval = 0; + self.bannerAd.delegate = self; + self.bannerAd.shouldAllowNativeDemand = YES; + self.bannerAd.enableNativeRendering = NO; + +} + +- (void)testBannerNativeAd { + CGRect rect = CGRectMake(0, 0, 300, 250); + int adWidth = 300; + int adHeight = 250; + CGSize size = CGSizeMake(adWidth, adHeight); + [self setupBannerWithPlacement:BANNERNATIVE_PLACEMENT withFrame:rect andSize:size]; + + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [self.bannerAd loadAd]; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + + }]; + + [self setupBannerWithPlacement:BANNERNATIVE_PLACEMENT withFrame:rect andSize:size]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [self.bannerAd loadAd]; + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + + }]; +} + +#pragma mark - Stubbing + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + + +#pragma mark - ANAdDelegate + + + +#pragma mark - ANAdDelegate + +- (void)adDidReceiveAd:(id)ad +{ + NSLog(@"Ad ReceiveAd "); +} + +- (void)ad:(id)loadInstance didReceiveNativeAd:(id)responseInstance{ + NSLog(@"Banner NativeAd did Receive Response "); + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNERNATIVE,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + + + + XCTAssertGreaterThan(PERFORMANCESTATSRTBNATIVEAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNERNATIVE,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBNATIVEAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } +} + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + NSLog(@"Ad Failed "); +} + +- (void)adRequest:(ANNativeAdRequest *)request didFailToLoadWithError:(NSError *)error withAdResponseInfo:(ANAdResponseInfo *)adResponseInfo{ + NSLog(@"Banner NativeAd Failed "); +} + +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerNativeRendererAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerNativeRendererAdTestCase.m new file mode 100644 index 000000000..de54e3aee --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerNativeRendererAdTestCase.m @@ -0,0 +1,185 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import +#import "ANBannerAdView.h" +#import "ANGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANTimeTracker.h" + +@interface AdPerformanceStatsBannerNativeRendererAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANBannerAdView *bannerAd; +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation AdPerformanceStatsBannerNativeRendererAdTestCase + +- (void)setUp { + [self clearAd]; + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [self clearAd]; +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + [self.bannerAd removeFromSuperview]; + self.bannerAd.delegate = nil; + self.bannerAd.appEventDelegate = nil; + [self.bannerAd removeFromSuperview]; + self.bannerAd = nil; + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + [[UIApplication sharedApplication].keyWindow.rootViewController.presentedViewController dismissViewControllerAnimated:NO completion:nil]; + +} + +-(void) setupBannerWithPlacement:(NSString *)placement withFrame:(CGRect)frame andSize:(CGSize)size{ + self.bannerAd = [[ANBannerAdView alloc] initWithFrame:frame + placementId:placement + adSize:size]; + self.bannerAd.autoRefreshInterval = 0; + self.bannerAd.delegate = self; + self.bannerAd.enableNativeRendering = YES; + self.bannerAd.shouldAllowNativeDemand = YES; + +} + +- (void)testBannerNativeRendererAd { + [self stubRequestWithResponse:@"PerformanceStatsRTBBannerNativeRendererAd"]; + + CGRect rect = CGRectMake(0, 0, 300, 250); + int adWidth = 300; + int adHeight = 250; + CGSize size = CGSizeMake(adWidth, adHeight); + [self setupBannerWithPlacement:BANNERNATIVERENDERER_PLACEMENT withFrame:rect andSize:size]; + + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [self.bannerAd loadAd]; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + + }]; + + + [self stubRequestWithResponse:@"PerformanceStatsRTBBannerNativeRendererAd"]; + + [self setupBannerWithPlacement:BANNERNATIVERENDERER_PLACEMENT withFrame:rect andSize:size]; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + [self.bannerAd loadAd]; + + + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + + }]; +} + +#pragma mark - Stubbing + +- (void) stubRequestWithResponse:(NSString *)responseName { + NSBundle *currentBundle = [NSBundle bundleForClass:[self class]]; + NSString *baseResponse = [NSString stringWithContentsOfFile: [currentBundle pathForResource:responseName + ofType:@"json" ] + encoding: NSUTF8StringEncoding + error: nil ]; + + ANURLConnectionStub *requestStub = [[ANURLConnectionStub alloc] init]; + + requestStub.requestURL = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; + requestStub.responseCode = 200; + requestStub.responseBody = baseResponse; + + [[ANHTTPStubbingManager sharedStubbingManager] addStub:requestStub]; +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + + +#pragma mark - ANAdDelegate + + +- (void)adDidReceiveAd:(id)ad +{ + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNERNATIVERENDERER,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERNATIVERENDERERAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERNATIVERENDERERADAD_WEBVIEW_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNERNATIVERENDERER,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERNATIVERENDERERAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERNATIVERENDERERADAD_WEBVIEW_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } +} + + + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + NSLog(@"BannerNative Renderer Ad Failed to Load"); +} + + +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerVideoAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerVideoAdTestCase.m new file mode 100644 index 000000000..b9250e43a --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsBannerVideoAdTestCase.m @@ -0,0 +1,161 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import +#import "ANBannerAdView.h" +#import "ANGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANTimeTracker.h" + +@interface AdPerformanceStatsBannerVideoAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANBannerAdView *bannerAd; +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation AdPerformanceStatsBannerVideoAdTestCase + +- (void)setUp { + [self clearAd]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [self clearAd]; +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + [self.bannerAd removeFromSuperview]; + self.bannerAd.delegate = nil; + self.bannerAd.appEventDelegate = nil; + [self.bannerAd removeFromSuperview]; + self.bannerAd = nil; + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + [[UIApplication sharedApplication].keyWindow.rootViewController.presentedViewController dismissViewControllerAnimated:NO completion:nil]; + +} + +-(void) setupBannerVideoWithPlacement:(NSString *)placement withFrame:(CGRect)frame andSize:(CGSize)size{ + self.bannerAd = [[ANBannerAdView alloc] initWithFrame:frame + placementId:placement + adSize:size]; + self.bannerAd.autoRefreshInterval = 0; + self.bannerAd.delegate = self; + self.bannerAd.shouldAllowVideoDemand = YES; + +} + +- (void)testBannerVideoAd { + CGRect rect = CGRectMake(0, 0, 300, 250); + int adWidth = 300; + int adHeight = 250; + CGSize size = CGSizeMake(adWidth, adHeight); + [self setupBannerVideoWithPlacement:BANNERVIDEO_PLACEMENT withFrame:rect andSize:size]; + + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + [self.bannerAd loadAd]; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + + [self setupBannerVideoWithPlacement:BANNERVIDEO_PLACEMENT withFrame:rect andSize:size]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:self.bannerAd]; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [self.bannerAd loadAd]; + + + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + + +#pragma mark - ANAdDelegate + + +- (void)adDidReceiveAd:(id)ad +{ + if([ad isKindOfClass:[ANBannerAdView class]]) { + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNERVIDEO,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBVIDEOAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERVIDEOAD_WEBVIEW_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",BANNERVIDEO,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBVIDEOAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBBANNERVIDEOAD_WEBVIEW_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } + } +} + + + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + NSLog(@"Ad Failed to Load"); +} + +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsInterstitialAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsInterstitialAdTestCase.m new file mode 100644 index 000000000..7882a867b --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsInterstitialAdTestCase.m @@ -0,0 +1,147 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import +#import "ANInterstitialAd.h" +#import "ANGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANTimeTracker.h" +@interface AdPerformanceStatsInterstitialAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANInterstitialAd *interstitial; +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; +@end + +@implementation AdPerformanceStatsInterstitialAdTestCase + +- (void)setUp { + + [self clearAd]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + [self clearAd]; +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + self.interstitial.delegate = nil; + self.interstitial.appEventDelegate = nil; + [self.interstitial removeFromSuperview]; + self.interstitial = nil; + + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + +} + +-(void) setupInterstitialWithPlacement:(NSString *)placement{ + self.interstitial = [[ANInterstitialAd alloc] init]; + self.interstitial.placementId = placement; + self.interstitial.delegate = self; +} + +- (void)testInterstitialAd { + [self setupInterstitialWithPlacement:INTERSTITIAL_PLACEMENT]; + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [self.interstitial loadAd]; + + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + + [self setupInterstitialWithPlacement:INTERSTITIAL_PLACEMENT]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [self.interstitial loadAd]; + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + + +#pragma mark - ANAdDelegate + + +- (void)adDidReceiveAd:(id)ad +{ + NSLog(@"Interstitial Ad Did ReceiveAd "); + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",INTERSTITIAL,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBINTERSTITIALAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBINTERSTITIALAD_WEBVIEW_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",INTERSTITIAL,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBINTERSTITIALAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBINTERSTITIALAD_WEBVIEW_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } + +} + + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + NSLog(@"Interstitial Ad Failed "); +} + +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsMARAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsMARAdTestCase.m new file mode 100644 index 000000000..b0981cb3f --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsMARAdTestCase.m @@ -0,0 +1,217 @@ +/* + * + * Copyright 2020 APPNEXUS INC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import "ANMultiAdRequest.h" +#import "ANHTTPStubbingManager.h" +#import "ANNativeAdRequest.h" +#import "ANInterstitialAd.h" +#import "ANInstreamVideoAd.h" +#import "ANBannerAdView.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANAdView+PrivateMethods.h" +#import "ANBannerAdView+ANTest.h" +#import "ANUniversalAdFetcher+ANTest.h" +#import "ANInterstitialAd+ANTest.h" +#import "ANNativeAdRequest+ANTest.h" +#import "ANInstreamVideoAd+Test.h" +#import "ANAdView+ANTest.h" +#import "ANTimeTracker.h" + + +#define kAppNexusRequestTimeoutInterval 15.0 + + + +@interface AdPerformanceStatsMARAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANMultiAdRequest *mar; + +@property (nonatomic, readwrite, strong) ANBannerAdView *bannerAd; +@property (strong, nonatomic) ANInterstitialAd *interstitialAd; +@property (nonatomic,readwrite,strong) ANNativeAdRequest *nativeAdRequest; +@property (strong, nonatomic) ANInstreamVideoAd *videoAd; + +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + + + +@end + +@implementation AdPerformanceStatsMARAdTestCase + +#pragma mark - Test lifecycle. + +- (void)setUp { + [super setUp]; + [self clearCountsAndExpectations]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + + +- (void)clearCountsAndExpectations +{ + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + + self.bannerAd = nil; + self.interstitialAd = nil; + self.videoAd = nil; + self.nativeAdRequest = nil; + self.mar = nil; + +} + + +#pragma mark - Test methods. + + + +-(void)createAllMARCombination { + self.bannerAd = [self setBannerAdUnit:CGRectMake(0, 50, 320, 50) size:CGSizeMake(320, 50)placement:MAR_PLACEMENT]; + self.interstitialAd = [self setInterstitialAdUnit:MAR_PLACEMENT]; + self.nativeAdRequest = [self setNativeAdUnit:NATIVE_PLACEMENT]; + self.videoAd = [self setInstreamVideoAdUnit:VIDEO_PLACEMENT]; + + self.mar = [[ANMultiAdRequest alloc] initWithMemberId:10094 andDelegate:self]; + + [self.mar addAdUnit:self.bannerAd]; + [self.mar addAdUnit:self.interstitialAd]; + [self.mar addAdUnit:self.nativeAdRequest]; + [self.mar addAdUnit:self.videoAd]; + + + + [self.mar load]; + +} + + +-(void)testMAR{ + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [self createAllMARCombination]; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [self createAllMARCombination]; + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval + handler:^(NSError *error) { + + }]; + +} + + + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; + [self clearCountsAndExpectations]; + +} + + +#pragma mark - ANAdDelegate +- (void)multiAdRequestDidComplete:(ANMultiAdRequest *)mar{ + NSLog(@"multiAdRequest - multiAdRequestDidComplete"); + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",MAR,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBMARAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",MAR,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBMARAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } +} + +- (void)multiAdRequest:(ANMultiAdRequest *)mar didFailWithError:(NSError *)error{ + NSLog(@"multiAdRequest - didFailWithError"); +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + +-(ANNativeAdRequest *) setNativeAdUnit : (NSString *)placement { + ANNativeAdRequest *nativeAdRequest= [[ANNativeAdRequest alloc] init]; + nativeAdRequest.placementId = placement; + nativeAdRequest.shouldLoadIconImage = YES; + nativeAdRequest.shouldLoadMainImage = YES; + return nativeAdRequest; +} + +-(ANBannerAdView *) setBannerAdUnit:(CGRect)rect size:(CGSize )size placement:(NSString *)placement { + ANBannerAdView* bannerAdView = [[ANBannerAdView alloc] initWithFrame:rect + placementId:placement + adSize:size]; + bannerAdView.rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController; + [[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:bannerAdView]; + return bannerAdView; +} + +-(ANInterstitialAd *) setInterstitialAdUnit: (NSString *)placement { + ANInterstitialAd *interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:placement]; + return interstitialAd; +} + + +-(ANInstreamVideoAd *) setInstreamVideoAdUnit: (NSString *)placement { + ANInstreamVideoAd* instreamVideoAdUnit = [[ANInstreamVideoAd alloc] initWithPlacementId:placement]; + return instreamVideoAdUnit; +} +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsNativeAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsNativeAdTestCase.m new file mode 100644 index 000000000..4fa82ac66 --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsNativeAdTestCase.m @@ -0,0 +1,154 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import +#import "ANNativeAdRequest.h" +#import "ANGlobal.h" +#import "ANTestGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "NSURLRequest+HTTPBodyTesting.h" +#import "ANLogManager.h" +#import "ANNativeAdResponse.h" +#import "ANTimeTracker.h" + +@interface AdPerformanceStatsNativeAdTestCase : XCTestCase + +@property (nonatomic, readwrite, strong) ANNativeAdRequest *adRequest; + +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation AdPerformanceStatsNativeAdTestCase + +- (void)setUp { + // Put setup code here. This method is called before the invocation of each test method in the class. + [self clearAd]; + +} + +- (void)tearDown { + [self clearAd]; + // Put teardown code here. This method is called after the invocation of each test method in the class. +} + +-(void) setupVideoAdWithPlacement:(NSString *)placement{ + + self.adRequest = [[ANNativeAdRequest alloc] init]; + self.adRequest.delegate = self; + [self.adRequest setPlacementId:placement]; +} + + +- (void)testNativeAd +{ + [self setupVideoAdWithPlacement:NATIVE_PLACEMENT]; + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + + [self.adRequest loadAd]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval/2 + handler:^(NSError * _Nullable error) { + + }]; + [self setupVideoAdWithPlacement:NATIVE_PLACEMENT]; + + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + + [self.adRequest loadAd]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval/2 + handler:^(NSError * _Nullable error) { + + }]; + +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + self.adRequest.delegate = nil; + self.adRequest = nil; + + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; +} + +- (void)adRequest:(nonnull ANNativeAdRequest *)request didFailToLoadWithError:(nonnull NSError *)error withAdResponseInfo:(nullable ANAdResponseInfo *)adResponseInfo { + NSLog(@"didFailToLoadWithError"); +} + +- (void)adRequest:(nonnull ANNativeAdRequest *)request didReceiveResponse:(nonnull ANNativeAdResponse *)response { + NSLog(@"didReceiveResponse"); + + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",NATIVE,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBNATIVEAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",NATIVE,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + + + + + XCTAssertGreaterThan(PERFORMANCESTATSRTBNATIVEAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } + +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + +@end diff --git a/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsVideoAdTestCase.m b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsVideoAdTestCase.m new file mode 100644 index 000000000..48e02b38c --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/AdPerformanceStatsVideoAdTestCase.m @@ -0,0 +1,158 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import +#import "ANInstreamVideoAd.h" +#import "ANGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANTimeTracker.h" +@interface AdPerformanceStatsVideoAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANInstreamVideoAd *videoAd; + +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation AdPerformanceStatsVideoAdTestCase + +- (void)setUp { + + [self clearAd]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [self clearAd]; +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + [[UIApplication sharedApplication].keyWindow.rootViewController.presentedViewController dismissViewControllerAnimated:NO completion:nil]; + + self.videoAd.loadDelegate = nil; + [self.videoAd removeFromSuperview]; + self.videoAd = nil; + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; +} + +-(void) setupVideoAdWithPlacement:(NSString *)placement{ + self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:placement]; + [self.videoAd loadAdWithDelegate:self]; +} + +- (void)testVideoAd { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST; + + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [self setupVideoAdWithPlacement:VIDEO_PLACEMENT]; + + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + }]; + + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + + [self setupVideoAdWithPlacement:VIDEO_PLACEMENT]; + + + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout: kAppNexusRequestTimeoutInterval/2 + handler:^(NSError *error) { + }]; + + +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + + +#pragma mark - ANAdDelegate + + +- (void)adDidReceiveAd:(id)ad +{ + NSLog(@"Video Ad Did ReceiveAd "); + + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",VIDEO,PERFORMANCESTATSRTBAD_FIRST_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + + + + + XCTAssertGreaterThan(PERFORMANCESTATSRTBVIDEOAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBVIDEOAD_WEBVIEW_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST]){ + + + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",VIDEO,PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBVIDEOAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + XCTAssertGreaterThan(PERFORMANCESTATSRTBVIDEOAD_WEBVIEW_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByWebview]); + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + + [self.secondLoadAdResponseReceivedExpectation fulfill]; + }} + + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + NSLog(@"Video Ad Failed "); +} + +@end diff --git a/tests/UnitTestApp/PerformanceStats/NativeOnlySDK/AdPerformanceStatsNativeOnlyMARAdTestCase.m b/tests/UnitTestApp/PerformanceStats/NativeOnlySDK/AdPerformanceStatsNativeOnlyMARAdTestCase.m new file mode 100644 index 000000000..aa44b9e1c --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/NativeOnlySDK/AdPerformanceStatsNativeOnlyMARAdTestCase.m @@ -0,0 +1,183 @@ +/* + * + * Copyright 2020 APPNEXUS INC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import "ANMultiAdRequest.h" +#import "ANHTTPStubbingManager.h" +#import "ANNativeAdRequest.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "ANUniversalAdFetcher+ANTest.h" +#import "ANNativeAdRequest+ANTest.h" +#import "ANTimeTracker.h" + + +#define kAppNexusRequestTimeoutInterval 15.0 + + + +@interface AdPerformanceStatsNativeOnlyMARAdTestCase : XCTestCase +@property (nonatomic, readwrite, strong) ANMultiAdRequest *mar; + +@property (nonatomic,readwrite,strong) ANNativeAdRequest *nativeAdRequest1; +@property (nonatomic,readwrite,strong) ANNativeAdRequest *nativeAdRequest2; + +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + + + +@end + +@implementation AdPerformanceStatsNativeOnlyMARAdTestCase + +#pragma mark - Test lifecycle. + +- (void)setUp { + [super setUp]; + [self clearCountsAndExpectations]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + + + +- (void)clearCountsAndExpectations +{ + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; + + self.nativeAdRequest1 = nil; + self.nativeAdRequest2 = nil; + self.mar = nil; + +} + + +#pragma mark - Test methods. + + + +-(void)createAllMARCombination { + + self.nativeAdRequest1 = [self setNativeAdUnit:NATIVE_PLACEMENT]; + self.nativeAdRequest2 = [self setNativeAdUnit:NATIVE_PLACEMENT]; + + self.mar = [[ANMultiAdRequest alloc] initWithMemberId:10094 andDelegate:self]; + + [self.mar addAdUnit:self.nativeAdRequest1]; + [self.mar addAdUnit:self.nativeAdRequest2]; + + [self.mar load]; + +} + + +-(void)testMAR{ + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK; + [self createAllMARCombination]; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval*2 + handler:^(NSError *error) { + + }]; + + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST]; + [self createAllMARCombination]; + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:@"Waiting for adDidReceiveAd to be received"]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval*2 + handler:^(NSError *error) { + + }]; + +} + + + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; + [self clearCountsAndExpectations]; + +} + + +#pragma mark - ANAdDelegate + +- (void)multiAdRequestDidComplete:(ANMultiAdRequest *)mar{ + NSLog(@"multiAdRequest - multiAdRequestDidComplete"); + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",MAR,PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + + XCTAssertGreaterThan(PERFORMANCESTATSRTBMARAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",MAR_NATIVE_SDK,PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK]; + + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + + XCTAssertGreaterThan(PERFORMANCESTATSRTBMARAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } +} + +- (void)multiAdRequest:(ANMultiAdRequest *)mar didFailWithError:(NSError *)error{ + NSLog(@"multiAdRequest - didFailWithError %@",error); +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + +-(ANNativeAdRequest *) setNativeAdUnit : (NSString *)placement { + ANNativeAdRequest *nativeAdRequest= [[ANNativeAdRequest alloc] init]; + nativeAdRequest.placementId = placement; + nativeAdRequest.shouldLoadIconImage = YES; + nativeAdRequest.shouldLoadMainImage = YES; + return nativeAdRequest; +} + +@end diff --git a/tests/UnitTestApp/PerformanceStats/NativeOnlySDK/PerformanceStatsNativeOnlyNativeAdTestCase.m b/tests/UnitTestApp/PerformanceStats/NativeOnlySDK/PerformanceStatsNativeOnlyNativeAdTestCase.m new file mode 100644 index 000000000..36818047f --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/NativeOnlySDK/PerformanceStatsNativeOnlyNativeAdTestCase.m @@ -0,0 +1,161 @@ +/* Copyright 2020 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + +#import +#import "ANNativeAdRequest.h" +#import "ANGlobal.h" +#import "ANTestGlobal.h" +#import "ANHTTPStubbingManager.h" +#import "ANSDKSettings+PrivateMethods.h" +#import "NSURLRequest+HTTPBodyTesting.h" +#import "ANLogManager.h" +#import "ANNativeAdResponse.h" +#import "ANTimeTracker.h" + +@interface PerformanceStatsNativeOnlyNativeAdTestCase : XCTestCase + +@property (nonatomic, readwrite, strong) ANNativeAdRequest *adRequest; + +@property (nonatomic, strong) XCTestExpectation *firstLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) XCTestExpectation *secondLoadAdResponseReceivedExpectation; +@property (nonatomic, strong) NSString *testCase; + +@end + +@implementation PerformanceStatsNativeOnlyNativeAdTestCase + +- (void)setUp { + // Put setup code here. This method is called before the invocation of each test method in the class. + + [self clearAd]; + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; + +} + +- (void)tearDown { + [self clearAd]; + // Put teardown code here. This method is called after the invocation of each test method in the class. +} + +-(void) setupVideoAdWithPlacement:(NSString *)placement{ + + self.adRequest = [[ANNativeAdRequest alloc] init]; + self.adRequest.delegate = self; + [self.adRequest setPlacementId:placement]; + + + +} + + +- (void)testNativeAd +{ + [self setupVideoAdWithPlacement:NATIVE_PLACEMENT]; + + self.firstLoadAdResponseReceivedExpectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; + self.testCase = PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK; + [[ANTimeTracker sharedInstance] setTimeAt:PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK]; + + [self.adRequest loadAd]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval/2 + handler:^(NSError * _Nullable error) { + + }]; + + + [self setupVideoAdWithPlacement:NATIVE_PLACEMENT]; + + self.secondLoadAdResponseReceivedExpectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; + self.testCase = PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK; + [[ANTimeTracker sharedInstance] getDiffereanceAt:PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK]; + + [self.adRequest loadAd]; + [self waitForExpectationsWithTimeout:kAppNexusRequestTimeoutInterval + handler:^(NSError * _Nullable error) { + + }]; + +} + +-(void)clearAd{ + + [[ANHTTPStubbingManager sharedStubbingManager] disable]; + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + + self.adRequest.delegate = nil; + self.adRequest = nil; + + self.firstLoadAdResponseReceivedExpectation = nil; + self.secondLoadAdResponseReceivedExpectation = nil; +} + +- (void)adRequest:(nonnull ANNativeAdRequest *)request didFailToLoadWithError:(nonnull NSError *)error withAdResponseInfo:(nullable ANAdResponseInfo *)adResponseInfo { + NSLog(@"didFailToLoadWithError"); +} + +- (void)adRequest:(nonnull ANNativeAdRequest *)request didReceiveResponse:(nonnull ANNativeAdResponse *)response { + NSLog(@"didReceiveResponse"); + + + + if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK]){ + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-FirstRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",NATIVE_SDK,PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBNATIVEAD_FIRST_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.firstLoadAdResponseReceivedExpectation fulfill]; + + }else if( [self.testCase isEqualToString:PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK]){ + + + [[ANTimeTracker sharedInstance] getDiffereanceAt:@"adDidReceiveAd-SecondRequest"]; + + NSString *adLoadKey = [NSString stringWithFormat:@"%@%@",NATIVE_SDK,PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK]; + [ANTimeTracker saveSet:adLoadKey date:[NSDate date] loadTime:[ANTimeTracker sharedInstance].timeTaken]; + NSLog(@"PerformanceStats RTB %@ - %@",adLoadKey, [ANTimeTracker getData:adLoadKey]); + + XCTAssertGreaterThan(PERFORMANCESTATSRTBNATIVEAD_SECOND_LOAD,[ANTimeTracker sharedInstance].timeTaken); + + XCTAssertGreaterThan(PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD,[[ANTimeTracker sharedInstance] getTimeTakenByNetworkCall]); + + [self.secondLoadAdResponseReceivedExpectation fulfill]; + } + +} + +- (void)fulfillExpectation:(XCTestExpectation *)expectation +{ + [expectation fulfill]; +} + +- (void)waitForTimeInterval:(NSTimeInterval)delay +{ + XCTestExpectation *expectation = [self expectationWithDescription:@"wait"]; + [self performSelector:@selector(fulfillExpectation:) withObject:expectation afterDelay:delay]; + + [self waitForExpectationsWithTimeout:delay + 1 handler:nil]; +} + + +@end diff --git a/tests/UnitTestApp/PerformanceStats/TimeTracker/ANTimeTracker.h b/tests/UnitTestApp/PerformanceStats/TimeTracker/ANTimeTracker.h new file mode 100644 index 000000000..ee2952b2f --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/TimeTracker/ANTimeTracker.h @@ -0,0 +1,146 @@ +/* Copyright 2020 APPNEXUS INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + + +#import + +NS_ASSUME_NONNULL_BEGIN + + +// Network +#define PERFORMANCESTATSRTB_NETWORK_FIRST_LOAD 1500 +#define PERFORMANCESTATSRTB_NETWORK_SECOND_LOAD 500 + + +//Banner +#define PERFORMANCESTATSRTBBANNERAD_FIRST_LOAD 8000 +#define PERFORMANCESTATSRTBBANNERAD_SECOND_LOAD 3000 + +//BannerWebview +#define PERFORMANCESTATSRTBBANNERAD_WEBVIEW_FIRST_LOAD 6000 +#define PERFORMANCESTATSRTBBANNERAD_WEBVIEW_SECOND_LOAD 2000 + +#define PERFORMANCESTATSRTBBANNERAD_WEBVIEW 2500 + +//Native Renderer +#define PERFORMANCESTATSRTBBANNERNATIVERENDERERAD_FIRST_LOAD 5000 +#define PERFORMANCESTATSRTBBANNERNATIVERENDERERAD_SECOND_LOAD 2000 + +//NativeWebview +#define PERFORMANCESTATSRTBBANNERNATIVERENDERERADAD_WEBVIEW_FIRST_LOAD 4500 +#define PERFORMANCESTATSRTBBANNERNATIVERENDERERADAD_WEBVIEW_SECOND_LOAD 1000 + + +////Native +//#define PERFORMANCESTATSRTBBANNERNATIVEAD_FIRST_LOAD 500 +//#define PERFORMANCESTATSRTBBANNERNATIVEAD_SECOND_LOAD 400 + +//BannerVideo +//#define PERFORMANCESTATSRTBBANNERVIDEOAD_FIRST_LOAD 6000 +//#define PERFORMANCESTATSRTBBANNERVIDEOAD_SECOND_LOAD 3500 + + +//BannerVideoWebview +#define PERFORMANCESTATSRTBBANNERVIDEOAD_WEBVIEW_FIRST_LOAD 5000 +#define PERFORMANCESTATSRTBBANNERVIDEOAD_WEBVIEW_SECOND_LOAD 1200 + +//Interstitial +#define PERFORMANCESTATSRTBINTERSTITIALAD_FIRST_LOAD 8000 +#define PERFORMANCESTATSRTBINTERSTITIALAD_SECOND_LOAD 3000 + + +//InterstitialWebview +#define PERFORMANCESTATSRTBINTERSTITIALAD_WEBVIEW_FIRST_LOAD 6000 +#define PERFORMANCESTATSRTBINTERSTITIALAD_WEBVIEW_SECOND_LOAD 2000 + +//MAR +#define PERFORMANCESTATSRTBMARAD_FIRST_LOAD 2000 +#define PERFORMANCESTATSRTBMARAD_SECOND_LOAD 500 + +//Native +#define PERFORMANCESTATSRTBNATIVEAD_FIRST_LOAD 2000 +#define PERFORMANCESTATSRTBNATIVEAD_SECOND_LOAD 500 + +//Video +#define PERFORMANCESTATSRTBVIDEOAD_FIRST_LOAD 7500 +#define PERFORMANCESTATSRTBVIDEOAD_SECOND_LOAD 6000 + + +//VideoWebview +#define PERFORMANCESTATSRTBVIDEOAD_WEBVIEW_FIRST_LOAD 400 +#define PERFORMANCESTATSRTBVIDEOAD_WEBVIEW_SECOND_LOAD 400 + + + +#define PERFORMANCESTATSRTBAD_FIRST_REQUEST @"FirstRequest" +#define PERFORMANCESTATSRTBAD_SECOND_REQUEST @"SecondRequest" + + + +#define PERFORMANCESTATSRTBAD_FIRST_REQUEST_NATIVE_SDK @"FirstRequestNativeSDK" +#define PERFORMANCESTATSRTBAD_SECOND_REQUEST_NATIVE_SDK @"SecondRequestNativeSDK" + +#define NATIVE_SDK @"nativeSDK" +#define MAR_NATIVE_SDK @"marNativeSDK" + + + +#define BANNER @"banner" +#define BANNERNATIVERENDERER @"bannernativerenderer" +#define BANNERNATIVE @"bannernative" +#define BANNERVIDEO @"bannervideo" +#define MAR @"mar" +#define VIDEO @"video" +#define NATIVE @"native" +#define INTERSTITIAL @"interstitial" + + +#define BANNER_PLACEMENT @"15215010" +#define BANNERNATIVERENDERER_PLACEMENT @"19197535" +#define BANNERNATIVE_PLACEMENT @"19197535" +#define BANNERVIDEO_PLACEMENT @"19197534" +#define MAR_PLACEMENT @"19212468" +#define VIDEO_PLACEMENT @"19197534" +#define NATIVE_PLACEMENT @"19197535" +#define INTERSTITIAL_PLACEMENT @"15215010" + + + +@interface ANTimeTracker : NSObject + ++ (instancetype)sharedInstance; + +- (void) getDiffereanceAt:(NSString *_Nonnull)timeAt; +- (void) setTimeAt:(NSString *)atValue; +@property (nonatomic, readonly) float timeTaken; + ++(void)saveSet:(NSString*)testCaseName date:(NSDate *)date loadTime:(int)value; ++(NSArray *)getData:(NSString*)testCaseName; + +@property (nonatomic, readwrite, nullable) NSDate *webViewInitLoadingAt; +@property (nonatomic, readwrite,nullable) NSDate *webViewFinishLoadingAt; + +-(float) getTimeTakenByWebview; + + +@property (nonatomic, readwrite, nullable) NSDate *networkAdRequestInit; +@property (nonatomic, readwrite,nullable) NSDate *networkAdRequestComplete; + +-(float) getTimeTakenByNetworkCall; + +@end + +NS_ASSUME_NONNULL_END diff --git a/tests/UnitTestApp/PerformanceStats/TimeTracker/ANTimeTracker.m b/tests/UnitTestApp/PerformanceStats/TimeTracker/ANTimeTracker.m new file mode 100644 index 000000000..385354778 --- /dev/null +++ b/tests/UnitTestApp/PerformanceStats/TimeTracker/ANTimeTracker.m @@ -0,0 +1,112 @@ +/* Copyright 2020 APPNEXUS INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +#import "ANTimeTracker.h" + + +@interface ANTimeTracker() +@property (nonatomic, readwrite, strong, nullable) NSDate *lastTime; +@property (nonatomic, readwrite, strong, nullable) NSString *lastTimeAt; +@property (nonatomic, readwrite) float timeTaken; + + + +@end + + +@implementation ANTimeTracker + + + ++ (instancetype)sharedInstance { + static dispatch_once_t onceToken; + static ANTimeTracker *timeTrackerObject; + dispatch_once(&onceToken, ^{ + timeTrackerObject = [[ANTimeTracker alloc] init]; + }); + return timeTrackerObject; +} + + +- (void) getDiffereanceAt:(NSString *_Nonnull)timeAt{ + NSDate *currentDate= [NSDate date]; + + float timeDiffrance = [currentDate timeIntervalSinceReferenceDate] - [self.lastTime timeIntervalSinceReferenceDate]; + + NSLog(@"%@",[NSString stringWithFormat:@"Differance Between %@ - %@ = %f ",self.lastTimeAt , timeAt , timeDiffrance*1000]); + + self.timeTaken = timeDiffrance*1000 ; + self.lastTime = currentDate; + self.lastTimeAt = timeAt; +} + +- (void) setTimeAt:(NSString *)atValue{ + self.lastTimeAt = atValue; + self.lastTime = [NSDate date]; +} + + + + ++(void)saveSet:(NSString*)testCaseName date:(NSDate *)date loadTime:(float)value +{ + NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults]; + NSMutableArray * arrayOfTime = [[ANTimeTracker getData:testCaseName] mutableCopy]; + if(arrayOfTime.count > 10){ + [arrayOfTime removeObjectAtIndex:0]; + }else if (arrayOfTime == nil){ + arrayOfTime = [[NSMutableArray alloc] init]; + } + + NSDictionary *data = @{ + @"date" : [NSDate date].description, + @"Testcase" : testCaseName, + @"loadTime" : [NSString stringWithFormat:@"%f",value] + + }; + + [arrayOfTime addObject:data]; + [standardUserDefaults setObject:arrayOfTime forKey:testCaseName]; + [standardUserDefaults synchronize]; +} + + ++(NSArray *)getData:(NSString*)testCaseName +{ + NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults]; + + NSArray *arrayOfTime = [standardUserDefaults objectForKey:testCaseName]; + return arrayOfTime; +} +-(float) getTimeTakenByWebview{ + return ([self.webViewFinishLoadingAt timeIntervalSinceReferenceDate] - [self.webViewInitLoadingAt timeIntervalSinceReferenceDate]) * 1000; + +} +-(void)clearTimeTracker{ + self.lastTime = NULL; + self.lastTimeAt = NULL; + self.timeTaken = 0; + self.webViewInitLoadingAt = NULL; + self.webViewFinishLoadingAt = NULL; + +} + +-(float) getTimeTakenByNetworkCall{ + return ([self.networkAdRequestComplete timeIntervalSinceReferenceDate] - [self.networkAdRequestInit timeIntervalSinceReferenceDate]) * 1000; + +} + +@end diff --git a/tests/UnitTestApp/Shared/MARHelper.m b/tests/UnitTestApp/Shared/MARHelper.m index 1937ce000..2362114ce 100644 --- a/tests/UnitTestApp/Shared/MARHelper.m +++ b/tests/UnitTestApp/Shared/MARHelper.m @@ -69,11 +69,11 @@ + (nonnull NSString *)adunitDescription:(nonnull id)ad } else if ([ad isKindOfClass:[ANInstreamVideoAd class]]) { - adinfo = @"video FIX"; + adinfo = @"video TBD"; //... } else if ([ad isKindOfClass:[ANNativeAdResponse class]]) { - adinfo = @"native FIX"; + adinfo = @"native TBD"; //... } else { @@ -90,7 +90,6 @@ + (nonnull NSString *)createDictionaryKeyFromPlacementID: (nullable NSString *)p orMemberID: (NSInteger)memberID andInventoryCode: (nullable NSString *)inventoryCode uniqueSuffix: (nullable NSString *)uniqueSuffix - //FIX -- unused? { NSString *key = @""; @@ -195,8 +194,7 @@ + (nonnull ANBannerAdView *)createBannerInstanceWithType: (MultiTagType) + (nullable NSDictionary *)getJSONBodyFromMultiAdRequestInstance:(nonnull ANMultiAdRequest *)marInstance { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithMultiAdRequestManager:marInstance baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithMultiAdRequestManager:marInstance]; NSError *error = nil; NSDictionary *jsonBody = (NSDictionary *)[NSJSONSerialization JSONObjectWithData: request.HTTPBody options: kNilOptions @@ -212,8 +210,7 @@ + (nullable NSDictionary *)getJSONBodyFromMultiAdRequestInstance:(nonnull ANMult + (nullable NSDictionary *)getJSONBodyFromAdUnit: (nonnull ANAdView *)adunit withMultiAdRequest: (nonnull ANMultiAdRequest *)marInstance { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adunit adunitMultiAdRequestManager:marInstance baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adunit adunitMultiAdRequestManager:marInstance]; NSError *error = nil; NSDictionary *jsonBody = (NSDictionary *)[NSJSONSerialization JSONObjectWithData: request.HTTPBody options: kNilOptions @@ -228,8 +225,7 @@ + (nullable NSDictionary *)getJSONBodyFromAdUnit: (nonnull ANAdView *)adunit + (nullable NSDictionary *)getJSONBodyFromAdUnit:(nonnull ANAdView *)adunit { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adunit baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adunit]; NSError *error = nil; NSDictionary *jsonBody = (NSDictionary *)[NSJSONSerialization JSONObjectWithData: request.HTTPBody options: kNilOptions diff --git a/tests/UnitTestApp/Shared/TestGlobal.h b/tests/UnitTestApp/Shared/TestGlobal.h index 44bb94534..4e1282732 100644 --- a/tests/UnitTestApp/Shared/TestGlobal.h +++ b/tests/UnitTestApp/Shared/TestGlobal.h @@ -28,6 +28,7 @@ limitations under the License. #pragma mark - Global public constants. +extern NSTimeInterval kWaitQuarterSecond; extern NSTimeInterval kWaitOneSecond; extern NSTimeInterval kWaitTwoSeconds; extern NSTimeInterval kWaitShort; diff --git a/tests/UnitTestApp/Shared/TestGlobal.m b/tests/UnitTestApp/Shared/TestGlobal.m index 9e2e7b961..1f06fde9b 100644 --- a/tests/UnitTestApp/Shared/TestGlobal.m +++ b/tests/UnitTestApp/Shared/TestGlobal.m @@ -21,11 +21,12 @@ #pragma mark - Global public constants. -NSTimeInterval kWaitOneSecond = 1; -NSTimeInterval kWaitTwoSeconds = 2; -NSTimeInterval kWaitShort = 5; -NSTimeInterval kWaitLong = 10; -NSTimeInterval kWaitVeryLong = 15; +NSTimeInterval kWaitQuarterSecond = 0.25; +NSTimeInterval kWaitOneSecond = 1; +NSTimeInterval kWaitTwoSeconds = 2; +NSTimeInterval kWaitShort = 5; +NSTimeInterval kWaitLong = 10; +NSTimeInterval kWaitVeryLong = 15; @@ -52,11 +53,11 @@ + (void)waitForSeconds:(NSTimeInterval)seconds thenExecuteBlock:(nullable void ( blockOperation.qualityOfService = NSQualityOfServiceBackground; [blockOperation addExecutionBlock:^{ - TINFO(@"SLEEPING for %@ seconds...", @(seconds)); - [NSThread sleepForTimeInterval:seconds]; + TINFO(@"SLEEPING for %@ seconds...", @(seconds)); + [NSThread sleepForTimeInterval:seconds]; - dispatch_async(dispatch_get_main_queue(), block); - } ]; + if (block) { dispatch_async(dispatch_get_main_queue(), block); } + } ]; [blockOperation start]; } diff --git a/tests/UnitTestApp/UnitTestApp.xcodeproj/project.pbxproj b/tests/UnitTestApp/UnitTestApp.xcodeproj/project.pbxproj index 8d82828b4..41d45de5d 100644 --- a/tests/UnitTestApp/UnitTestApp.xcodeproj/project.pbxproj +++ b/tests/UnitTestApp/UnitTestApp.xcodeproj/project.pbxproj @@ -8,6 +8,9 @@ /* Begin PBXBuildFile section */ 003A7D1C2444BE5800F97F7D /* ANBannerAdViewHTMLImpressionTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 003A7D1B2444BE5800F97F7D /* ANBannerAdViewHTMLImpressionTestCase.m */; }; + 00436C1B24A45F2C00C42D73 /* ANJAMCustomKeywordsResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 00436C1724A45F1C00C42D73 /* ANJAMCustomKeywordsResponse.json */; }; + 004833BF24A39D6400BFF7A6 /* ANHTTPStubbingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970C21FF32EB005D1F0E /* ANHTTPStubbingManager.m */; }; + 004833E824A3CF7300BFF7A6 /* ANHTTPStubURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970E21FF32EB005D1F0E /* ANHTTPStubURLProtocol.m */; }; 0E061F1E23D1F37F000F0E1E /* testLoadTwoMARInstancesSimultaneously.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E061F1C23D1F37F000F0E1E /* testLoadTwoMARInstancesSimultaneously.json */; }; 0E14222122F99B9A006C597A /* ANResourceValidationTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E14221F22F99B9A006C597A /* ANResourceValidationTestCase.m */; }; 0E14222322F99BA8006C597A /* ANResourceValidationTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E14222222F99BA8006C597A /* ANResourceValidationTestCase.m */; }; @@ -24,9 +27,15 @@ 0E1D14B522784C9500343050 /* appnexus_bannerNative_renderingInvalidURL.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E1D14B322784C9500343050 /* appnexus_bannerNative_renderingInvalidURL.json */; }; 0E2B4BAE23C4AD6E002AFBD8 /* testMARCombinationTwoRTBNative.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E2B4BAC23C4AD6E002AFBD8 /* testMARCombinationTwoRTBNative.json */; }; 0E2C248A2236AE4D006038E1 /* MediationBannerAdResizeTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E2C24892236AE4D006038E1 /* MediationBannerAdResizeTestCase.m */; }; + 0E32ACDC24832E2F0027D5A5 /* SuccessfulMediationResponseDefaultTimeout.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E32ACDB24832E2F0027D5A5 /* SuccessfulMediationResponseDefaultTimeout.json */; }; 0E32F7DF23C608B10036E0B4 /* testMARCombinationTwelveRTBBanner.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E32F7DD23C608B10036E0B4 /* testMARCombinationTwelveRTBBanner.json */; }; 0E32F7E123C60E800036E0B4 /* testMARCombinationThirtyCSMBanner.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E32F7E023C60E800036E0B4 /* testMARCombinationThirtyCSMBanner.json */; }; 0E336C2D2461FB000033C76F /* NoNetworkAdFailTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E336C2C2461FB000033C76F /* NoNetworkAdFailTestCase.m */; }; + 0E336C3224620A890033C76F /* ANHTTPStubURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970E21FF32EB005D1F0E /* ANHTTPStubURLProtocol.m */; }; + 0E336C3A24631D030033C76F /* ANAdWebViewController+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C972D21FF32EB005D1F0E /* ANAdWebViewController+ANTest.m */; }; + 0E336C3C24632A770033C76F /* ANTimeTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E3FE350245999220096A978 /* ANTimeTracker.m */; }; + 0E336C3F246346DB0033C76F /* ANNativeRenderingViewController+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E336C3E246346DB0033C76F /* ANNativeRenderingViewController+ANTest.m */; }; + 0E336C48246372140033C76F /* ANAdFetcherBase+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E336C46246372140033C76F /* ANAdFetcherBase+ANTest.m */; }; 0E3D3F2723C4D2CD00BCBE14 /* testMARCombinationAllRTB.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E3D3F2523C4D2CD00BCBE14 /* testMARCombinationAllRTB.json */; }; 0E3D3F2923C5C5CD00BCBE14 /* testMARCombinationAllCSM.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E3D3F2823C5C5CD00BCBE14 /* testMARCombinationAllCSM.json */; }; 0E3D3F3523C5F25200BCBE14 /* testMARCombinationBannerCSMWithOtherRTB.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E3D3F3423C5F25200BCBE14 /* testMARCombinationBannerCSMWithOtherRTB.json */; }; @@ -75,6 +84,7 @@ 0E3F330723CE694300CA830D /* custom_adapter_fb_mediated_response.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E3F32E323CE68E300CA830D /* custom_adapter_fb_mediated_response.json */; }; 0E3F331923D077D700CA830D /* MARPublicAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E3F331823D077D700CA830D /* MARPublicAPI.m */; }; 0E3F331A23D080D600CA830D /* MARHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FE4DB05237B40F8005B5BCF /* MARHelper.m */; }; + 0E3FE351245999220096A978 /* ANTimeTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E3FE350245999220096A978 /* ANTimeTracker.m */; }; 0E43003A243D057C0070BB1E /* ANLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E430036243D057C0070BB1E /* ANLog.m */; }; 0E43003B243D057C0070BB1E /* ANLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E430036243D057C0070BB1E /* ANLog.m */; }; 0E43003C243D057C0070BB1E /* ANLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E430036243D057C0070BB1E /* ANLog.m */; }; @@ -94,7 +104,6 @@ 0E4701622237A31C005CFFAC /* SuccessfulRTBShouldResizeAdToFitContainer.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E4701612237A31C005CFFAC /* SuccessfulRTBShouldResizeAdToFitContainer.json */; }; 0E47017F2237B35B005CFFAC /* ANBannerAdView+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C971B21FF32EB005D1F0E /* ANBannerAdView+ANTest.m */; }; 0E4701B42237B443005CFFAC /* ANInstreamVideoAd+Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E4701932237B441005CFFAC /* ANInstreamVideoAd+Test.m */; }; - 0E4701B52237B443005CFFAC /* ANVideoAdPlayer+Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E4701952237B441005CFFAC /* ANVideoAdPlayer+Test.m */; }; 0E4701C22237B443005CFFAC /* ViewController+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E4701AB2237B443005CFFAC /* ViewController+ANTest.m */; }; 0E4701C42237CDC9005CFFAC /* ANTrackerManager+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C971321FF32EB005D1F0E /* ANTrackerManager+ANTest.m */; }; 0E4B79212282E9510085C612 /* NativeAsssemblyRendererOMID_Native_RTBResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E4B791E2282E9140085C612 /* NativeAsssemblyRendererOMID_Native_RTBResponse.json */; }; @@ -133,6 +142,16 @@ 0E56C71521F8AF5600ADE6E1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E56C71421F8AF5600ADE6E1 /* UIKit.framework */; }; 0E56C71721F8AF5A00ADE6E1 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E56C71621F8AF5A00ADE6E1 /* WebKit.framework */; }; 0E56C83521F8B2A900ADE6E1 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E56C83321F8B2A300ADE6E1 /* XCTest.framework */; }; + 0E642D53244E6098009084E0 /* ANAdMediationTimeoutTestcase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E642D52244E6098009084E0 /* ANAdMediationTimeoutTestcase.m */; }; + 0E642D57244E63FE009084E0 /* csm_bannerad.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D56244E63FE009084E0 /* csm_bannerad.json */; }; + 0E642D58244E640C009084E0 /* SecondPriceForDFPSuccess.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1EF22009802002B5F5F /* SecondPriceForDFPSuccess.json */; }; + 0E642D5B244E6678009084E0 /* ANAdMediationTimeoutTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E642D5A244E6678009084E0 /* ANAdMediationTimeoutTestCase.m */; }; + 0E642D73244E6DEB009084E0 /* timeout_banner.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D6F244E6DEB009084E0 /* timeout_banner.json */; }; + 0E642D75244E6DEB009084E0 /* timeout_interstiatal.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D70244E6DEB009084E0 /* timeout_interstiatal.json */; }; + 0E642D77244E6DEC009084E0 /* timeout_native.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D71244E6DEB009084E0 /* timeout_native.json */; }; + 0E642D8B244E9881009084E0 /* timeout_native_over.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D88244E9880009084E0 /* timeout_native_over.json */; }; + 0E642D8C244E9881009084E0 /* timeout_banner_over.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D89244E9881009084E0 /* timeout_banner_over.json */; }; + 0E642D8D244E9881009084E0 /* timeout_interstiatal_over.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E642D8A244E9881009084E0 /* timeout_interstiatal_over.json */; }; 0E6612B922CA736300DDC5CD /* ANNativeAdView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0E6612B322CA736200DDC5CD /* ANNativeAdView.xib */; }; 0E6612BA22CA736300DDC5CD /* ANNativeAdView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0E6612B322CA736200DDC5CD /* ANNativeAdView.xib */; }; 0E6612BB22CA736300DDC5CD /* ANNativeAdView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0E6612B322CA736200DDC5CD /* ANNativeAdView.xib */; }; @@ -143,6 +162,15 @@ 0E6612C222CA736300DDC5CD /* ANNativeAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6612B722CA736200DDC5CD /* ANNativeAdView.m */; }; 0E6612C322CA736300DDC5CD /* ANNativeAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6612B722CA736200DDC5CD /* ANNativeAdView.m */; }; 0E6612C422CA736300DDC5CD /* ANNativeAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6612B722CA736200DDC5CD /* ANNativeAdView.m */; }; + 0E66360A2458AABF008FB3FB /* AdPerformanceStatsVideoAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636042458AABF008FB3FB /* AdPerformanceStatsVideoAdTestCase.m */; }; + 0E66360B2458AABF008FB3FB /* AdPerformanceStatsMARAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636052458AABF008FB3FB /* AdPerformanceStatsMARAdTestCase.m */; }; + 0E66360C2458AABF008FB3FB /* AdPerformanceStatsInterstitialAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636062458AABF008FB3FB /* AdPerformanceStatsInterstitialAdTestCase.m */; }; + 0E66360D2458AABF008FB3FB /* AdPerformanceStatsBannerNativeAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636072458AABF008FB3FB /* AdPerformanceStatsBannerNativeAdTestCase.m */; }; + 0E66360E2458AABF008FB3FB /* AdPerformanceStatsBannerVideoAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636082458AABF008FB3FB /* AdPerformanceStatsBannerVideoAdTestCase.m */; }; + 0E66360F2458AABF008FB3FB /* AdPerformanceStatsNativeAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636092458AABF008FB3FB /* AdPerformanceStatsNativeAdTestCase.m */; }; + 0E6636112458BA2E008FB3FB /* AdPerformanceStatsBannerAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636022458A9EC008FB3FB /* AdPerformanceStatsBannerAdTestCase.m */; }; + 0E6636172458D04C008FB3FB /* AdPerformanceStatsBannerNativeRendererAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E6636162458D04C008FB3FB /* AdPerformanceStatsBannerNativeRendererAdTestCase.m */; }; + 0E6636192458D0F1008FB3FB /* PerformanceStatsRTBBannerNativeRendererAd.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E6636182458D0F1008FB3FB /* PerformanceStatsRTBBannerNativeRendererAd.json */; }; 0E6B7E4522D8DE01005D069E /* AppNexusSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ECF333E22D798DB007DB185 /* AppNexusSDK.framework */; }; 0E6B7E4622D8DE06005D069E /* AppNexusSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ECF333E22D798DB007DB185 /* AppNexusSDK.framework */; }; 0E6B7E4722D8DE0B005D069E /* AppNexusSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ECF333E22D798DB007DB185 /* AppNexusSDK.framework */; }; @@ -151,6 +179,8 @@ 0E7BC1B9229E905F002F41FF /* SuccessfulVerticalVideoAdResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E7BC1B7229E905F002F41FF /* SuccessfulVerticalVideoAdResponse.json */; }; 0E7BC1BA229E905F002F41FF /* SuccessfulVerticalVideoAdResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E7BC1B7229E905F002F41FF /* SuccessfulVerticalVideoAdResponse.json */; }; 0E7BC1BC229E91E9002F41FF /* SuccessfulSquareInstreamVideoAdResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E7BC1BB229E91E9002F41FF /* SuccessfulSquareInstreamVideoAdResponse.json */; }; + 0E7DE71A2450F30A005468B5 /* timeout_ssm.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E7DE7182450F30A005468B5 /* timeout_ssm.json */; }; + 0E7DE71B2450F30A005468B5 /* timeout_ssm_over.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E7DE7192450F30A005468B5 /* timeout_ssm_over.json */; }; 0E81279C23C88D810045D788 /* ANSSMMediationAdViewController+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E81279923C88D810045D788 /* ANSSMMediationAdViewController+ANTest.m */; }; 0E81279E23C894660045D788 /* ssmAd.txt in Resources */ = {isa = PBXBuildFile; fileRef = 0E81279D23C894660045D788 /* ssmAd.txt */; }; 0E81279F23C895420045D788 /* ssmAd.txt in Resources */ = {isa = PBXBuildFile; fileRef = 0E81279D23C894660045D788 /* ssmAd.txt */; }; @@ -167,8 +197,6 @@ 0E8C979521FF32EC005D1F0E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0E8C970821FF32EB005D1F0E /* Default-568h@2x.png */; }; 0E8C979621FF32EC005D1F0E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0E8C970821FF32EB005D1F0E /* Default-568h@2x.png */; }; 0E8C979721FF32EC005D1F0E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0E8C970821FF32EB005D1F0E /* Default-568h@2x.png */; }; - 0E8C979921FF32EC005D1F0E /* ANHTTPStubbingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970C21FF32EB005D1F0E /* ANHTTPStubbingManager.m */; }; - 0E8C979A21FF32EC005D1F0E /* ANHTTPStubbingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970C21FF32EB005D1F0E /* ANHTTPStubbingManager.m */; }; 0E8C979F21FF32EC005D1F0E /* ANHTTPStubURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970E21FF32EB005D1F0E /* ANHTTPStubURLProtocol.m */; }; 0E8C97A021FF32EC005D1F0E /* ANHTTPStubURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970E21FF32EB005D1F0E /* ANHTTPStubURLProtocol.m */; }; 0E8C97A221FF32EC005D1F0E /* ANURLConnectionStub+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970F21FF32EB005D1F0E /* ANURLConnectionStub+NSURLSessionConfiguration.m */; }; @@ -196,7 +224,6 @@ 0E8C97C821FF32EC005D1F0E /* NSObject+Swizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C972C21FF32EB005D1F0E /* NSObject+Swizzling.m */; }; 0E8C97C921FF32EC005D1F0E /* NSObject+Swizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C972C21FF32EB005D1F0E /* NSObject+Swizzling.m */; }; 0E8C97CA21FF32EC005D1F0E /* NSObject+Swizzling.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C972C21FF32EB005D1F0E /* NSObject+Swizzling.m */; }; - 0E8C97CB21FF32EC005D1F0E /* ANAdWebViewController+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C972D21FF32EB005D1F0E /* ANAdWebViewController+ANTest.m */; }; 0E8C97D021FF32EC005D1F0E /* ANTestGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C972E21FF32EB005D1F0E /* ANTestGlobal.m */; }; 0E8C97D121FF3342005D1F0E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E56C83321F8B2A300ADE6E1 /* XCTest.framework */; }; 0E8C981A21FF36F6005D1F0E /* Accounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E8C981921FF36F6005D1F0E /* Accounts.framework */; }; @@ -214,9 +241,13 @@ 0E8C983B21FF42C9005D1F0E /* ANBaseTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C983A21FF42C9005D1F0E /* ANBaseTestCase.m */; }; 0E8C983E21FF42E0005D1F0E /* ANTestResponses.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C983D21FF42E0005D1F0E /* ANTestResponses.m */; }; 0E8C984121FF42F1005D1F0E /* ANMockMediationAdapterBannerNeverCalled.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C983F21FF42F1005D1F0E /* ANMockMediationAdapterBannerNeverCalled.m */; }; + 0E8E8357245B8E18008F6CAC /* ANTimeTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E3FE350245999220096A978 /* ANTimeTracker.m */; }; 0E9441EC24476B6F00D266F9 /* CSR_Facebook_Banner_Native.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E9441EA24476B6F00D266F9 /* CSR_Facebook_Banner_Native.json */; }; 0E9441EF24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9441EE24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m */; }; 0E9441F22447718C00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9441EE24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m */; }; + 0E960B6C245B92510070EAF3 /* AdPerformanceStatsNativeOnlyMARAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E960B6B245B92510070EAF3 /* AdPerformanceStatsNativeOnlyMARAdTestCase.m */; }; + 0E960B6E245B92790070EAF3 /* PerformanceStatsNativeOnlyNativeAdTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E960B6D245B92790070EAF3 /* PerformanceStatsNativeOnlyNativeAdTestCase.m */; }; + 0E99B51D246B3F6F0024A8DC /* SuccessfulDisabledBannerEnableNative.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E99B51C246B3F6F0024A8DC /* SuccessfulDisabledBannerEnableNative.json */; }; 0E9B356C23C72C82002BE178 /* testMARCombinationNativeRTBWithOtherCSM.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E9B356323C72C81002BE178 /* testMARCombinationNativeRTBWithOtherCSM.json */; }; 0E9B356D23C72C82002BE178 /* testMARCombinationInterstitialAndNativeCSMWithOtherRTB.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E9B356523C72C82002BE178 /* testMARCombinationInterstitialAndNativeCSMWithOtherRTB.json */; }; 0E9B356E23C72C82002BE178 /* testMARCombinationBannerRTBWithOtherCSM.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E9B356623C72C82002BE178 /* testMARCombinationBannerRTBWithOtherCSM.json */; }; @@ -229,6 +260,9 @@ 0E9B358023C73943002BE178 /* ANAdAdapterNativeMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9B357923C73943002BE178 /* ANAdAdapterNativeMock.m */; }; 0E9B358123C73943002BE178 /* ANAdAdapterBannerMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9B357A23C73943002BE178 /* ANAdAdapterBannerMock.m */; }; 0E9B358323C73943002BE178 /* ANVideoAdProcessor+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9B357D23C73943002BE178 /* ANVideoAdProcessor+ANTest.m */; }; + 0E9D6A6D248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9D6A67248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.m */; }; + 0E9D6A6E248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9D6A6A248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.m */; }; + 0E9D6A6F248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9D6A6C248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.m */; }; 0E9EBD6A24336111001A30D8 /* TestANCSRUniversalFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EBD6924336111001A30D8 /* TestANCSRUniversalFetcher.m */; }; 0E9EBD6B24336111001A30D8 /* TestANCSRUniversalFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EBD6924336111001A30D8 /* TestANCSRUniversalFetcher.m */; }; 0EA29A5F23C4947200D78555 /* testMARCombinationTwoRTBInterstitial.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EA29A5D23C4947200D78555 /* testMARCombinationTwoRTBInterstitial.json */; }; @@ -244,7 +278,6 @@ 0EB24C4F22CBD54B008E927F /* ANMockMediationAdapterSuccessfulNative.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EB24C4D22CBD54B008E927F /* ANMockMediationAdapterSuccessfulNative.m */; }; 0EB24C5122CBD568008E927F /* appnexus_mock_mediation_response.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EB24C5022CBD568008E927F /* appnexus_mock_mediation_response.json */; }; 0EB24C5322CBD5CB008E927F /* NativeSDKTestAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EB24C5222CBD5CB008E927F /* NativeSDKTestAppTests.m */; }; - 0EB24C5522CBD770008E927F /* ANHTTPStubbingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970C21FF32EB005D1F0E /* ANHTTPStubbingManager.m */; }; 0EB24C5622CBD770008E927F /* ANURLConnectionStub.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970D21FF32EB005D1F0E /* ANURLConnectionStub.m */; }; 0EB24C5722CBD770008E927F /* ANHTTPStubURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970E21FF32EB005D1F0E /* ANHTTPStubURLProtocol.m */; }; 0EB24C5822CBD770008E927F /* ANURLConnectionStub+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970F21FF32EB005D1F0E /* ANURLConnectionStub+NSURLSessionConfiguration.m */; }; @@ -295,6 +328,7 @@ 0EEAF643229BCC2E0008CAC9 /* TestCaseConstent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EEAF634229BCB840008CAC9 /* TestCaseConstent.swift */; }; 0EEAF64A229BD2F30008CAC9 /* appnexus_bannerNative_rendering.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E1D14B222784C9500343050 /* appnexus_bannerNative_rendering.json */; }; 0EEAF64B229BD2F60008CAC9 /* appnexus_bannerNative_renderingInvalidURL.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E1D14B322784C9500343050 /* appnexus_bannerNative_renderingInvalidURL.json */; }; + 0EECFD2124659C8800AC90F7 /* ANAdFetcherBase+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E336C46246372140033C76F /* ANAdFetcherBase+ANTest.m */; }; 0EEFE114220055C4002B5F5F /* ANMockMediationAdapterSuccessfulBanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE112220055C4002B5F5F /* ANMockMediationAdapterSuccessfulBanner.m */; }; 0EEFE118220057BE002B5F5F /* ANAdAdapterBannerUnableToFill.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE116220057BE002B5F5F /* ANAdAdapterBannerUnableToFill.m */; }; 0EEFE11B2200580D002B5F5F /* ANAdAdapterBannerNetworkError.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE1192200580D002B5F5F /* ANAdAdapterBannerNetworkError.m */; }; @@ -319,7 +353,6 @@ 0EEFE17022007317002B5F5F /* SuccessfulInstreamVideoAdResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE16F22007317002B5F5F /* SuccessfulInstreamVideoAdResponse.json */; }; 0EEFE175220073F0002B5F5F /* ANHTTPStubbingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970C21FF32EB005D1F0E /* ANHTTPStubbingManager.m */; }; 0EEFE176220073F0002B5F5F /* ANURLConnectionStub.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970D21FF32EB005D1F0E /* ANURLConnectionStub.m */; }; - 0EEFE177220073F0002B5F5F /* ANHTTPStubURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970E21FF32EB005D1F0E /* ANHTTPStubURLProtocol.m */; }; 0EEFE178220073F0002B5F5F /* ANURLConnectionStub+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C970F21FF32EB005D1F0E /* ANURLConnectionStub+NSURLSessionConfiguration.m */; }; 0EEFE17A2200746D002B5F5F /* SuccessfulMRAIDResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1792200746D002B5F5F /* SuccessfulMRAIDResponse.json */; }; 0EEFE17C22007497002B5F5F /* SuccessfulNativeStandardAdResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE17B22007497002B5F5F /* SuccessfulNativeStandardAdResponse.json */; }; @@ -354,21 +387,31 @@ 0EEFE1DD22008E6D002B5F5F /* ANUniversalAdFetcher+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E8C971821FF32EB005D1F0E /* ANUniversalAdFetcher+ANTest.m */; }; 0EEFE1E8220096A9002B5F5F /* SuccessfulMRAIDListenerResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1E7220096A9002B5F5F /* SuccessfulMRAIDListenerResponse.json */; }; 0EEFE1EE22009797002B5F5F /* SuccessfulOutstreamVideoResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1ED22009797002B5F5F /* SuccessfulOutstreamVideoResponse.json */; }; - 0EEFE1F022009802002B5F5F /* SecondPriceForDFPSuccess.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1EF22009802002B5F5F /* SecondPriceForDFPSuccess.json */; }; 0EEFE1F222009819002B5F5F /* SecondPriceForDFPParamIsUnset.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1F122009819002B5F5F /* SecondPriceForDFPParamIsUnset.json */; }; 0EEFE1F522009898002B5F5F /* ANMockMediationAdapterLoadedMultiple.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE1F422009898002B5F5F /* ANMockMediationAdapterLoadedMultiple.m */; }; 0EEFE1F8220098BD002B5F5F /* ANMockMediationAdapterLoadThenFail.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE1F7220098BD002B5F5F /* ANMockMediationAdapterLoadThenFail.m */; }; 0EEFE1FB220098C9002B5F5F /* ANMockMediationAdapterLoadAndHitOtherCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE1FA220098C9002B5F5F /* ANMockMediationAdapterLoadAndHitOtherCallbacks.m */; }; 0EEFE1FD22009CDB002B5F5F /* OMID_TestResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1FC22009CDB002B5F5F /* OMID_TestResponse.json */; }; 4F11628B238749A200101DC1 /* MARHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FE4DB05237B40F8005B5BCF /* MARHelper.m */; }; + 4F3B837E2481E866005EE88C /* LazyWebview_Basic.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F3B837B2481E865005EE88C /* LazyWebview_Basic.json */; }; + 4F3B837F2481E866005EE88C /* LazyWebview_MRAID.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F3B837D2481E865005EE88C /* LazyWebview_MRAID.json */; }; + 4F3B83802481E8E1005EE88C /* LazyWebview_Basic.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F3B837B2481E865005EE88C /* LazyWebview_Basic.json */; }; + 4F3B83812481E8E1005EE88C /* LazyWebview_MRAID.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F3B837D2481E865005EE88C /* LazyWebview_MRAID.json */; }; 4F3D9E93238747D200B02AC6 /* MARGeneralTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F59A7A42379CC6B002E0482 /* MARGeneralTests.m */; }; 4F5BFB8123E513AD00C4AE32 /* DefaultPlacementLogic.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F5BFB8023E513AD00C4AE32 /* DefaultPlacementLogic.m */; }; + 4F5F4DB224988A9F008BC33C /* LazyWebview_nobid.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F5F4DB024988A9F008BC33C /* LazyWebview_nobid.json */; }; + 4F5F4DB324988A9F008BC33C /* LazyWebview_nobid.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F5F4DB024988A9F008BC33C /* LazyWebview_nobid.json */; }; + 4F78CD8324A5262800196E1B /* LazyLoadFeatureTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F78CD8224A5262800196E1B /* LazyLoadFeatureTests.m */; }; 4F83244C23963481003BF9E2 /* srm--testInitThenLoadWithTwoMethods--response.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F83244823963480003BF9E2 /* srm--testInitThenLoadWithTwoMethods--response.json */; }; 4F83244D23963481003BF9E2 /* srm--testInitAndLoadWithOneMethod--response.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F83244923963481003BF9E2 /* srm--testInitAndLoadWithOneMethod--response.json */; }; 4F83244E23963481003BF9E2 /* srm--testInitWithAddAndRemoveThenLoad--response1.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F83244A23963481003BF9E2 /* srm--testInitWithAddAndRemoveThenLoad--response1.json */; }; 4F83244F23963481003BF9E2 /* srm--testInitWithAddAndRemoveThenLoad--response2.json in Resources */ = {isa = PBXBuildFile; fileRef = 4F83244B23963481003BF9E2 /* srm--testInitWithAddAndRemoveThenLoad--response2.json */; }; + 4F9BF31D248EDFE200A3D687 /* SuccessfulOutstreamBannerVideoResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE1A42200820F002B5F5F /* SuccessfulOutstreamBannerVideoResponse.json */; }; + 4F9BF320248EF37B00A3D687 /* ANAdResponseRTB_Native.json in Resources */ = {isa = PBXBuildFile; fileRef = 97FFD0502372DA7900412B20 /* ANAdResponseRTB_Native.json */; }; 4F9CED4823CC9E7700BE3443 /* PrivateAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F9CED4723CC9E7700BE3443 /* PrivateAPI.m */; }; 4F9CED4A23CCAAEF00BE3443 /* SuccessfulInstreamVideoAdResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 0EEFE16F22007317002B5F5F /* SuccessfulInstreamVideoAdResponse.json */; }; + 4FE5D816248A21AD00B86BDA /* ANNativeAdRequest+ANTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EEFE19922008124002B5F5F /* ANNativeAdRequest+ANTest.m */; }; + 4FE5D818248A223400B86BDA /* testMARCombinationAllRTB.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E3D3F2523C4D2CD00BCBE14 /* testMARCombinationAllRTB.json */; }; 4FF9B85E23AC0C3E00A9EB56 /* TestGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF9B85C23AC0C3E00A9EB56 /* TestGlobal.m */; }; 4FF9B85F23AC0CE000A9EB56 /* TestGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FF9B85C23AC0C3E00A9EB56 /* TestGlobal.m */; }; 607BB64523F32852002A0F57 /* appnexus_standard_response.json in Resources */ = {isa = PBXBuildFile; fileRef = 0E3F32DD23CE68E300CA830D /* appnexus_standard_response.json */; }; @@ -515,6 +558,9 @@ /* Begin PBXFileReference section */ 003A7D1B2444BE5800F97F7D /* ANBannerAdViewHTMLImpressionTestCase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANBannerAdViewHTMLImpressionTestCase.m; sourceTree = ""; }; + 00436C1724A45F1C00C42D73 /* ANJAMCustomKeywordsResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ANJAMCustomKeywordsResponse.json; sourceTree = ""; }; + 004833C824A3AC4300BFF7A6 /* ANGlobal+ANTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ANGlobal+ANTest.h"; sourceTree = ""; }; + 004833CD24A3B81A00BFF7A6 /* ANHTTPNetworkSession+ANTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ANHTTPNetworkSession+ANTest.h"; sourceTree = ""; }; 0E061F1C23D1F37F000F0E1E /* testLoadTwoMARInstancesSimultaneously.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testLoadTwoMARInstancesSimultaneously.json; sourceTree = ""; }; 0E14221F22F99B9A006C597A /* ANResourceValidationTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANResourceValidationTestCase.m; sourceTree = ""; }; 0E14222222F99BA8006C597A /* ANResourceValidationTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANResourceValidationTestCase.m; sourceTree = ""; }; @@ -532,9 +578,14 @@ 0E2B4BAC23C4AD6E002AFBD8 /* testMARCombinationTwoRTBNative.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationTwoRTBNative.json; sourceTree = ""; }; 0E2C24892236AE4D006038E1 /* MediationBannerAdResizeTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MediationBannerAdResizeTestCase.m; sourceTree = ""; }; 0E2C24902236B075006038E1 /* GoogleMobileAds.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleMobileAds.framework; path = ../../mediation/mediatedviews/GoogleAdMob/GoogleAdMobSDK/Frameworks/GoogleMobileAds.framework; sourceTree = ""; }; + 0E32ACDB24832E2F0027D5A5 /* SuccessfulMediationResponseDefaultTimeout.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SuccessfulMediationResponseDefaultTimeout.json; sourceTree = ""; }; 0E32F7DD23C608B10036E0B4 /* testMARCombinationTwelveRTBBanner.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationTwelveRTBBanner.json; sourceTree = ""; }; 0E32F7E023C60E800036E0B4 /* testMARCombinationThirtyCSMBanner.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationThirtyCSMBanner.json; sourceTree = ""; }; 0E336C2C2461FB000033C76F /* NoNetworkAdFailTestCase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NoNetworkAdFailTestCase.m; sourceTree = ""; }; + 0E336C3D246346DB0033C76F /* ANNativeRenderingViewController+ANTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANNativeRenderingViewController+ANTest.h"; sourceTree = ""; }; + 0E336C3E246346DB0033C76F /* ANNativeRenderingViewController+ANTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ANNativeRenderingViewController+ANTest.m"; sourceTree = ""; }; + 0E336C46246372140033C76F /* ANAdFetcherBase+ANTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ANAdFetcherBase+ANTest.m"; sourceTree = ""; }; + 0E336C47246372140033C76F /* ANAdFetcherBase+ANTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANAdFetcherBase+ANTest.h"; sourceTree = ""; }; 0E3D3F2523C4D2CD00BCBE14 /* testMARCombinationAllRTB.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationAllRTB.json; sourceTree = ""; }; 0E3D3F2823C5C5CD00BCBE14 /* testMARCombinationAllCSM.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationAllCSM.json; sourceTree = ""; }; 0E3D3F3423C5F25200BCBE14 /* testMARCombinationBannerCSMWithOtherRTB.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationBannerCSMWithOtherRTB.json; sourceTree = ""; }; @@ -565,6 +616,8 @@ 0E3F32E223CE68E300CA830D /* nativeResponseWithoutImpTrackers.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = nativeResponseWithoutImpTrackers.json; sourceTree = ""; }; 0E3F32E323CE68E300CA830D /* custom_adapter_fb_mediated_response.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = custom_adapter_fb_mediated_response.json; sourceTree = ""; }; 0E3F331823D077D700CA830D /* MARPublicAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MARPublicAPI.m; sourceTree = ""; }; + 0E3FE34F245999220096A978 /* ANTimeTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANTimeTracker.h; sourceTree = ""; }; + 0E3FE350245999220096A978 /* ANTimeTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANTimeTracker.m; sourceTree = ""; }; 0E430033243D057C0070BB1E /* ANLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANLog.h; sourceTree = ""; }; 0E430035243D057C0070BB1E /* ANLogging+Make.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANLogging+Make.h"; sourceTree = ""; }; 0E430036243D057C0070BB1E /* ANLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANLog.m; sourceTree = ""; }; @@ -621,14 +674,34 @@ 0E56C71421F8AF5600ADE6E1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 0E56C71621F8AF5A00ADE6E1 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 0E56C83321F8B2A300ADE6E1 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 0E642D52244E6098009084E0 /* ANAdMediationTimeoutTestcase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANAdMediationTimeoutTestcase.m; sourceTree = ""; }; + 0E642D56244E63FE009084E0 /* csm_bannerad.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = csm_bannerad.json; sourceTree = ""; }; + 0E642D5A244E6678009084E0 /* ANAdMediationTimeoutTestCase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANAdMediationTimeoutTestCase.m; sourceTree = ""; }; + 0E642D6F244E6DEB009084E0 /* timeout_banner.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_banner.json; sourceTree = ""; }; + 0E642D70244E6DEB009084E0 /* timeout_interstiatal.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_interstiatal.json; sourceTree = ""; }; + 0E642D71244E6DEB009084E0 /* timeout_native.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_native.json; sourceTree = ""; }; + 0E642D88244E9880009084E0 /* timeout_native_over.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_native_over.json; sourceTree = ""; }; + 0E642D89244E9881009084E0 /* timeout_banner_over.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_banner_over.json; sourceTree = ""; }; + 0E642D8A244E9881009084E0 /* timeout_interstiatal_over.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_interstiatal_over.json; sourceTree = ""; }; 0E6612B322CA736200DDC5CD /* ANNativeAdView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ANNativeAdView.xib; sourceTree = ""; }; 0E6612B422CA736200DDC5CD /* ANGADUnifiedNativeAdView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANGADUnifiedNativeAdView.m; sourceTree = ""; }; 0E6612B522CA736200DDC5CD /* ANNativeAdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANNativeAdView.h; sourceTree = ""; }; 0E6612B622CA736200DDC5CD /* ANGADUnifiedNativeAdView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ANGADUnifiedNativeAdView.xib; sourceTree = ""; }; 0E6612B722CA736200DDC5CD /* ANNativeAdView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANNativeAdView.m; sourceTree = ""; }; 0E6612B822CA736200DDC5CD /* ANGADUnifiedNativeAdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANGADUnifiedNativeAdView.h; sourceTree = ""; }; + 0E6636022458A9EC008FB3FB /* AdPerformanceStatsBannerAdTestCase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsBannerAdTestCase.m; sourceTree = ""; }; + 0E6636042458AABF008FB3FB /* AdPerformanceStatsVideoAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsVideoAdTestCase.m; sourceTree = ""; }; + 0E6636052458AABF008FB3FB /* AdPerformanceStatsMARAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsMARAdTestCase.m; sourceTree = ""; }; + 0E6636062458AABF008FB3FB /* AdPerformanceStatsInterstitialAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsInterstitialAdTestCase.m; sourceTree = ""; }; + 0E6636072458AABF008FB3FB /* AdPerformanceStatsBannerNativeAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsBannerNativeAdTestCase.m; sourceTree = ""; }; + 0E6636082458AABF008FB3FB /* AdPerformanceStatsBannerVideoAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsBannerVideoAdTestCase.m; sourceTree = ""; }; + 0E6636092458AABF008FB3FB /* AdPerformanceStatsNativeAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsNativeAdTestCase.m; sourceTree = ""; }; + 0E6636162458D04C008FB3FB /* AdPerformanceStatsBannerNativeRendererAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsBannerNativeRendererAdTestCase.m; sourceTree = ""; }; + 0E6636182458D0F1008FB3FB /* PerformanceStatsRTBBannerNativeRendererAd.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = PerformanceStatsRTBBannerNativeRendererAd.json; sourceTree = ""; }; 0E7BC1B7229E905F002F41FF /* SuccessfulVerticalVideoAdResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SuccessfulVerticalVideoAdResponse.json; sourceTree = ""; }; 0E7BC1BB229E91E9002F41FF /* SuccessfulSquareInstreamVideoAdResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SuccessfulSquareInstreamVideoAdResponse.json; sourceTree = ""; }; + 0E7DE7182450F30A005468B5 /* timeout_ssm.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_ssm.json; sourceTree = ""; }; + 0E7DE7192450F30A005468B5 /* timeout_ssm_over.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = timeout_ssm_over.json; sourceTree = ""; }; 0E81279923C88D810045D788 /* ANSSMMediationAdViewController+ANTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ANSSMMediationAdViewController+ANTest.m"; sourceTree = ""; }; 0E81279B23C88D810045D788 /* ANSSMMediationAdViewController+ANTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANSSMMediationAdViewController+ANTest.h"; sourceTree = ""; }; 0E81279D23C894660045D788 /* ssmAd.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ssmAd.txt; sourceTree = ""; }; @@ -705,6 +778,9 @@ 0E9441EA24476B6F00D266F9 /* CSR_Facebook_Banner_Native.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = CSR_Facebook_Banner_Native.json; sourceTree = ""; }; 0E9441ED24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANAdAdapterCSRNativeBannerFacebook+ANTest.h"; sourceTree = ""; }; 0E9441EE24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ANAdAdapterCSRNativeBannerFacebook+ANTest.m"; sourceTree = ""; }; + 0E960B6B245B92510070EAF3 /* AdPerformanceStatsNativeOnlyMARAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdPerformanceStatsNativeOnlyMARAdTestCase.m; sourceTree = ""; }; + 0E960B6D245B92790070EAF3 /* PerformanceStatsNativeOnlyNativeAdTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PerformanceStatsNativeOnlyNativeAdTestCase.m; sourceTree = ""; }; + 0E99B51C246B3F6F0024A8DC /* SuccessfulDisabledBannerEnableNative.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = SuccessfulDisabledBannerEnableNative.json; sourceTree = ""; }; 0E9B356323C72C81002BE178 /* testMARCombinationNativeRTBWithOtherCSM.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationNativeRTBWithOtherCSM.json; sourceTree = ""; }; 0E9B356523C72C82002BE178 /* testMARCombinationInterstitialAndNativeCSMWithOtherRTB.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationInterstitialAndNativeCSMWithOtherRTB.json; sourceTree = ""; }; 0E9B356623C72C82002BE178 /* testMARCombinationBannerRTBWithOtherCSM.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationBannerRTBWithOtherCSM.json; sourceTree = ""; }; @@ -721,6 +797,12 @@ 0E9B357C23C73943002BE178 /* ANAdAdapterInterstitialMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterInterstitialMock.h; sourceTree = ""; }; 0E9B357D23C73943002BE178 /* ANVideoAdProcessor+ANTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ANVideoAdProcessor+ANTest.m"; sourceTree = ""; }; 0E9B357E23C73943002BE178 /* ANAdAdapterNativeMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterNativeMock.h; sourceTree = ""; }; + 0E9D6A67248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterBannerNetworkTimeout.m; sourceTree = ""; }; + 0E9D6A68248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterNativeNetworkTimeout.h; sourceTree = ""; }; + 0E9D6A69248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterInterstitialNetworkTimeout.h; sourceTree = ""; }; + 0E9D6A6A248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterNativeNetworkTimeout.m; sourceTree = ""; }; + 0E9D6A6B248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterBannerNetworkTimeout.h; sourceTree = ""; }; + 0E9D6A6C248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterInterstitialNetworkTimeout.m; sourceTree = ""; }; 0E9EBD6724336111001A30D8 /* TestANCSRUniversalFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestANCSRUniversalFetcher.h; sourceTree = ""; }; 0E9EBD6924336111001A30D8 /* TestANCSRUniversalFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestANCSRUniversalFetcher.m; sourceTree = ""; }; 0EA29A5D23C4947200D78555 /* testMARCombinationTwoRTBInterstitial.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testMARCombinationTwoRTBInterstitial.json; sourceTree = ""; }; @@ -871,8 +953,12 @@ 0EEFE1F9220098C9002B5F5F /* ANMockMediationAdapterLoadAndHitOtherCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANMockMediationAdapterLoadAndHitOtherCallbacks.h; sourceTree = ""; }; 0EEFE1FA220098C9002B5F5F /* ANMockMediationAdapterLoadAndHitOtherCallbacks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANMockMediationAdapterLoadAndHitOtherCallbacks.m; sourceTree = ""; }; 0EEFE1FC22009CDB002B5F5F /* OMID_TestResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = OMID_TestResponse.json; sourceTree = ""; }; + 4F3B837B2481E865005EE88C /* LazyWebview_Basic.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LazyWebview_Basic.json; sourceTree = ""; }; + 4F3B837D2481E865005EE88C /* LazyWebview_MRAID.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LazyWebview_MRAID.json; sourceTree = ""; }; 4F59A7A42379CC6B002E0482 /* MARGeneralTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MARGeneralTests.m; sourceTree = ""; }; 4F5BFB8023E513AD00C4AE32 /* DefaultPlacementLogic.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DefaultPlacementLogic.m; path = MARTestCase/MARTestMockMediation/DefaultPlacementLogic.m; sourceTree = ""; }; + 4F5F4DB024988A9F008BC33C /* LazyWebview_nobid.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LazyWebview_nobid.json; sourceTree = ""; }; + 4F78CD8224A5262800196E1B /* LazyLoadFeatureTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LazyLoadFeatureTests.m; sourceTree = ""; }; 4F83244823963480003BF9E2 /* srm--testInitThenLoadWithTwoMethods--response.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "srm--testInitThenLoadWithTwoMethods--response.json"; sourceTree = ""; }; 4F83244923963481003BF9E2 /* srm--testInitAndLoadWithOneMethod--response.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "srm--testInitAndLoadWithOneMethod--response.json"; sourceTree = ""; }; 4F83244A23963481003BF9E2 /* srm--testInitWithAddAndRemoveThenLoad--response1.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "srm--testInitWithAddAndRemoveThenLoad--response1.json"; sourceTree = ""; }; @@ -1013,13 +1099,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0E3F32CF23CE685F00CA830D /* Recovered References */ = { - isa = PBXGroup; - children = ( - ); - name = "Recovered References"; - sourceTree = ""; - }; 0E3F32D123CE68E300CA830D /* NativeResponses */ = { isa = PBXGroup; children = ( @@ -1046,6 +1125,15 @@ path = UnitTestApp/SharedMockFiles/StubResponse/NativeResponses; sourceTree = SOURCE_ROOT; }; + 0E3FE34E245999100096A978 /* TimeTracker */ = { + isa = PBXGroup; + children = ( + 0E3FE34F245999220096A978 /* ANTimeTracker.h */, + 0E3FE350245999220096A978 /* ANTimeTracker.m */, + ); + path = TimeTracker; + sourceTree = ""; + }; 0E430032243D057C0070BB1E /* Logs */ = { isa = PBXGroup; children = ( @@ -1061,6 +1149,7 @@ isa = PBXGroup; children = ( 0E44C3A522D7371100DF68D0 /* GoogleAdMob */, + 0E642D5C244E66BC009084E0 /* NetworkTimeout */, ); name = mediatedviews; path = ../../../mediation/mediatedviews; @@ -1188,6 +1277,21 @@ name = Frameworks; sourceTree = ""; }; + 0E642D59244E665D009084E0 /* CSM */ = { + isa = PBXGroup; + children = ( + 0E642D5A244E6678009084E0 /* ANAdMediationTimeoutTestCase.m */, + ); + path = CSM; + sourceTree = ""; + }; + 0E642D5C244E66BC009084E0 /* NetworkTimeout */ = { + isa = PBXGroup; + children = ( + ); + path = NetworkTimeout; + sourceTree = ""; + }; 0E6612B222CA736200DDC5CD /* NativeAd */ = { isa = PBXGroup; children = ( @@ -1201,6 +1305,37 @@ path = NativeAd; sourceTree = ""; }; + 0E6636002458A643008FB3FB /* PerformanceStats */ = { + isa = PBXGroup; + children = ( + 0E8E8351245B8D72008F6CAC /* NativeOnlySDK */, + 0E3FE34E245999100096A978 /* TimeTracker */, + 0E6636022458A9EC008FB3FB /* AdPerformanceStatsBannerAdTestCase.m */, + 0E6636162458D04C008FB3FB /* AdPerformanceStatsBannerNativeRendererAdTestCase.m */, + 0E6636072458AABF008FB3FB /* AdPerformanceStatsBannerNativeAdTestCase.m */, + 0E6636082458AABF008FB3FB /* AdPerformanceStatsBannerVideoAdTestCase.m */, + 0E6636062458AABF008FB3FB /* AdPerformanceStatsInterstitialAdTestCase.m */, + 0E6636052458AABF008FB3FB /* AdPerformanceStatsMARAdTestCase.m */, + 0E6636092458AABF008FB3FB /* AdPerformanceStatsNativeAdTestCase.m */, + 0E6636042458AABF008FB3FB /* AdPerformanceStatsVideoAdTestCase.m */, + ); + path = PerformanceStats; + sourceTree = ""; + }; + 0E6636122458C9BC008FB3FB /* PerformanceStatsStub */ = { + isa = PBXGroup; + children = ( + 0E6636182458D0F1008FB3FB /* PerformanceStatsRTBBannerNativeRendererAd.json */, + 0E7DE7132450F248005468B5 /* ANAdAdapterBannerNetworkTimeout.h */, + 0E7DE70F2450F248005468B5 /* ANAdAdapterBannerNetworkTimeout.m */, + 0E7DE7112450F248005468B5 /* ANAdAdapterInterstitialNetworkTimeout.h */, + 0E7DE7142450F248005468B5 /* ANAdAdapterInterstitialNetworkTimeout.m */, + 0E7DE7102450F248005468B5 /* ANAdAdapterNativeNetworkTimeout.h */, + 0E7DE7122450F248005468B5 /* ANAdAdapterNativeNetworkTimeout.m */, + ); + path = PerformanceStatsStub; + sourceTree = ""; + }; 0E86339323C3453400C804E9 /* MARTestCase */ = { isa = PBXGroup; children = ( @@ -1282,21 +1417,21 @@ 0E8C971121FF32EB005D1F0E /* Categories */ = { isa = PBXGroup; children = ( + 0E336C3D246346DB0033C76F /* ANNativeRenderingViewController+ANTest.h */, + 0E336C3E246346DB0033C76F /* ANNativeRenderingViewController+ANTest.m */, 0E9441ED24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.h */, 0E9441EE24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m */, - 0E516FE5243E6F1500B5E744 /* ANNativeAdResponse+ANTest.h */, - 0E516FE7243E6F1500B5E744 /* ANNativeAdResponse+ANTest.m */, 0E8C971621FF32EB005D1F0E /* ANAdView+ANTest.h */, 0E8C972521FF32EB005D1F0E /* ANAdView+ANTest.m */, 0E8C971D21FF32EB005D1F0E /* ANAdWebViewController+ANTest.h */, 0E8C972D21FF32EB005D1F0E /* ANAdWebViewController+ANTest.m */, 0E8C972821FF32EB005D1F0E /* ANBannerAdView+ANTest.h */, 0E8C971B21FF32EB005D1F0E /* ANBannerAdView+ANTest.m */, + 004833C824A3AC4300BFF7A6 /* ANGlobal+ANTest.h */, + 004833CD24A3B81A00BFF7A6 /* ANHTTPNetworkSession+ANTest.h */, 0E8C971721FF32EB005D1F0E /* ANInterstitialAd+ANTest.h */, 0E8C972421FF32EB005D1F0E /* ANInterstitialAd+ANTest.m */, 0E430043243D08400070BB1E /* ANMRAIDContainerView+ANTest.h */, - 0E430043243D08400070BB1E /* ANMRAIDContainerView+ANTest.h */, - 0E430044243D08400070BB1E /* ANMRAIDContainerView+ANTest.m */, 0E430044243D08400070BB1E /* ANMRAIDContainerView+ANTest.m */, 0E8C971A21FF32EB005D1F0E /* ANNativeAdRequest+ANBaseUrlOverride.h */, 0E8C972721FF32EB005D1F0E /* ANNativeAdRequest+ANBaseUrlOverride.m */, @@ -1307,6 +1442,8 @@ 0E8C972221FF32EB005D1F0E /* ANTrackerManager+ANTest.h */, 0E8C971321FF32EB005D1F0E /* ANTrackerManager+ANTest.m */, 0E8C972A21FF32EB005D1F0E /* ANUniversalAdFetcher+ANTest.h */, + 0E336C47246372140033C76F /* ANAdFetcherBase+ANTest.h */, + 0E336C46246372140033C76F /* ANAdFetcherBase+ANTest.m */, 0E8C971821FF32EB005D1F0E /* ANUniversalAdFetcher+ANTest.m */, 9792384A22412E49007433C0 /* ANVerificationScriptResource+ANTest.h */, 9792384B22412E49007433C0 /* ANVerificationScriptResource+ANTest.m */, @@ -1347,6 +1484,15 @@ path = UnitTestShared; sourceTree = ""; }; + 0E8E8351245B8D72008F6CAC /* NativeOnlySDK */ = { + isa = PBXGroup; + children = ( + 0E960B6B245B92510070EAF3 /* AdPerformanceStatsNativeOnlyMARAdTestCase.m */, + 0E960B6D245B92790070EAF3 /* PerformanceStatsNativeOnlyNativeAdTestCase.m */, + ); + path = NativeOnlySDK; + sourceTree = ""; + }; 0E9B357423C73943002BE178 /* MARTestMockMediation */ = { isa = PBXGroup; children = ( @@ -1364,6 +1510,20 @@ path = MARTestMockMediation; sourceTree = ""; }; + 0E9D6A66248E8301006600CC /* NetworkTimeout */ = { + isa = PBXGroup; + children = ( + 0E9D6A67248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.m */, + 0E9D6A68248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.h */, + 0E9D6A69248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.h */, + 0E9D6A6A248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.m */, + 0E9D6A6B248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.h */, + 0E9D6A6C248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.m */, + ); + name = NetworkTimeout; + path = mediation/NetworkTimeout; + sourceTree = ""; + }; 0EB24C1022CBD242008E927F /* NativeSDKTestApp */ = { isa = PBXGroup; children = ( @@ -1393,13 +1553,13 @@ 0EC17C2921F72D1700F0F6AF = { isa = PBXGroup; children = ( + 0E6636002458A643008FB3FB /* PerformanceStats */, 0E56C6ED21F8AEF200ADE6E1 /* Frameworks */, 0EC17C5E21F72EC500F0F6AF /* FunctionalTests */, 0EEAF622229BC8BD0008CAC9 /* FunctionalUITests */, 0EB24C1022CBD242008E927F /* NativeSDKTestApp */, 0EB24C2922CBD243008E927F /* NativeSDKTestAppTests */, 0EC17C3321F72D1700F0F6AF /* Products */, - 0E3F32CF23CE685F00CA830D /* Recovered References */, 4F3D9E91238746E100B02AC6 /* Shared */, 0EC17C3421F72D1700F0F6AF /* UnitTestApp */, 0EC17C5021F72EA300F0F6AF /* UnitTests */, @@ -1447,6 +1607,7 @@ isa = PBXGroup; children = ( 0E5529B22419203A00D50C51 /* CSR */, + 0E642D52244E6098009084E0 /* ANAdMediationTimeoutTestcase.m */, 0E8C982821FF4141005D1F0E /* ANAdResponseTestCase.m */, 0E8C983021FF41A8005D1F0E /* ANBannerAdViewTransitionsTestCase.m */, 0E8C982021FF4025005D1F0E /* ANContainerViewTestCase.m */, @@ -1463,6 +1624,7 @@ 97E3447A2281856A008C3C0F /* ANVideoPlayerSettingsDefaultTestCase.m */, 60D39E44226F69A80029F741 /* ANVideoPlayerSettingsTestCase.m */, 0EC17C5321F72EA300F0F6AF /* Info.plist */, + 4F78CD8224A5262800196E1B /* LazyLoadFeatureTests.m */, 0E15D60A23D1AE2D00BD57DB /* MARGeneralUnitTests.m */, 0E8C983421FF41C4005D1F0E /* MediationTests.m */, 4F9CED4723CC9E7700BE3443 /* PrivateAPI.m */, @@ -1475,8 +1637,10 @@ 0EC17C5E21F72EC500F0F6AF /* FunctionalTests */ = { isa = PBXGroup; children = ( + 0E642D59244E665D009084E0 /* CSM */, 0E5529AF2419202900D50C51 /* CSR */, 0E86339323C3453400C804E9 /* MARTestCase */, + 0E7DE7042450F225005468B5 /* mediation */, 0E1C24B9242AA2FC00A70AC4 /* ANAdOMIDViewablityTestCase.m */, 97FFD0492372D49400412B20 /* ANAdResponseTestCase.m */, 0EEFE1AC220089F2002B5F5F /* ANAdViewMRAIDCreativeTestCase.m */, @@ -1510,8 +1674,8 @@ 0E2C24892236AE4D006038E1 /* MediationBannerAdResizeTestCase.m */, 0EEFE1AE220089FB002B5F5F /* MediationCallbacksTests.m */, 0EEFE1B422008A1A002B5F5F /* MRAIDTests.m */, - 0EEFE190220080DE002B5F5F /* OutstreamVideoAdClassObjectFromUTResponseTests.m */, 0E336C2C2461FB000033C76F /* NoNetworkAdFailTestCase.m */, + 0EEFE190220080DE002B5F5F /* OutstreamVideoAdClassObjectFromUTResponseTests.m */, ); path = FunctionalTests; sourceTree = ""; @@ -1519,8 +1683,8 @@ 0ECF333622D798DB007DB185 /* Products */ = { isa = PBXGroup; children = ( - 0ECF333E22D798DB007DB185 /* AppNexusSDK.framework */, 0ECF334022D798DB007DB185 /* AppNexusNativeSDK.framework */, + 0ECF333E22D798DB007DB185 /* AppNexusSDK.framework */, ); name = Products; sourceTree = ""; @@ -1595,6 +1759,7 @@ 97FFD04D2372DA7700412B20 /* ANAdResponseRTB_Banner.json */, 97FFD0502372DA7900412B20 /* ANAdResponseRTB_Native.json */, 97FFD0512372DA7900412B20 /* ANAdResponseRTB_Video.json */, + 00436C1724A45F1C00C42D73 /* ANJAMCustomKeywordsResponse.json */, 60F8A80723280EC10030D53D /* ANJAMDeviceIdResponse.json */, 60F8A80523280EC10030D53D /* ANJAMDispatchAppEventResponse.json */, 60F8A80B23280EC10030D53D /* ANJAMExternalBrowserResponse.json */, @@ -1607,7 +1772,11 @@ 0EB24C5022CBD568008E927F /* appnexus_mock_mediation_response.json */, 0EEFE1A62200821F002B5F5F /* BannerMediationFailRTBVideoSuccess.json */, 0ED15A1B2236BFC000D56022 /* BaseMediationSingleNetworkResponse.json */, + 0E642D56244E63FE009084E0 /* csm_bannerad.json */, 0E9441EA24476B6F00D266F9 /* CSR_Facebook_Banner_Native.json */, + 4F3B837B2481E865005EE88C /* LazyWebview_Basic.json */, + 4F3B837D2481E865005EE88C /* LazyWebview_MRAID.json */, + 4F5F4DB024988A9F008BC33C /* LazyWebview_nobid.json */, 0E4B791E2282E9140085C612 /* NativeAsssemblyRendererOMID_Native_RTBResponse.json */, 979EA168223BB575009B79B7 /* OMID_Native_CSMResponse.json */, 979EA169223BB575009B79B7 /* OMID_Native_RTBResponse.json */, @@ -1623,9 +1792,11 @@ 0EEFE1A2220081C0002B5F5F /* SuccessfulAllowMagicSizeBannerObjectResponse.json */, 0EEFE17D220074BA002B5F5F /* SuccessfulANRTBVideoAdResponse.json */, 0EEFE1A8220082F9002B5F5F /* SuccessfulANRTBVideoAdWithoutCreativeIdResponse.json */, + 0E99B51C246B3F6F0024A8DC /* SuccessfulDisabledBannerEnableNative.json */, 0EEFE16F22007317002B5F5F /* SuccessfulInstreamVideoAdResponse.json */, 0EEFE1A0220081B3002B5F5F /* SuccessfulLocationCreativeForBannerAdResponse.json */, 0EEFE181220074EC002B5F5F /* SuccessfulMediationResponse.json */, + 0E32ACDB24832E2F0027D5A5 /* SuccessfulMediationResponseDefaultTimeout.json */, 0EEFE1E7220096A9002B5F5F /* SuccessfulMRAIDListenerResponse.json */, 0EEFE1792200746D002B5F5F /* SuccessfulMRAIDResponse.json */, 0EEFE17B22007497002B5F5F /* SuccessfulNativeStandardAdResponse.json */, @@ -1636,6 +1807,14 @@ 0E7BC1BB229E91E9002F41FF /* SuccessfulSquareInstreamVideoAdResponse.json */, 0EEFE17F220074D1002B5F5F /* SuccessfulStandardAdFromRTBObjectResponse.json */, 0E7BC1B7229E905F002F41FF /* SuccessfulVerticalVideoAdResponse.json */, + 0E642D6F244E6DEB009084E0 /* timeout_banner.json */, + 0E642D89244E9881009084E0 /* timeout_banner_over.json */, + 0E642D70244E6DEB009084E0 /* timeout_interstiatal.json */, + 0E642D8A244E9881009084E0 /* timeout_interstiatal_over.json */, + 0E642D71244E6DEB009084E0 /* timeout_native.json */, + 0E642D88244E9880009084E0 /* timeout_native_over.json */, + 0E7DE7182450F30A005468B5 /* timeout_ssm.json */, + 0E7DE7192450F30A005468B5 /* timeout_ssm_over.json */, ); name = StubResponse; path = UnitTestApp/SharedMockFiles/StubResponse; @@ -1707,6 +1886,7 @@ 0EEFE1722200736D002B5F5F /* FunctionalMockFiles */ = { isa = PBXGroup; children = ( + 0E9D6A66248E8301006600CC /* NetworkTimeout */, 0E5529B82419228C00D50C51 /* FacebookSDK */, 0E4701922237B441005CFFAC /* Video */, 0ED159D52236B35A00D56022 /* ANAdAdapterBannerAdMob+ANTest.h */, @@ -1722,6 +1902,7 @@ 0EEFE1732200737D002B5F5F /* SharedMockFiles */ = { isa = PBXGroup; children = ( + 0E6636122458C9BC008FB3FB /* PerformanceStatsStub */, 0E8C971121FF32EB005D1F0E /* Categories */, 0E430032243D057C0070BB1E /* Logs */, 0EEFE111220055B9002B5F5F /* MockMediationAdapters */, @@ -1995,6 +2176,9 @@ 0E8C979521FF32EC005D1F0E /* Default-568h@2x.png in Resources */, 0EEAF63D229BCB9F0008CAC9 /* FunctionalUITest.storyboard in Resources */, 0EC17C4221F72D1900F0F6AF /* LaunchScreen.storyboard in Resources */, + 4F3B837E2481E866005EE88C /* LazyWebview_Basic.json in Resources */, + 4F3B837F2481E866005EE88C /* LazyWebview_MRAID.json in Resources */, + 4F5F4DB224988A9F008BC33C /* LazyWebview_nobid.json in Resources */, 0EC17C3D21F72D1700F0F6AF /* Main.storyboard in Resources */, 9736FABB2354CF26008F6687 /* OMID_VideoResponse.json in Resources */, 0E81279F23C895420045D788 /* ssmAd.txt in Resources */, @@ -2006,6 +2190,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 4F9BF320248EF37B00A3D687 /* ANAdResponseRTB_Native.json in Resources */, 0E6612C022CA736300DDC5CD /* ANGADUnifiedNativeAdView.xib in Resources */, 60F8A81123280EC10030D53D /* ANJAMDeviceIdResponse.json in Resources */, 60F8A80D23280EC10030D53D /* ANJAMDispatchAppEventResponse.json in Resources */, @@ -2019,6 +2204,7 @@ 0E3F330123CE694300CA830D /* appnexus_standard_response.json in Resources */, 0E3F330523CE694300CA830D /* bannerNative_basic_banner.json in Resources */, 0E3F330423CE694300CA830D /* bannerNative_native_mediation.json in Resources */, + 0E642D57244E63FE009084E0 /* csm_bannerad.json in Resources */, 0E3F330723CE694300CA830D /* custom_adapter_fb_mediated_response.json in Resources */, 0E3F32FF23CE694300CA830D /* custom_adapter_invalid_type.json in Resources */, 0E3F32FE23CE694300CA830D /* custom_adapter_mediated_response.json in Resources */, @@ -2032,6 +2218,9 @@ 0E3F32F623CE694300CA830D /* facebook_mediated_response.json in Resources */, 0E8C973321FF32EC005D1F0E /* GreyWhiteCat.jpg in Resources */, 0E8C973621FF32EC005D1F0E /* GreyWhiteCat@2x.jpg in Resources */, + 4F3B83802481E8E1005EE88C /* LazyWebview_Basic.json in Resources */, + 4F3B83812481E8E1005EE88C /* LazyWebview_MRAID.json in Resources */, + 4F5F4DB324988A9F008BC33C /* LazyWebview_nobid.json in Resources */, 0E3F32F723CE694300CA830D /* mopub_mediated_response.json in Resources */, 0E3F32F923CE694300CA830D /* native_videoResponse.json in Resources */, 0E3F330023CE694300CA830D /* nativeResponse1.json in Resources */, @@ -2047,9 +2236,12 @@ 0EEFE17E220074BA002B5F5F /* SuccessfulANRTBVideoAdResponse.json in Resources */, 4F9CED4A23CCAAEF00BE3443 /* SuccessfulInstreamVideoAdResponse.json in Resources */, 0EEFE182220074EC002B5F5F /* SuccessfulMediationResponse.json in Resources */, + 0E32ACDC24832E2F0027D5A5 /* SuccessfulMediationResponseDefaultTimeout.json in Resources */, 0EEFE17A2200746D002B5F5F /* SuccessfulMRAIDResponse.json in Resources */, 0EEFE17C22007497002B5F5F /* SuccessfulNativeStandardAdResponse.json in Resources */, + 4F9BF31D248EDFE200A3D687 /* SuccessfulOutstreamBannerVideoResponse.json in Resources */, 0EEFE180220074D1002B5F5F /* SuccessfulStandardAdFromRTBObjectResponse.json in Resources */, + 4FE5D818248A223400B86BDA /* testMARCombinationAllRTB.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2062,6 +2254,7 @@ 97FFD0552372DA7900412B20 /* ANAdResponseRTB_Native.json in Resources */, 97FFD0562372DA7900412B20 /* ANAdResponseRTB_Video.json in Resources */, 0E6612C122CA736300DDC5CD /* ANGADUnifiedNativeAdView.xib in Resources */, + 00436C1B24A45F2C00C42D73 /* ANJAMCustomKeywordsResponse.json in Resources */, 60F8A82423294D590030D53D /* ANJAMDeviceIdResponse.json in Resources */, 60F8A82523294D5C0030D53D /* ANJAMDispatchAppEventResponse.json in Resources */, 60F8A82523294D5C0030D53D /* ANJAMDispatchAppEventResponse.json in Resources */, @@ -2084,6 +2277,7 @@ 0ED15A1D2236C03400D56022 /* BaseMediationSingleNetworkResponse.json in Resources */, 0ED15A1D2236C03400D56022 /* BaseMediationSingleNetworkResponse.json in Resources */, 0E9441EC24476B6F00D266F9 /* CSR_Facebook_Banner_Native.json in Resources */, + 0E9441EC24476B6F00D266F9 /* CSR_Facebook_Banner_Native.json in Resources */, 0E3F32F523CE68E300CA830D /* custom_adapter_fb_mediated_response.json in Resources */, 0E3F32ED23CE68E300CA830D /* custom_adapter_invalid_type.json in Resources */, 0E3F32EC23CE68E300CA830D /* custom_adapter_mediated_response.json in Resources */, @@ -2106,10 +2300,12 @@ 0E1C24B8242A86C300A70AC4 /* OMID_Video_TestResponse.json in Resources */, 9736FABC2354CF26008F6687 /* OMID_VideoResponse.json in Resources */, 0EEFE1F222009819002B5F5F /* SecondPriceForDFPParamIsUnset.json in Resources */, - 0EEFE1F022009802002B5F5F /* SecondPriceForDFPSuccess.json in Resources */, + 0E642D58244E640C009084E0 /* SecondPriceForDFPSuccess.json in Resources */, 0E81279E23C894660045D788 /* ssmAd.txt in Resources */, 0EEFE1A3220081C0002B5F5F /* SuccessfulAllowMagicSizeBannerObjectResponse.json in Resources */, 0EEFE1A9220082F9002B5F5F /* SuccessfulANRTBVideoAdWithoutCreativeIdResponse.json in Resources */, + 0E6636192458D0F1008FB3FB /* PerformanceStatsRTBBannerNativeRendererAd.json in Resources */, + 0E99B51D246B3F6F0024A8DC /* SuccessfulDisabledBannerEnableNative.json in Resources */, 0EEFE17022007317002B5F5F /* SuccessfulInstreamVideoAdResponse.json in Resources */, 0EEFE1A1220081B3002B5F5F /* SuccessfulLocationCreativeForBannerAdResponse.json in Resources */, 0EEFE1E8220096A9002B5F5F /* SuccessfulMRAIDListenerResponse.json in Resources */, @@ -2153,6 +2349,14 @@ 0E15D61223D1E18B00BD57DB /* testMARFailureWithRequestError.json in Resources */, 0E15D61423D1E70A00BD57DB /* testMARSuccessWithAdUnitNoBid.json in Resources */, 0E15D61023D1DE5900BD57DB /* testMARSuccessWithSomeAdUnitErrors.json in Resources */, + 0E642D73244E6DEB009084E0 /* timeout_banner.json in Resources */, + 0E642D8C244E9881009084E0 /* timeout_banner_over.json in Resources */, + 0E642D75244E6DEB009084E0 /* timeout_interstiatal.json in Resources */, + 0E642D8D244E9881009084E0 /* timeout_interstiatal_over.json in Resources */, + 0E642D77244E6DEC009084E0 /* timeout_native.json in Resources */, + 0E642D8B244E9881009084E0 /* timeout_native_over.json in Resources */, + 0E7DE71A2450F30A005468B5 /* timeout_ssm.json in Resources */, + 0E7DE71B2450F30A005468B5 /* timeout_ssm_over.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2172,6 +2376,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 004833BF24A39D6400BFF7A6 /* ANHTTPStubbingManager.m in Sources */, + 004833E824A3CF7300BFF7A6 /* ANHTTPStubURLProtocol.m in Sources */, 0EB24C1322CBD242008E927F /* AppDelegate.m in Sources */, 0EB24C2122CBD243008E927F /* main.m in Sources */, 0EB24C1622CBD242008E927F /* NativeViewController.m in Sources */, @@ -2182,13 +2388,16 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0EB24C5522CBD770008E927F /* ANHTTPStubbingManager.m in Sources */, 0EB24C5722CBD770008E927F /* ANHTTPStubURLProtocol.m in Sources */, 0EB24C4F22CBD54B008E927F /* ANMockMediationAdapterSuccessfulNative.m in Sources */, 607BB64823F32936002A0F57 /* ANNativeAdRequest+ANTest.m in Sources */, 0E14222122F99B9A006C597A /* ANResourceValidationTestCase.m in Sources */, + 0E960B6C245B92510070EAF3 /* AdPerformanceStatsNativeOnlyMARAdTestCase.m in Sources */, 0EB24C5822CBD770008E927F /* ANURLConnectionStub+NSURLSessionConfiguration.m in Sources */, + 0EECFD2124659C8800AC90F7 /* ANAdFetcherBase+ANTest.m in Sources */, + 0E8E8357245B8E18008F6CAC /* ANTimeTracker.m in Sources */, 0EB24C5622CBD770008E927F /* ANURLConnectionStub.m in Sources */, + 0E960B6E245B92790070EAF3 /* PerformanceStatsNativeOnlyNativeAdTestCase.m in Sources */, 0EB24C5322CBD5CB008E927F /* NativeSDKTestAppTests.m in Sources */, 0EB24C5922CBD77B008E927F /* NSObject+Swizzling.m in Sources */, ); @@ -2198,6 +2407,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 0E336C3224620A890033C76F /* ANHTTPStubURLProtocol.m in Sources */, 0EEAF638229BCB840008CAC9 /* AdObjectModel.swift in Sources */, 0E44C3DA22D7371100DF68D0 /* ANAdAdapterBannerAdMob.m in Sources */, 0E44C3D822D7371100DF68D0 /* ANAdAdapterBannerDFP.m in Sources */, @@ -2208,11 +2418,9 @@ 0E44C3D622D7371100DF68D0 /* ANAdAdapterInterstitialDFP.m in Sources */, 0E44C3D722D7371100DF68D0 /* ANAdAdapterNativeAdMob.m in Sources */, 0E8C97BC21FF32EC005D1F0E /* ANAdView+ANTest.m in Sources */, - 0E8C97CB21FF32EC005D1F0E /* ANAdWebViewController+ANTest.m in Sources */, 0E47017F2237B35B005CFFAC /* ANBannerAdView+ANTest.m in Sources */, 0E6612BC22CA736300DDC5CD /* ANGADUnifiedNativeAdView.m in Sources */, 0EEFE175220073F0002B5F5F /* ANHTTPStubbingManager.m in Sources */, - 0EEFE177220073F0002B5F5F /* ANHTTPStubURLProtocol.m in Sources */, 0E4701B42237B443005CFFAC /* ANInstreamVideoAd+Test.m in Sources */, 0E43003A243D057C0070BB1E /* ANLog.m in Sources */, 0E43003A243D057C0070BB1E /* ANLog.m in Sources */, @@ -2226,9 +2434,9 @@ 60F8A80023280C2A0030D53D /* ANReachability+ANTest.h in Sources */, 0EEFE15422005AD1002B5F5F /* ANTestResponses.m in Sources */, 0E4701C42237CDC9005CFFAC /* ANTrackerManager+ANTest.m in Sources */, + 0E336C3C24632A770033C76F /* ANTimeTracker.m in Sources */, 0EEFE178220073F0002B5F5F /* ANURLConnectionStub+NSURLSessionConfiguration.m in Sources */, 0EEFE176220073F0002B5F5F /* ANURLConnectionStub.m in Sources */, - 0E4701B52237B443005CFFAC /* ANVideoAdPlayer+Test.m in Sources */, 0EC17C3721F72D1700F0F6AF /* AppDelegate.m in Sources */, 973D2C1922C634A2008195C9 /* BannerAdClickThruViewController.swift in Sources */, 0EEAF63A229BCB840008CAC9 /* BannerAdFunctionalViewController.swift in Sources */, @@ -2261,6 +2469,7 @@ 0EEFE1252200585A002B5F5F /* ANAdAdapterBannerUnableToFillThenSuccessful.m in Sources */, 0EEFE14822005951002B5F5F /* ANAdAdapterBannerUnableToFillWithSubsequentCallbacks.m in Sources */, 0E516FF5243FA01200B5E744 /* ANAdAdapterCSRNativeBannerFacebook.m in Sources */, + 0E642D53244E6098009084E0 /* ANAdMediationTimeoutTestcase.m in Sources */, 0E8C982921FF4141005D1F0E /* ANAdResponseTestCase.m in Sources */, 0E8C97BD21FF32EC005D1F0E /* ANAdView+ANTest.m in Sources */, 0E8C983121FF41A8005D1F0E /* ANBannerAdViewTransitionsTestCase.m in Sources */, @@ -2268,7 +2477,6 @@ 0E8C982121FF4025005D1F0E /* ANContainerViewTestCase.m in Sources */, 0E5529AD2419201F00D50C51 /* ANCSRUniversalTagRequestBuilderTests.m in Sources */, 0EEFE14A22005951002B5F5F /* ANFailedMultiple.m in Sources */, - 0E8C979921FF32EC005D1F0E /* ANHTTPStubbingManager.m in Sources */, 0E8C979F21FF32EC005D1F0E /* ANHTTPStubURLProtocol.m in Sources */, 0E8C97BA21FF32EC005D1F0E /* ANInterstitialAd+ANTest.m in Sources */, 0EEFE14622005951002B5F5F /* ANLoadAndHitOtherCallbacks.m in Sources */, @@ -2278,6 +2486,7 @@ 0E8C983321FF41B2005D1F0E /* ANMediationAdViewControllerTestCase.m in Sources */, 0E8C984121FF42F1005D1F0E /* ANMockMediationAdapterBannerNeverCalled.m in Sources */, 0EEFE114220055C4002B5F5F /* ANMockMediationAdapterSuccessfulBanner.m in Sources */, + 4FE5D816248A21AD00B86BDA /* ANNativeAdRequest+ANTest.m in Sources */, 0E6612C322CA736300DDC5CD /* ANNativeAdView.m in Sources */, 0E8C982B21FF417C005D1F0E /* ANNativeStandardAdResponseTestCase.m in Sources */, 60F8A7FF23280BF10030D53D /* ANReachability+ANTest.h in Sources */, @@ -2296,6 +2505,7 @@ 979EA146223BA485009B79B7 /* ANVerificationScriptResourceTestCase.m in Sources */, 97E3447B2281856A008C3C0F /* ANVideoPlayerSettingsDefaultTestCase.m in Sources */, 60D39E46226F69A80029F741 /* ANVideoPlayerSettingsTestCase.m in Sources */, + 4F78CD8324A5262800196E1B /* LazyLoadFeatureTests.m in Sources */, 0E15D60C23D1AE2D00BD57DB /* MARGeneralUnitTests.m in Sources */, 0E3F331A23D080D600CA830D /* MARHelper.m in Sources */, 0E8C983521FF41C4005D1F0E /* MediationTests.m in Sources */, @@ -2319,33 +2529,43 @@ buildActionMask = 2147483647; files = ( 0E9B358123C73943002BE178 /* ANAdAdapterBannerMock.m in Sources */, + 0E7DE7152450F248005468B5 /* ANAdAdapterBannerNetworkTimeout.m in Sources */, 0E9441EF24476B9B00D266F9 /* ANAdAdapterCSRNativeBannerFacebook+ANTest.m in Sources */, 0E516FF0243F9DCA00B5E744 /* ANAdAdapterCSRNativeBannerFacebook.m in Sources */, 0E9B357F23C73943002BE178 /* ANAdAdapterInterstitialMock.m in Sources */, + 0E7DE7172450F248005468B5 /* ANAdAdapterInterstitialNetworkTimeout.m in Sources */, 0E9B358023C73943002BE178 /* ANAdAdapterNativeMock.m in Sources */, + 0E9D6A6D248E8301006600CC /* ANAdAdapterBannerNetworkTimeout.m in Sources */, + 0E7DE7162450F248005468B5 /* ANAdAdapterNativeNetworkTimeout.m in Sources */, + 0E642D5B244E6678009084E0 /* ANAdMediationTimeoutTestCase.m in Sources */, 0E1C24BA242AA2FC00A70AC4 /* ANAdOMIDViewablityTestCase.m in Sources */, 97FFD04A2372D49400412B20 /* ANAdResponseTestCase.m in Sources */, 0E8C97BE21FF32EC005D1F0E /* ANAdView+ANTest.m in Sources */, 0EEFE1AD220089F2002B5F5F /* ANAdViewMRAIDCreativeTestCase.m in Sources */, 0EAA0BAC242A401900597B23 /* ANBannerAdOMIDViewablityTestCase.m in Sources */, 0EEFE197220080FB002B5F5F /* ANBannerAdTestCase.m in Sources */, + 0E6636172458D04C008FB3FB /* AdPerformanceStatsBannerNativeRendererAdTestCase.m in Sources */, 003A7D1C2444BE5800F97F7D /* ANBannerAdViewHTMLImpressionTestCase.m in Sources */, + 0E9D6A6F248E8301006600CC /* ANAdAdapterInterstitialNetworkTimeout.m in Sources */, + 0E336C3F246346DB0033C76F /* ANNativeRenderingViewController+ANTest.m in Sources */, 0EEFE193220080E7002B5F5F /* ANBannerAdViewVideoTestCase.m in Sources */, 0EAFC639242E22E200500DC1 /* ANBannerNativeRenderAdOMIDViewablityTestCase.m in Sources */, 0E1D14B022784C0900343050 /* ANBannerNativeRenderingTestCase.m in Sources */, 0EEFE1B322008A11002B5F5F /* ANBannerNativeTestCase.m in Sources */, 0EEFE18F220080D6002B5F5F /* ANBannerVideoAutoRefreshAdViewTestCase.m in Sources */, 0EEFE1882200762B002B5F5F /* ANBaseTestCase.m in Sources */, + 0E336C48246372140033C76F /* ANAdFetcherBase+ANTest.m in Sources */, 0E5529B12419203400D50C51 /* ANCSRUniversalTagRequestBuilderTests.m in Sources */, 0ED6435524323402006B2A2E /* ANFBSettings.m in Sources */, 0E8C979A21FF32EC005D1F0E /* ANHTTPStubbingManager.m in Sources */, + 0E9D6A6E248E8301006600CC /* ANAdAdapterNativeNetworkTimeout.m in Sources */, 0E8C97A021FF32EC005D1F0E /* ANHTTPStubURLProtocol.m in Sources */, - 0E336C2D2461FB000033C76F /* NoNetworkAdFailTestCase.m in Sources */, 973A67A9239908E30008126D /* ANInstreamVideoAd+Test.m in Sources */, 0E1C24B6242A855B00A70AC4 /* ANInstreamVideoAdOMIDViewablityTestCase.m in Sources */, 0EEFE16222007170002B5F5F /* ANInstreamVideoAdTestCase.m in Sources */, 0E8C97BB21FF32EC005D1F0E /* ANInterstitialAd+ANTest.m in Sources */, 0EEFE184220075B0002B5F5F /* ANInterstitialAdTestCase.m in Sources */, + 0E66360D2458AABF008FB3FB /* AdPerformanceStatsBannerNativeAdTestCase.m in Sources */, 60F8A81E23294BF80030D53D /* ANJAMDeviceIdResponse.json in Sources */, 60F8A81F23294BFC0030D53D /* ANJAMDispatchAppEventResponse.json in Sources */, 60F8A82023294BFF0030D53D /* ANJAMExternalBrowserResponse.json in Sources */, @@ -2355,6 +2575,13 @@ 60F8A81D23293A900030D53D /* ANJAMTestCase.m in Sources */, 0E43003C243D057C0070BB1E /* ANLog.m in Sources */, 0E430042243D057C0070BB1E /* ANLogging+Make.m in Sources */, + 0E1C24BA242AA2FC00A70AC4 /* ANAdOMIDViewablityTestCase.m in Sources */, + 0E3FE351245999220096A978 /* ANTimeTracker.m in Sources */, + 0E3D3F4D23C600B900BCBE14 /* ANMARScalingTestCase.m in Sources */, + 0E86339623C3456800C804E9 /* ANMARTestCase.m in Sources */, + 0E336C3A24631D030033C76F /* ANAdWebViewController+ANTest.m in Sources */, + 0E6636112458BA2E008FB3FB /* AdPerformanceStatsBannerAdTestCase.m in Sources */, + 0E516FE9243E6F1500B5E744 /* ANNativeAdResponse+ANTest.m in Sources */, 0E3D3F4D23C600B900BCBE14 /* ANMARScalingTestCase.m in Sources */, 0E86339623C3456800C804E9 /* ANMARTestCase.m in Sources */, 0EEFE1FB220098C9002B5F5F /* ANMockMediationAdapterLoadAndHitOtherCallbacks.m in Sources */, @@ -2362,10 +2589,13 @@ 0EEFE1F8220098BD002B5F5F /* ANMockMediationAdapterLoadThenFail.m in Sources */, 0EEFE18D220079EE002B5F5F /* ANMockMediationAdapterSuccessfulBanner.m in Sources */, 0EEFE1B822008C14002B5F5F /* ANMockMediationAdapterTimeout.m in Sources */, + 0E66360B2458AABF008FB3FB /* AdPerformanceStatsMARAdTestCase.m in Sources */, 0E430046243D08400070BB1E /* ANMRAIDContainerView+ANTest.m in Sources */, 0EEFE1BB22008C29002B5F5F /* ANMRAIDTestResponses.m in Sources */, 0EAFC63B242E3A9A00500DC1 /* ANNativeAdOMIDViewablityTestCase.m in Sources */, 0EEFE19A22008124002B5F5F /* ANNativeAdRequest+ANTest.m in Sources */, + 0E9EBD6B24336111001A30D8 /* TestANCSRUniversalFetcher.m in Sources */, + 0E66360C2458AABF008FB3FB /* AdPerformanceStatsInterstitialAdTestCase.m in Sources */, 0EEFE195220080F0002B5F5F /* ANNativeAdRequestTestCase.m in Sources */, 0E516FE9243E6F1500B5E744 /* ANNativeAdResponse+ANTest.m in Sources */, 0E6612C422CA736300DDC5CD /* ANNativeAdView.m in Sources */, @@ -2377,6 +2607,7 @@ 0EEFE1B122008A0A002B5F5F /* ANSecondPriceDFPTestCase.m in Sources */, 0E81279C23C88D810045D788 /* ANSSMMediationAdViewController+ANTest.m in Sources */, 0E8C97D021FF32EC005D1F0E /* ANTestGlobal.m in Sources */, + 0E66360E2458AABF008FB3FB /* AdPerformanceStatsBannerVideoAdTestCase.m in Sources */, 0E8C97A621FF32EC005D1F0E /* ANTrackerManager+ANTest.m in Sources */, 0EEFE1602200715C002B5F5F /* ANTrackerManagerTestCase.m in Sources */, 0EEFE1DD22008E6D002B5F5F /* ANUniversalAdFetcher+ANTest.m in Sources */, @@ -2389,12 +2620,15 @@ 0EEFE186220075C7002B5F5F /* BasicTests.m in Sources */, 4F5BFB8123E513AD00C4AE32 /* DefaultPlacementLogic.m in Sources */, 0EC17C6021F72EC500F0F6AF /* FunctionalTests.m in Sources */, + 0E66360F2458AABF008FB3FB /* AdPerformanceStatsNativeAdTestCase.m in Sources */, 4F3D9E93238747D200B02AC6 /* MARGeneralTests.m in Sources */, 4F11628B238749A200101DC1 /* MARHelper.m in Sources */, + 0E66360A2458AABF008FB3FB /* AdPerformanceStatsVideoAdTestCase.m in Sources */, 0E3F331923D077D700CA830D /* MARPublicAPI.m in Sources */, 0E2C248A2236AE4D006038E1 /* MediationBannerAdResizeTestCase.m in Sources */, 0EEFE1AF220089FB002B5F5F /* MediationCallbacksTests.m in Sources */, 0EEFE1B522008A1B002B5F5F /* MRAIDTests.m in Sources */, + 0E336C2D2461FB000033C76F /* NoNetworkAdFailTestCase.m in Sources */, 0E8C97CA21FF32EC005D1F0E /* NSObject+Swizzling.m in Sources */, 976E5A2B23571682008A4E60 /* NSURLProtocol+WKWebViewSupport.m in Sources */, 0E8C97A921FF32EC005D1F0E /* NSURLRequest+HTTPBodyTesting.m in Sources */, @@ -2504,6 +2738,11 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = HR94J6TSB3; FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../../sdk/sourcefiles/Viewability\""; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/SharedMockFiles/StubResponse/**", + "\"$(SRCROOT)/../../sdk/sourcefiles\"/**", + ); INFOPLIST_FILE = NativeSDKTestApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.2; LD_RUNPATH_SEARCH_PATHS = ( @@ -2523,6 +2762,11 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = HR94J6TSB3; FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../../sdk/sourcefiles/Viewability\""; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/SharedMockFiles/StubResponse/**", + "\"$(SRCROOT)/../../sdk/sourcefiles\"/**", + ); INFOPLIST_FILE = NativeSDKTestApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.2; LD_RUNPATH_SEARCH_PATHS = ( @@ -2818,6 +3062,7 @@ "\"$(SRCROOT)/../../sdk/internal\"/**", "\"$(SRCROOT)/../../sdk/native/internal\"/**", "$(SRCROOT)/UnitTestApp/**", + "\"$(SRCROOT)/../../sdk/sourcefiles/internal\"", ); INFOPLIST_FILE = UnitTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -2851,6 +3096,7 @@ "\"$(SRCROOT)/../../sdk/internal\"/**", "\"$(SRCROOT)/../../sdk/native/internal\"/**", "$(SRCROOT)/UnitTestApp/**", + "\"$(SRCROOT)/../../sdk/sourcefiles/internal\"", ); INFOPLIST_FILE = UnitTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -2882,6 +3128,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../sdk/sourcefiles\"/**", + "\"$(SRCROOT)/../../sdk/sourcefiles/internal\"", ); INFOPLIST_FILE = FunctionalTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -2913,6 +3160,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../../sdk/sourcefiles\"/**", + "\"$(SRCROOT)/../../sdk/sourcefiles/internal\"", ); INFOPLIST_FILE = FunctionalTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.h b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.h index a78a02c7e..7303ab25a 100644 --- a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.h +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.h @@ -31,4 +31,5 @@ -(void)createInstreamVideoWithCreativeTag; -(void)createInstreamVideoWithVASTCreativeXML; -(NSUInteger) getAdPlayElapsedTime; +- (void) createVideoPlayer; @end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.m b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.m index ec46d71b4..91994fadc 100644 --- a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.m +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/Video/ANVideoAdPlayer+Test.m @@ -17,6 +17,10 @@ #import "ANVideoAdPlayer+Test.h" +#import "NSObject+Swizzling.h" +#import +#import +#import "ANTimeTracker.h" @implementation ANVideoAdPlayer(Test) @@ -50,6 +54,27 @@ -(NSUInteger) getAdPlayElapsedTime{ return 10; } ++ (void)load { + NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ + + [[self class] exchangeInstanceSelector:@selector(webView:didStartProvisionalNavigation:) + withSelector:@selector(test_webView:didStartProvisionalNavigation:)]; + + [[self class] exchangeInstanceSelector:@selector(webView:didFinishNavigation:) + withSelector:@selector(test_webView:didFinishNavigation:)]; + }]; + [operation start]; +} + +-(void)test_webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{ + [ANTimeTracker sharedInstance].webViewInitLoadingAt = [NSDate date]; + [self test_webView:webView didStartProvisionalNavigation:navigation]; +} + +- (void)test_webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + [ANTimeTracker sharedInstance].webViewFinishLoadingAt = [NSDate date]; + [self test_webView:webView didFinishNavigation:navigation]; +} @end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterBannerNetworkTimeout.h b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterBannerNetworkTimeout.h new file mode 100644 index 000000000..0cd02509e --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterBannerNetworkTimeout.h @@ -0,0 +1,27 @@ +/* Copyright 2020 Xandr INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + + +#if __has_include() +#import +#else +#import "ANCustomAdapter.h" +#import "ANLogging.h" +#endif + +@interface ANAdAdapterBannerNetworkTimeout : NSObject + +@end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterBannerNetworkTimeout.m b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterBannerNetworkTimeout.m new file mode 100644 index 000000000..8c7797c1a --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterBannerNetworkTimeout.m @@ -0,0 +1,37 @@ +/* Copyright 2020 Xandr INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + + +#import "ANAdAdapterBannerNetworkTimeout.h" + +@interface ANAdAdapterBannerNetworkTimeout() + +@end + +@implementation ANAdAdapterBannerNetworkTimeout + +@synthesize delegate; + +- (void)requestBannerAdWithSize:(CGSize)size + rootViewController:(nullable UIViewController *)rootViewController + serverParameter:(nullable NSString *)parameterString + adUnitId:(nullable NSString *)idString + targetingParameters:(nullable ANTargetingParameters *)targetingParameters { + // Do nothing wait for timeout + +} + +@end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterInterstitialNetworkTimeout.h b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterInterstitialNetworkTimeout.h new file mode 100644 index 000000000..133c40d19 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterInterstitialNetworkTimeout.h @@ -0,0 +1,27 @@ +/* Copyright 2020 Xandr INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + + +#if __has_include() +#import +#else +#import "ANCustomAdapter.h" +#import "ANLogging.h" +#endif + +@interface ANAdAdapterInterstitialNetworkTimeout : NSObject + +@end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterInterstitialNetworkTimeout.m b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterInterstitialNetworkTimeout.m new file mode 100644 index 000000000..3a5a9893f --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterInterstitialNetworkTimeout.m @@ -0,0 +1,35 @@ +/* Copyright 2020 Xandr INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + + +#import "ANAdAdapterInterstitialNetworkTimeout.h" + +@interface ANAdAdapterInterstitialNetworkTimeout () + + +@end + +@implementation ANAdAdapterInterstitialNetworkTimeout + +@synthesize delegate; + +- (void)requestInterstitialAdWithParameter:(nullable NSString *)parameterString + adUnitId:(nullable NSString *)idString + targetingParameters:(nullable ANTargetingParameters *)targetingParameters { +// Do nothing wait for timeout +} + +@end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterNativeNetworkTimeout.h b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterNativeNetworkTimeout.h new file mode 100644 index 000000000..d0f1d22f3 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterNativeNetworkTimeout.h @@ -0,0 +1,31 @@ +/* Copyright 2020 Xandr INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + + +#if __has_include() +#import +#elif __has_include() +#import +#else +#import "ANNativeCustomAdapter.h" +#import "ANLogging.h" +#import "ANNativeAdResponse.h" +#endif + + +@interface ANAdAdapterNativeNetworkTimeout : NSObject + +@end diff --git a/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterNativeNetworkTimeout.m b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterNativeNetworkTimeout.m new file mode 100644 index 000000000..51e3293d0 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/FunctionalMockFiles/mediation/NetworkTimeout/ANAdAdapterNativeNetworkTimeout.m @@ -0,0 +1,37 @@ +/* Copyright 2020 Xandr INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + + +#import "ANAdAdapterNativeNetworkTimeout.h" + +@implementation ANAdAdapterNativeNetworkTimeout + +@synthesize requestDelegate = _requestDelegate; +@synthesize nativeAdDelegate = _nativeAdDelegate; +@synthesize expired = _expired; + +#pragma mark ANNativeCustomAdapter + +- (void)requestNativeAdWithServerParameter:(nullable NSString *)parameterString + adUnitId:(nullable NSString *)adUnitId + targetingParameters:(nullable ANTargetingParameters *)targetingParameters { + + // Do nothing wait for timeout +} + + + +@end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdFetcherBase+ANTest.h b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdFetcherBase+ANTest.h new file mode 100644 index 000000000..6b9540175 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdFetcherBase+ANTest.h @@ -0,0 +1,21 @@ +/* Copyright 2014 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import "ANAdFetcherBase.h" + +@interface ANAdFetcherBase (ANTest) + + +@end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdFetcherBase+ANTest.m b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdFetcherBase+ANTest.m new file mode 100644 index 000000000..720e73eb9 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdFetcherBase+ANTest.m @@ -0,0 +1,56 @@ +/* Copyright 2014 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import +#import "ANTimeTracker.h" +#import "ANAdFetcherBase+ANTest.h" +#import "NSObject+Swizzling.h" +#import +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wincomplete-implementation" +@implementation ANAdFetcherBase (ANTest) +#pragma clang diagnostic pop + + + ++ (void)load { + NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ + + [[self class] exchangeInstanceSelector:@selector(requestAd) + withSelector:@selector(test_requestAd)]; + [[self class] exchangeInstanceSelector:@selector(handleAdServerResponse:) + withSelector:@selector(test_handleAdServerResponse:)]; + + + +// [[self class] exchangeInstanceSelector:@selector(webView:didFinishNavigation:) +// withSelector:@selector(test_webView:didFinishNavigation:)]; + }]; + [operation start]; +} + + + +-(void)test_requestAd{ + [ANTimeTracker sharedInstance].networkAdRequestInit = [NSDate date]; + [self test_requestAd]; +} + +- (void)test_handleAdServerResponse:(NSData *)data{ + [ANTimeTracker sharedInstance].networkAdRequestComplete = [NSDate date]; + [self test_handleAdServerResponse:data]; + +} +@end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdView+ANTest.h b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdView+ANTest.h index 362f5c2a8..2da27ec5d 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdView+ANTest.h +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdView+ANTest.h @@ -30,7 +30,7 @@ static NSString * _Nonnull const kANAdViewAdFailedToDisplayNotification @interface ANAdView (ANTest) -@property (nonatomic, readwrite, weak) id appEventDelegate; +@property (nonatomic, readwrite, weak, nullable) id appEventDelegate; @end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdWebViewController+ANTest.m b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdWebViewController+ANTest.m index f61a87530..e88201698 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdWebViewController+ANTest.m +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANAdWebViewController+ANTest.m @@ -14,9 +14,38 @@ */ #import "ANAdWebViewController+ANTest.h" +#import "NSObject+Swizzling.h" +#import +#import +#import "ANTimeTracker.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wincomplete-implementation" @implementation ANAdWebViewController (ANTest) @dynamic completedFirstLoad, lastKnownVisibleRect, lastKnownExposedPercentage; ++ (void)load { + NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ + [[self class] exchangeInstanceSelector:@selector(initWithConfiguration:) + withSelector:@selector(test_initWithConfiguration:)]; + [[self class] exchangeInstanceSelector:@selector(webView:didFinishNavigation:) + withSelector:@selector(test_webView:didFinishNavigation:)]; + }]; + [operation start]; +} + + +- (ANAdWebViewControllerConfiguration *)test_initWithConfiguration:(ANAdWebViewControllerConfiguration *)configuration{ + ANAdWebViewControllerConfiguration *wkwebConfiguration = [self test_initWithConfiguration:configuration]; + [ANTimeTracker sharedInstance].webViewInitLoadingAt = [NSDate date]; + return wkwebConfiguration; + +} + +- (void)test_webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + [ANTimeTracker sharedInstance].webViewFinishLoadingAt = [NSDate date]; + [self test_webView:webView didFinishNavigation:navigation]; +} + @end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANGlobal+ANTest.h b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANGlobal+ANTest.h new file mode 100644 index 000000000..be1a71a51 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANGlobal+ANTest.h @@ -0,0 +1,26 @@ +/* Copyright 2020 APPNEXUS INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#import "ANGlobal.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ANGlobal (ANTest) + ++ (void) constructAdServerRequestURL; + +@end + +NS_ASSUME_NONNULL_END diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANHTTPNetworkSession+ANTest.h b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANHTTPNetworkSession+ANTest.h new file mode 100644 index 000000000..812dbe7a3 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANHTTPNetworkSession+ANTest.h @@ -0,0 +1,26 @@ +/* Copyright 2020 APPNEXUS INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#import "ANHTTPNetworkSession.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ANHTTPNetworkSession (ANTest) + +@property (nonatomic, strong) NSURLSession * adServerSession; + +@end + +NS_ASSUME_NONNULL_END diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.h b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.h index 3380f8af1..4b3e69aa5 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.h +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.h @@ -20,9 +20,10 @@ - @interface ANMRAIDContainerView (ANTest) @property (nonatomic, readwrite, strong) ANAdWebViewController *webViewController; ++ (void)swizzleMRAIDContainerView:(BOOL)swizzleForward; + @end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.m b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.m index 778201a07..17b4c8c32 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.m +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANMRAIDContainerView+ANTest.m @@ -16,8 +16,21 @@ #import "ANMRAIDContainerView+ANTest.h" #import "ANOMIDImplementation.h" +#import "NSObject+Swizzling.h" +#import + + + + +#pragma mark - Globals. + static CGFloat const kANOMIDSessionFinishDelay = 3.0f; + + + +#pragma mark - + @implementation ANMRAIDContainerView (ANTest) -(void) willMoveToSuperview:(UIView *)newSuperview { @@ -38,4 +51,55 @@ -(void) willMoveToSuperview:(UIView *)newSuperview { } } + + +#pragma mark - Swizzle methods. + ++ (void)swizzleMRAIDContainerView:(BOOL)swizzleForward +{ + NSBlockOperation *operation = nil; + + if (swizzleForward) + { + operation = [NSBlockOperation blockOperationWithBlock: + ^{ + [[self class] exchangeInstanceSelector: @selector(initWithSize:HTML:webViewBaseURL:) + withSelector: @selector(test_initWithSize:HTML:webViewBaseURL:) ]; + + [[self class] exchangeInstanceSelector: @selector(initWithSize:videoXML:) + withSelector: @selector(test_initWithSize:videoXML:) ]; + }]; + + } else { + operation = [NSBlockOperation blockOperationWithBlock: + ^{ + [[self class] exchangeInstanceSelector: @selector(test_initWithSize:HTML:webViewBaseURL:) + withSelector: @selector(initWithSize:HTML:webViewBaseURL:) ]; + + [[self class] exchangeInstanceSelector: @selector(test_initWithSize:videoXML:) + withSelector: @selector(initWithSize:videoXML:) ]; + }]; + } + + // + [operation start]; +} + + +- (instancetype)test_initWithSize: (CGSize)size + HTML: (NSString *)html + webViewBaseURL: (NSURL *)baseURL +{ + NSLog(@"%s -- RETURNING nil.", __PRETTY_FUNCTION__); + return nil; +} + +- (instancetype)test_initWithSize: (CGSize)size + videoXML: (NSString *)videoXML +{ + NSLog(@"%s -- RETURNING nil.", __PRETTY_FUNCTION__); + return nil; +} + + @end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANNativeRenderingViewController+ANTest.h b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANNativeRenderingViewController+ANTest.h new file mode 100644 index 000000000..4f885cc13 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANNativeRenderingViewController+ANTest.h @@ -0,0 +1,20 @@ +/* Copyright 2014 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import "ANNativeRenderingViewController.h" + +@interface ANNativeRenderingViewController (ANTest) + +@end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANNativeRenderingViewController+ANTest.m b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANNativeRenderingViewController+ANTest.m new file mode 100644 index 000000000..ac8015357 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Categories/ANNativeRenderingViewController+ANTest.m @@ -0,0 +1,48 @@ +/* Copyright 2014 APPNEXUS INC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#import "ANNativeRenderingViewController+ANTest.h" +#import "NSObject+Swizzling.h" +#import +#import +#import "ANTimeTracker.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wincomplete-implementation" + +@implementation ANNativeRenderingViewController (ANTest) + ++ (void)load { + NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ + [[self class] exchangeInstanceSelector:@selector(initWithSize:BaseObject:) + withSelector:@selector(test_initWithSize:BaseObject:)]; + [[self class] exchangeInstanceSelector:@selector(webView:didFinishNavigation:) + withSelector:@selector(test_webView:didFinishNavigation:)]; + }]; + [operation start]; +} + +- (instancetype)test_initWithSize:(CGSize)size BaseObject:(id)baseObject{ + ANNativeRenderingViewController *wkwebConfiguration = [self test_initWithSize:size BaseObject:baseObject]; + [ANTimeTracker sharedInstance].webViewInitLoadingAt = [NSDate date]; + return wkwebConfiguration; +} + + +- (void)test_webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + [ANTimeTracker sharedInstance].webViewFinishLoadingAt = [NSDate date]; + [self test_webView:webView didFinishNavigation:navigation]; +} + +@end diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/MockMediationAdapters/ANMRAIDTestResponses.m b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/MockMediationAdapters/ANMRAIDTestResponses.m index e18fc59e3..d44965b91 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/MockMediationAdapters/ANMRAIDTestResponses.m +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/MockMediationAdapters/ANMRAIDTestResponses.m @@ -35,7 +35,7 @@ + (NSString *)basicMRAIDInterstitialWithSelectorName:(NSString *)selector + (NSString *)MRAIDListenerBannerWithSelectorName:(NSString *)selector { - return [self createResponseForBannerMediaTypeWithContent: [NSString stringWithFormat:@"", selector ] + return [self createResponseForBannerMediaTypeWithContent: [NSString stringWithFormat:@"", selector ] width:320 height:50 ]; } diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/PerformanceStatsStub/PerformanceStatsRTBBannerNativeRendererAd.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/PerformanceStatsStub/PerformanceStatsRTBBannerNativeRendererAd.json new file mode 100644 index 000000000..c36244b21 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/PerformanceStatsStub/PerformanceStatsRTBBannerNativeRendererAd.json @@ -0,0 +1,60 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 15740033, + "auction_id": "3579836792830527402", + "nobid": false, + "no_ad_url": "https://sin1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKtCKAtBAAAAwDWAAUBCIG7rucFEKqPprSK04jXMRi1zICs5JfXxSYqNgkAAAkCABEJBywAABkAAABA4XqEPyEREgApEQkAMREb8JowgdnABzjuTkDuTkgAUABYzrNsYABopJOGAXgAgAEBigEAkgEDVVNEmAEBoAEBqAEBsAEAuAEBwAEAyAEC0AEA2AEA4AEA8AEAigJZdWYoJ2EnLCAzMDM4MzE0LCAxNTU4OTQ1MTUzKTt1ZignaScsIDEwMDg3NzgsIDE1NTg5NDUxNTMpO3VmKCdyJywgMTU0NDg1ODA3LCAxNRk88JqSApECIXJ6N1J3UWlIaS1FTkVLLUkxVWtZQUNET3Myd3dBRGdBUUFSSTdrNVFnZG5BQjFnQVlLVUZhQUJ3QUhnQWdBRUFpQUVBa0FFQm1BRUJvQUVCcUFFRHNBRUF1UUdSN3dydzRYcUVQOEVCa2U4SzhPRjZoRF9KQVNSRzBvREZWUUJBMlFFQUFBQUFBQUR3UC1BQmlzazk5UQkULG1BSUFvQUlBdFFJQQEBAHYNCJh3QUlBeUFJQTBBSUEyQUlBNEFJQTZBSUEtQUlBZ0FNQm1BTUJxQU8F1Oh1Z01KVTBsT01Ub3pOVGMxNEFQTURJQUU4OERrQVlnRTljRGtBWkFFQUpnRUFRLi6aAmEhT0JDSDVnaQVAMRRAenJOc0lBUW9BREY3Rks1SDQB2AR6bzJcABRRTXdNU1EBqhhBQUFQQV9VEQwMQUFBVx0M9DQB2AIA4ALKqE3qAjRpdHVuZXMuYXBwbGUuY29tL3VzL2FwcC9hcHBuZXh1cy1zZGstYXBwL2lkNzM2ODY5ODMzgAMAiAMBkAMAmAMXoAMBqgMAwAOsAsgDANIDKAgAEiQ1MzYzOTYzYi02MWVhLTRiZmUtYjczMS05ZGE1MGFhNTJhYmPSAygIChIkZWY1NDA0ZTQtM2NmOS00YzNiLTkzNTAtYjRhOWE5YzA0YjU12AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAsxMC4xNC4xMi40NagEhOYisgQQCAAQARisAiD6ASgAMAA4ArgEAMAEAMgEANIEDzEwMDk0I1NJTjE6MzU3NdoEAggA4AQB8ASviNVJ-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2CfwgiAUBmAUAoAX_EQEYAcAFAMkFAAUBFPA_0gUJCQULdAAAANgFAeAFAfAFAfoFBAgAEACQBgGYBgC4BgDBBgEfLAAA8L_IBgDaBhYKEAkQGQFEEAAYAOAGDPIGAggAgAcBiAcA&s=6f2fa33f3b83d94aacc2346e5345dead47934579", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "ads": [ + { + "content_source": "rtb", + "ad_type": "native", + "buyer_member_id": 10094, + "creative_id": 154485807, + "media_type_id": 12, + "media_subtype_id": 65, + "brand_category_id": 0, + "renderer_url": "https://dcdn.adnxs.com/renderer-content/b6da3b80-39c5-43f0-a37d-bbfa6a348aed", + "renderer_id": 258, + "client_initiated_ad_counting": true, + "viewability": { + "config": "" + }, + "rtb": { + "native": { + "title": "Native Renderer Campaign", + "desc": "Native Renderer Campaign", + "sponsored": "Abhishek Sharma", + "ctatext": "NativeRendererCampaign", + "icon": { + "url": "https://vcdn.adnxs.com/p/creative-image/73/0d/53/85/730d5385-8952-4f74-9700-693fe2f17da0.png", + "width": 868, + "height": 996, + "prevent_crop": false + }, + "main_img": { + "url": "https://vcdn.adnxs.com/p/creative-image/66/91/f0/ab/6691f0ab-d2a3-47c8-a1fb-dfdac2a80cc2.png", + "width": 868, + "height": 996, + "prevent_crop": false + }, + "link": { + "url": "https://appnexus.com", + "click_trackers": [ + "https://sin1-mobile.adnxs.com/click?exSuR-F6hD97FK5H4XqEPwAAAEDheoQ_exSuR-F6hD97FK5H4XqEP6qHiaaYIq4xNSaARb5ciyaBnetcAAAAAIEs8ABuJwAAbicAAAIAAAAvRDUJzhkbAAAAAABVU0QAVVNEAAEAAQCkiQAAAAABAQQCAAAAAMIAfSJ4VQAAAAA./cpcpm=AAAAAAAAAAA=/bcr=AAAAAAAA8D8=/cnd=%21OBCH5giHi-ENEK-I1UkYzrNsIAQoADF7FK5H4XqEPzoJU0lOMTozNTc1QMwMSQAAAAAAAPA_UQAAAAAAAAAAWQAAAAAAAAAA/cca=MTAwOTQjU0lOMTozNTc1/bn=86603/" + ] + }, + "impression_trackers": [ + "https://sin1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QK2CPA8NgQAAAMA1gAFAQiBu67nBRCqj6a0itOI1zEYtcyArOSX18UmKjYJexSuR-F6hD8RexSuR-F6hD8ZAAAAQAESACERGwApEQkAMREbqDCB2cAHOO5OQO5OSAJQr4jVSVjOs2xgAGikk4YBeMukBYABAYoBA1VTRJIFBvBPmAEBoAEBqAEBsAEAuAEBwAEEyAEC0AEA2AEA4AEA8AEAigJZdWYoJ2EnLCAzMDM4MzE0LCAxNTU4OTQ1MTUzKTt1ZignaScsIDEwMDg3NzhGHQAEcicBFBg0NDg1ODA3AQsZPPCakgKRAiFyejdSd1FpSGktRU5FSy1JMVVrWUFDRE9zMnd3QURnQVFBUkk3azVRZ2RuQUIxZ0FZS1VGYUFCd0FIZ0FnQUVBaUFFQWtBRUJtQUVCb0FFQnFBRURzQUVBdVFHUjd3cnc0WHFFUDhFQmtlOEs4T0Y2aERfSkFTUkcwb0RGVlFCQTJRRUFBQUFBQUFEd1AtQUJpc2s5OVEJFCxtQUlBb0FJQXRRSUEBAQB2DQiYd0FJQXlBSUEwQUlBMkFJQTRBSUE2QUlBLUFJQWdBTUJtQU1CcUFPBdTodWdNSlUwbE9NVG96TlRjMTRBUE1ESUFFODhEa0FZZ0U5Y0RrQVpBRUFKZ0VBUS4umgJhIU9CQ0g1Z2kFQDEUQHpyTnNJQVFvQURGN0ZLNUg0AdgEem8yXAAUUU13TVNRAaoYQUFBUEFfVREMDEFBQVcdDPReAdgCAOACyqhN6gI0aXR1bmVzLmFwcGxlLmNvbS91cy9hcHAvYXBwbmV4dXMtc2RrLWFwcC9pZDczNjg2OTgzM4ADAIgDAZADAJgDF6ADAaoDAMAD4KgByAMA0gMoCAASJDUzNjM5NjNiLTYxZWEtNGJmZS1iNzMxLTlkYTUwYWE1MmFiY9IDKAgKEiRlZjU0MDRlNC0zY2Y5LTRjM2ItOTM1MC1iNGE5YTljMDRiNTXYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIECzEwLjE0LjEyLjQ1qASE5iKyBBAIABABGKwCIPoBKAAwADgCuAQAwAQAyAQA0gQPMTAwOTQjU0lOMTozNTc12gQCCAHgBAHwBK-I1Un6BBIJAAAAQJbkQkARAAAAwAKaXsCCBQk3MzY4Njk4MzOIBQGYBQCgBf___________wHABQDJBQAAAAAAAPA_0gUJCQULdAAAANgFAeAFAfAFAfoFBAgAEACQBgGYBgC4BgDBBgEfLAAA8D_IBgDaBhYKEAkQGQFEEAAYAOAGDPIGAggAgAcBiAcA&s=91d3af1f75b86ccc77cdf065374aa86b1385b11f" + ], + "id": 154485807 + } + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/ANJAMCustomKeywordsResponse.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/ANJAMCustomKeywordsResponse.json new file mode 100644 index 000000000..983379c6f --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/ANJAMCustomKeywordsResponse.json @@ -0,0 +1,43 @@ +{ + "version": "0.0.1", + + "tags": [ + { + "tag_id": 0, + "auction_id": "1234567890", + "nobid": false, + "no_ad_url": "MOCK__no_ad_url", + "timeout_ms": 10000, + "ad_profile_id": 10000, + + "ads": [ + { + "content_source": "rtb", + "ad_type": "banner", + "buyer_member_id": 444433322, + "creative_id": 108, + "media_type_id": 1, + "media_subtype_id": 1, + "client_initiated_ad_counting": true, + + "rtb": { + "banner": { + "content": "", + "width": 320, + "height": 50 + }, + + "trackers": [ + { + "impression_urls": [ + "MOCK__impression_urls" + ], + "video_events": {} + } + ] + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_Basic.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_Basic.json new file mode 100644 index 000000000..ea4072224 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_Basic.json @@ -0,0 +1,34 @@ +{ + "version": "3.0.0", + "tags": [{ + "uuid": "B2D01404-08E0-45D2-B0F4-8C50BAF0CECC", + "tag_id": 19065996, + "auction_id": "2005466846794945526", + "nobid": false, + "no_ad_url": "https://nym1-ib.adnxs.com/it?an_audit=0&e=wqT_3QLdCKBdBAAAAwDWAAUBCIO_xvYFEPanpKCMr7bqGxiO462vluGBz1QqNgkAAAkCABEJBywAABkAAADgUbiuPyEREgApEQkAMREb8IYwjNmLCTjuTkDuTkgAUABYzrNsYABopJOGAXgAgAEBigEAkgEDVVNEmAGsAqAB-gGoAQGwAQC4AQHAAQDIAQLQAQDYAQDgAQDwAQCKAll1ZignYScsIDMwMzgzMTQsIDE1OTA3OTYxNjMpO3VmKCdpJywgNDI1NDc4NywgMTU5MDc5NjE2MykFHTByJywgMTQyODc3MjY3Nh8A8J-SApUDIVoweS1LZ2lrOTZzVEVOUEVrRVFZQUNET3Myd3dBRGdBUUFSSTdrNVFqTm1MQ1ZnQVlOWUJhQUJ3SUhqQ0ZJQUJfQUdJQVFDUUFRQ1lBUUNnQVFHb0FRT3dBUUM1QVhXckRXeWFtYWtfd1FGMXF3MXNtcG1wUDhrQlhxdklmMUNFMVRfWkFRQUFBQUFBQVBBXzRBSEQySU1DOVFFBRQobUFJQW9BSUF0UUkFEAB2DQjwRjBBTG9BZGdDQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEcFBlckU3b0RDVTVaVFRJNk5EazBNdUFEdUNHQUJOR0k0d09JQk5xAQgkUUJBQ1lCQUhCQgViCQEIeVFRCQkBARhOZ0VBUEVFAQsJASBDSUJjNG1xUVUJDxhBRHdQN0VGDQ0UQUFBREJCHT8AeRUoDEFBQU4yKAAAWi4oAEg0QVdJSncuLpoCiQEhUWhQOVF3NpkBNHpyTnNJQVFvQURHYW1aBQJUcFB6b0pUbGxOTWpvME9UUXlRTGdoUxF9DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQzwwmVBQS7YAgDgAsqoTYADAIgDAZADAJgDF6ADAaoDAMADrALIAwDYAwDgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xNC4yMTmoBMWFBLIEDggAEAEYrAIg-gEwADgCuAQAwAQAyAQA0gQPMTAwOTQjTllNMjo0OTQy2gQCCADgBAHwBNPEkESCBQ9BTi5TaW1wbGVCYW5uZXKIBQGYBQCgBf___________wHABQDJBQAAAAAAAPA_0gUJCQkMcAAA2AUB4AUB8AUB-gUECAAQAJAGAJgGALgGAMEGCSMo8L_QBtYz2gYWChAJERkBbBAAGADgBgHyBgIIAIAHAYgHAKAHAcgHANIHDQkRJjAQABgA2gcGCAAQABgA&s=a3abb962403f68e547f146d036e73154e9b78879", + "timeout_ms": 800, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [{ + "content_source": "rtb", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 142877267, + "media_type_id": 1, + "media_subtype_id": 1, + "brand_category_id": 0, + "client_initiated_ad_counting": true, + "rtb": { + "banner": { + "content": "
", + "width": 300, + "height": 250 + }, + "trackers": [{ + "impression_urls": ["https://nym1-ib.adnxs.com/it?an_audit=0&e=wqT_3QLlCMBlBAAAAwDWAAUBCIO_xvYFEPanpKCMr7bqGxiO462vluGBz1QqNgmamZmZmZmpPxGaAQgwmak_GQAAAOBRuK4_IREbACkRCQAxERuoMIzZiwk47k5A7k5IAlDTxJBEWM6zbGAAaKSThgF4zu0CgAEBigEDVVNEkgUG8FWYAawCoAH6AagBAbABALgBAcABBMgBAtABANgBAOABAPABAIoCWXVmKCdhJywgMzAzODMxNCwgMTU5MDc5NjE2Myk7dWYoJ2knLCA0MjU0Nzg3LCAxNTYdADByJywgMTQyODc3MjY3NjwA8J-SApUDIVoweS1LZ2lrOTZzVEVOUEVrRVFZQUNET3Myd3dBRGdBUUFSSTdrNVFqTm1MQ1ZnQVlOWUJhQUJ3SUhqQ0ZJQUJfQUdJQVFDUUFRQ1lBUUNnQVFHb0FRT3dBUUM1QVhXckRXeWFtYWtfd1FGMXF3MXNtcG1wUDhrQlhxdklmMUNFMVRfWkFRQUFBQUFBQVBBXzRBSEQySU1DOVFFBRQobUFJQW9BSUF0UUkFEAB2DQjwRjBBTG9BZGdDQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEcFBlckU3b0RDVTVaVFRJNk5EazBNdUFEdUNHQUJOR0k0d09JQk5xAQgkUUJBQ1lCQUhCQgViCQEIeVFRCQkBARhOZ0VBUEVFAQsJASBDSUJjNG1xUVUJDxhBRHdQN0VGDQ0UQUFBREJCHT8AeRUoDEFBQU4yKAAAWi4oAEg0QVdJSncuLpoCiQEhUWhQOVF3NpkBNHpyTnNJQVFvQURHYW1aBQJUcFB6b0pUbGxOTWpvME9UUXlRTGdoUxF9DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQzwwmVBQS7YAgDgAsqoTYADAIgDAZADAJgDF6ADAaoDAMADrALIAwDYAwDgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xNC4yMTmoBMWFBLIEDggAEAEYrAIg-gEwADgCuAQAwAQAyAQA0gQPMTAwOTQjTllNMjo0OTQy2gQCCAHgBAHwBNPEkESCBQ9BTi5TaW1wbGVCYW5uZXKIBQGYBQCgBf___________wHABQDJBQAAAAAAAPA_0gUJCQkMcAAA2AUB4AUB8AUB-gUECAAQAJAGAJgGALgGAMEGCSMo8D_QBtYz2gYWChAJERkBbBAAGADgBgHyBgIIAIAHAYgHAKAHAcgHANIHDQkRJjAQABgA2gcGCAAQABgA&s=81444d9fb1703152353f717b0b6c1e4d18c7af09"], + "video_events": {} + }] + } + }] + }] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_MRAID.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_MRAID.json new file mode 100644 index 000000000..076698d41 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_MRAID.json @@ -0,0 +1,34 @@ +{ + "version": "3.0.0", + "tags": [{ + "uuid": "9DD9425D-09A1-4C6A-814C-C6D2265512AC", + "tag_id": 10002000, + "auction_id": "6739505924009742180", + "nobid": false, + "no_ad_url": "https://nym1-ib.adnxs.com/it?an_audit=0&e=wqT_3QLdCKBdBAAAAwDWAAUBCNG9xvYFEOSe95HjneLDXRiO462vluGBz1QqNgkAAAkCABEJBywAABkAAADgUbiuPyEREgApEQkAMREb8IYwjNmLCTjuTkDuTkgAUABYzrNsYABopJOGAXgAgAEBigEAkgEDVVNEmAGsAqAB-gGoAQGwAQC4AQHAAQDIAQLQAQDYAQDgAQDwAQCKAll1ZignYScsIDMwMzgzMTQsIDE1OTA3OTU5ODUpO3VmKCdpJywgNDI1NDc4NywgMTU5MDc5NTk4NSkFHTByJywgMTYzMDUxOTUwNh8A8LCSApUDIXdVemIwQWlrOTZzVEVLN3ozMDBZQUNET3Myd3dBRGdBUUFSSTdrNVFqTm1MQ1ZnQVlOWUJhQUJ3R25qY0xJQUI5QUdJQWJ3VWtBRUFtQUVBb0FFQnFBRURzQUVBdVFGMXF3MXNtcG1wUDhFQmRhc05iSnFacVRfSkFUWVVTNm9URTlJXzJRRUFBQUFBQUFEd1AtQUJ3OWlEQXZVQkFBQUFBSmdDQUtBQ0FMVUMFJQhMMEMFCIhOQUM0QUhZQXBvczRBSUE2QUlBLUFJQWdBTUJtQU1CcUFPawHUwHVnTUpUbGxOTWpvME9UUTI0QU80SVlBRTBZampBNGdFMm9qakE1QUVBSmdFQWNFRUEFXQEBBERKCYEJARgyQVFBOFFRCQ0BARxJZ0YwaWFwQhETFFBBX3NRVQEaCQEITUVGCQkBAQREShUoDEFBQTAuKAAETmsuKAA8Z0JZZ26aAokBIXFCUGJaZzaZATR6ck5zSUFRb0FER2FtWgUCDHBQem8y4QAQUUxnaFMdlQBVEQwMQUFBVx0MAFkdDABhHQwAYx0M8LZlQUEu2AIA4ALKqE2AAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMA2AMA4AMA6AMC-AMAgAQAkgQGL3V0L3YzmAQAogQMMTAuNzUuMTQuMjE5qATChQSyBA4IABABGKwCIPoBMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDk0NtoEAggA4AQB8ASu899NggUPQU4uU2ltcGxlQmFubmVyiAUBmAUAoAX___________8BwAUAyQVpkRTwP9IFCQkJDHAAANgFAeAFAfAFAfoFBAgAEACQBgCYBgC4BgDBBgkjKPC_0AbWM9oGFgoQCREZAWgQABgA4AYB8gYCCACABwGIBwCgBwHIBwDSBw0VYDAQABgA2gcGCAAQABgA&s=fa34a83371144ebd9a64320953451f1247a3145b", + "timeout_ms": 800, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [{ + "content_source": "rtb", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 163051950, + "media_type_id": 1, + "media_subtype_id": 1, + "brand_category_id": 0, + "client_initiated_ad_counting": true, + "rtb": { + "banner": { + "content": "
", + "width": 300, + "height": 250 + }, + "trackers": [{ + "impression_urls": ["https://nym1-ib.adnxs.com/it?an_audit=0&e=wqT_3QLlCMBlBAAAAwDWAAUBCNG9xvYFEOSe95HjneLDXRiO462vluGBz1QqNgmamZmZmZmpPxGaAQgwmak_GQAAAOBRuK4_IREbACkRCQAxERuoMIzZiwk47k5A7k5IAlCu899NWM6zbGAAaKSThgF4rO0CgAEBigEDVVNEkgUG8FWYAawCoAH6AagBAbABALgBAcABBMgBAtABANgBAOABAPABAIoCWXVmKCdhJywgMzAzODMxNCwgMTU5MDc5NTk4NSk7dWYoJ2knLCA0MjU0Nzg3LCAxNTYdADByJywgMTYzMDUxOTUwNjwA8LCSApUDIXdVemIwQWlrOTZzVEVLN3ozMDBZQUNET3Myd3dBRGdBUUFSSTdrNVFqTm1MQ1ZnQVlOWUJhQUJ3R25qY0xJQUI5QUdJQWJ3VWtBRUFtQUVBb0FFQnFBRURzQUVBdVFGMXF3MXNtcG1wUDhFQmRhc05iSnFacVRfSkFUWVVTNm9URTlJXzJRRUFBQUFBQUFEd1AtQUJ3OWlEQXZVQkFBQUFBSmdDQUtBQ0FMVUMFJQhMMEMFCIhOQUM0QUhZQXBvczRBSUE2QUlBLUFJQWdBTUJtQU1CcUFPawHUwHVnTUpUbGxOTWpvME9UUTI0QU80SVlBRTBZampBNGdFMm9qakE1QUVBSmdFQWNFRUEFXQEBBERKCYEJARgyQVFBOFFRCQ0BARxJZ0YwaWFwQhETFFBBX3NRVQEaCQEITUVGCQkBAQREShUoDEFBQTAuKAAETmsuKAA8Z0JZZ26aAokBIXFCUGJaZzaZATR6ck5zSUFRb0FER2FtWgUCDHBQem8y4QAQUUxnaFMdlQBVEQwMQUFBVx0MAFkdDABhHQwAYx0M8MJlQUEu2AIA4ALKqE2AAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMA2AMA4AMA6AMC-AMAgAQAkgQGL3V0L3YzmAQAogQMMTAuNzUuMTQuMjE5qATChQSyBA4IABABGKwCIPoBMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDk0NtoEAggB4AQB8ASu899NggUPQU4uU2ltcGxlQmFubmVyiAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkJDHAAANgFAeAFAfAFAfoFBAgAEACQBgCYBgC4BgDBBgkjKPA_0AbWM9oGFgoQCREZAWwQABgA4AYB8gYCCACABwGIBwCgBwHIBwDSBw0JESYwEAAYANoHBggAEAAYAA..&s=e64e6e2cdc9d97a4398dae1368614e4ca79e826c"], + "video_events": {} + }] + } + }] + }] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_nobid.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_nobid.json new file mode 100644 index 000000000..07aca81d8 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/LazyWebview_nobid.json @@ -0,0 +1,11 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18132994, + "auction_id": "8071407390407296010", + "nobid": true, + "ad_profile_id": 1266762 + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulDisabledBannerEnableNative.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulDisabledBannerEnableNative.json new file mode 100644 index 000000000..40ad79dec --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulDisabledBannerEnableNative.json @@ -0,0 +1,58 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 19213468, + "auction_id": "1853737175188688253", + "nobid": false, + "no_ad_url": "https://nym1-ib.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKLCaCLBAAAAwDWAAUBCPOK7PUFEP2au9C6hPPcGRj_5I7-ruzA_3cqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwhuA_MJzZlAk47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBAaABAagBAbABALgBAcABAMgBAtABANgBAOABAPABAIoCWXVmKCdhJywgMzAzODMxNCwgMTU4OTMxNDkzMSk7dWYoJ2knLCA0MzIyNDg5LCAxNTg5MzE0OTMxKQUdBHInARQYNDQ4NTgwNwELGR_0FwGSAokDIU5VcVVfZ2l5dzg0VEVLLUkxVWtZQUNET3Myd3dBRGdBUUFSSTdrNVFuTm1VQ1ZnQVlNY0dhQUJ3QUhnQWdBRUFpQUVBa0FFQW1BRUFvQUVCcUFFRHNBRUF1UUdSN3dydzRYcUVQOEVCa2U4SzhPRjZoRF9KQVluc2tGR3V6d0JBMlFFQUFBQUFBQUR3UC1BQnVlbUhBdlVCQUFBQUFKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHNzUE9FN29EQ1U1WlRUSTZORE0yTi1BRG9pQ0FCT0xVOEFPSUJPWFU4QU9RQkFDWUJBSEJCQUFBQUFBQUFBQUF5UVFBQUFBCRIUTmdFQVBFEZ0sQUFBQ0lCWThpcVFVAQ0JsAg3RUYBCgkBDERCQlEJCgEBAHkVKAxBQUFOMigAAFouKABINEFYb0J3Li6aAokBIU5oTGU4dzaNAUB6ck5zSUFRb0FERjdGSzVINCFRTHpvSlRsbE5Nam8wTXpZM1FLSWdTEX0MUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPDeZUFBLtgCAOACyqhN6gI0aXR1bmVzLmFwcGxlLmNvbS91cy9hcHAvYXBwbmV4dXMtc2RrLWFwcC9pZDczNjg2OTgzM4ADAIgDAZADAJgDF6ADAaoDAMAD4KgByAMA2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAsxMC43NS4xMC4zMagEALIEDQgAEAEYwAIgMjAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQzNjfaBAIIAOAEAfAEr4jVSfoEEgkAAABAluRCQBEAAADAAppewIIFCTczNgmiIIgFAZgFAKAF_xEBFAHABQDJBWm_FPA_0gUJCQkMcAAA2AUB4AUB8AUB-gUECAAQAJAGAZgGALgGAMEGCSMo8L_QBtYz2gYWChAJERkBnBAAGADgBgzyBgIIAIAHAYgHAKAHQcgHANIHDQkAAAAAAAAAABAAGAA.&s=926fa40ee42bdf08f81017805fb30927fe571d48", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "rtb", + "ad_type": "native", + "buyer_member_id": 10094, + "creative_id": 154485807, + "media_type_id": 12, + "media_subtype_id": 65, + "brand_category_id": 0, + "client_initiated_ad_counting": true, + "viewability": { + "config": "" + }, + "rtb": { + "native": { + "title": "Native Renderer Campaign", + "desc": "Native Renderer Campaign", + "sponsored": "Abhishek Sharma", + "icon": { + "url": "https://vcdn.adnxs.com/p/creative-image/73/0d/53/85/730d5385-8952-4f74-9700-693fe2f17da0.png", + "width": 868, + "height": 996, + "prevent_crop": false + }, + "main_img": { + "url": "https://vcdn.adnxs.com/p/creative-image/66/91/f0/ab/6691f0ab-d2a3-47c8-a1fb-dfdac2a80cc2.png", + "width": 868, + "height": 996, + "prevent_crop": false + }, + "link": { + "url": "https://appnexus.com", + "click_trackers": [ + "https://nym1-ib.adnxs.com/click?exSuR-F6hD97FK5H4XqEPwAAAAAAAOA_exSuR-F6hD97FK5H4XqEP33NDqojzLkZf7LD72ID_3dzBbteAAAAAJwsJQFuJwAAbicAAAIAAAAvRDUJzhkbAAAAAABVU0QAVVNEAAEAAQCkiQAAAAABAQQCAAAAAMIAWCGW4wAAAAA./bcr=AAAAAAAA8D8=/cnd=%21NhLe8wiyw84TEK-I1UkYzrNsIAQoADF7FK5H4XqEPzoJTllNMjo0MzY3QKIgSQAAAAAAAPA_UQAAAAAAAAAAWQAAAAAAAAAAYQAAAAAAAAAAaQAAAAAAAAAAcQAAAAAAAAAAeAA./cca=MTAwOTQjTllNMjo0MzY3/bn=87001/" + ] + }, + "impression_trackers": [ + "https://nym1-ib.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKTCeiTBAAAAwDWAAUBCPOK7PUFEP2au9C6hPPcGRj_5I7-ruzA_3cqNgl7FK5H4XqEPxF7FK5H4XqEPxkAAAECCOA_IREbACkRCQAxARm4AADgPzCc2ZQJOO5OQO5OSAJQr4jVSVjOs2xgAGikk4YBeNmnBYABAYoBA1VTRJIFBvBPmAEBoAEBqAEBsAEAuAEBwAEEyAEC0AEA2AEA4AEA8AEAigJZdWYoJ2EnLCAzMDM4MzE0LCAxNTg5MzE0OTMxKTt1ZignaScsIDQzMjI0ODlGHQAEcicBFBg0NDg1ODA3AQsZPPQXAZICiQMhTlVxVV9naXl3ODRURUstSTFVa1lBQ0RPczJ3d0FEZ0FRQVJJN2s1UW5ObVVDVmdBWU1jR2FBQndBSGdBZ0FFQWlBRUFrQUVBbUFFQW9BRUJxQUVEc0FFQXVRR1I3d3J3NFhxRVA4RUJrZThLOE9GNmhEX0pBWW5za0ZHdXp3QkEyUUVBQUFBQUFBRHdQLUFCdWVtSEF2VUJBQUFBQUpnQ0FLQUNBTFVDQUFBQUFMMENBQUFBQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEc3NQT0U3b0RDVTVaVFRJNk5ETTJOLUFEb2lDQUJPTFU4QU9JQk9YVThBT1FCQUNZQkFIQkJBQUFBQUFBQUFBQXlRUUFBQUEJEhROZ0VBUEURnSxBQUFDSUJZOGlxUVUBDQmwCDdFRgEKCQEMREJCUQkKAQEAeRUoDEFBQU4yKAAAWi4oAEg0QVhvQncuLpoCiQEhTmhMZTh3No0BQHpyTnNJQVFvQURGN0ZLNUg0IVFMem9KVGxsTk1qbzBNelkzUUtJZ1MRfQxQQV9VEQwMQUFBVx0MAFkdDABhHQwAYx0M8N5lQUEu2AIA4ALKqE3qAjRpdHVuZXMuYXBwbGUuY29tL3VzL2FwcC9hcHBuZXh1cy1zZGstYXBwL2lkNzM2ODY5ODMzgAMAiAMBkAMAmAMXoAMBqgMAwAPgqAHIAwDYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIECzEwLjc1LjEwLjMxqAQAsgQNCAAQARjAAiAyMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDM2N9oEAggB4AQB8ASviNVJ-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2CaIgiAUBmAUAoAX_EQEUAcAFAMkFaccU8D_SBQkJCQxwAADYBQHgBQHwBQH6BQQIABAAkAYBmAYAuAYAwQYJIyjwP9AG1jPaBhYKEAkRGQGcEAAYAOAGDPIGAggAgAcBiAcAoAdByAcA0gcNCQAAAAAAAAAAEAAYAA..&s=a3e0c8b0a927fa9c69e127dd5976d15dee78ceff" + ], + "id": 154485807 + } + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponse.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponse.json index 6ca5bb074..6fbc158e0 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponse.json +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponse.json @@ -15,6 +15,7 @@ "width": 320, "height": 50 }, + "timeout_ms": 1500, "handler": [{ "param": "#{PARAM}", "class": "ANAdAdapterBannerDFP", @@ -50,6 +51,7 @@ "width": 320, "height": 50 }, + "timeout_ms": 1500, "handler": [{ "param": "#{PARAM}", "class": "ANAdAdapterBannerMillennialMedia", @@ -85,6 +87,7 @@ "width": 320, "height": 50 }, + "timeout_ms": 1500, "handler": [{ "param": "#{PARAM}", "class": "ANAdAdapterBannerAdMob", @@ -120,6 +123,7 @@ "width": 320, "height": 50 }, + "timeout_ms": 1500, "handler": [{ "param": "#{PARAM}", "class": "ANAdAdapterBanneriAd", diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponseDefaultTimeout.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponseDefaultTimeout.json new file mode 100644 index 000000000..dd6ec4555 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/SuccessfulMediationResponseDefaultTimeout.json @@ -0,0 +1,147 @@ +{ + "tags": [{ + "no_ad_url": "MOCK__no_ad_url_1", + "ads": [{ + "content_source": "csm", + "ad_type": "banner", + "media_type_id": 0, + "media_subtype_id": 0, + "viewability": { + "config": "MOCK__config_1", + }, + "csm": { + "banner": { + "content": "MOCK__content_1", + "width": 320, + "height": 50 + }, + "timeout_ms": 0, + "handler": [{ + "param": "#{PARAM}", + "class": "ANAdAdapterBannerDFP", + "width": "320", + "height": "50", + "type": "ios", + "id": "/6925/Shazam_iPhoneAPP/Standard_Banners/My_Tags" + }, { + "param": "#{PARAM}", + "class": "com.appnexus.opensdk.mediatedviews.MOCK__androidClass_1", + "width": "320", + "height": "50", + "type": "android", + "id": "MOCK__id_1b" + }], + "trackers": [{ + "impression_urls": [ "MOCK__impression_url_1" ], + "video_events": {} + }], + "response_url": "MOCK__response_url_1" + } + }, { + "content_source": "csm", + "ad_type": "banner", + "media_type_id": 0, + "media_subtype_id": 0, + "viewability": { + "config": "MOCK__config_2", + }, + "csm": { + "banner": { + "content": "MOCK__content_2", + "width": 320, + "height": 50 + }, + "timeout_ms": 500, + "handler": [{ + "param": "#{PARAM}", + "class": "ANAdAdapterBannerMillennialMedia", + "width": "320", + "height": "50", + "type": "ios", + "id": "148502" + }, { + "param": "#{PARAM}", + "class": "com.appnexus.opensdk.mediatedviews.MOCK__androidClass_2", + "width": "320", + "height": "50", + "type": "android", + "id": "MOCK__id_2b" + }], + "trackers": [{ + "impression_urls": [ "MOCK__impression_url_2" ], + "video_events": {} + }], + "response_url": "MOCK__response_url_2" + } + }, { + "content_source": "csm", + "ad_type": "banner", + "media_type_id": 0, + "media_subtype_id": 0, + "viewability": { + "config": "MOCK__config_3", + }, + "csm": { + "banner": { + "content": "MOCK__content_3", + "width": 320, + "height": 50 + }, + "timeout_ms": 0, + "handler": [{ + "param": "#{PARAM}", + "class": "ANAdAdapterBannerAdMob", + "width": "320", + "height": "50", + "type": "ios", + "id": "ca-app-pub-5668774179595841/1125462353" + }, { + "param": "#{PARAM}", + "class": "com.appnexus.opensdk.mediatedviews.MOCK__androidClass_3", + "width": "320", + "height": "50", + "type": "android", + "id": "MOCK__id_3b" + }], + "trackers": [{ + "impression_urls": [ "MOCK__impression_url_3" ], + "video_events": {} + }], + "response_url": "MOCK__response_url_3" + } + }, { + "content_source": "csm", + "ad_type": "banner", + "media_type_id": 0, + "media_subtype_id": 0, + "viewability": { + "config": "MOCK__config_4", + }, + "csm": { + "banner": { + "content": "MOCK__content_4", + "width": 320, + "height": 50 + }, + "timeout_ms": 500, + "handler": [{ + "param": "#{PARAM}", + "class": "ANAdAdapterBanneriAd", + "type": "ios" + }, { + "param": "#{PARAM}", + "class": "com.appnexus.opensdk.mediatedviews.MOCK__androidClass_4", + "width": "320", + "height": "50", + "type": "android", + "id": "MOCK__id_4b" + }], + "trackers": [{ + "impression_urls": [ "MOCK__impression_url_4" ], + "video_events": {} + }], + "response_url": "MOCK__response_url_4" + } + }] + }] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/csm_bannerad.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/csm_bannerad.json new file mode 100644 index 000000000..58c133e20 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/csm_bannerad.json @@ -0,0 +1,54 @@ + { + "version": "0.0.1", + "tags": [{ + "tag_id": 13981426, + "auction_id": "320061905651522722", + "nobid": false, + "no_ad_url": "MOCK__no_ad_url", + "timeout_ms": 10000, + "ad_profile_id": 27079, + "ads": [{ + "content_source": "csm", + "ad_type": "banner", + "buyer_member_id": 958, + "creative_id": 116333882, + "media_type_id": 1, + "media_subtype_id": 1, + "client_initiated_ad_counting": false, + "viewability": { + "config": "MOCK__viewability_config" + }, + "csm": { + "banner": { + "content": "MOCK__csm_banner_content", + "width": 300, + "height": 250 + }, + "timeout_ms": 3500, + "handler": [{ + "second_price": "5.01", + "param": "{\"optimized\":true}", + "height": "250", + "width": "300", + "id": "/19968336/second-price-dfp-ad-unit", + "type": "ios", + "class": "ANAdAdapterBannerDFP" + }, { + "second_price": "5.01", + "param": "{\"optimized\":true}", + "height": "250", + "width": "300", + "id": "/19968336/second-price-dfp-ad-unit", + "type": "android", + "class": "com.appnexus.opensdk.mediatedviews.DFPBanner" + }], + "trackers": [{ + "impression_urls": ["MOCK__csm__impression_url1"], + "video_events": {} + }], + "request_url": "MOCK__request_url", + "response_url": "MOCK__response_url", + } + }] + }] + } diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_banner.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_banner.json new file mode 100644 index 000000000..63e941d00 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_banner.json @@ -0,0 +1,63 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18144580, + "auction_id": "6918394593318350869", + "nobid": false, + "no_ad_url": "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKNCKANBAAAAwDWAAUBCIffy_AFEJXg5LWj58SBYBie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MMS60wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBwAKgATKoAQawAQC4AQDAAQDIAQLQAQDYAQDgAQDwAQCKAjx1ZignYScsIDMzOTA3NTMsIDE1NzgyOTkyNzEpO3VmKCdyJywgMjAxNzIxNzU4LDIfAPD1kgK1AiFmai1KelFqTjFkMFJFSjZQbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReExyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFHZlIxZjV0QWlNUDhFQm4wZFgtYlFJakRfSkFkU2J2NjdNNXZVXzJRRUFBQUFBQUFEd1AtQUJBUFVCb1VWZ1BKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHpkWGRFYm9EQ1U1WlRUSTZOREF3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYWtmcVFVAREBFDx3UHcuLpoCiQEhaUJMZkNBNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTURBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMB2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xMC4xNDGoBIeaAbIEDggAEAEYACAAKAAwADgCuAQAwAQAyAQA0gQPMTAwOTQjTllNMjo0MDA52gQCCADgBADwBJ6PmGD6BBIJAAAAQJbkQkARAAAAwAKaXsCCBQk3MzY4Njk4MzOIBQGYBQCgBf___________wHABQDJBQAAAAAAAPA_0gUJCQAAAABhYnDYBQHgBQHwBY2XBvoFBAgAEACQBgCYBgC4BgDBBgEhMAAA8L_QBtYz2gYWChAJERkBUBAAGADgBgHyBgIIAIAHAYgHAKAHAQ..&s=ab2bb0e4df506ecdd3f1072c63113f3bf0a8bb26", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "csm", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 201721758, + "media_type_id": 1, + "media_subtype_id": 1, + "brand_category_id": 53, + "client_initiated_ad_counting": false, + "viewability": { + "config": "document.write('
');" + }, + "csm": { + "banner": { + "content": "
", + "width": 320, + "height": 50 + }, + "timeout_ms": 200, + "handler": [ + { + "width": "320", + "height": "50", + "type": "ios", + "class": "ANAdAdapterBannerNetworkTimeout", + "id": "ca-app-pub-3940256099942544/2934735716" + }, + { + "width": "320", + "height": "50", + "type": "android", + "class": "com.appnexus.opensdk.mediatedviews.NetworkTimeoutBanner", + "id": "ca-app-pub-3940256099942544/6300978111" + } + ], + "trackers": [ + { + "impression_urls": [ + "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKVCOgVBAAAAwDWAAUBCIffy_AFEJXg5LWj58SBYBie4p7ovf_NlngqNgkLB0KygAmMPxELB0KygAmMPxkAAAECCOA_IREbACkRCQAxARm4AADgPzDEutMIOO5OQO5OSAJQno-YYFjOs2xgAGikk4YBePrbBIABAYoBA1VTRJIFBvBVmAHAAqABMqgBBrABALgBAcABBMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgMzM5MDc1MywgMTU3ODI5OTI3MSk7dWYoJ3InLCAyMDE3MjE3NTgsIDEdH_D1kgK1AiFmai1KelFqTjFkMFJFSjZQbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReExyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFHZlIxZjV0QWlNUDhFQm4wZFgtYlFJakRfSkFkU2J2NjdNNXZVXzJRRUFBQUFBQUFEd1AtQUJBUFVCb1VWZ1BKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHpkWGRFYm9EQ1U1WlRUSTZOREF3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYWtmcVFVAREBFDx3UHcuLpoCiQEhaUJMZkNBNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTURBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPDCZUFBLtgCAOACyqhN6gI0aXR1bmVzLmFwcGxlLmNvbS91cy9hcHAvYXBwbmV4dXMtc2RrLWFwcC9pZDczNjg2OTgzM4ADAIgDAZADAJgDF6ADAaoDAMADrALIAwHYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIEDDEwLjc1LjEwLjE0MagEh5oBsgQOCAAQARgAIAAoADAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQwMDnaBAIIAeAEAfAEYQhg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNxGlIIgFAZgFAKAF_xEBFAHABQDJBWlaEPA_0gUJAUAFAXDYBQHgBQHwBY2XBvoFBAgAEACQBgCYBgC4BgDBBgUiLADwP9AG1jPaBhYKEAkRGQFQEAAYAOAGAfIGAggAgAcBiAcAoAcB&s=a0968149b94b6033cda75ec96054b354c039e55a" + ], + "video_events": {} + } + ], + "request_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_req?info=LwAAAAMABQEFAQiH38vwBRCV4OS1o-fEgWAY7k4hCwdCsoAJjD8ono-YYDANOAA.&s=fa584117ee352a237773c5b4b837c831473e1af4", + "response_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_resp?info=LwAAAAMABQEFAQiH38vwBRCV4OS1o-fEgWAY7k4hCwdCsoAJjD8ono-YYDANOAA.&s=fa584117ee352a237773c5b4b837c831473e1af4" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_banner_over.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_banner_over.json new file mode 100644 index 000000000..37d451c40 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_banner_over.json @@ -0,0 +1,63 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18144580, + "auction_id": "6918394593318350869", + "nobid": false, + "no_ad_url": "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKNCKANBAAAAwDWAAUBCIffy_AFEJXg5LWj58SBYBie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MMS60wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBwAKgATKoAQawAQC4AQDAAQDIAQLQAQDYAQDgAQDwAQCKAjx1ZignYScsIDMzOTA3NTMsIDE1NzgyOTkyNzEpO3VmKCdyJywgMjAxNzIxNzU4LDIfAPD1kgK1AiFmai1KelFqTjFkMFJFSjZQbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReExyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFHZlIxZjV0QWlNUDhFQm4wZFgtYlFJakRfSkFkU2J2NjdNNXZVXzJRRUFBQUFBQUFEd1AtQUJBUFVCb1VWZ1BKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHpkWGRFYm9EQ1U1WlRUSTZOREF3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYWtmcVFVAREBFDx3UHcuLpoCiQEhaUJMZkNBNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTURBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMB2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xMC4xNDGoBIeaAbIEDggAEAEYACAAKAAwADgCuAQAwAQAyAQA0gQPMTAwOTQjTllNMjo0MDA52gQCCADgBADwBJ6PmGD6BBIJAAAAQJbkQkARAAAAwAKaXsCCBQk3MzY4Njk4MzOIBQGYBQCgBf___________wHABQDJBQAAAAAAAPA_0gUJCQAAAABhYnDYBQHgBQHwBY2XBvoFBAgAEACQBgCYBgC4BgDBBgEhMAAA8L_QBtYz2gYWChAJERkBUBAAGADgBgHyBgIIAIAHAYgHAKAHAQ..&s=ab2bb0e4df506ecdd3f1072c63113f3bf0a8bb26", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "csm", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 201721758, + "media_type_id": 1, + "media_subtype_id": 1, + "brand_category_id": 53, + "client_initiated_ad_counting": false, + "viewability": { + "config": "document.write('
');" + }, + "csm": { + "banner": { + "content": "
", + "width": 320, + "height": 50 + }, + "timeout_ms": 10000, + "handler": [ + { + "width": "320", + "height": "50", + "type": "ios", + "class": "ANAdAdapterBannerNetworkTimeout", + "id": "ca-app-pub-3940256099942544/2934735716" + }, + { + "width": "320", + "height": "50", + "type": "android", + "class": "com.appnexus.opensdk.mediatedviews.NetworkTimeoutBanner", + "id": "ca-app-pub-3940256099942544/6300978111" + } + ], + "trackers": [ + { + "impression_urls": [ + "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKVCOgVBAAAAwDWAAUBCIffy_AFEJXg5LWj58SBYBie4p7ovf_NlngqNgkLB0KygAmMPxELB0KygAmMPxkAAAECCOA_IREbACkRCQAxARm4AADgPzDEutMIOO5OQO5OSAJQno-YYFjOs2xgAGikk4YBePrbBIABAYoBA1VTRJIFBvBVmAHAAqABMqgBBrABALgBAcABBMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgMzM5MDc1MywgMTU3ODI5OTI3MSk7dWYoJ3InLCAyMDE3MjE3NTgsIDEdH_D1kgK1AiFmai1KelFqTjFkMFJFSjZQbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReExyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFHZlIxZjV0QWlNUDhFQm4wZFgtYlFJakRfSkFkU2J2NjdNNXZVXzJRRUFBQUFBQUFEd1AtQUJBUFVCb1VWZ1BKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHpkWGRFYm9EQ1U1WlRUSTZOREF3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYWtmcVFVAREBFDx3UHcuLpoCiQEhaUJMZkNBNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTURBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPDCZUFBLtgCAOACyqhN6gI0aXR1bmVzLmFwcGxlLmNvbS91cy9hcHAvYXBwbmV4dXMtc2RrLWFwcC9pZDczNjg2OTgzM4ADAIgDAZADAJgDF6ADAaoDAMADrALIAwHYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIEDDEwLjc1LjEwLjE0MagEh5oBsgQOCAAQARgAIAAoADAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQwMDnaBAIIAeAEAfAEYQhg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNxGlIIgFAZgFAKAF_xEBFAHABQDJBWlaEPA_0gUJAUAFAXDYBQHgBQHwBY2XBvoFBAgAEACQBgCYBgC4BgDBBgUiLADwP9AG1jPaBhYKEAkRGQFQEAAYAOAGAfIGAggAgAcBiAcAoAcB&s=a0968149b94b6033cda75ec96054b354c039e55a" + ], + "video_events": {} + } + ], + "request_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_req?info=LwAAAAMABQEFAQiH38vwBRCV4OS1o-fEgWAY7k4hCwdCsoAJjD8ono-YYDANOAA.&s=fa584117ee352a237773c5b4b837c831473e1af4", + "response_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_resp?info=LwAAAAMABQEFAQiH38vwBRCV4OS1o-fEgWAY7k4hCwdCsoAJjD8ono-YYDANOAA.&s=fa584117ee352a237773c5b4b837c831473e1af4" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_interstiatal.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_interstiatal.json new file mode 100644 index 000000000..7bd5d9589 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_interstiatal.json @@ -0,0 +1,56 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18144585, + "auction_id": "1741743309004110761", + "nobid": false, + "no_ad_url": "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKNCKANBAAAAwDWAAUBCL3fy_AFEKn36bj7yfqVGBie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MMm60wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBAaABAagBBrABALgBAMABAMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgMzM5MDc1MywgMTU3ODI5OTMyNSk7dWYoJ3InLCAyMDE3MjIwNDQsIC4fAPD1kgK1AiFVRDJXandqTzFkMFJFTHlSbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReWJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFGdUNIYVh1R09RUDhFQmJnaDJsN2hqa0RfSkFVNHVJcHJQbV9rXzJRRUFBQUFBQUFEd1AtQUJBUFVCd1IyRFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHp0WGRFYm9EQ1U1WlRUSTZOREk0TS1BRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYnNocVFVAREBFEB3UHcuLpoCiQEhclJLWkZRajI5AaB6ck5zSUFRb0FERjdGSzVINFhxRVB6b0pUbGxOTWpvME1qZ3pRUGtZUxF4DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQz0DgFlQUEu2AIA4ALKqE3qAjRpdHVuZXMuYXBwbGUuY29tL3VzL2FwcC9hcHBuZXh1cy1zZGstYXBwL2lkNzM2ODY5ODMzgAMAiAMBkAMAmAMXoAMBqgMAwAPgqAHIAwHYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIEDDEwLjc1LjEwLjE0MagEiJoBsgQOCAAQARgAIAAoADAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQyODPaBAIIAOAEAPAEvJGYYPoEEgkAAABAluRCQBEAAADAAppewIIFCTczNjg2OTgzM4gFAZgFAKAF____________AcAFAMkFAAAAAAAA8D_SBQkJAAAAZWFw2AUB4AUB8AWNlwb6BQQIABAAkAYBmAYAuAYAwQYFIiwA8L_QBtYz2gYWChAJERkBUBAAGADgBgPyBgIIAIAHAYgHAKAHBQ..&s=2fc401f5b025ed9baeeeb2716cef352dcfe19596", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "csm", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 201722044, + "media_type_id": 3, + "media_subtype_id": 5, + "brand_category_id": 53, + "client_initiated_ad_counting": false, + "csm": { + "banner": { + "content": "", + "width": 1, + "height": 1 + }, + "timeout_ms": 200, + "handler": [ + { + "type": "ios", + "class": "ANAdAdapterInterstitialNetworkTimeout", + "id": "ca-app-pub-3940256099942544/4411468910" + }, + { + "type": "android", + "class": "com.appnexus.opensdk.mediatedviews.NetworkTimeoutInterstitial", + "id": "ca-app-pub-3940256099942544/1033173712" + } + ], + "trackers": [ + { + "impression_urls": [ + "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKVCOgVBAAAAwDWAAUBCL3fy_AFEKn36bj7yfqVGBie4p7ovf_NlngqNglpxqLp7GSQPxFpxqLp7GSQPxkAAAECCOA_IREbACkRCQAxARm4AADgPzDJutMIOO5OQO5OSAJQvJGYYFjOs2xgAGikk4YBeJGlBYABAYoBA1VTRJIFBvBVmAEBoAEBqAEGsAEAuAEBwAEEyAEC0AEA2AEA4AEA8AEAigI8dWYoJ2EnLCAzMzkwNzUzLCAxNTc4Mjk5MzI1KTt1ZigncicsIDIwMTcyMjA0NCwgMTUZH_D1kgK1AiFVRDJXandqTzFkMFJFTHlSbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReWJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFGdUNIYVh1R09RUDhFQmJnaDJsN2hqa0RfSkFVNHVJcHJQbV9rXzJRRUFBQUFBQUFEd1AtQUJBUFVCd1IyRFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHp0WGRFYm9EQ1U1WlRUSTZOREk0TS1BRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYnNocVFVAREBFEB3UHcuLpoCiQEhclJLWkZRajI5AaB6ck5zSUFRb0FERjdGSzVINFhxRVB6b0pUbGxOTWpvME1qZ3pRUGtZUxF4DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQz0DgFlQUEu2AIA4ALKqE3qAjRpdHVuZXMuYXBwbGUuY29tL3VzL2FwcC9hcHBuZXh1cy1zZGstYXBwL2lkNzM2ODY5ODMzgAMAiAMBkAMAmAMXoAMBqgMAwAPgqAHIAwHYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIEDDEwLjc1LjEwLjE0MagEiJoBsgQOCAAQARgAIAAoADAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQyODPaBAIIAOAEAfAEvJGYYPoEEgkAAABAluRCQBEAAADAAppewIIFCTczNjg2OTgzM4gFAZgFAKAF____________AcAFAMkFAAAAAAAA8D_SBQkJAAAAZWlw2AUB4AUB8AWNlwb6BQQIABAAkAYBmAYAuAYAwQYFIiwA8D_QBtYz2gYWChAJERkBUBAAGADgBgPyBgIIAIAHAYgHAKAHBQ..&s=0fc2be5f237c535c682b550d73fa8aee703ed1ca" + ], + "video_events": {} + } + ], + "request_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_req?info=LwAAAAMABQEFAQi938vwBRCp9-m4-8n6lRgY7k4hacai6exkkD8ovJGYYDAKOAA.&s=8bbf9d0cd1194953c7f824f2b5f91dc93624a7dd", + "response_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_resp?info=LwAAAAMABQEFAQi938vwBRCp9-m4-8n6lRgY7k4hacai6exkkD8ovJGYYDAKOAA.&s=8bbf9d0cd1194953c7f824f2b5f91dc93624a7dd" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_interstiatal_over.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_interstiatal_over.json new file mode 100644 index 000000000..6f1d5ba1a --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_interstiatal_over.json @@ -0,0 +1,56 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18144585, + "auction_id": "1741743309004110761", + "nobid": false, + "no_ad_url": "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKNCKANBAAAAwDWAAUBCL3fy_AFEKn36bj7yfqVGBie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MMm60wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBAaABAagBBrABALgBAMABAMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgMzM5MDc1MywgMTU3ODI5OTMyNSk7dWYoJ3InLCAyMDE3MjIwNDQsIC4fAPD1kgK1AiFVRDJXandqTzFkMFJFTHlSbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReWJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFGdUNIYVh1R09RUDhFQmJnaDJsN2hqa0RfSkFVNHVJcHJQbV9rXzJRRUFBQUFBQUFEd1AtQUJBUFVCd1IyRFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHp0WGRFYm9EQ1U1WlRUSTZOREk0TS1BRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYnNocVFVAREBFEB3UHcuLpoCiQEhclJLWkZRajI5AaB6ck5zSUFRb0FERjdGSzVINFhxRVB6b0pUbGxOTWpvME1qZ3pRUGtZUxF4DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQz0DgFlQUEu2AIA4ALKqE3qAjRpdHVuZXMuYXBwbGUuY29tL3VzL2FwcC9hcHBuZXh1cy1zZGstYXBwL2lkNzM2ODY5ODMzgAMAiAMBkAMAmAMXoAMBqgMAwAPgqAHIAwHYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIEDDEwLjc1LjEwLjE0MagEiJoBsgQOCAAQARgAIAAoADAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQyODPaBAIIAOAEAPAEvJGYYPoEEgkAAABAluRCQBEAAADAAppewIIFCTczNjg2OTgzM4gFAZgFAKAF____________AcAFAMkFAAAAAAAA8D_SBQkJAAAAZWFw2AUB4AUB8AWNlwb6BQQIABAAkAYBmAYAuAYAwQYFIiwA8L_QBtYz2gYWChAJERkBUBAAGADgBgPyBgIIAIAHAYgHAKAHBQ..&s=2fc401f5b025ed9baeeeb2716cef352dcfe19596", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "csm", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 201722044, + "media_type_id": 3, + "media_subtype_id": 5, + "brand_category_id": 53, + "client_initiated_ad_counting": false, + "csm": { + "banner": { + "content": "", + "width": 1, + "height": 1 + }, + "timeout_ms": 10000, + "handler": [ + { + "type": "ios", + "class": "ANAdAdapterInterstitialNetworkTimeout", + "id": "ca-app-pub-3940256099942544/4411468910" + }, + { + "type": "android", + "class": "com.appnexus.opensdk.mediatedviews.NetworkTimeoutInterstitial", + "id": "ca-app-pub-3940256099942544/1033173712" + } + ], + "trackers": [ + { + "impression_urls": [ + "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKVCOgVBAAAAwDWAAUBCL3fy_AFEKn36bj7yfqVGBie4p7ovf_NlngqNglpxqLp7GSQPxFpxqLp7GSQPxkAAAECCOA_IREbACkRCQAxARm4AADgPzDJutMIOO5OQO5OSAJQvJGYYFjOs2xgAGikk4YBeJGlBYABAYoBA1VTRJIFBvBVmAEBoAEBqAEGsAEAuAEBwAEEyAEC0AEA2AEA4AEA8AEAigI8dWYoJ2EnLCAzMzkwNzUzLCAxNTc4Mjk5MzI1KTt1ZigncicsIDIwMTcyMjA0NCwgMTUZH_D1kgK1AiFVRDJXandqTzFkMFJFTHlSbUdBWUFDRE9zMnd3QURnQVFBUkk3azVReWJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFGdUNIYVh1R09RUDhFQmJnaDJsN2hqa0RfSkFVNHVJcHJQbV9rXzJRRUFBQUFBQUFEd1AtQUJBUFVCd1IyRFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRHp0WGRFYm9EQ1U1WlRUSTZOREk0TS1BRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCYnNocVFVAREBFEB3UHcuLpoCiQEhclJLWkZRajI5AaB6ck5zSUFRb0FERjdGSzVINFhxRVB6b0pUbGxOTWpvME1qZ3pRUGtZUxF4DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQz0DgFlQUEu2AIA4ALKqE3qAjRpdHVuZXMuYXBwbGUuY29tL3VzL2FwcC9hcHBuZXh1cy1zZGstYXBwL2lkNzM2ODY5ODMzgAMAiAMBkAMAmAMXoAMBqgMAwAPgqAHIAwHYA_mjeuADAOgDAvgDAIAEAJIEBi91dC92M5gEAKIEDDEwLjc1LjEwLjE0MagEiJoBsgQOCAAQARgAIAAoADAAOAK4BADABADIBADSBA8xMDA5NCNOWU0yOjQyODPaBAIIAOAEAfAEvJGYYPoEEgkAAABAluRCQBEAAADAAppewIIFCTczNjg2OTgzM4gFAZgFAKAF____________AcAFAMkFAAAAAAAA8D_SBQkJAAAAZWlw2AUB4AUB8AWNlwb6BQQIABAAkAYBmAYAuAYAwQYFIiwA8D_QBtYz2gYWChAJERkBUBAAGADgBgPyBgIIAIAHAYgHAKAHBQ..&s=0fc2be5f237c535c682b550d73fa8aee703ed1ca" + ], + "video_events": {} + } + ], + "request_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_req?info=LwAAAAMABQEFAQi938vwBRCp9-m4-8n6lRgY7k4hacai6exkkD8ovJGYYDAKOAA.&s=8bbf9d0cd1194953c7f824f2b5f91dc93624a7dd", + "response_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_resp?info=LwAAAAMABQEFAQi938vwBRCp9-m4-8n6lRgY7k4hacai6exkkD8ovJGYYDAKOAA.&s=8bbf9d0cd1194953c7f824f2b5f91dc93624a7dd" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_native.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_native.json new file mode 100644 index 000000000..5c7725feb --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_native.json @@ -0,0 +1,56 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18144598, + "auction_id": "8195076460992493534", + "nobid": false, + "no_ad_url": "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKNCKANBAAAAwDWAAUBCJney_AFEN7v_aTz07DdcRie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MNa60wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBAaABAagBBrABALgBAMABAMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgMzM5MDc1MywgMTU3ODI5OTE2MSk7dWYoJ3InLCAyMDE3MjI0MzUsIC4fAPD1kgK1AiFtajZNT1FqVTFkMFJFTU9VbUdBWUFDRE9zMnd3QURnQVFBUkk3azVRMXJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFFUU9PVE5KN1NNUDhFQkVEamt6U2UwakRfSkFicVZnR0MtYlBZXzJRRUFBQUFBQUFEd1AtQUJBUFVCTjZGbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDFOWGRFYm9EQ1U1WlRUSTZOREl3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNPEFBQUQ0QkFDSUJmRWdxUVUBEQEUQHdQdy4umgKJASF1eExrR2dqMjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTWpBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDAdgD-aN64AMA6AMC-AMAgAQAkgQGL3V0L3YzmAQAogQMMTAuNzUuMTAuMTQxqASGmgGyBA4IABABGAAgACgAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDIwOdoEAggA4AQA8ATDlJhg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlYXDYBQHgBQHwBY2XBvoFBAgAEACQBgGYBgC4BgDBBgUiLADwv9AG1jPaBhYKEAkRGQFQEAAYAOAGDPIGAggAgAcBiAcAoAdB&s=b5d32852ea3b1bbcaa5a189bdf91a73f10c9b90c", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "csm", + "ad_type": "native", + "buyer_member_id": 10094, + "creative_id": 201722435, + "media_type_id": 12, + "media_subtype_id": 65, + "brand_category_id": 53, + "client_initiated_ad_counting": true, + "viewability": { + "config": "" + }, + "csm": { + "timeout_ms": 200, + "handler": [ + { + "type": "ios", + "class": "ANAdAdapterNativeNetworkTimeout", + "param": "", + "id": "ca-app-pub-3940256099942544/3986624511" + }, + { + "type": "android", + "class": "com.appnexus.opensdk.mediatednativead.NetworkTimeoutNativeAd", + "param": "", + "id": "ca-app-pub-3940256099942544/2247696110" + } + ], + "trackers": [ + { + "impression_urls": [ + "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKVCOgVBAAAAwDWAAUBCJney_AFEN7v_aTz07DdcRie4p7ovf_NlngqNgktW-uLhLaMPxEtW-uLhLaMPxkAAAECCOA_IREbACkRCQAxARm4AADgPzDWutMIOO5OQO5OSAJQw5SYYFjOs2xgAGikk4YBeN6RBYABAYoBA1VTRJIFBvBVmAEBoAEBqAEGsAEAuAEAwAEEyAEC0AEA2AEA4AEA8AEAigI8dWYoJ2EnLCAzMzkwNzUzLCAxNTc4Mjk5MTYxKTt1ZigncicsIDIwMTcyMjQzNSwgMTUZH_D1kgK1AiFtajZNT1FqVTFkMFJFTU9VbUdBWUFDRE9zMnd3QURnQVFBUkk3azVRMXJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFFUU9PVE5KN1NNUDhFQkVEamt6U2UwakRfSkFicVZnR0MtYlBZXzJRRUFBQUFBQUFEd1AtQUJBUFVCTjZGbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDFOWGRFYm9EQ1U1WlRUSTZOREl3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNPEFBQUQ0QkFDSUJmRWdxUVUBEQEUQHdQdy4umgKJASF1eExrR2dqMjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTWpBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDAdgD-aN64AMA6AMC-AMAgAQAkgQGL3V0L3YzmAQAogQMMTAuNzUuMTAuMTQxqASGmgGyBA4IABABGAAgACgAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDIwOdoEAggB4AQA8ATDlJhg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlaXDYBQHgBQHwBY2XBvoFBAgAEACQBgGYBgC4BgDBBgUiLADwP9AG1jPaBhYKEAkRGQFQEAAYAOAGDPIGAggAgAcBiAcAoAdB&s=0570e781603fc61a0a13795369e56d18b174b362" + ], + "video_events": {} + } + ], + "request_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_req?info=LwAAAAMABQEFAQiZ3svwBRDe7_2k89Ow3XEY7k4hLVvri4S2jD8ow5SYYDBaOAA.&s=0ef93d82d284a01bfe1b6f1a2f144fa1e38ff2f0", + "response_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_resp?info=LwAAAAMABQEFAQiZ3svwBRDe7_2k89Ow3XEY7k4hLVvri4S2jD8ow5SYYDBaOAA.&s=0ef93d82d284a01bfe1b6f1a2f144fa1e38ff2f0" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_native_over.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_native_over.json new file mode 100644 index 000000000..f1b768c78 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_native_over.json @@ -0,0 +1,56 @@ +{ + "version": "3.0.0", + "tags": [ + { + "tag_id": 18144598, + "auction_id": "8195076460992493534", + "nobid": false, + "no_ad_url": "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKNCKANBAAAAwDWAAUBCJney_AFEN7v_aTz07DdcRie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MNa60wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBAaABAagBBrABALgBAMABAMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgMzM5MDc1MywgMTU3ODI5OTE2MSk7dWYoJ3InLCAyMDE3MjI0MzUsIC4fAPD1kgK1AiFtajZNT1FqVTFkMFJFTU9VbUdBWUFDRE9zMnd3QURnQVFBUkk3azVRMXJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFFUU9PVE5KN1NNUDhFQkVEamt6U2UwakRfSkFicVZnR0MtYlBZXzJRRUFBQUFBQUFEd1AtQUJBUFVCTjZGbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDFOWGRFYm9EQ1U1WlRUSTZOREl3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNPEFBQUQ0QkFDSUJmRWdxUVUBEQEUQHdQdy4umgKJASF1eExrR2dqMjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTWpBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDAdgD-aN64AMA6AMC-AMAgAQAkgQGL3V0L3YzmAQAogQMMTAuNzUuMTAuMTQxqASGmgGyBA4IABABGAAgACgAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDIwOdoEAggA4AQA8ATDlJhg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlYXDYBQHgBQHwBY2XBvoFBAgAEACQBgGYBgC4BgDBBgUiLADwv9AG1jPaBhYKEAkRGQFQEAAYAOAGDPIGAggAgAcBiAcAoAdB&s=b5d32852ea3b1bbcaa5a189bdf91a73f10c9b90c", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "csm", + "ad_type": "native", + "buyer_member_id": 10094, + "creative_id": 201722435, + "media_type_id": 12, + "media_subtype_id": 65, + "brand_category_id": 53, + "client_initiated_ad_counting": true, + "viewability": { + "config": "" + }, + "csm": { + "timeout_ms": 10000, + "handler": [ + { + "type": "ios", + "class": "ANAdAdapterNativeNetworkTimeout", + "param": "", + "id": "ca-app-pub-3940256099942544/3986624511" + }, + { + "type": "android", + "class": "com.appnexus.opensdk.mediatednativead.NetworkTimeoutNativeAd", + "param": "", + "id": "ca-app-pub-3940256099942544/2247696110" + } + ], + "trackers": [ + { + "impression_urls": [ + "http://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKVCOgVBAAAAwDWAAUBCJney_AFEN7v_aTz07DdcRie4p7ovf_NlngqNgktW-uLhLaMPxEtW-uLhLaMPxkAAAECCOA_IREbACkRCQAxARm4AADgPzDWutMIOO5OQO5OSAJQw5SYYFjOs2xgAGikk4YBeN6RBYABAYoBA1VTRJIFBvBVmAEBoAEBqAEGsAEAuAEAwAEEyAEC0AEA2AEA4AEA8AEAigI8dWYoJ2EnLCAzMzkwNzUzLCAxNTc4Mjk5MTYxKTt1ZigncicsIDIwMTcyMjQzNSwgMTUZH_D1kgK1AiFtajZNT1FqVTFkMFJFTU9VbUdBWUFDRE9zMnd3QURnQVFBUkk3azVRMXJyVENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFFUU9PVE5KN1NNUDhFQkVEamt6U2UwakRfSkFicVZnR0MtYlBZXzJRRUFBQUFBQUFEd1AtQUJBUFVCTjZGbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDFOWGRFYm9EQ1U1WlRUSTZOREl3T2VBRC1SaUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNPEFBQUQ0QkFDSUJmRWdxUVUBEQEUQHdQdy4umgKJASF1eExrR2dqMjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wTWpBNVFQa1lTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDAdgD-aN64AMA6AMC-AMAgAQAkgQGL3V0L3YzmAQAogQMMTAuNzUuMTAuMTQxqASGmgGyBA4IABABGAAgACgAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDIwOdoEAggB4AQA8ATDlJhg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlaXDYBQHgBQHwBY2XBvoFBAgAEACQBgGYBgC4BgDBBgUiLADwP9AG1jPaBhYKEAkRGQFQEAAYAOAGDPIGAggAgAcBiAcAoAdB&s=0570e781603fc61a0a13795369e56d18b174b362" + ], + "video_events": {} + } + ], + "request_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_req?info=LwAAAAMABQEFAQiZ3svwBRDe7_2k89Ow3XEY7k4hLVvri4S2jD8ow5SYYDBaOAA.&s=0ef93d82d284a01bfe1b6f1a2f144fa1e38ff2f0", + "response_url": "http://nym1-mobile.adnxs.com/mediation/v2/log_resp?info=LwAAAAMABQEFAQiZ3svwBRDe7_2k89Ow3XEY7k4hLVvri4S2jD8ow5SYYDBaOAA.&s=0ef93d82d284a01bfe1b6f1a2f144fa1e38ff2f0" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_ssm.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_ssm.json new file mode 100644 index 000000000..331933d54 --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_ssm.json @@ -0,0 +1,53 @@ +{ + "version": "3.0.0", + "tags": [ + { + "uuid": "1", + "tag_id": 18144670, + "auction_id": "5381237704447748305", + "nobid": false, + "no_ad_url": "https://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKOCKAOBAAAAwDWAAUBCO6k3PAFENHRr4zm5f_WShie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MJ670wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBwAKgATKoAQawAQC4AQDAAQDIAQLQAQDYAQDgAQDwAQCKAjx1ZignYScsIDQyNDU2NTUsIDE1Nzg1NzAzNTApO3VmKCdyJywgMjAxNzI1MzMyLDIfAPD1kgK1AiFTRDN0dHdqZzF0MFJFSlNybUdBWUFDRE9zMnd3QURnQVFBUkk3azVRbnJ2VENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFIWGR4VmRJYnlNUDhFQjEzY1ZYU0c4akRfSkFaYlhLMWo1Y3ZZXzJRRUFBQUFBQUFEd1AtQUJBUFVCQk9GbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDROYmRFYm9EQ1U1WlRUSTZORGs1T2VBRGpSbUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCWWNucVFVAREBFDx3UHcuLpoCiQEhVlJLOEFnNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wT1RrNVFJMFpTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMB2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xMC4xNDGoBK29AbIEDwgAEAEYwAIgMigAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDk5OdoEAggA4AQA8ASUq5hg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlYnDYBQHgBQHwBdyKBfoFBAgAEACQBgCYBgC4BgDBBgUiLADwv9AG1jPaBhYKEAkRGQFQEAAYAOAGAfIGAggAgAcBiAcAoAcB&s=250cf904e1e8421b83d4770ef0432782ea9d0d77", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "ssm", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 166843311, + "media_type_id": 1, + "media_subtype_id": 1, + "brand_category_id": 25, + "client_initiated_ad_counting": false, + "viewability": { + "config": "document.write('
');" + }, + "ssm": { + "banner": { + "content": "
", + "width": 320, + "height": 50 + }, + "timeout_ms": 200, + "handler": [ + { + "url": "https://donothing.adnxs.com/ssm?session=Cs0HCroFCAEQyAEYASABMQeUTbnCu4w_OQeUTbnCu4w_QQeUTbnCu4w_SQeUTbnCu4w_aokBIVZSSzhBZ2pnMXQwUkVKU3JtR0FZenJOc0lBUW9BREY3Rks1SDRYcUVQem9KVGxsTk1qbzBPVGs1UUkwWlNRQUFBQUFBQVBBX1VRQUFBQUFBQUFBQVdRQUFBQUFBQUFBQVlRQUFBQUFBQUFBQWFRQUFBQUFBQUFBQWNRQUFBQUFBQUFBQWVBQS5yRENVU1RPTV9NT0RFTF9JRF5eQ1VTVE9NX01PREVMX0xFQUZfTkFNRV5eQ1VTVE9NX01PREVMX0xBU1RfTU9ESUZJRUReerUCIVNEM3R0d2pnMXQwUkVKU3JtR0FZQUNET3Myd3dBRGdBUUFSSTdrNVFucnZUQ0ZnQVlJWUZhQUJ3QUhnQWdBRUFpQUVBa0FFQW1BRUFvQUVCcUFFRHNBRUF1UUhYZHhWZElieU1QOEVCMTNjVlhTRzhqRF9KQVpiWEsxajVjdllfMlFFQUFBQUFBQUR3UC1BQkFQVUJCT0ZsUEpnQ0FLQUNBTFVDQUFBQUFMMENBQUFBQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdENE5iZEVib0RDVTVaVFRJNk5EazVPZUFEalJtSUJBQ1FCQUNZQkFIQkJBQUFBQUFBQUFBQXlRUUFBQUFBQUFBQUFOZ0VBUEVFQUFBQUFBQUFBQUQ0QkFDSUJZY25xUVVBQUFBQUFBRHdQdy4umgE8dWYoJ2EnLCA0MjQ1NjU1LCAxNTc4NTcwMzUwKTt1ZigncicsIDIwMTcyNTMzMiwgMTU3ODU3MDM1MCk7oAECqAHuTrABlKuYYLgBA8AB_LwF0gEDVVNEkAIBoQIAAAAAAADwP6gCAdoCDzEwMDk0I05ZTTI6NDk5OfgC1jOYAwAQABkAAAAAAAAAAJoBNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOgAcqoTagBhM9XyAEA0AEA2AEC6QEHlE25wruMP_EBB5RNucK7jD_5AQAAAAAAAOA_gQIHlE25wruMP4kCB5RNucK7jD-RAtHoi2Eu_61KmQIesQfd-zcteKECbhIXXgAAAACoAp670wiwAu5OuALuTsACAsgClKuYYNACzrNs2AIA4AIB6gIDVVNE8gIDVVNE-ALAAoADMogDpJOGAZAD_LwFmAMGoAMBqAMEsAMCwAMAyAMA0AMA2AMA6AMB8AMB-AMAiQQAAAAAAAAAABAAGNPBlui49uYCINPBlui49uYCKAEyDDEwLjc1LjEwLjE0MTptTW96aWxsYS81LjAgKGlQaG9uZTsgQ1BVIGlQaG9uZSBPUyAxMV8zIGxpa2UgTWFjIE9TIFgpIEFwcGxlV2ViS2l0LzYwNS4xLjE1IChLSFRNTCwgbGlrZSBHZWNrbykgTW9iaWxlLzE1RTIxN1D36_vXBVoAagk3MzY4Njk4MzNwAIgBAKABAagBGrABrQK4AQDAAQnIAQjQAbkB4AEX6gEyCAEQGhitAiAAKAkwADgIQLkBShAI4AMQwAIYACIECAAQACoAUAJYAGD36_vXBWoAcgDyASYoADIQDQAAAAAVAAAAABgAIAAoADoQDbIkF0IVFtD0whgAIAAoAZAC-aN6" + } + ], + "trackers": [ + { + "impression_urls": [ + "https://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKWCOgWBAAAAwDWAAUBCO6k3PAFENHRr4zm5f_WShie4p7ovf_NlngqNgkHlE25wruMPxEHlE25wruMPxkAAAECCOA_IREbACkRCQAxARm4AADgPzCeu9MIOO5OQO5OSAJQlKuYYFjOs2xgAGikk4YBePy8BYABAYoBA1VTRJIFBvBVmAHAAqABMqgBBrABALgBAcABBMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgNDI0NTY1NSwgMTU3ODU3MDM1MCk7dWYoJ3InLCAyMDE3MjUzMzIsIDEdH_D1kgK1AiFTRDN0dHdqZzF0MFJFSlNybUdBWUFDRE9zMnd3QURnQVFBUkk3azVRbnJ2VENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFIWGR4VmRJYnlNUDhFQjEzY1ZYU0c4akRfSkFaYlhLMWo1Y3ZZXzJRRUFBQUFBQUFEd1AtQUJBUFVCQk9GbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDROYmRFYm9EQ1U1WlRUSTZORGs1T2VBRGpSbUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCWWNucVFVAREBFDx3UHcuLpoCiQEhVlJLOEFnNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wT1RrNVFJMFpTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMB2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xMC4xNDGoBK29AbIEDwgAEAEYwAIgMigAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDk5OdoEAggB4AQB8ASUq5hg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlanDYBQHgBQHwBdyKBfoFBAgAEACQBgCYBgC4BgDBBgUiLADwP9AG1jPaBhYKEAkRGQFQEAAYAOAGAfIGAggAgAcBiAcAoAcB&s=2edceb517482fdb21a998b42786262cd9573cafa" + ], + "video_events": {} + } + ], + "request_url": "https://mobile.adnxs.com/nop", + "response_url": "https://mobile.adnxs.com/nop" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_ssm_over.json b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_ssm_over.json new file mode 100644 index 000000000..5c153b20b --- /dev/null +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/StubResponse/timeout_ssm_over.json @@ -0,0 +1,53 @@ +{ + "version": "3.0.0", + "tags": [ + { + "uuid": "1", + "tag_id": 18144670, + "auction_id": "5381237704447748305", + "nobid": false, + "no_ad_url": "https://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKOCKAOBAAAAwDWAAUBCO6k3PAFENHRr4zm5f_WShie4p7ovf_NlngqNgkAAAkCABEJBwgAABkJCQjgPyEJCQgAACkRCQAxCQnwfeA_MJ670wg47k5A7k5IAFAAWM6zbGAAaKSThgF4AIABAYoBAJIBA1VTRJgBwAKgATKoAQawAQC4AQDAAQDIAQLQAQDYAQDgAQDwAQCKAjx1ZignYScsIDQyNDU2NTUsIDE1Nzg1NzAzNTApO3VmKCdyJywgMjAxNzI1MzMyLDIfAPD1kgK1AiFTRDN0dHdqZzF0MFJFSlNybUdBWUFDRE9zMnd3QURnQVFBUkk3azVRbnJ2VENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFIWGR4VmRJYnlNUDhFQjEzY1ZYU0c4akRfSkFaYlhLMWo1Y3ZZXzJRRUFBQUFBQUFEd1AtQUJBUFVCQk9GbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDROYmRFYm9EQ1U1WlRUSTZORGs1T2VBRGpSbUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCWWNucVFVAREBFDx3UHcuLpoCiQEhVlJLOEFnNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wT1RrNVFJMFpTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMB2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xMC4xNDGoBK29AbIEDwgAEAEYwAIgMigAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDk5OdoEAggA4AQA8ASUq5hg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlYnDYBQHgBQHwBdyKBfoFBAgAEACQBgCYBgC4BgDBBgUiLADwv9AG1jPaBhYKEAkRGQFQEAAYAOAGAfIGAggAgAcBiAcAoAcB&s=250cf904e1e8421b83d4770ef0432782ea9d0d77", + "timeout_ms": 0, + "ad_profile_id": 1266762, + "rtb_video_fallback": false, + "ads": [ + { + "content_source": "ssm", + "ad_type": "banner", + "buyer_member_id": 10094, + "creative_id": 166843311, + "media_type_id": 1, + "media_subtype_id": 1, + "brand_category_id": 25, + "client_initiated_ad_counting": false, + "viewability": { + "config": "document.write('
');" + }, + "ssm": { + "banner": { + "content": "
", + "width": 320, + "height": 50 + }, + "timeout_ms": 10000, + "handler": [ + { + "url": "https://donothing.adnxs.com/ssm?session=Cs0HCroFCAEQyAEYASABMQeUTbnCu4w_OQeUTbnCu4w_QQeUTbnCu4w_SQeUTbnCu4w_aokBIVZSSzhBZ2pnMXQwUkVKU3JtR0FZenJOc0lBUW9BREY3Rks1SDRYcUVQem9KVGxsTk1qbzBPVGs1UUkwWlNRQUFBQUFBQVBBX1VRQUFBQUFBQUFBQVdRQUFBQUFBQUFBQVlRQUFBQUFBQUFBQWFRQUFBQUFBQUFBQWNRQUFBQUFBQUFBQWVBQS5yRENVU1RPTV9NT0RFTF9JRF5eQ1VTVE9NX01PREVMX0xFQUZfTkFNRV5eQ1VTVE9NX01PREVMX0xBU1RfTU9ESUZJRUReerUCIVNEM3R0d2pnMXQwUkVKU3JtR0FZQUNET3Myd3dBRGdBUUFSSTdrNVFucnZUQ0ZnQVlJWUZhQUJ3QUhnQWdBRUFpQUVBa0FFQW1BRUFvQUVCcUFFRHNBRUF1UUhYZHhWZElieU1QOEVCMTNjVlhTRzhqRF9KQVpiWEsxajVjdllfMlFFQUFBQUFBQUR3UC1BQkFQVUJCT0ZsUEpnQ0FLQUNBTFVDQUFBQUFMMENBQUFBQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdENE5iZEVib0RDVTVaVFRJNk5EazVPZUFEalJtSUJBQ1FCQUNZQkFIQkJBQUFBQUFBQUFBQXlRUUFBQUFBQUFBQUFOZ0VBUEVFQUFBQUFBQUFBQUQ0QkFDSUJZY25xUVVBQUFBQUFBRHdQdy4umgE8dWYoJ2EnLCA0MjQ1NjU1LCAxNTc4NTcwMzUwKTt1ZigncicsIDIwMTcyNTMzMiwgMTU3ODU3MDM1MCk7oAECqAHuTrABlKuYYLgBA8AB_LwF0gEDVVNEkAIBoQIAAAAAAADwP6gCAdoCDzEwMDk0I05ZTTI6NDk5OfgC1jOYAwAQABkAAAAAAAAAAJoBNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOgAcqoTagBhM9XyAEA0AEA2AEC6QEHlE25wruMP_EBB5RNucK7jD_5AQAAAAAAAOA_gQIHlE25wruMP4kCB5RNucK7jD-RAtHoi2Eu_61KmQIesQfd-zcteKECbhIXXgAAAACoAp670wiwAu5OuALuTsACAsgClKuYYNACzrNs2AIA4AIB6gIDVVNE8gIDVVNE-ALAAoADMogDpJOGAZAD_LwFmAMGoAMBqAMEsAMCwAMAyAMA0AMA2AMA6AMB8AMB-AMAiQQAAAAAAAAAABAAGNPBlui49uYCINPBlui49uYCKAEyDDEwLjc1LjEwLjE0MTptTW96aWxsYS81LjAgKGlQaG9uZTsgQ1BVIGlQaG9uZSBPUyAxMV8zIGxpa2UgTWFjIE9TIFgpIEFwcGxlV2ViS2l0LzYwNS4xLjE1IChLSFRNTCwgbGlrZSBHZWNrbykgTW9iaWxlLzE1RTIxN1D36_vXBVoAagk3MzY4Njk4MzNwAIgBAKABAagBGrABrQK4AQDAAQnIAQjQAbkB4AEX6gEyCAEQGhitAiAAKAkwADgIQLkBShAI4AMQwAIYACIECAAQACoAUAJYAGD36_vXBWoAcgDyASYoADIQDQAAAAAVAAAAABgAIAAoADoQDbIkF0IVFtD0whgAIAAoAZAC-aN6" + } + ], + "trackers": [ + { + "impression_urls": [ + "https://nym1-mobile.adnxs.com/it?an_audit=0&referrer=itunes.apple.com%2Fus%2Fapp%2Fappnexus-sdk-app%2Fid736869833&e=wqT_3QKWCOgWBAAAAwDWAAUBCO6k3PAFENHRr4zm5f_WShie4p7ovf_NlngqNgkHlE25wruMPxEHlE25wruMPxkAAAECCOA_IREbACkRCQAxARm4AADgPzCeu9MIOO5OQO5OSAJQlKuYYFjOs2xgAGikk4YBePy8BYABAYoBA1VTRJIFBvBVmAHAAqABMqgBBrABALgBAcABBMgBAtABANgBAOABAPABAIoCPHVmKCdhJywgNDI0NTY1NSwgMTU3ODU3MDM1MCk7dWYoJ3InLCAyMDE3MjUzMzIsIDEdH_D1kgK1AiFTRDN0dHdqZzF0MFJFSlNybUdBWUFDRE9zMnd3QURnQVFBUkk3azVRbnJ2VENGZ0FZSVlGYUFCd0FIZ0FnQUVBaUFFQWtBRUFtQUVBb0FFQnFBRURzQUVBdVFIWGR4VmRJYnlNUDhFQjEzY1ZYU0c4akRfSkFaYlhLMWo1Y3ZZXzJRRUFBQUFBQUFEd1AtQUJBUFVCQk9GbFBKZ0NBS0FDQUxVQ0FBQUFBTDBDQUFBQUFPQUNBT2dDQVBnQ0FJQURBWmdEQWFnRDROYmRFYm9EQ1U1WlRUSTZORGs1T2VBRGpSbUlCQUNRQkFDWUJBSEJCBUUJAQh5UVEJCQEBFE5nRUFQRRGNAZAsNEJBQ0lCWWNucVFVAREBFDx3UHcuLpoCiQEhVlJLOEFnNjkBoHpyTnNJQVFvQURGN0ZLNUg0WHFFUHpvSlRsbE5Nam8wT1RrNVFJMFpTEXgMUEFfVREMDEFBQVcdDABZHQwAYR0MAGMdDPQOAWVBQS7YAgDgAsqoTeoCNGl0dW5lcy5hcHBsZS5jb20vdXMvYXBwL2FwcG5leHVzLXNkay1hcHAvaWQ3MzY4Njk4MzOAAwCIAwGQAwCYAxegAwGqAwDAA6wCyAMB2AP5o3rgAwDoAwL4AwCABACSBAYvdXQvdjOYBACiBAwxMC43NS4xMC4xNDGoBK29AbIEDwgAEAEYwAIgMigAMAA4ArgEAMAEAMgEANIEDzEwMDk0I05ZTTI6NDk5OdoEAggB4AQB8ASUq5hg-gQSCQAAAECW5EJAEQAAAMACml7AggUJNzM2ODY5ODMziAUBmAUAoAX___________8BwAUAyQUAAAAAAADwP9IFCQkAAABlanDYBQHgBQHwBdyKBfoFBAgAEACQBgCYBgC4BgDBBgUiLADwP9AG1jPaBhYKEAkRGQFQEAAYAOAGAfIGAggAgAcBiAcAoAcB&s=2edceb517482fdb21a998b42786262cd9573cafa" + ], + "video_events": {} + } + ], + "request_url": "https://mobile.adnxs.com/nop", + "response_url": "https://mobile.adnxs.com/nop" + } + } + ] + } + ] +} diff --git a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Stubbing/ANURLConnectionStub+NSURLSessionConfiguration.m b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Stubbing/ANURLConnectionStub+NSURLSessionConfiguration.m index 20d38a8c4..d1b6ff7d5 100644 --- a/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Stubbing/ANURLConnectionStub+NSURLSessionConfiguration.m +++ b/tests/UnitTestApp/UnitTestApp/SharedMockFiles/Stubbing/ANURLConnectionStub+NSURLSessionConfiguration.m @@ -17,6 +17,9 @@ #import "ANURLConnectionStub.h" #import "NSObject+Swizzling.h" +#import "ANHTTPNetworkSession+ANTest.h" +#import "ANGlobal+ANTest.h" + /** @@ -59,6 +62,10 @@ +(void)load (IMP)ANHTTPStubs_ephemeralSessionConfiguration, [NSURLSessionConfiguration class], YES); + + // Recreated network session and mutable request after http stubbing is enabled. + [[ANHTTPNetworkSession sharedInstance]setAdServerSession:[NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:[ANHTTPNetworkSession sharedInstance] delegateQueue:nil]]; + [ANGlobal constructAdServerRequestURL]; } @end diff --git a/tests/UnitTestApp/UnitTests/ANAdMediationTimeoutTestcase.m b/tests/UnitTestApp/UnitTests/ANAdMediationTimeoutTestcase.m new file mode 100644 index 000000000..b58410601 --- /dev/null +++ b/tests/UnitTestApp/UnitTests/ANAdMediationTimeoutTestcase.m @@ -0,0 +1,72 @@ +/* Copyright 2020 APPNEXUS INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +#import +#import "TestGlobal.h" + +#import "ANUniversalTagAdServerResponse.h" +#import "XCTestCase+ANCategory.h" +#import "ANMediatedAd.h" +#import "ANNativeStandardAdResponse.h" + +@interface ANAdMediationTimeoutTestcase : XCTestCase + +@end + +@implementation ANAdMediationTimeoutTestcase + +- (void)setUp { + // Put setup code here. This method is called before the invocation of each test method in the class. + +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. +} + +- (void)testNativeMediationResponseTimeout { + NSMutableArray *adsArray = [TestGlobal adsArrayFromFirstTagInReponseData:[self dataWithJSONResource:@"SuccessfulMediationResponse"]]; + + XCTAssertEqual([adsArray count], 4); + + for (ANMediatedAd *mediatedAd in adsArray) { + XCTAssertEqual(mediatedAd.networkTimeout,1500); + } +} + + +- (void)testBannerMediationResponseTimeout { + NSMutableArray *adsArray = [TestGlobal adsArrayFromFirstTagInReponseData:[self dataWithJSONResource:@"csm_bannerad"]]; + + XCTAssertEqual([adsArray count], 1); + + for (ANMediatedAd *mediatedAd in adsArray) { + XCTAssertEqual(mediatedAd.networkTimeout,3500); + } +} + + + +- (void)testMediationResponseDefaultTimeout { + NSMutableArray *adsArray = [TestGlobal adsArrayFromFirstTagInReponseData:[self dataWithJSONResource:@"SuccessfulMediationResponseDefaultTimeout"]]; + + XCTAssertEqual([adsArray count], 4); + + for (ANMediatedAd *mediatedAd in adsArray) { + XCTAssertEqual(mediatedAd.networkTimeout,15000); + } +} +@end diff --git a/tests/UnitTestApp/UnitTests/ANUniversalTagRequestBuilderTests.m b/tests/UnitTestApp/UnitTests/ANUniversalTagRequestBuilderTests.m index a7aa87e1a..07adaa439 100644 --- a/tests/UnitTestApp/UnitTests/ANUniversalTagRequestBuilderTests.m +++ b/tests/UnitTestApp/UnitTests/ANUniversalTagRequestBuilderTests.m @@ -57,7 +57,6 @@ - (void)tearDown { - (void)testUTRequest { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; dispatch_queue_t backgroundQueue = dispatch_queue_create("QUEUE FOR testUTRequest.", DISPATCH_QUEUE_SERIAL); @@ -66,7 +65,7 @@ - (void)testUTRequest // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), backgroundQueue, ^{ - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSError *error; id jsonObject = [NSJSONSerialization JSONObjectWithData: request.HTTPBody @@ -179,7 +178,6 @@ - (void)testUTRequest - (void)testUTRequestWithPurpose1AndConsentSetTrue { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; dispatch_queue_t backgroundQueue = dispatch_queue_create("QUEUE FOR testUTRequest.", DISPATCH_QUEUE_SERIAL); @@ -190,7 +188,7 @@ - (void)testUTRequestWithPurpose1AndConsentSetTrue // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), backgroundQueue, ^{ - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSError *error; id jsonObject = [NSJSONSerialization JSONObjectWithData: request.HTTPBody @@ -231,7 +229,6 @@ - (void)testUTRequestWithPurpose1AndConsentSetTrue - (void)testUTRequestWithPurpose1SetTrueAndConsentSetFalse { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; dispatch_queue_t backgroundQueue = dispatch_queue_create("QUEUE FOR testUTRequest.", DISPATCH_QUEUE_SERIAL); @@ -242,7 +239,7 @@ - (void)testUTRequestWithPurpose1SetTrueAndConsentSetFalse // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), backgroundQueue, ^{ - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSError *error; id jsonObject = [NSJSONSerialization JSONObjectWithData: request.HTTPBody @@ -283,7 +280,6 @@ - (void)testUTRequestWithPurpose1SetTrueAndConsentSetFalse - (void)testUTRequestWithPurpose1SetFalse { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; dispatch_queue_t backgroundQueue = dispatch_queue_create("QUEUE FOR testUTRequest.", DISPATCH_QUEUE_SERIAL); @@ -294,7 +290,7 @@ - (void)testUTRequestWithPurpose1SetFalse // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), backgroundQueue, ^{ - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSError *error; id jsonObject = [NSJSONSerialization JSONObjectWithData: request.HTTPBody @@ -334,7 +330,6 @@ - (void)testUTRequestWithPurpose1SetFalse - (void)testUTRequestWithoutPurpose1ConsentTrue { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; dispatch_queue_t backgroundQueue = dispatch_queue_create("QUEUE FOR testUTRequest.", DISPATCH_QUEUE_SERIAL); @@ -345,7 +340,7 @@ - (void)testUTRequestWithoutPurpose1ConsentTrue // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), backgroundQueue, ^{ - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSError *error; id jsonObject = [NSJSONSerialization JSONObjectWithData: request.HTTPBody @@ -386,7 +381,6 @@ - (void)testUTRequestWithoutPurpose1ConsentTrue - (void)testUTRequestWithoutPurpose1ConsentFalse { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; dispatch_queue_t backgroundQueue = dispatch_queue_create("QUEUE FOR testUTRequest.", DISPATCH_QUEUE_SERIAL); @@ -397,7 +391,7 @@ - (void)testUTRequestWithoutPurpose1ConsentFalse // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), backgroundQueue, ^{ - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSError *error; id jsonObject = [NSJSONSerialization JSONObjectWithData: request.HTTPBody @@ -441,9 +435,8 @@ - (void)testUTRequestWithoutPurpose1ConsentFalse - (void)testUTRequestForDuration { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; @@ -499,12 +492,11 @@ - (void)testUTRequestForDuration - (void)testUTRequestWithOneCustomKeywordsValue { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; [adFetcher addCustomKeywordWithKey:@"state" value:@"NY"]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; @@ -547,7 +539,6 @@ - (void)testUTRequestWithOneCustomKeywordsValue - (void)testUTRequestWithMultipleCustomKeywordsValues { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; [adFetcher addCustomKeywordWithKey:@"state" value:@"NY"]; @@ -555,7 +546,7 @@ - (void)testUTRequestWithMultipleCustomKeywordsValues [adFetcher addCustomKeywordWithKey:@"county" value:@"essex"]; [adFetcher addCustomKeywordWithKey:@"county" value:@"morris"]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), @@ -603,11 +594,9 @@ - (void)testUTRequestWithMultipleCustomKeywordsValues - (void)testRequestContentType { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; - TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:@"1281482"]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; NSString *contentType = [request valueForHTTPHeaderField:@"content-type"]; XCTAssertNotNil(contentType); @@ -619,12 +608,11 @@ - (void)testRequestContentType { - (void)testUTRequestWithContentURLCustomKeywordsValue { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANUniversalFetcher *adFetcher = [[TestANUniversalFetcher alloc] initWithPlacementId:videoPlacementID]; [adFetcher addCustomKeywordWithKey:@"content_url" value:@"http://www.appnexus.com"]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; diff --git a/tests/UnitTestApp/UnitTests/CSR/ANCSRUniversalTagRequestBuilderTests.m b/tests/UnitTestApp/UnitTests/CSR/ANCSRUniversalTagRequestBuilderTests.m index 2cb43e75f..414360775 100644 --- a/tests/UnitTestApp/UnitTests/CSR/ANCSRUniversalTagRequestBuilderTests.m +++ b/tests/UnitTestApp/UnitTests/CSR/ANCSRUniversalTagRequestBuilderTests.m @@ -40,11 +40,10 @@ - (void)tearDown { - (void)testUTRequestWithoutTpuids { - NSString *urlString = [[[ANSDKSettings sharedInstance] baseUrlConfig] utAdRequestBaseUrl]; TestANCSRUniversalFetcher *adFetcher = [[TestANCSRUniversalFetcher alloc] initWithPlacementId:PlacementID]; - NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate baseUrlString:urlString]; + NSURLRequest *request = [ANUniversalTagRequestBuilder buildRequestWithAdFetcherDelegate:adFetcher.delegate]; XCTestExpectation *expectation = [self expectationWithDescription:@"Dummy expectation"]; diff --git a/tests/UnitTestApp/UnitTests/LazyLoadFeatureTests.m b/tests/UnitTestApp/UnitTests/LazyLoadFeatureTests.m new file mode 100644 index 000000000..479185782 --- /dev/null +++ b/tests/UnitTestApp/UnitTests/LazyLoadFeatureTests.m @@ -0,0 +1,713 @@ +/* Copyright 2020 APPNEXUS INC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#import + +#import "ANHTTPStubbingManager.h" +#import "TestGlobal.h" +#import "MARHelper.h" + +#import "ANLogManager.h" +#import "ANSDKSettings.h" + +#import "ANAdView.h" +#import "ANAdView+PrivateMethods.h" +#import "ANAdViewInternalDelegate.h" + +#import "ANBannerAdView.h" +#import "ANBannerAdView+ANTest.h" +#import "ANInterstitialAd+ANTest.h" +#import "ANNativeAdRequest+ANTest.h" +#import "ANInstreamVideoAd+Test.h" +#import "ANMultiAdRequest.h" + +#import "ANAdFetcherBase.h" +#import "ANUniversalAdFetcher+ANTest.h" +#import "ANMRAIDContainerView+ANTest.h" + + + + +#pragma mark - + +@interface LazyLoadFeatureTests :XCTestCase + +@property (nonatomic, readwrite, strong) ANBannerAdView *lazyBanner; +@property (nonatomic, readwrite, strong) ANBannerAdView *multiFormatBanner; + +@property (nonatomic, readwrite, strong) ANMultiAdRequest *mar; +@property (nonatomic, readwrite, strong, nullable) MARAdUnits *adUnitsForTest; + +@property (nonatomic, readwrite) NSUInteger countOfRequestedAdUnits; + +@property (nonatomic, readwrite) ANAdResponseInfo *responseInfoFirstTime; +@property (nonatomic, readwrite) ANAdResponseInfo *responseInfoSecondTime; + + +@property (nonatomic, strong) XCTestExpectation *expectationLazyAdDidReceiveAd; +@property (nonatomic, strong) XCTestExpectation *expectationAdDidReceiveAd; +@property (nonatomic, strong) XCTestExpectation *expectationAdDidReceiveNativeAd; +@property (nonatomic, strong) XCTestExpectation *expectationMultiAdRequestSuccess; +@property (nonatomic, strong) XCTestExpectation *expectationRequestFailedWithError; + +@property (nonatomic, strong) XCTestExpectation *expectationAdResponseInfoIsDefined; +@property (nonatomic, strong) XCTestExpectation *expectationAdResponseInfoIsDefinedAndDifferent; +@property (nonatomic, strong) XCTestExpectation *expectationTryToLoadWebviewSecondTimeForLazyAdUnit; +@property (nonatomic, strong) XCTestExpectation *expectationAutoRefreshTimerIsSetProperly; +@property (nonatomic, strong) XCTestExpectation *expectationFindANAdResponseInfoOnLazyFailure; +@property (nonatomic, strong) XCTestExpectation *expectationAdResponseInfoIsDefinedAndDifferentForTwoCallsToLoadAd; +@property (nonatomic, strong) XCTestExpectation *expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd; + + +@property (nonatomic) BOOL loadWebviewWhenLazyLoadCompletes; +@property (nonatomic) BOOL swizzleToPreventWebviewLoad; +@property (nonatomic) BOOL loadWebviewForAdUnitThatIsNotLazy; + + +@property (nonatomic, strong) UIViewController *rootVC; + +@end + + + + +#pragma mark - + +/** + * NOTE: This feature has been renamed from "Lazy Webview" to "Lazy Load". + */ +@implementation LazyLoadFeatureTests + +#pragma mark Lifecycle. + +- (void)setUp +{ + [[ANHTTPStubbingManager sharedStubbingManager] enable]; + [ANHTTPStubbingManager sharedStubbingManager].ignoreUnstubbedRequests = YES; + + [ANLogManager setANLogLevel:ANLogLevelAll]; + + + // + [self createAdUnits]; + + self.mar = nil; + self.adUnitsForTest = [[MARAdUnits alloc] initWithDelegate:self]; + + [ANBannerAdView setDoNotResetAdUnitUUID:YES]; + [ANInterstitialAd setDoNotResetAdUnitUUID:YES]; + [ANNativeAdRequest setDoNotResetAdUnitUUID:YES]; + [ANInstreamVideoAd setDoNotResetAdUnitUUID:YES]; + + + // + self.expectationLazyAdDidReceiveAd = nil; + self.expectationAdDidReceiveAd = nil; + self.expectationAdDidReceiveNativeAd = nil; + self.expectationMultiAdRequestSuccess = nil; + self.expectationRequestFailedWithError = nil; + + self.expectationAdResponseInfoIsDefined = nil; + self.expectationAdResponseInfoIsDefinedAndDifferent = nil; + self.expectationTryToLoadWebviewSecondTimeForLazyAdUnit = nil; + self.expectationAutoRefreshTimerIsSetProperly = nil; + self.expectationFindANAdResponseInfoOnLazyFailure = nil; + self.expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd = nil; + + // + self.rootVC = [UIApplication sharedApplication].keyWindow.rootViewController; + + self.loadWebviewWhenLazyLoadCompletes = YES; + self.swizzleToPreventWebviewLoad = NO; + self.loadWebviewForAdUnitThatIsNotLazy = NO; + + self.responseInfoFirstTime = nil; + self.responseInfoSecondTime = nil; +} + +- (void)tearDown +{ + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + [[ANHTTPStubbingManager sharedStubbingManager] disable]; +} + +- (void)createAdUnits +{ + int adWidth = 300; + int adHeight = 250; + + // We want to center our ad on the screen. + CGRect screenRect = [[UIScreen mainScreen] bounds]; + CGFloat originX = (screenRect.size.width / 2) - (adWidth / 2); + CGFloat originY = (screenRect.size.height / 2) - (adHeight / 2); + + // Needed for when we create our ad view. + CGRect rect = CGRectMake(originX, originY, adWidth, adHeight); + CGSize size = CGSizeMake(adWidth, adHeight); + + + // Make some banner ad views. + // + self.lazyBanner = [ANBannerAdView adViewWithFrame:rect placementId:@"11112222" adSize:size]; + + self.lazyBanner.delegate = self; +// self.lazyBanner.rootViewController = self.rootVC; + self.lazyBanner.autoRefreshInterval = 0; + self.lazyBanner.shouldAllowVideoDemand = NO; // self.banner1 is always Banner-banner. + self.lazyBanner.shouldAllowNativeDemand = NO; + + self.lazyBanner.shouldServePublicServiceAnnouncements = NO; + + self.lazyBanner.externalUid = @"banner-banner"; + + self.lazyBanner.enableLazyLoad = YES; + + + // + self.multiFormatBanner = [ANBannerAdView adViewWithFrame:rect placementId:@"33334444" adSize:size]; + + self.multiFormatBanner.delegate = self; +// self.multiFormatBanner.rootViewController = self.rootVC; + self.multiFormatBanner.autoRefreshInterval = 0; + self.multiFormatBanner.shouldAllowVideoDemand = YES; + self.multiFormatBanner.shouldAllowNativeDemand = YES; + + self.lazyBanner.shouldServePublicServiceAnnouncements = NO; + + self.multiFormatBanner.externalUid = @"banner-multiformat"; + + self.multiFormatBanner.enableLazyLoad = NO; + +} + + + + +#pragma mark - Tests. + +- (void)testBasicOperation +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdDidReceiveAd", __PRETTY_FUNCTION__]]; + + // + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testFeatureFlagCanBeSet +{ + XCTAssert(self.multiFormatBanner.enableLazyLoad == NO); + self.multiFormatBanner.enableLazyLoad = YES; + XCTAssert(self.multiFormatBanner.enableLazyLoad == YES); +} + +- (void)testFeatureFlagCannotBeUnset +{ + XCTAssert(self.multiFormatBanner.enableLazyLoad == NO); + self.multiFormatBanner.enableLazyLoad = YES; + XCTAssert(self.multiFormatBanner.enableLazyLoad == YES); + self.multiFormatBanner.enableLazyLoad = NO; + XCTAssert(self.multiFormatBanner.enableLazyLoad == YES); +} + +- (void)testFeatureFlagCannotBeSetDuringLoadAd +{ + XCTAssert(self.multiFormatBanner.enableLazyLoad == NO); + + // + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__]]; + + // + [self.multiFormatBanner loadAd]; + + [TestGlobal waitForSeconds: kWaitQuarterSecond + thenExecuteBlock: ^{ + self.multiFormatBanner.enableLazyLoad = YES; + XCTAssert(self.multiFormatBanner.enableLazyLoad == NO); + } ]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testAdResponseInfoIsDeliveredForLazyLoad +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationAdResponseInfoIsDefined = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdResponseInfoIsDefined", __PRETTY_FUNCTION__]]; + + // + self.loadWebviewWhenLazyLoadCompletes = NO; + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testLoadWebviewDoesNothingForAdUnitsThatAreNotLazyLoaded +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationLazyAdDidReceiveAd.inverted = YES; + + self.expectationAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationAdDidReceiveAd.assertForOverFulfill = YES; + + // + self.loadWebviewWhenLazyLoadCompletes = NO; + self.loadWebviewForAdUnitThatIsNotLazy = YES; + + [self.multiFormatBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testLoadWebviewDoesNothingForLazyAdUnitsThatAreAlreadyLoaded +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + + self.expectationAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationAdDidReceiveAd.assertForOverFulfill = YES; + + self.expectationTryToLoadWebviewSecondTimeForLazyAdUnit = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationTryToLoadWebviewSecondTimeForLazyAdUnit", __PRETTY_FUNCTION__]]; + + // + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testLoadWebviewDoesNothingWhenAdUnitReturnsNobid +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_nobid"]; + + self.expectationRequestFailedWithError = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationRequestFailedWithError", __PRETTY_FUNCTION__]]; + self.expectationFindANAdResponseInfoOnLazyFailure = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationFindANAdResponseInfoOnLazyFailure", __PRETTY_FUNCTION__]]; + + // + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +/* + * TBD -- Replace this test with two new tests, #25 and #26, defined on feature wiki in the section "Testing >> New Test for AdUnits and Single Request Mode (SRM)". + * + * https://corpwiki.xandr-services.com/display/CT/MobileSDK+AdUnit+load+re-architecture#MobileSDKAdUnitloadre-architecture-NewTestforAdUnitsandSingleRequestMode(SRM) + * +- (void)testAutoRefreshTimerIsNotStartedBeforeLazyWebview +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationAutoRefreshTimerIsSetProperly = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAutoRefreshTimer", __PRETTY_FUNCTION__]]; + + // + self.lazyBanner.autoRefreshInterval = 108; + XCTAssertNil(self.lazyBanner.universalAdFetcher.autoRefreshTimer); + + [self.lazyBanner loadAd]; + XCTAssertNil(self.lazyBanner.universalAdFetcher.autoRefreshTimer); + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + * + */ + +- (void)testMultiAdRequestWorksWithLazyWebview +{ + [TestGlobal stubRequestWithResponse:@"testMARCombinationAllRTB"]; + + self.mar = [[ANMultiAdRequest alloc] initWithMemberId: self.adUnitsForTest.memberIDGood + delegate: self + adUnits: self.adUnitsForTest.bannerBanner, + self.adUnitsForTest.interstitial, + self.adUnitsForTest.native, + self.adUnitsForTest.instreamVideo, + nil ]; + + self.countOfRequestedAdUnits = 4; + + self.adUnitsForTest.bannerBanner.utRequestUUIDString = @"1"; + self.adUnitsForTest.interstitial.utRequestUUIDString = @"2"; + self.adUnitsForTest.native.utRequestUUIDString = @"3"; + self.adUnitsForTest.instreamVideo.utRequestUUIDString = @"4"; + + XCTAssertNotNil(self.mar); + + + // + self.expectationMultiAdRequestSuccess = [self expectationWithDescription:@"EXPECTATION: expectationMultiAdRequestSuccess"]; + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:@"EXPECTATION: expectationLazyAdDidReceiveAd"]; + + self.expectationAdDidReceiveAd = [self expectationWithDescription:@"EXPECTATION: expectationAdDidReceiveAd"]; + self.expectationAdDidReceiveAd.expectedFulfillmentCount = self.countOfRequestedAdUnits; + + + self.loadWebviewWhenLazyLoadCompletes = YES; + self.adUnitsForTest.bannerBanner.enableLazyLoad = YES; + [self.mar load]; + + [self waitForExpectationsWithTimeout:kWaitLong handler:nil]; +} + +- (void)testLoadWebviewFailsWhenWebviewAllocationFails +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationRequestFailedWithError = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationRequestFailedWithError", __PRETTY_FUNCTION__]]; + + self.expectationAdResponseInfoIsDefined = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdResponseInfoIsDefined", __PRETTY_FUNCTION__]]; + self.expectationFindANAdResponseInfoOnLazyFailure = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationFindANAdResponseInfoOnNobidFailure", __PRETTY_FUNCTION__]]; + + + // + [ANMRAIDContainerView swizzleMRAIDContainerView:YES]; + self.swizzleToPreventWebviewLoad = YES; + + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testBannerNativeDoesNotAllowLazyLoading +{ + [TestGlobal stubRequestWithResponse:@"ANAdResponseRTB_Native"]; + + self.expectationAdDidReceiveNativeAd = [self expectationWithDescription:@"EXPECTATION: expectationAdDidReceiveNativeAd"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationLazyAdDidReceiveAd.inverted = YES; + + // + self.multiFormatBanner.enableLazyLoad = YES; + [self.multiFormatBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testBannerVideoDoesNotAllowLazyLoading +{ + [TestGlobal stubRequestWithResponse:@"SuccessfulOutstreamBannerVideoResponse"]; + + self.expectationAdDidReceiveAd = [self expectationWithDescription:@"EXPECTATION: expectationAdDidReceiveAd"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationLazyAdDidReceiveAd.inverted = YES; + + // + self.multiFormatBanner.enableLazyLoad = YES; + [self.multiFormatBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testLoadWebviewFailsIfLoadAdHasNotBeenCalled +{ + self.expectationAdDidReceiveAd = [self expectationWithDescription:@"EXPECTATION: expectationAdDidReceiveAd"]; + self.expectationAdDidReceiveAd.inverted = YES; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationLazyAdDidReceiveAd.inverted = YES; + + // + BOOL returnValue = [self.lazyBanner loadLazyAd]; + XCTAssertFalse(returnValue); + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testLoadAdAgainAfterSuccessfulLoadLazyAd +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationLazyAdDidReceiveAd.expectedFulfillmentCount = 2; + + self.expectationAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdDidReceiveAd", __PRETTY_FUNCTION__]]; + + self.expectationAdResponseInfoIsDefinedAndDifferent = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdResponseInfoIsDefinedAndDifferent", __PRETTY_FUNCTION__]]; + self.expectationAdResponseInfoIsDefinedAndDifferent.expectedFulfillmentCount = 2; + + // + self.lazyBanner.autoRefreshInterval = 108; + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + +- (void)testLoadAdTwiceInARow +{ + [TestGlobal stubRequestWithResponse:@"LazyWebview_Basic"]; + + self.expectationLazyAdDidReceiveAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationLazyAdDidReceiveAd", __PRETTY_FUNCTION__]]; + self.expectationLazyAdDidReceiveAd.expectedFulfillmentCount = 2; + + self.expectationAdResponseInfoIsDefinedAndDifferent = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationAdResponseInfoIsDefinedAndDifferent", __PRETTY_FUNCTION__]]; + self.expectationAdResponseInfoIsDefinedAndDifferent.expectedFulfillmentCount = 2; + + self.expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd = [self expectationWithDescription:[NSString stringWithFormat:@"%s -- expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd", __PRETTY_FUNCTION__]]; + self.expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd.expectedFulfillmentCount = 1; + + + // + self.lazyBanner.autoRefreshInterval = 108; + [self.lazyBanner loadAd]; + + [self waitForExpectationsWithTimeout:kWaitShort handler:nil]; +} + + + + +#pragma mark - ANAdProtocol. + +- (void)adDidReceiveAd:(id)ad +{ + TINFO(@"Ad did receive ad -- %@", (self.mar) ? [MARHelper adunitDescription:ad] : @""); + + if (self.expectationTryToLoadWebviewSecondTimeForLazyAdUnit) + { + BOOL returnValue = [self.lazyBanner loadLazyAd]; + XCTAssertFalse(returnValue); + + [self.expectationTryToLoadWebviewSecondTimeForLazyAdUnit fulfill]; + } + + if (self.expectationAutoRefreshTimerIsSetProperly) { + XCTAssertNotNil(self.lazyBanner.universalAdFetcher.autoRefreshTimer); + [self.expectationAutoRefreshTimerIsSetProperly fulfill]; + } + + if (self.expectationAdResponseInfoIsDefinedAndDifferent) + { + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + [TestGlobal stubRequestWithResponse:@"LazyWebview_MRAID"]; + + // + ANBannerAdView *banner = (ANBannerAdView *)ad; + + XCTAssertNotNil(banner.universalAdFetcher.autoRefreshTimer); + + [banner loadAd]; // Run a second lazy load, after the first successful lazy load + webview load. + } + + if (self.expectationAdDidReceiveAd) { + [self.expectationAdDidReceiveAd fulfill]; + } +} + +- (void)lazyAdDidReceiveAd:(id)ad +{ + TINFO(@"Lazy ad did receive ad -- %@", (self.mar) ? [MARHelper adunitDescription:ad] : @""); + + + // + if (self.expectationLazyAdDidReceiveAd) { + [self.expectationLazyAdDidReceiveAd fulfill]; + } + + + // + if ([ad isKindOfClass:[ANBannerAdView class]]) + { + ANBannerAdView *banner = (ANBannerAdView *)ad; + + if (self.expectationAdResponseInfoIsDefined) + { + XCTAssertNotNil(banner.adResponseInfo); + XCTAssertNotNil(banner.adResponseInfo.creativeId); + XCTAssertNotNil(banner.adResponseInfo.contentSource); + + [self.expectationAdResponseInfoIsDefined fulfill]; + } + + if (self.loadWebviewWhenLazyLoadCompletes && banner.enableLazyLoad) + { + TINFO(@"%s -- LOADING lazy webview...", __PRETTY_FUNCTION__); + + if (self.expectationAutoRefreshTimerIsSetProperly) { + XCTAssertNil(self.lazyBanner.universalAdFetcher.autoRefreshTimer); + } + + [banner loadLazyAd]; + } + + if (self.loadWebviewForAdUnitThatIsNotLazy) + { + BOOL returnValue = [banner loadLazyAd]; + XCTAssertFalse(returnValue); + } + + if (self.expectationAdResponseInfoIsDefinedAndDifferent) + { + if (!self.responseInfoFirstTime) + { + self.responseInfoFirstTime = banner.adResponseInfo; + + XCTAssertNotNil(self.responseInfoFirstTime); + XCTAssertNotNil(self.responseInfoFirstTime.creativeId); + XCTAssertNotNil(self.responseInfoFirstTime.contentSource); + + } else { + self.responseInfoSecondTime = banner.adResponseInfo; + + XCTAssertNil(banner.contentView); + + XCTAssertNotNil(self.responseInfoSecondTime); + XCTAssertNotNil(self.responseInfoSecondTime.creativeId); + XCTAssertNotNil(self.responseInfoSecondTime.contentSource); + + XCTAssertFalse([self.responseInfoFirstTime.creativeId isEqualToString:self.responseInfoSecondTime.creativeId]); + XCTAssertFalse([self.responseInfoFirstTime.placementId isEqualToString:self.responseInfoSecondTime.placementId]); + +// XCTAssertNil(banner.universalAdFetcher.autoRefreshTimer); //FIX -- should it run or not? + } + + [self.expectationAdResponseInfoIsDefinedAndDifferent fulfill]; + + if (self.expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd && !self.responseInfoSecondTime) + { + [[ANHTTPStubbingManager sharedStubbingManager] removeAllStubs]; + [TestGlobal stubRequestWithResponse:@"LazyWebview_MRAID"]; + + // + ANBannerAdView *banner = (ANBannerAdView *)ad; + +// XCTAssertNil(banner.universalAdFetcher.autoRefreshTimer); //FIX -- should it run or not? + + [banner loadAd]; // Run lazy load again, without loading the webview of the existing lazy load. + + [self.expectationRunLoadAdASecondTimeWithoutCallingLoadLazyAd fulfill]; + } + + } //ENDIF -- expectationAdResponseInfoIsDefinedAndDifferent + } //ENDIF -- ad is ANBannerAdView +} + +- (void)ad:(nonnull id)loadInstance didReceiveNativeAd:(nonnull id)responseInstance +{ + TINFO(@"Ad did receive Multi-format NATIVE ad -- %@", (self.mar) ? [MARHelper adunitDescription:loadInstance] : @""); + + if (self.expectationAdDidReceiveNativeAd) { + [self.expectationAdDidReceiveNativeAd fulfill]; + } +} + + +- (void)ad:(id)ad requestFailedWithError:(NSError *)error +{ + TINFO(@"Ad failed to load: %@ -- %@", error, (self.mar) ? [MARHelper adunitDescription:ad] : @""); + + if ([ad isKindOfClass:[ANBannerAdView class]]) + { + ANBannerAdView *banner = (ANBannerAdView *)ad; + + if (banner.enableLazyLoad && (banner.adResponseInfo.adType == ANAdTypeBanner)) + { + TERROR(@"%s -- Lazy webview load FAILED.", __PRETTY_FUNCTION__); + } + + if (self.expectationTryToLoadWebviewSecondTimeForLazyAdUnit) { + BOOL returnValue = [banner loadLazyAd]; + XCTAssertFalse(returnValue); + + [self.expectationTryToLoadWebviewSecondTimeForLazyAdUnit fulfill]; + } + + if (self.expectationFindANAdResponseInfoOnLazyFailure) + { + XCTAssertNotNil(banner.adResponseInfo); + XCTAssertNotNil(banner.adResponseInfo.placementId); + + [self.expectationFindANAdResponseInfoOnLazyFailure fulfill]; + } + } + + if (self.swizzleToPreventWebviewLoad) { + [ANMRAIDContainerView swizzleMRAIDContainerView:NO]; + } + + if (self.expectationRequestFailedWithError) { + [self.expectationRequestFailedWithError fulfill]; + } +} + + +- (void)adDidClose:(id)ad +{ + TINFO(@"Ad did close"); +} + +- (void)adWasClicked:(id)ad +{ + TINFO(@"Ad was clicked"); +} + +- (void)adWasClicked:(id)ad withURLString:(NSString *)urlString +{ + TINFO(@"ClickThroughURL=%@", urlString); +} + + + + +#pragma mark - ANMultiAdRequestDelegate. + +- (void)multiAdRequestDidComplete:(ANMultiAdRequest *)mar +{ + TINFO(@"%s", __PRETTY_FUNCTION__); + + if (self.expectationMultiAdRequestSuccess) { + [self.expectationMultiAdRequestSuccess fulfill]; + } +} + +- (void)multiAdRequest:(ANMultiAdRequest *)mar didFailWithError:(NSError *)error +{ + TINFO(@"%s", __PRETTY_FUNCTION__); +} + + + + +#pragma mark - ANNativeRequestDelegate. + +- (void)adRequest:(nonnull ANNativeAdRequest *)request didReceiveResponse:(nonnull ANNativeAdResponse *)response +{ + TINFO(@"Ad did receive NATIVE ad -- %@", (self.mar) ? [MARHelper adunitDescription:request] : @""); + + if (self.expectationAdDidReceiveAd) { + [self.expectationAdDidReceiveAd fulfill]; + } +} + +- (void)adRequest:(nonnull ANNativeAdRequest *)request didFailToLoadWithError:(nonnull NSError *)error withAdResponseInfo:(nullable ANAdResponseInfo *)adResponseInfo +{ + TINFO(@"Ad did receive NATIVE ad -- %@", (self.mar) ? [MARHelper adunitDescription:request] : @""); +} + + +@end diff --git a/tests/UnitTestApp/UnitTests/PrivateAPI.m b/tests/UnitTestApp/UnitTests/PrivateAPI.m index 55114d101..fa0ce5aee 100644 --- a/tests/UnitTestApp/UnitTests/PrivateAPI.m +++ b/tests/UnitTestApp/UnitTests/PrivateAPI.m @@ -30,7 +30,6 @@ #pragma mark - @interface PrivateAPI : XCTestCase - //FIX -- cleanup unrequired propertis. @@ -168,7 +167,6 @@ - (void)testGenerateRTBVideoAdUnitFromVASTObject #pragma mark - ANMultiAdRequestDelegate. - //FIX -- required? - (void)multiAdRequestDidComplete:(ANMultiAdRequest *)mar { @@ -188,7 +186,6 @@ - (void)multiAdRequest:(nonnull ANMultiAdRequest *)mar didFailWithError:(NSError #pragma mark - ANAdProtocol. - //FIX -- required? - (void)adDidReceiveAd:(nonnull id)ad { @@ -255,7 +252,6 @@ - (void)adWillLeaveApplication:(nonnull id)ad #pragma mark - ANNativeAdRequestDelegate. - //FIX -- required? - (void)adRequest:(nonnull ANNativeAdRequest *)request didReceiveResponse:(nonnull ANNativeAdResponse *)response { diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/FBAudienceNetwork b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/FBAudienceNetwork index 4400a657f..b4e28f940 100755 Binary files a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/FBAudienceNetwork and b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/FBAudienceNetwork differ diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdChoicesView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdChoicesView.h index 52c2149cb..5c47090af 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdChoicesView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdChoicesView.h @@ -30,8 +30,7 @@ NS_ASSUME_NONNULL_BEGIN /** FBAdChoicesView offers a simple way to display a sponsored or AdChoices icon. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBAdChoicesView : UIView +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdChoicesView : UIView /** Access to the text label contained in this view. @@ -86,8 +85,7 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @param nativeAd The native ad to initialize with. @param expandable Controls whether view defaults to expanded or not, see property documentation */ -- (instancetype)initWithNativeAd:(FBNativeAdBase *)nativeAd - expandable:(BOOL)expandable; +- (instancetype)initWithNativeAd:(FBNativeAdBase *)nativeAd expandable:(BOOL)expandable; /** Initialize this view with a given native ad. Configuration is pulled from the native ad. @@ -106,14 +104,16 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED - (void)updateFrameFromSuperview; /** - Using the superview, this updates the frame of this view, positioning the icon in the corner specified. UIRectCornerAllCorners not supported. + Using the superview, this updates the frame of this view, positioning the icon in the corner specified. + UIRectCornerAllCorners not supported. @param corner The corner to display this view from. */ - (void)updateFrameFromSuperview:(UIRectCorner)corner; /** - Using the superview, this updates the frame of this view, positioning the icon in the corner specified. UIRectCornerAllCorners not supported. + Using the superview, this updates the frame of this view, positioning the icon in the corner specified. + UIRectCornerAllCorners not supported. @param corner The corner to display this view from. @param insets Insets to take into account when positioning the view. Only respective insets are applied to corners. diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdDefines.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdDefines.h index 5a63b6761..761c70d9b 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdDefines.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdDefines.h @@ -20,17 +20,17 @@ #define FBAudienceNetwork_FBAdDefines_h #ifdef __cplusplus -#define FB_EXTERN_C_BEGIN extern "C" { -#define FB_EXTERN_C_END } +#define FB_EXTERN_C_BEGIN extern "C" { +#define FB_EXTERN_C_END } #else #define FB_EXTERN_C_BEGIN #define FB_EXTERN_C_END #endif #ifdef __cplusplus -# define FB_EXPORT extern "C" __attribute__((visibility("default"))) +#define FB_EXPORT extern "C" __attribute__((visibility("default"))) #else -# define FB_EXPORT extern __attribute__((visibility("default"))) +#define FB_EXPORT extern __attribute__((visibility("default"))) #endif #define FB_CLASS_EXPORT __attribute__((visibility("default"))) @@ -40,21 +40,21 @@ #if __has_feature(objc_generics) #define FB_NSArrayOf(x) NSArray #define FB_NSMutableArrayOf(x) NSMutableArray -#define FB_NSDictionaryOf(x,y) NSDictionary +#define FB_NSDictionaryOf(x, y) NSDictionary #define FB_NSMutableDictionaryOf(x, y) NSMutableDictionary #define FB_NSSetOf(x) NSSet #define FB_NSMutableSetOf(x) NSMutableSet #else #define FB_NSArrayOf(x) NSArray #define FB_NSMutableArrayOf(x) NSMutableArray -#define FB_NSDictionaryOf(x,y) NSDictionary +#define FB_NSDictionaryOf(x, y) NSDictionary #define FB_NSMutableDictionaryOf(x, y) NSMutableDictionary #define FB_NSSetOf(x) NSSet #define FB_NSMutableSetOf(x) NSMutableSet #define __covariant #endif -#if ! __has_feature(nullability) +#if !__has_feature(nullability) #define NS_ASSUME_NONNULL_BEGIN #define NS_ASSUME_NONNULL_END #define nullable diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdExperienceConfig.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdExperienceConfig.h new file mode 100644 index 000000000..a1986c720 --- /dev/null +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdExperienceConfig.h @@ -0,0 +1,52 @@ +// Copyright 2004-present Facebook. All Rights Reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NSString *FBAdExperienceType NS_STRING_ENUM; +extern FBAdExperienceType const FBAdExperienceTypeRewarded; +extern FBAdExperienceType const FBAdExperienceTypeInterstitial; +extern FBAdExperienceType const FBAdExperienceTypeRewardedInterstitial; + +FB_CLASS_EXPORT +/** + FBAdExperienceConfig is class designed to add some configuration to ad experience + */ +@interface FBAdExperienceConfig : NSObject + +/** + Ad experience type to set up + */ +@property (nonatomic, strong, readwrite, nonnull) FBAdExperienceType adExperienceType; + +- (instancetype)init NS_UNAVAILABLE; + ++ (instancetype)new NS_UNAVAILABLE; + +/** + Creates an FBAdExperienceConfig with a specified type of experience + */ +- (instancetype)initWithAdExperienceType:(FBAdExperienceType)adExperienceType NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdImage.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdImage.h index 9e9914958..088d1ef2f 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdImage.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdImage.h @@ -48,16 +48,14 @@ FB_CLASS_EXPORT @param width the image width. @param height the image height. */ -- (instancetype)initWithURL:(NSURL *)url - width:(NSInteger)width - height:(NSInteger)height NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithURL:(NSURL *)url width:(NSInteger)width height:(NSInteger)height NS_DESIGNATED_INITIALIZER; /** Loads an image from self.url over the network, or returns the cached image immediately. @param block Block to handle the loaded image. */ -- (void)loadImageAsyncWithBlock:(nullable void (^)(UIImage * __nullable image))block; +- (void)loadImageAsyncWithBlock:(nullable void (^)(UIImage *__nullable image))block; @end diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdSettings.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdSettings.h index 1e773c644..3cd5bf567 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdSettings.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdSettings.h @@ -25,11 +25,11 @@ NS_ASSUME_NONNULL_BEGIN /** Audience Network error domain */ -FB_EXPORT NSString * const FBAudienceNetworkErrorDomain; +FB_EXPORT NSString *const FBAudienceNetworkErrorDomain; /** Audience Network error FBMediaView error domain */ -FB_EXPORT NSString * const FBAudienceNetworkMediaViewErrorDomain; +FB_EXPORT NSString *const FBAudienceNetworkMediaViewErrorDomain; /** Audience Network SDK logging levels @@ -51,20 +51,6 @@ typedef NS_ENUM(NSInteger, FBAdLogLevel) { FBAdLogLevelVerbose }; -/** - Determines what method is used for rendering FBMediaView content - */ -typedef NS_ENUM(NSInteger, FBMediaViewRenderingMethod) { - /// Automatic selection of rendering method - FBMediaViewRenderingMethodDefault, - /// Force Metal rendering (only use for devices with support) - FBMediaViewRenderingMethodMetal, - /// Force OpenGL rendering - FBMediaViewRenderingMethodOpenGL, - /// Software fallback - FBMediaViewRenderingMethodSoftware -} FB_DEPRECATED_WITH_MESSAGE("Rendering method is no longer used in Audience Network"); - /** Test Ad type to be injected when test mode is on */ @@ -102,8 +88,7 @@ typedef NS_ENUM(NSInteger, FBAdTestAdType) { /** AdSettings contains global settings for all ad controls. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBAdSettings : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdSettings : NSObject /** Controls support for audio-only video playback when the app is backgrounded. Note that this is only supported @@ -119,8 +104,8 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @property (class, nonatomic, assign) FBAdTestAdType testAdType; /** - When this delegate is set, logs will be redirected to the delegate instead of being logged directly to the console with NSLog. - This can be used in combination with external logging frameworks. + When this delegate is set, logs will be redirected to the delegate instead of being logged directly to the console with + NSLog. This can be used in combination with external logging frameworks. */ @property (class, nonatomic, weak, nullable) id loggingDelegate; @@ -161,7 +146,7 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @param devicesHash The array of the device id to use test mode, can be obtained from debug log or testDeviceHash */ -+ (void)addTestDevices:(FB_NSArrayOf(NSString *)*)devicesHash; ++ (void)addTestDevices:(FB_NSArrayOf(NSString *) *)devicesHash; /** Clear all the added test devices @@ -194,7 +179,8 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @property (class, nonatomic, assign, getter=isMixedAudience) BOOL mixedAudience; /** - If an ad provided service is mediating Audience Network in their sdk, it is required to set the name of the mediation service + If an ad provided service is mediating Audience Network in their sdk, it is required to set the name of the mediation + service @param service Representing the name of the mediation that is mediation Audience Network */ @@ -214,7 +200,7 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED This method should never be used in production. */ -+ (void)setUrlPrefix:(nullable NSString *) urlPrefix; ++ (void)setUrlPrefix:(nullable NSString *)urlPrefix; /** Gets the current SDK logging level @@ -226,23 +212,6 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED */ + (void)setLogLevel:(FBAdLogLevel)level; -/** - Gets the FBMediaView rendering method - */ -+ (FBMediaViewRenderingMethod) - mediaViewRenderingMethod FB_DEPRECATED_WITH_MESSAGE("Rendering method is no longer used in Audience Network"); - -/** - Sets the FBMediaView rendering method - - Parameter mediaViewRenderingMethod: - FBMediaViewRenderingMethodDefault: SDK chooses optimized rendering method - FBMediaViewRenderingMethodMetal: use Metal kit rendering method - FBMediaViewRenderingMethodOpenGL: use OpenGL rendering method - FBMediaViewRenderingMethodSoftware: use software rendering method - */ -+ (void)setMediaViewRenderingMethod:(FBMediaViewRenderingMethod)mediaViewRenderingMethod - FB_DEPRECATED_WITH_MESSAGE("Rendering method is no longer used in Audience Network"); - @end @protocol FBAdLoggingDelegate diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdView.h index d7c4ce4ef..de27718e8 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAdView.h @@ -54,7 +54,7 @@ FB_CLASS_EXPORT - (nullable instancetype)initWithPlacementID:(NSString *)placementID bidPayload:(NSString *)bidPayload rootViewController:(nullable UIViewController *)rootViewController - error:(NSError * __autoreleasing *) error; + error:(NSError *__autoreleasing *)error; /** Begins loading the FBAdView content. diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetwork.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetwork.h index d3a252104..546e0a763 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetwork.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetwork.h @@ -21,6 +21,7 @@ #import #import +#import #import #import #import @@ -56,4 +57,4 @@ // NOTE: Any changes should also be made to the module.modulemap // to ensure comptability with Swift apps using Cocoapods -#define FB_AD_SDK_VERSION @"5.7.1" +#define FB_AD_SDK_VERSION @"5.9.0" diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetworkAds.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetworkAds.h index b90b41cb8..399ce5b69 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetworkAds.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBAudienceNetworkAds.h @@ -25,12 +25,12 @@ NS_ASSUME_NONNULL_BEGIN /** FBAdInitSettings is an object to incapsulate all the settings you can pass to SDK on initialization call. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBAdInitSettings : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdInitSettings : NSObject /** Designated initializer for FBAdInitSettings - If an ad provided service is mediating Audience Network in their sdk, it is required to set the name of the mediation service + If an ad provided service is mediating Audience Network in their sdk, it is required to set the name of the mediation + service @param placementIDs An array of placement identifiers. @param mediationService String to identify mediation provider. @@ -52,13 +52,12 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED /** FBAdInitResults is an object to incapsulate all the results you'll get as a result of SDK initialization call. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBAdInitResults : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdInitResults : NSObject /** Boolean which says whether initialization was successful */ -@property (nonatomic, assign, readonly, getter = isSuccess) BOOL success; +@property (nonatomic, assign, readonly, getter=isSuccess) BOOL success; /** Message which provides more details about initialization result @@ -80,16 +79,17 @@ typedef NS_ENUM(NSInteger, FBAdFormatTypeName) { FBAdFormatTypeNameRewardedVideo, }; -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBAudienceNetworkAds : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAudienceNetworkAds : NSObject /** - Initialize Audience Network SDK at any given point of time. It will be called automatically with default settigs when you first touch AN related code otherwise. + Initialize Audience Network SDK at any given point of time. It will be called automatically with default settigs when + you first touch AN related code otherwise. @param settings The settings to initialize with @param completionHandler The block which will be called when initialization finished */ -+ (void)initializeWithSettings:(nullable FBAdInitSettings *)settings completionHandler:(nullable void (^)(FBAdInitResults *results))completionHandler; ++ (void)initializeWithSettings:(nullable FBAdInitSettings *)settings + completionHandler:(nullable void (^)(FBAdInitResults *results))completionHandler; /** Returns ad format type name for a given placement id. diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInstreamAdView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInstreamAdView.h index 22eae1d0c..3950a41fa 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInstreamAdView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInstreamAdView.h @@ -28,8 +28,7 @@ NS_ASSUME_NONNULL_BEGIN /** A customized UIView to display an instream video ad by Facebook. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBInstreamAdView : UIView +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBInstreamAdView : UIView /** Returns YES if the instream ad has been successfully loaded. diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInterstitialAd.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInterstitialAd.h index e7a4f8a10..3366c5c27 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInterstitialAd.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBInterstitialAd.h @@ -30,8 +30,7 @@ NS_ASSUME_NONNULL_BEGIN A modal view controller to represent a Facebook interstitial ad. This is a full-screen ad shown in your application. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBInterstitialAd : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBInterstitialAd : NSObject /** Typed access to the id of the ad placement. diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaView.h index 91633ec6c..43625628d 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaView.h @@ -28,7 +28,8 @@ NS_ASSUME_NONNULL_BEGIN @class FBNativeAd; /** - The FBMediaView loads media content from a given FBNativeAd. This view takes the place of manually loading a cover image. + The FBMediaView loads media content from a given FBNativeAd. This view takes the place of manually loading a cover + image. */ FB_CLASS_EXPORT @interface FBMediaView : UIView @@ -77,7 +78,8 @@ FB_CLASS_EXPORT @end /** - The methods declared by the FBMediaViewDelegate protocol allow the adopting delegate to respond to messages from the FBMediaView class and thus respond to operations such as whether the media content has been loaded. + The methods declared by the FBMediaViewDelegate protocol allow the adopting delegate to respond to messages from the + FBMediaView class and thus respond to operations such as whether the media content has been loaded. */ @protocol FBMediaViewDelegate diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaViewVideoRenderer.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaViewVideoRenderer.h index 40a87bed3..336956b0d 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaViewVideoRenderer.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBMediaViewVideoRenderer.h @@ -24,7 +24,9 @@ NS_ASSUME_NONNULL_BEGIN /** - The FBMediaViewVideoRenderer class allows for customization of the user experience for video ads in FBMediaView. This class should be subclassed, and an instance of that subclass should be passed to the videoRenderer property of an FBMediaView instance. + The FBMediaViewVideoRenderer class allows for customization of the user experience for video ads in FBMediaView. This + class should be subclassed, and an instance of that subclass should be passed to the videoRenderer property of an + FBMediaView instance. */ FB_CLASS_EXPORT @interface FBMediaViewVideoRenderer : UIView @@ -65,7 +67,8 @@ FB_CLASS_EXPORT - (void)pauseVideo; /** - Used to put the video into seek mode. Video playback halts, and one or more calls to seekVideoToTime: can be made before calling disengageVideoSeek. + Used to put the video into seek mode. Video playback halts, and one or more calls to seekVideoToTime: can be made + before calling disengageVideoSeek. */ - (void)engageVideoSeek; @@ -82,7 +85,8 @@ FB_CLASS_EXPORT /** Requests the periodic invocation of a given block during playback to report changing time. - @param interval The time interval at which the block should be invoked during normal playback, according to progress of the player's current time. + @param interval The time interval at which the block should be invoked during normal playback, according to progress of + the player's current time. @param queue A serial dispatch queue onto which block should be enqueued. @param block The block to be invoked periodically. */ diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewAdProvider.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewAdProvider.h index ba19ccfb5..f49bcc44c 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewAdProvider.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewAdProvider.h @@ -27,7 +27,9 @@ NS_ASSUME_NONNULL_BEGIN /** - Additional functionality on top of FBNativeAdsManager to assist in using native ads within a UICollectionView. This class contains a mechanism to map indexPaths to native ads in a stable manner as well as helpers which assist in doing the math to include ads at a regular interval within a collection view. + Additional functionality on top of FBNativeAdsManager to assist in using native ads within a UICollectionView. This + class contains a mechanism to map indexPaths to native ads in a stable manner as well as helpers which assist in doing + the math to include ads at a regular interval within a collection view. */ FB_CLASS_EXPORT @interface FBNativeAdCollectionViewAdProvider : NSObject @@ -50,7 +52,9 @@ FB_CLASS_EXPORT - (instancetype)initWithManager:(FBNativeAdsManager *)manager NS_DESIGNATED_INITIALIZER; /** - Retrieve a native ad for an indexPath, will return the same ad for a given indexPath until the native ads manager is refreshed. This method is intended for usage with a collection view and specifically the caller is recommended to wait until collectionView:cellForRowAtIndexPath: to ensure getting the best native ad for the given collection cell. + Retrieve a native ad for an indexPath, will return the same ad for a given indexPath until the native ads manager is + refreshed. This method is intended for usage with a collection view and specifically the caller is recommended to wait + until collectionView:cellForRowAtIndexPath: to ensure getting the best native ad for the given collection cell. @param collectionView The collectionView where native ad will be used @param indexPath The indexPath to use as a key for this native ad @@ -68,7 +72,8 @@ FB_CLASS_EXPORT - (BOOL)isAdCellAtIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; /** - Support for evenly distributed native ads within a collection view. Adjusts a non-ad cell indexPath to the indexPath it would be in a collection with no ads. + Support for evenly distributed native ads within a collection view. Adjusts a non-ad cell indexPath to the indexPath + it would be in a collection with no ads. @param indexPath The indexPath to of the non-ad cell @param stride The frequency that native ads are to appear within the collection view @@ -77,7 +82,8 @@ FB_CLASS_EXPORT - (nullable NSIndexPath *)adjustNonAdCellIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; /** - Support for evenly distributed native ads within a collection view. Adjusts the total count of cells within the collection view to account for the ad cells. + Support for evenly distributed native ads within a collection view. Adjusts the total count of cells within the + collection view to account for the ad cells. @param count The count of cells in the collection view not including ads @param stride The frequency that native ads are to appear within the collection view diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewCellProvider.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewCellProvider.h index 9a31a3de7..7ce2f4267 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewCellProvider.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdCollectionViewCellProvider.h @@ -28,10 +28,12 @@ NS_ASSUME_NONNULL_BEGIN /** - Class which assists in putting FBNativeAdViews into UICollectionViews. This class manages the creation of UICollectionViewCells which host native ad views. Functionality is provided to create UICollectionCellViews as needed for a given indexPath as well as computing the height of the cells. + Class which assists in putting FBNativeAdViews into UICollectionViews. This class manages the creation of + UICollectionViewCells which host native ad views. Functionality is provided to create UICollectionCellViews as needed + for a given indexPath as well as computing the height of the cells. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBNativeAdCollectionViewCellProvider : FBNativeAdCollectionViewAdProvider +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBNativeAdCollectionViewCellProvider + : FBNativeAdCollectionViewAdProvider /** Method to create a FBNativeAdCollectionViewCellProvider. @@ -48,15 +50,20 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @param type The type of this native ad template. For more information, consult FBNativeAdViewType. @param attributes The layout of this native ad template. For more information, consult FBNativeAdViewLayout. */ -- (instancetype)initWithManager:(FBNativeAdsManager *)manager forType:(FBNativeAdViewType)type forAttributes:(FBNativeAdViewAttributes *)attributes NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithManager:(FBNativeAdsManager *)manager + forType:(FBNativeAdViewType)type + forAttributes:(FBNativeAdViewAttributes *)attributes NS_DESIGNATED_INITIALIZER; /** - Helper method for implementors of UICollectionViewDataSource who would like to host native ad UICollectionViewCells in their collection view. + Helper method for implementors of UICollectionViewDataSource who would like to host native ad UICollectionViewCells in + their collection view. */ -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath; +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView + cellForItemAtIndexPath:(NSIndexPath *)indexPath; /** - Helper method for implementors of UICollectionViewDelegate who would like to host native ad UICollectionViewCells in their collection view. + Helper method for implementors of UICollectionViewDelegate who would like to host native ad UICollectionViewCells in + their collection view. */ - (CGFloat)collectionView:(UICollectionView *)collectionView heightForRowAtIndexPath:(NSIndexPath *)indexPath; diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdScrollView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdScrollView.h index a5efe0e5a..c9fe5ba25 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdScrollView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdScrollView.h @@ -30,13 +30,16 @@ NS_ASSUME_NONNULL_BEGIN Contains multiple ads in a scroll view. - If adding this view to a XIB or Storyboard, you may recieve the error "Unknown class FBNativeAdScrollView in Interface Builder file" in some cases. This error is caused by the linker failing to include FBNativeAdScrollView in your build. To resolve this, call [FBNativeAdScrollView class] in your project, or add "-all_load -ObjC" to "Other Linker Flags" in your project settings. + If adding this view to a XIB or Storyboard, you may recieve the error "Unknown class FBNativeAdScrollView in Interface + Builder file" in some cases. This error is caused by the linker failing to include FBNativeAdScrollView in your build. + To resolve this, call [FBNativeAdScrollView class] in your project, or add "-all_load -ObjC" to "Other Linker Flags" in + your project settings. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBNativeAdScrollView : UIView +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBNativeAdScrollView : UIView /** - Maximum native ads that this scroll view will load. Defaults to 10. If changed after calling loadAds, all current ads will be discarded and loadAds must be called again. + Maximum native ads that this scroll view will load. Defaults to 10. If changed after calling loadAds, all current ads + will be discarded and loadAds must be called again. */ @property (nonatomic, assign, readonly) NSUInteger maximumNativeAdCount; @@ -66,16 +69,18 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @property (nonatomic, weak, nullable) id delegate; /** - Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the manager to load ads normally. + Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be + preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the + manager to load ads normally. @param manager An instance of FBNativeAdManager. Can be preloaded with ads. @param type The type of this native ad template. For more information, consult FBNativeAdViewType. */ -- (instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager - withType:(FBNativeAdViewType)type; - +- (instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type; /** - Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the manager to load ads normally. + Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be + preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the + manager to load ads normally. @param manager An instance of FBNativeAdManager. Can be preloaded with ads. @param type The type of this native ad template. For more information, consult FBNativeAdViewType. @param attributes The layout of this native ad template. For more information, consult FBNativeAdViewLayout. @@ -85,7 +90,9 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED withAttributes:(FBNativeAdViewAttributes *)attributes; /** - Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the manager to load ads normally. + Creates a native ad horizontal scroll view for a given native ads manager and native ad template. The manager can be + preloaded with ads, and loadAds will use the preloaded ads from the manager. Otherwise, the scroll view uses the + manager to load ads normally. @param manager An instance of FBNativeAdManager. Can be preloaded with ads. @param type The type of this native ad template. For more information, consult FBNativeAdViewType. @param attributes The layout of this native ad template. For more information, consult FBNativeAdViewLayout. @@ -96,23 +103,26 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED withAttributes:(FBNativeAdViewAttributes *)attributes withMaximum:(NSUInteger)maximumNativeAdCount; - /** This is a method to create a native ad horizontal scroll view from a user provided view. @param manager An instance of FBNativeAdManager. Can be preloaded with ads. - @param childViewProvider Block that creates new views for each loaded native ad. Must not reuse the same instance, but return a new view for each call. Views may be arbitrarily resized and should support resizing their content through Auto Layout constraints, autoresizing masks, or manual resizing. + @param childViewProvider Block that creates new views for each loaded native ad. Must not reuse the same instance, but + return a new view for each call. Views may be arbitrarily resized and should support resizing their content through + Auto Layout constraints, autoresizing masks, or manual resizing. */ - (instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager - withViewProvider:(UIView *(^)( FBNativeAd *nativeAd, NSUInteger position))childViewProvider; + withViewProvider:(UIView * (^)(FBNativeAd *nativeAd, NSUInteger position))childViewProvider; /** This is a method to create a native ad horizontal scroll view from a user provided view. @param manager An instance of FBNativeAdManager. Can be preloaded with ads. - @param childViewProvider Block that creates new views for each loaded native ad. Must not reuse the same instance, but return a new view for each call. Views may be arbitrarily resized and should support resizing their content through Auto Layout constraints, autoresizing masks, or manual resizing. + @param childViewProvider Block that creates new views for each loaded native ad. Must not reuse the same instance, but + return a new view for each call. Views may be arbitrarily resized and should support resizing their content through + Auto Layout constraints, autoresizing masks, or manual resizing. @param maximumNativeAdCount Maximum native ads to show at once. */ - (instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager - withViewProvider:(UIView *(^)(FBNativeAd *nativeAd, NSUInteger position))childViewProvider + withViewProvider:(UIView * (^)(FBNativeAd *nativeAd, NSUInteger position))childViewProvider withMaximum:(NSUInteger)maximumNativeAdCount NS_DESIGNATED_INITIALIZER; @end diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewAdProvider.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewAdProvider.h index 3f979381c..2b15b158a 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewAdProvider.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewAdProvider.h @@ -27,7 +27,9 @@ NS_ASSUME_NONNULL_BEGIN /** - Additional functionality on top of FBNativeAdsManager to assist in using native ads within a UITableView. This class contains a mechanism to map indexPaths to native ads in a stable manner as well as helpers which assist in doing the math to include ads at a regular interval within a table view. + Additional functionality on top of FBNativeAdsManager to assist in using native ads within a UITableView. This class + contains a mechanism to map indexPaths to native ads in a stable manner as well as helpers which assist in doing the + math to include ads at a regular interval within a table view. */ FB_CLASS_EXPORT @interface FBNativeAdTableViewAdProvider : NSObject @@ -50,7 +52,9 @@ FB_CLASS_EXPORT - (instancetype)initWithManager:(FBNativeAdsManager *)manager NS_DESIGNATED_INITIALIZER; /** - Retrieve a native ad for an indexPath, will return the same ad for a given indexPath until the native ads manager is refreshed. This method is intended for usage with a table view and specifically the caller is recommended to wait until tableView:cellForRowAtIndexPath: to ensure getting the best native ad for the given table cell. + Retrieve a native ad for an indexPath, will return the same ad for a given indexPath until the native ads manager is + refreshed. This method is intended for usage with a table view and specifically the caller is recommended to wait until + tableView:cellForRowAtIndexPath: to ensure getting the best native ad for the given table cell. @param tableView The tableView where native ad will be used @param indexPath The indexPath to use as a key for this native ad @@ -68,7 +72,8 @@ FB_CLASS_EXPORT - (BOOL)isAdCellAtIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; /** - Support for evenly distributed native ads within a table view. Adjusts a non-ad cell indexPath to the indexPath it would be in a collection with no ads. + Support for evenly distributed native ads within a table view. Adjusts a non-ad cell indexPath to the indexPath it + would be in a collection with no ads. @param indexPath The indexPath to of the non-ad cell @param stride The frequency that native ads are to appear within the table view @@ -77,7 +82,8 @@ FB_CLASS_EXPORT - (nullable NSIndexPath *)adjustNonAdCellIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; /** - Support for evenly distributed native ads within a table view. Adjusts the total count of cells within the table view to account for the ad cells. + Support for evenly distributed native ads within a table view. Adjusts the total count of cells within the table view + to account for the ad cells. @param count The count of cells in the table view not including ads @param stride The frequency that native ads are to appear within the table view diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewCellProvider.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewCellProvider.h index c5c61b3a6..ff2d4ef26 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewCellProvider.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdTableViewCellProvider.h @@ -28,10 +28,12 @@ NS_ASSUME_NONNULL_BEGIN /** - Class which assists in putting FBNativeAdViews into UITableViews. This class manages the creation of UITableViewCells which host native ad views. Functionality is provided to create UITableCellViews as needed for a given indexPath as well as computing the height of the cells. + Class which assists in putting FBNativeAdViews into UITableViews. This class manages the creation of UITableViewCells + which host native ad views. Functionality is provided to create UITableCellViews as needed for a given indexPath as + well as computing the height of the cells. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBNativeAdTableViewCellProvider : FBNativeAdTableViewAdProvider +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBNativeAdTableViewCellProvider + : FBNativeAdTableViewAdProvider /** Method to create a FBNativeAdTableViewCellProvider. @@ -48,20 +50,25 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @param type The type of this native ad template. For more information, consult FBNativeAdViewType. @param attributes The layout of this native ad template. For more information, consult FBNativeAdViewLayout. */ -- (instancetype)initWithManager:(FBNativeAdsManager *)manager forType:(FBNativeAdViewType)type forAttributes:(FBNativeAdViewAttributes *)attributes NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithManager:(FBNativeAdsManager *)manager + forType:(FBNativeAdViewType)type + forAttributes:(FBNativeAdViewAttributes *)attributes NS_DESIGNATED_INITIALIZER; /** - Helper method for implementors of UITableViewDataSource who would like to host native ad UITableViewCells in their table view. + Helper method for implementors of UITableViewDataSource who would like to host native ad UITableViewCells in their + table view. */ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; /** - Helper method for implementors of UITableViewDelegate who would like to host native ad UITableViewCells in their table view. + Helper method for implementors of UITableViewDelegate who would like to host native ad UITableViewCells in their table + view. */ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; /** - Helper method for implementors of UITableViewDelegate who would like to host native ad UITableViewCells in their table view. + Helper method for implementors of UITableViewDelegate who would like to host native ad UITableViewCells in their table + view. */ - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath; diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdView.h index cbbcf535a..c008187ee 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdView.h @@ -74,7 +74,9 @@ FB_CLASS_EXPORT @param type The type of this native ad template. For more information, consult FBNativeAdViewType. @param attributes The attributes to render this native ad template with. */ -+ (instancetype)nativeAdViewWithNativeAd:(FBNativeAd *)nativeAd withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes; ++ (instancetype)nativeAdViewWithNativeAd:(FBNativeAd *)nativeAd + withType:(FBNativeAdViewType)type + withAttributes:(FBNativeAdViewAttributes *)attributes; @end diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdViewAttributes.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdViewAttributes.h index 07002fa7c..9c1e39422 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdViewAttributes.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdViewAttributes.h @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN /** This is a method to create native ad view attributes with a dictionary */ -- (instancetype)initWithDictionary:(NSDictionary *) dict NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithDictionary:(NSDictionary *)dict NS_DESIGNATED_INITIALIZER; /** Background color of the native ad view. @@ -77,7 +77,8 @@ NS_ASSUME_NONNULL_BEGIN /** Enables or disables autoplay for some types of media. Defaults to YES. */ -@property (nonatomic, assign, getter=isAutoplayEnabled) BOOL autoplayEnabled __attribute((deprecated("This attribute is no longer used."))); +@property (nonatomic, assign, getter=isAutoplayEnabled) BOOL autoplayEnabled + __attribute((deprecated("This attribute is no longer used."))); @end diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdsManager.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdsManager.h index 36becefc6..20ed38e93 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdsManager.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeAdsManager.h @@ -32,13 +32,17 @@ NS_ASSUME_NONNULL_BEGIN @protocol FBNativeAdsManagerDelegate /** - When the FBNativeAdsManager has finished loading a batch of ads this message will be sent. A batch of ads may be loaded in response to calling loadAds or due to an automatic refresh by the FBNativeAdsManager. At the point this message is fired all of the native ads will already be loaded and will not hence send their own nativeAdLoad: or nativeAd:didFailWithError: message. + When the FBNativeAdsManager has finished loading a batch of ads this message will be sent. A batch of ads may be + loaded in response to calling loadAds or due to an automatic refresh by the FBNativeAdsManager. At the point this + message is fired all of the native ads will already be loaded and will not hence send their own nativeAdLoad: or + nativeAd:didFailWithError: message. */ - (void)nativeAdsLoaded; /** - When the FBNativeAdsManager has reached a failure while attempting to load a batch of ads this message will be sent to the application. + When the FBNativeAdsManager has reached a failure while attempting to load a batch of ads this message will be sent to + the application. @param error An NSError object with information about the failure. */ - (void)nativeAdsFailedToLoadWithError:(NSError *)error; @@ -46,10 +50,12 @@ NS_ASSUME_NONNULL_BEGIN @end /** - This class provides a mechanism to fetch a set of ads and then use them within your application. The recommended usage is to call nextNativeAd: at the moment when you are about to render an ad. The native ads manager supports giving out as many ads as needed by cloning over the set of ads it got back from the server which can be useful for feed scenarios. + This class provides a mechanism to fetch a set of ads and then use them within your application. The recommended usage + is to call nextNativeAd: at the moment when you are about to render an ad. The native ads manager supports giving out + as many ads as needed by cloning over the set of ads it got back from the server which can be useful for feed + scenarios. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBNativeAdsManager : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBNativeAdsManager : NSObject /** The delegate @@ -57,12 +63,14 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @property (nonatomic, weak, nullable) id delegate; /** - Set the native ads manager caching policy. This controls which media from the native ads are cached before the native ads manager calls nativeAdsLoaded on its delegate. The default is to not block on caching. + Set the native ads manager caching policy. This controls which media from the native ads are cached before the native + ads manager calls nativeAdsLoaded on its delegate. The default is to not block on caching. */ @property (nonatomic, assign) FBNativeAdsCachePolicy mediaCachePolicy; /** - Number of unique native ads that can be accessed through nextNativeAd:. This is not valid until the nativeAdsLoaded: message has been sent. + Number of unique native ads that can be accessed through nextNativeAd:. This is not valid until the nativeAdsLoaded: + message has been sent. */ @property (nonatomic, assign, readonly) NSUInteger uniqueNativeAdCount; @@ -91,13 +99,17 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED - (void)loadAds; /** - By default the native ads manager will refresh its ads periodically. This does not mean that any ads which are shown in the application's UI will be refreshed but simply that calling nextNativeAd: may return different ads at different times. This method disables that functionality. + By default the native ads manager will refresh its ads periodically. This does not mean that any ads which are shown + in the application's UI will be refreshed but simply that calling nextNativeAd: may return different ads at different + times. This method disables that functionality. */ - (void)disableAutoRefresh; - /** - Retrieve the next native ad to be used from the batch. It is highly recommended that the caller wait until immediately before rendering the ad content to call this method to ensure the best ad for the given context is used. If more than uniqueNativeAdCount ads are requested cloned ads will be returned. Periodically the native ads manager will refresh and new ads will be returned. + Retrieve the next native ad to be used from the batch. It is highly recommended that the caller wait until immediately + before rendering the ad content to call this method to ensure the best ad for the given context is used. If more than + uniqueNativeAdCount ads are requested cloned ads will be returned. Periodically the native ads manager will refresh and + new ads will be returned. @return A FBNativeAd which is loaded and ready to be used. */ diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAd.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAd.h index 7c0d0d152..1a8ec0750 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAd.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAd.h @@ -34,8 +34,7 @@ NS_ASSUME_NONNULL_BEGIN The FBNativeBannerAd represents ad metadata to allow you to construct custom ad views. See the AdUnitsSample in the sample apps section of the Audience Network framework. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBNativeBannerAd : FBNativeAdBase +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBNativeBannerAd : FBNativeAdBase @property (nonatomic, weak, nullable) id delegate; @@ -47,7 +46,8 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @param view The UIView you created to render all the native ads data elements. @param iconView The FBMediaView you created to render the icon @param viewController The UIViewController that will be used to present SKStoreProductViewController - (iTunes Store product information) or the in-app browser. If nil is passed, the top view controller currently shown will be used. + (iTunes Store product information) or the in-app browser. If nil is passed, the top view controller currently shown + will be used. The whole area of the UIView will be clickable. diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAdView.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAdView.h index 17b00e17e..b598124d7 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAdView.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBNativeBannerAdView.h @@ -54,7 +54,8 @@ FB_CLASS_EXPORT @param nativeBannerAd The native banner ad to use to create this view. @param type The type of this native banner ad template. For more information, consult FBNativeAdBannerViewType. */ -+ (instancetype)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd *)nativeBannerAd withType:(FBNativeBannerAdViewType)type; ++ (instancetype)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd *)nativeBannerAd + withType:(FBNativeBannerAdViewType)type; /** This is a method to create a native ad template using the given placement id and type. @@ -62,7 +63,9 @@ FB_CLASS_EXPORT @param type The type of this native banner ad template. For more information, consult FBNativeAdBannerViewType. @param attributes The attributes to render this native ad template with. */ -+ (instancetype)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd *)nativeBannerAd withType:(FBNativeBannerAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes; ++ (instancetype)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd *)nativeBannerAd + withType:(FBNativeBannerAdViewType)type + withAttributes:(FBNativeAdViewAttributes *)attributes; @end diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBRewardedVideoAd.h b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBRewardedVideoAd.h index 1aaa4b903..d6e204985 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBRewardedVideoAd.h +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Headers/FBRewardedVideoAd.h @@ -20,6 +20,7 @@ #import #import +#import #import NS_ASSUME_NONNULL_BEGIN @@ -30,8 +31,7 @@ NS_ASSUME_NONNULL_BEGIN A modal view controller to represent a Facebook rewarded video ad. This is a full-screen ad shown in your application. */ -FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED -@interface FBRewardedVideoAd : NSObject +FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBRewardedVideoAd : NSObject /** Typed access to the id of the ad placement. @@ -59,6 +59,11 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED */ @property (nonatomic, strong, nullable) FBAdExtraHint *extraHint; +/** + FBAdExperiencConfig to provide additional ad configuration + */ +@property (nonatomic, copy, nullable) FBAdExperienceConfig *adExperienceConfig; + /** This is a method to initialize an FBRewardedVideoAd matching the given placement id. @@ -104,8 +109,7 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED - Parameter currency reward currency type */ -- (BOOL)setRewardDataWithUserID:(NSString *)userID - withCurrency:(NSString *)currency; +- (BOOL)setRewardDataWithUserID:(NSString *)userID withCurrency:(NSString *)currency; /** Presents the rewarded video ad modally from the specified view controller. @@ -210,5 +214,4 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @end - NS_ASSUME_NONNULL_END diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Info.plist b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Info.plist index 4c61b628f..1b126a5a4 100644 Binary files a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Info.plist and b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Info.plist differ diff --git a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Modules/module.modulemap b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Modules/module.modulemap index 8e773a57d..1c74ba58a 100644 --- a/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Modules/module.modulemap +++ b/tests/UnitTestApp/mediationsdk/FacebookSDK/FBAudienceNetwork.framework/Modules/module.modulemap @@ -32,6 +32,7 @@ framework module FBAudienceNetwork { header "FBAdChoicesView.h" header "FBAdDefines.h" + header "FBAdExperienceConfig.h" header "FBAdSettings.h" header "FBAdView.h" header "FBInstreamAdView.h" @@ -46,7 +47,7 @@ framework module FBAudienceNetwork { header "FBNativeAdView.h" header "FBNativeAdsManager.h" header "FBRewardedVideoAd.h" - + header "FBAdBridgeCommon.h" header "FBAdBridgeContainer.h" header "FBAdSettingsBridge.h"