Resize with Errrs Ad URL fr this Creative http://mraid.iab.net/cmpliance/units/resize-err.txt Gal f Ad This ad will test that the cntainer triggers apprpriate errr handling when resize-related methds and prperties are used incrrectly. All expected errrs are caught by the creative and reprted t the cnsle. With the exceptin f the last few tests, a cmpliant cntainer will nt resize the ad. Instead it will trigger the MRAID errr event s that the creative can respnd. This Creative Tests: MRAID Methds Tested: mraid.addeventlistener mraid.getmaxsize mraid.getresizeprperties mraid.getstate mraid.getversin mraid.remveeventlistener mraid.resize mraid.setresizeprperties MRAID Events Watched: Other: errr ready statechange Calling resize() befre setting prperties Calling setresizeprperties with invalid values Calling setresizeprperties with width and height less than 50x50 Calling setresizeprperties with width and height values that are t large fr the screen t als shw a clse buttn Resizing t wide s clse indicatr ff screen t the west r east Resizing t tall s clse indicatr ff screen t the nrth r suth Changing rientatin s allwoffscreen=false is nt effective Page 1 f 8
Behavir f Ad Initial/Default State Ad begins as a 300x100 banner There are n initial r autmatic ad behavirs beynd registering fr the ready event Tapping n the buttns generate errr cnditins Cnsle utput expected ResizeErrTester(2):mraid state is ready ResizeErrTester(2):mraid.getVersin() ResizeErrTester(1):adding listener fr errr ResizeErrTester(1):adding listener fr statechange User Interactin 1 Click 1 bad timing This test must be run first and attempts t resize befre setting any resizeprperties values. Nte that resize() relies n parameters that are stred in the resizeprperties JavaScript bject. Thus the creative must set thse parameters via the setresizeprperties() methd BEFORE attempting t resize(). Calling resize() befre setresizeprperties will result in an errr. The bad timing buttn must be clicked first befre any ther interactin Clicking this buttn attempts t call mraid.resize befre setting any prperties This interactin must nt change the ad status, size r appearance Cnsle utput expected: ResizeErrTester(2):mraid.getResizePrperties() ResizeErrTester(3):ERR: mraid errr caught frm resize... User Interactin 2 Click 2 bad values This test must be run secnd and attempts t resize after setting invalid values fr resizeprperties. Nte that width, height, ffsetx and ffsety are required and have n default prperties. If the ad creative attempts t call resize() befre Page 2 f 8
[prperly] setting these fur prperties, the cntainer will leave the ad in its current state and return an errr. Click the bad values buttn secnd during testing Clicking this buttn attempts t call mraid.setresizeprperties twice with invalid values nce with string values instead f integer and nce with incmplete values This interactin must nt change the ad status, size r appearance Cnsle utput expected (tw errrs) ResizeErrTester(3): ERR: mraid errr caught frm setresizeprperties... ResizeErrTester(3): ERR: mraid errr caught frm setresizeprperties... User Interactin 3 Click t small This test attempts t resize with resizeprperties set t less than 50px wide and 50px high. This requirement als means that a resized ad must be at least 50x50 pixels, t ensure there is rm n the resized creative fr the clse event regin. Click the t small buttn at any time during testing Clicking this buttn attempts t call mraid.setresizeprperties with values less than 50x50 This interactin must nt change the ad status, size r appearance Cnsle utput expected ResizeErrTester(3):ERR: mraid errr caught frm setresizeprperties... User Interactin 4 Click t big This test attempts t resize with resizeprperties set t greater than the screen size. Nte: resize shuld nt be used fr ad creative that expands t fullscreen (r larger) size: fr such creative executins expand() shuld always be used. Resize will always result in a nnmdal size change, and sme prtin f the app shuld always remain visible t the end user. If the parameters are ut f range, then the errr event identifies the exceptin. Fr example, an errr will ccur if an ad sets allwoffscreen t "false" but sets the width and height f the resize t be t big t actually fit n the screen. Page 3 f 8
Click the first Test ffscreen buttn until the label displays TRUE Click the t big buttn Clicking the t big buttn attempts t call mraid.setresizeprperties with values that are t large fr the screen because the clse buttn wuld be ff screen This interactin must nt change the ad status, size r appearance Cnsle utput expected ResizeErrTester(2):mraid.getMaxSize(x,y) ResizeErrTester(3):ERR: mraid errr caught frm setresizeprperties... User Interactin 5 Test resize directins arrws with ffscreen TRUE These tests attempt t resize with resizeprperties greater than the screen size in ne directin such that the lcatin f the clse buttn wuld display utside the cntainer area. allwoffscreen: (ptinal) tells the cntainer whether r nt it shuld allw the resized creative t be drawn fully/partially ffscreen. A resized ad must psitin itself such that the entire clse event regin appears nscreen. If the cntainer/sdk detects that a request t resize will result in the clse event regin being ffscreen, the cntainer/sdk shuld return an errr, and ignre the resize. Click the first Test ffscreen buttn at least twice until the label displays TRUE this sets the ffscreen resize prperty t true which allws a resized ad t be display partially ff the screen. Click each f the arrw buttns left: attempt resize t wide with clse indicatr ff screen t the west right: attempt resize t wide with clse indicatr ff screen t the east up: attempt resize t tall with clse indicatr ff screen t the nrth dwn: attempt resize t tall with clse indicatr ff screen t the suth This interactin must nt change the ad status, size r appearance Cnsle utput expected ResizeErrTester(2):mraid.setResizePrperties() ResizeErrTester(2):mraid.getMaxSize(x,y) ResizeErrTester(2):ERR: mraid errr caught frm setresizeprperties... ResizeErrTester(3):ERR: mraid errr caught frm resize... User Interactin 6 Test resize directin arrws with ffscreen FALSE Page 4 f 8
These tests attempt t resize with x-ffsets and y-ffsets that require the cntainer t repsitin the ad back n screen. Theses tests must succeed in resizing the ad unit in prtrait rientatin. When allwoffscreen is set t False, the SDK will d its best t mve the default (banner) ad cntainer t ensure that the resized creative fits n the screen. Fr example, if ad is n the tp f the screen, and ad wants t resize upwards by 50 pixels, then the SDK will mve the default (banner) ad 50 pixels dwn and then execute the resize. Click the first Test ffscreen buttn at least twice until the label displays FALSE this sets the ffscreen prperty t false which attempts t mve a resized ad s that it displays n the screen. Click each f the arrw buttns left: resizes t full width with clse indicatr in tp-left right: resizes t full width with clse indicatr in tp-right up: resizes t full height with clse indicatr in tp-left Page 5 f 8
dwn: resizes t full height with clse indicatr in bttm-right Click the X clse buttn t return t the default state and display Unlike the ther tests, these interactins must change the ad status, size and appearance Cnsle utput expected ResizeErrTester(2):mraid.setResizePrperties() ResizeErrTester(2):mraid.getMaxSize() ResizeErrTester(2):mraid.setResizePrperties() ResizeErrTester(2):mraid.resize() ResizeErrTester(2):state changed t: default User Interactin 7 Change the rientatin t see the effect f allwoffscreen=false This test reviews the cntainer s respnse t a resized ad unit that is valid fr ne rientatin, but nt anther. allwoffscreen cannt slve all psitining issues. Fr example, if an ad successfully resizes in landscape rientatin, but then becmes larger than the size f the screen due t an rientatin change t prtrait, the setting f allwoffscreen t false will have n effect, as there is n way the cntainer/sdk can successfully repsitin a landscape creative t fit n a prtrait screen. Ensure the device is physically in prtrait mde where screen height is greater than screen width Click the first Test ffscreen buttn at least twice until the label displays FALSE Click the f the dwn arrw s the ad resizes t full height with clse buttn in the bttm-right Rtate the device s it is physically in landscape mde where the screen width is greater than screen height Either the clse buttn r the testing buttns are n lnger n screen, but sme f the ad is still visible Rtate the device back t prtrait Click the X clse buttn t return t the default state and display These interactins must return the ad unit t exactly the same lcatin as it started Cnsle utput expected Page 6 f 8
ResizeErrTester(2):mraid.setResizePrperties() ResizeErrTester(2):mraid.getMaxSize() ResizeErrTester(2):mraid.setResizePrperties() ResizeErrTester(2):mraid.resize() ResizeErrTester(2):state changed t: default User Interactin 8 Click t big t cnfirm rientatin-aware getmaxsize This test simply utputs the values f getmaxsize s that the tester can cnfirm that the values change after changing the device rientatin. Click the t big buttn at any time during testing Change the rientatin f the device Click the t big buttn again Cnsle utput must cnfirm that the width values and height values have changed t represent the new dimensins fr maxsize. Cnsle utput expected ResizeErrTester(2):mraid.getMaxSize(x,y) ResizeErrTester(3):ERR: mraid errr caught frm setresizeprperties... ResizeErrTester(2):mraid.getMaxSize(y,x) ResizeErrTester(3):ERR: mraid errr caught frm setresizeprperties... Page 7 f 8
MRAID 2 Cmpliance Checklist A cntainer/sdk running this test creative must exhibit these behavirs t prve MRAID cmpliance. Ad remains in default status, appearance and lcatin except fr resizing when ffscreen is false Ad returns t default status, appearance and lcatin after clicking the clse indicatr even after changing rientatin Cnsle lgs match thse identified in the User Interactins it is pssible t have additinal cnsle utput especially if yu change the lgging level, but all cmpliant cntainers must be able t demnstrate the minimum utput fr each test Nne f the fllwing cnsle messages can appear ResizeErrTester(3):ERR calling getstate, mraid is nt defined ResizeErrTester(3):ERR mraid state is nt recgnized - tests cannt cntinue ResizeErrTester(3):ERR calling getversin, mraid is nt defined ResizeErrTester(3):ERR versin mismatch; cannt run resize tester ResizeErrTester(2):ERR mraid resize tester unit disabled Additinal Ntes If yur cntainer testing envirnment des nt supprt capturing cnsle.lg utput frm JavaScript, yu can change the value f variable usealert t mirrr all lgging t pp-up alert bxes. Alternately, yu can use the n-screen cnsle. T see the ad unit utput, click the IAB lg. This will display the cnsle view. In this mde, yu can scrll thrugh the lgging utput and click the clear buttn t clear the screen. Clicking the IAB lg again will return the ad t the standard display with the testing buttns. The debugging utput level can als be adjusted t see mre inf fr trubleshting; use the variable lglevel. Surce cde is thrughly dcumented. Develper-testers can use a supplied mck-bject file mraid.mck.js r the WebTester at http://mraid.webtester.rg/ fr brwser-based testing. Acknwledgement The IAB is grateful fr the assistance f Nathan Carver f Crisp Media wh created this IAB MRAID Test ad. Please direct any questins abut the creative r the assciated dcumentatin t the IAB at mbile@iab.net. Page 8 f 8