/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 8 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* Ġ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 . Ċ Ġ*/ Ċ package Ġcom . android . tools . profil ers . cpu . capture details Ċ Ċ import Ġcom . android . test utils . TestUtils . resolve Workspace Path Ċ import Ġcom . android . tools . adt ui . common . Data Visualization Colors Ċ import Ġcom . android . tools . profil ers . Profiler Colors Ċ import Ġcom . android . tools . profil ers . cpu . Capture Node Ċ import Ġcom . android . tools . profil ers . cpu . node model . Capture Node Model Ċ import Ġcom . android . tools . profil ers . cpu . node model . Cpp Function Model Ċ import Ġcom . android . tools . profil ers . cpu . node model . Java Method Model Ċ import Ġcom . android . tools . profil ers . cpu . node model . Native Node Model Ċ import Ġcom . android . tools . profil ers . cpu . node model . Single Name Model Ċ import Ġcom . android . tools . profil ers . cpu . node model . Sy scall Model Ċ import Ġcom . android . tools . profil ers . cpu . node model . System Trace Node Factory Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . intellij . ui . Color Util Ċ import Ġcom . intellij . ui . Graphics 2 D Delegate Ċ import Ġcom . intellij . ui . JB Color Ċ import Ġcom . intellij . util . ui . Image Util Ċ import Ġorg . junit . Assert . fail Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġjava . awt . Color Ċ import Ġjava . awt . Font Metrics Ċ import Ġjava . awt . Paint Ċ import Ġjava . awt . Shape Ċ import Ġjava . awt . geom . Rectangle 2 D Ċ import Ġjava . awt . image . Buffered Image Ċ import Ġjava . nio . file . Files Ċ Ċ class ĠCapture Node H Renderer Test Ġ{ ĊĊĠ Ġ@ Before ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ ĠData Visualization Colors . do Initialize ( ĊĠĠĠĠĠĠĠ ĠFiles . new InputStream ( resolve Workspace Path Ġ(" tools / adt / idea / profil ers - ui / testData / data - colors . json "))) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġrender Idle Cpu Time () Ġ{ ĊĠĠĠ Ġval Ġsimple Node Ġ= ĠCapture Node ( System Trace Node Factory (). getNode (" Some Name ")) ĊĠĠĠ Ġsimple Node . start Global Ġ= Ġ 1 0 ĊĠĠĠ Ġsimple Node . end Global Ġ= Ġ 2 0 ĊĠĠĠ Ġsimple Node . start Thread Ġ= Ġ 1 0 ĊĠĠĠ Ġsimple Node . end Thread Ġ= Ġ 1 5 ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART ) ĊĠĠĠ Ġval Ġrender Window Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 1 0 . 0 f , 1 0 . 0 f ) ĊĠĠĠ Ġval Ġfake Graphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġrender Window , Ġrender Window , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . fill Shapes ). has Size ( 2 ) ĊĊĠĠĠ Ġ// ĠValidate Ġwe Ġget Ġtwo Ġshapes Ġdrawn , Ġthe Ġfirst Ġone Ġis Ġthe Ġexpected Ġsize Ġof Ġthe Ġwindow . ĊĠĠĠ Ġ// ĠThe Ġsecond Ġon Ġis Ġthe Ġsize Ġof Ġthe Ġidle Ġtime . ĠIn Ġthis Ġcase Ġhalf Ġour Ġglobal Ġtime . ĊĠĠĠ Ġfake Graphics . expect Fill Shapes ( render Window , ĠRectangle 2 D . Double ( 5 . 0 , Ġ 0 . 0 , Ġ 5 . 0 , Ġ 1 0 . 0 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġrender Use Clamp ed Render Window For S izing () Ġ{ ĊĠĠĠ Ġval Ġsimple Node Ġ= ĠCapture Node ( System Trace Node Factory (). getNode (" Some Name ")). apply Ġ{ ĊĠĠĠĠĠ Ġstart Global Ġ= Ġ 1 0 ĊĠĠĠĠĠ Ġend Global Ġ= Ġ 2 0 ĊĠĠĠĠĠ Ġstart Thread Ġ= Ġ 1 0 ĊĠĠĠĠĠ Ġend Thread Ġ= Ġ 1 5 ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART ) ĊĠĠĠ Ġ// ĠTest Ġclamp Ġwidth . ĊĠĠĠ Ġvar Ġrender Window Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 1 0 . 0 f , 1 0 . 0 f ) ĊĠĠĠ Ġvar Ġclamp ed Render Window Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 6 . 0 f , Ġ 6 . 0 f ) ĊĠĠĠ Ġval Ġfake Graphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġrender Window , Ġclamp ed Render Window , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . fill Shapes ). has Size ( 2 ) ĊĊĠĠĠ Ġ// ĠValidate Ġwe Ġget Ġtwo Ġshapes Ġdrawn , Ġthe Ġfirst Ġone Ġis Ġthe Ġexpected Ġsize Ġof Ġthe Ġclamp ed Ġwindow . ĊĠĠĠ Ġ// ĠThe Ġsecond Ġon Ġis Ġthe Ġsize Ġof Ġthe Ġidle Ġtime Ġclamp ed Ġto Ġthe Ġwindow Ġsize . ĊĠĠĠ Ġfake Graphics . expect Fill Shapes ( clamp ed Render Window , ĠRectangle 2 D . Double ( 5 . 0 , Ġ 0 . 0 , Ġ 1 . 0 , Ġ 1 0 . 0 )) ĊĠĠĠ Ġfake Graphics . fill Shapes . clear () ĊĊĠĠĠ Ġ// ĠTest Ġclamp Ġstart Ġand Ġwidth ĊĠĠĠ Ġrender Window Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 1 0 . 0 f , 1 0 . 0 f ) ĊĠĠĠ Ġclamp ed Render Window Ġ= ĠRectangle 2 D . Float ( 3 . 0 f , Ġ 0 . 0 f , Ġ 1 . 0 f , Ġ 6 . 0 f ) ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġrender Window , Ġclamp ed Render Window , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . fill Shapes ). has Size ( 2 ) ĊĊĠĠĠ Ġ// ĠValidate Ġwe Ġget Ġtwo Ġshapes Ġdrawn , Ġthe Ġfirst Ġone Ġis Ġthe Ġexpected Ġsize Ġof Ġthe Ġclamp ed Ġwindow . ĊĠĠĠ Ġ// ĠThe Ġsecond Ġon Ġis Ġthe Ġsize Ġof Ġthe Ġidle Ġtime Ġclamp ed Ġto Ġthe Ġwindow Ġsize . ĊĠĠĠ Ġfake Graphics . expect Fill Shapes ( clamp ed Render Window , ĠRectangle 2 D . Double ( 4 . 0 , Ġ 0 . 0 , Ġ 0 . 0 , Ġ 1 0 . 0 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġrender Idle Cpu Time DoesNot H appen On Other Models () Ġ{ ĊĠĠĠ Ġval Ġsimple Node Ġ= ĠCapture Node ( Single Name Model (" Some Name ")) ĊĠĠĠ Ġsimple Node . start Global Ġ= Ġ 1 0 ĊĠĠĠ Ġsimple Node . end Global Ġ= Ġ 2 0 ĊĠĠĠ Ġsimple Node . start Thread Ġ= Ġ 1 0 ĊĠĠĠ Ġsimple Node . end Thread Ġ= Ġ 1 5 ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART ) ĊĠĠĠ Ġval Ġrender Window Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 1 0 . 0 f , 1 0 . 0 f ) ĊĠĠĠ Ġval Ġfake Graphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġrender Window , Ġrender Window , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . fill Shapes ). has Size ( 1 ) ĊĊĠĠĠ Ġ// ĠValidate Ġwe Ġget Ġthe Ġexpected Ġsize Ġof Ġthe Ġwindow . ĊĠĠĠ Ġfake Graphics . expect Fill Shapes ( render Window ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġrender Idle Time With Negative Start Fill s Idle Time () Ġ{ ĊĠĠĠ Ġval Ġsimple Node Ġ= ĠCapture Node ( System Trace Node Factory (). getNode (" Some Name ")) ĊĠĠĠ Ġsimple Node . start Global Ġ= Ġ 1 0 ĊĠĠĠ Ġsimple Node . end Global Ġ= Ġ 1 1 0 ĊĠĠĠ Ġsimple Node . start Thread Ġ= Ġ 1 0 ĊĠĠĠ Ġsimple Node . end Thread Ġ= Ġ 1 5 ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART ) ĊĠĠĠ Ġval Ġrender Window Ġ= ĠRectangle 2 D . Float (- 1 0 0 . 0 f , Ġ 0 . 0 f , Ġ 3 0 0 . 0 f , 1 0 . 0 f ) ĊĠĠĠ Ġval Ġclamp Window Ġ= ĠRectangle 2 D . Float ( 0 f , Ġ 0 f , Ġ 1 0 f , Ġ 1 0 f ) ĊĠĠĠ Ġval Ġfake Graphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġrender Window , Ġclamp Window , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . fill Shapes ). has Size ( 2 ) ĊĊĠĠĠ Ġ// ĠValidate Ġwe Ġget Ġthe Ġexpected Ġsize Ġof Ġthe Ġwindow . ĊĠĠĠ Ġ// ĠOur Ġfirst Ġrender Ġshould Ġbe Ġonly Ġ 1 0 px Ġon Ġscreen , ĊĠĠĠ Ġ// ĠThe Ġsecond Ġ( idle ) Ġshould Ġbe Ġthis Ġentire Ġ 1 0 px . ĊĠĠĠ Ġfake Graphics . expect Fill Shapes ( clamp Window , Ġclamp Window ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġrender Invalid Node Should Throw Exception () Ġ{ ĊĠĠĠ Ġval Ġunsupported Node Ġ= ĠCapture Node ( Stub Capture Node Model ()) ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART ) ĊĊĠĠĠ Ġval Ġfake Graphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ Ġrenderer . render ( fake Graphics , Ġunsupported Node , ĠRectangle 2 D . Float (), ĠRectangle 2 D . Float (), Ġfalse , Ġfalse ) ĊĠĠĠĠĠ Ġfail () ĊĠĠĠ Ġ} ĊĠĠĠ Ġcatch Ġ( e : ĠIllegalStateException ) Ġ{ ĊĠĠĠĠĠ ĠassertThat ( e . message ). isEqualTo (" Node Ġtype Ġnot Ġsupported .") ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġinvalid Chart Type Should Throw Exception () Ġ{ ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ ĠCapture Node H Renderer ( Capture Details . Type . BOTTOM _ UP ) ĊĠĠĠĠĠ Ġfail () ĊĠĠĠ Ġ} ĊĠĠĠ Ġcatch Ġ( e : ĠIllegalStateException ) Ġ{ ĊĠĠĠĠĠ ĠassertThat ( e . message ). isEqualTo (" Chart Ġtype Ġnot Ġsupported Ġand Ġcan 't Ġbe Ġrendered .") ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Filter Render Styles () Ġ{ ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART ) ĊĠĠĠ Ġval Ġfake Graphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġval Ġdrawing Rectangle Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 1 0 0 . 0 f , Ġ 1 . 0 f ) ĊĊĠĠĠ Ġval Ġsimple Node Ġ= ĠCapture Node ( Sy scall Model (" write ")) ĊĊĠĠĠ Ġfake Graphics . paint Ġ= ĠColor . RED ĊĠĠĠ Ġsimple Node . filter Type Ġ= ĠCapture Node . Filter Type . MATCH ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġdrawing Rectangle , Ġdrawing Rectangle , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. paint ). isEqualTo ( Color . BLACK ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. is Bold ). isFalse () ĊĊĠĠĠ Ġfake Graphics . paint Ġ= ĠColor . RED ĊĠĠĠ Ġsimple Node . filter Type Ġ= ĠCapture Node . Filter Type . UN MATCH ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġdrawing Rectangle , Ġdrawing Rectangle , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. paint ). isEqualTo ( Capture Node H Renderer . to Un match Color ( Color . BLACK )) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. is Bold ). isFalse () ĊĊĠĠĠ Ġfake Graphics . paint Ġ= ĠColor . RED ĊĠĠĠ Ġsimple Node . filter Type Ġ= ĠCapture Node . Filter Type . EX ACT _ MATCH ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġdrawing Rectangle , Ġdrawing Rectangle , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. paint ). isEqualTo ( Color . BLACK ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. is Bold ). isTrue () ĊĊĠĠĠ Ġ// ĠMake Ġsure Ġthat , Ġwhen Ġwe Ġrender Ġa Ġnon - exact Ġmatch Ġafter Ġan ĠEX ACT _ MATCH , Ġthat Ġthe Ġbold Ġstate Ġis Ġcleared ĊĠĠĠ Ġfake Graphics . paint Ġ= ĠColor . RED ĊĠĠĠ Ġsimple Node . filter Type Ġ= ĠCapture Node . Filter Type . MATCH ĊĠĠĠ Ġrenderer . render ( fake Graphics , Ġsimple Node , Ġdrawing Rectangle , Ġdrawing Rectangle , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. paint ). isEqualTo ( Color . BLACK ) ĊĠĠĠ ĠassertThat ( fake Graphics . last Text Info !!. is Bold ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest System Trace Colors () Ġ{ ĊĠĠĠ Ġval Ġinvalid Model Ġ= ĠSy scall Model (" write ") ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ ĠSystem Trace Node Model H Chart Colors . get Fill Color ( invalid Model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠĠĠ Ġfail () ĊĠĠĠ Ġ} ĊĠĠĠ Ġcatch Ġ( e : ĠIllegalStateException ) Ġ{ ĊĠĠĠĠĠ ĠassertThat ( e . message ). isEqualTo (" Model Ġmust Ġbe Ġan Ġinstance Ġof ĠSystem Trace Node Model .") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġfactory Ġ= ĠSystem Trace Node Factory () ĊĠĠĠ Ġval Ġmodel Ġ= Ġfactory . getNode (" Some Name ") ĊĠĠĠ Ġval Ġmodel 2 Ġ= Ġfactory . getNode (" Different ĠColor ") ĊĠĠĠ Ġval Ġmodel 3 Ġ= Ġfactory . getNode (" Color Ġ 1 2 3 4 ") ĊĠĠĠ Ġval Ġmodel 4 Ġ= Ġfactory . getNode (" Color Ġ 4 3 2 1 ") ĊĊĠĠĠ Ġval Ġnot Focused Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ Ġval Ġfocused Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( not Focused ). isNot EqualTo ( focused ) ĊĊĠĠĠ Ġval Ġcolor Model Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ Ġval Ġcolor Model 2 Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model 2 , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color Model ). isNot EqualTo ( color Model 2 ) ĊĊĠĠĠ Ġval Ġcolor Model 3 Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model 3 , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ Ġval Ġcolor Model 4 Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model 4 , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color Model 3 ). isEqualTo ( color Model 4 ) ĊĊĠĠĠ Ġval Ġidle Model Ġ= ĠSystem Trace Node Model H Chart Colors . getId le Cpu Color ( model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ Ġval Ġidle Model 2 Ġ= ĠSystem Trace Node Model H Chart Colors . getId le Cpu Color ( model 2 , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( idle Model ). isNot EqualTo ( idle Model 2 ) ĊĠĠĠ ĠassertThat ( idle Model ). isNot EqualTo ( focused ) ĊĠĠĠ ĠassertThat ( idle Model ). isNot EqualTo ( model ) ĊĠĠĠ ĠassertThat ( JB Color . is B right ()). isTrue () ĊĠĠĠ Ġ// ĠIn Ġlight Ġmode Ġwe Ġdar ken Ġthe Ġcolors Ġas Ġsuch Ġour Ġidle Ġcolors Ġare Ġless Ġbright Ġthan Ġthe Ġnon Ġidle Ġones . ĊĠĠĠ ĠassertThat ( Color Util . get L uminance ( idle Model )). is LessThan ( Color Util . get L uminance ( focused )) ĊĊĠĠĠ Ġvar Ġcolor Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model , ĠCapture Details . Type . FL AME _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Profiler Colors . CPU _ FL AME CH ART _ APP ) ĊĊĠĠĠ Ġcolor Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model , ĠCapture Details . Type . FL AME _ CH ART , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Profiler Colors . CPU _ FL AME CH ART _ APP _ HO VER ) ĊĊĠĠĠ Ġcolor Ġ= ĠSystem Trace Node Model H Chart Colors . getId le Cpu Color ( model , ĠCapture Details . Type . FL AME _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Profiler Colors . CPU _ FL AME CH ART _ APP _ IDLE ) ĊĊĠĠĠ Ġcolor Ġ= ĠSystem Trace Node Model H Chart Colors . getId le Cpu Color ( model , ĠCapture Details . Type . FL AME _ CH ART , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Profiler Colors . CPU _ FL AME CH ART _ APP _ HO VER _ IDLE ) ĊĊĠĠĠ Ġcolor Ġ= ĠSystem Trace Node Model H Chart Colors . get Fill Color ( model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġtrue ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Data Visualization Colors . to Gray scale ( Data Visualization Colors . getColor ( model . fullName . hashCode (), Ġfalse ))) ĊĊĠĠĠ Ġcolor Ġ= ĠSystem Trace Node Model H Chart Colors . getId le Cpu Color ( model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġtrue ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Data Visualization Colors . to Gray scale ( color )) ĊĊĠĠĠ Ġ// ĠValidate Ġtext Ġcolors Ġusing Ġnodes Ġthat Ġmap Ġto Ġdark Ġand Ġlight Ġtext Ġcolors Ġrespectively . ĊĠĠĠ Ġval Ġdark Text Node Ġ= Ġfactory . getNode (" Ġ") ĊĠĠĠ Ġval Ġlight Text Node Ġ= Ġfactory . getNode (" !") ĊĠĠĠ Ġval Ġdark Text Ġ= ĠSystem Trace Node Model H Chart Colors . getText Color ( dark Text Node , ĠCapture Details . Type . CALL _ CH ART , Ġfalse ) ĊĠĠĠ Ġval Ġlight Text Ġ= ĠSystem Trace Node Model H Chart Colors . getText Color ( light Text Node , ĠCapture Details . Type . CALL _ CH ART , Ġfalse ) ĊĠĠĠ ĠassertThat ( dark Text ). isEqualTo ( Data Visualization Colors . DEFAULT _ DARK _ TEXT _ COLOR ) ĊĠĠĠ ĠassertThat ( light Text ). isEqualTo ( Data Visualization Colors . DEFAULT _ LIGHT _ TEXT _ COLOR ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Java Colors () Ġ{ ĊĠĠĠ Ġval Ġinvalid Model Ġ= ĠSy scall Model (" write ") ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ ĠJava Method H Chart Colors . get Fill Color ( invalid Model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠĠĠ Ġfail () ĊĠĠĠ Ġ} ĊĠĠĠ Ġcatch Ġ( e : ĠIllegalStateException ) Ġ{ ĊĠĠĠĠĠ ĠassertThat ( e . message ). isEqualTo (" Model Ġmust Ġbe Ġan Ġinstance Ġof ĠJava Method Model .") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġvendor Model Ġ= ĠJava Method Model (" toString ", Ġ" java . lang . String ") ĊĠĠĠ Ġdo Test Java Method Colors ( vendor Model , ĠProfiler Colors . CPU _ CALL CH ART _ VENDOR , ĠProfiler Colors . CPU _ FL AME CH ART _ VENDOR , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfiler Colors . CPU _ CALL CH ART _ VENDOR _ HO VER , ĠProfiler Colors . CPU _ FL AME CH ART _ VENDOR _ HO VER ) ĊĊĠĠĠ Ġval Ġplatform Model Ġ= ĠJava Method Model (" inflate ", Ġ" com . android . Activity ") ĊĠĠĠ Ġdo Test Java Method Colors ( platform Model , ĠProfiler Colors . CPU _ CALL CH ART _ PLATFORM , ĠProfiler Colors . CPU _ FL AME CH ART _ PLATFORM , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfiler Colors . CPU _ CALL CH ART _ PLATFORM _ HO VER , ĠProfiler Colors . CPU _ FL AME CH ART _ PLATFORM _ HO VER ) ĊĊĠĠĠ Ġval Ġapp Model Ġ= ĠJava Method Model (" toString ", Ġ" com . example . My Class ") ĊĠĠĠ Ġdo Test Java Method Colors ( app Model , ĠProfiler Colors . CPU _ CALL CH ART _ APP , ĠProfiler Colors . CPU _ FL AME CH ART _ APP , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfiler Colors . CPU _ CALL CH ART _ APP _ HO VER , ĠProfiler Colors . CPU _ FL AME CH ART _ APP _ HO VER ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Native Colors () Ġ{ ĊĠĠĠ Ġval Ġinvalid Model Ġ= ĠJava Method Model (" toString ", Ġ" com . example . My Class ") ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠ ĠNative Model H Chart Colors . get Fill Color ( invalid Model , ĠCapture Details . Type . CALL _ CH ART , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠĠĠ Ġfail () ĊĠĠĠ Ġ} ĊĠĠĠ Ġcatch Ġ( e : ĠIllegalStateException ) Ġ{ ĊĠĠĠĠĠ ĠassertThat ( e . message ). isEqualTo (" Model Ġmust Ġbe Ġa Ġsubclass Ġof ĠNative Node Model .") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġvendor Model Ġ= ĠCpp Function Model . Builder (" Load "). setIs User Code ( false ). set Class Or Namespace (" gl Clear "). build () ĊĠĠĠ Ġdo Test Native Colors ( vendor Model , ĠProfiler Colors . CPU _ CALL CH ART _ VENDOR , ĠProfiler Colors . CPU _ FL AME CH ART _ VENDOR , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfiler Colors . CPU _ CALL CH ART _ VENDOR _ HO VER , ĠProfiler Colors . CPU _ FL AME CH ART _ VENDOR _ HO VER ) ĊĊĠĠĠ Ġval Ġplatform Model Ġ= ĠCpp Function Model . Builder (" Inf late "). setIs User Code ( false ). set Class Or Namespace (" android :: Activity "). build () ĊĠĠĠ Ġdo Test Native Colors ( platform Model , ĠProfiler Colors . CPU _ CALL CH ART _ PLATFORM , ĠProfiler Colors . CPU _ FL AME CH ART _ PLATFORM , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfiler Colors . CPU _ CALL CH ART _ PLATFORM _ HO VER , ĠProfiler Colors . CPU _ FL AME CH ART _ PLATFORM _ HO VER ) ĊĊĠĠĠ Ġval Ġapp Model Ġ= ĠCpp Function Model . Builder (" Do Frame "). setIs User Code ( true ). set Class Or Namespace (" Play Scene "). build () ĊĠĠĠ Ġdo Test Native Colors ( app Model , ĠProfiler Colors . CPU _ CALL CH ART _ APP , ĠProfiler Colors . CPU _ FL AME CH ART _ APP , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfiler Colors . CPU _ CALL CH ART _ APP _ HO VER , ĠProfiler Colors . CPU _ FL AME CH ART _ APP _ HO VER ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Fit ting Text For Java Method () Ġ{ ĊĠĠĠ Ġcheck Fit ting Text ( node Model Ġ= ĠJava Method Model (" toString ", Ġ" com . example . My Class "), Ġexpected Texts Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġ" com . example . My Class . toString ", ĊĠĠĠĠĠĠĠ Ġ" c . example . My Class . toString ", ĊĠĠĠĠĠĠĠ Ġ" c . e . My Class . toString ", ĊĠĠĠĠĠĠĠ Ġ" c . e . M . toString ", ĊĠĠĠĠĠĠĠ Ġ" toString ", ĊĠĠĠĠĠĠĠ Ġ" to St ..." ĊĠĠĠ Ġ)) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Fit ting Text For Native Method () Ġ{ ĊĠĠĠ Ġcheck Fit ting Text ( node Model Ġ= ĠCpp Function Model . Builder (" my Native Method "). set Parameters (" int , Ġfloat ") ĊĠĠĠĠĠĠĠ Ġ. set Class Or Namespace (" My Native Class "). build (), Ġexpected Texts Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġ" My Native Class :: my Native Method ", ĊĠĠĠĠĠĠĠ Ġ" M :: my Native Method ", ĊĠĠĠĠĠĠĠ Ġ" my Native Method ", ĊĠĠĠĠĠĠĠ Ġ" my Native Me ..." ĊĠĠĠ Ġ)) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Fit ting Text For Malformed Method () Ġ{ ĊĠĠĠ Ġ// ĠThe Ġname Ġ".. B 1 . 1 " Ġwas Ġreturned Ġfrom Ġsimple perf Ġwhen Ġprofiling Ġa Ġlibrary Ġthat Ġlinked Ġagainst ĊĠĠĠ Ġ// Ġlib m . so Ġ( the Ġc Ġmath Ġlibrary ) ĊĠĠĠ Ġcheck Fit ting Text ( node Model Ġ= ĠJava Method Model (" 1 ", Ġ".. B 1 "), Ġexpected Texts Ġ= ĠlistOf ( ĊĠĠĠĠĠ Ġ".. B 1 . 1 ", ĊĠĠĠĠĠ Ġ".. B . 1 ", ĊĠĠĠĠĠ Ġ" 1 " ĊĠĠĠ Ġ)) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Fit ting Text Drawing Area Too Small () Ġ{ ĊĠĠĠ Ġval Ġnode Ġ= ĠCapture Node ( Java Method Model (" my Method ", Ġ" My Class ")) ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART , ĠTest Text Fit Predicate ()) ĊĠĠĠ Ġval Ġgraphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġval Ġdrawing Rectangle Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 0 . 5 f , Ġ 1 . 0 f ) ĊĊĠĠĠ Ġrenderer . render ( graphics , Ġnode , Ġdrawing Rectangle , Ġdrawing Rectangle , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( graphics . last Text Info ). isNull () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcheck Fit ting Text ( node Model : ĠCapture Node Model , Ġexpected Texts : ĠList < String >) Ġ{ ĊĠĠĠ Ġval Ġnode Ġ= ĠCapture Node ( node Model ) ĊĠĠĠ Ġval Ġtext Fit Predicate Ġ= ĠTest Text Fit Predicate () ĊĠĠĠ Ġval Ġrenderer Ġ= ĠCapture Node H Renderer ( Capture Details . Type . CALL _ CH ART , Ġtext Fit Predicate ) ĊĠĠĠ Ġval Ġgraphics Ġ= ĠTest Graphics 2 D () ĊĠĠĠ Ġval Ġdrawing Rectangle : ĠRectangle 2 D . Float Ġ= ĠRectangle 2 D . Float ( 0 . 0 f , Ġ 0 . 0 f , Ġ 1 0 0 . 0 f , Ġ 1 . 0 f ) ĊĊĠĠĠ Ġvar Ġprev Text Length Ġ= Ġexpected Texts [ 0 ]. length Ġ+ Ġ 1 ĊĠĠĠ Ġfor Ġ( text Ġin Ġexpected Texts ) Ġ{ ĊĠĠĠĠĠ Ġtext Fit Predicate . fitting Length Ġ= Ġprev Text Length Ġ- Ġ 1 ĊĠĠĠĠĠ Ġrenderer . render ( graphics , Ġnode , Ġdrawing Rectangle , Ġdrawing Rectangle , Ġfalse , Ġfalse ) ĊĠĠĠĠĠ ĠassertThat ( graphics . last Text Info !!. text ). isEqualTo ( text ) ĊĠĠĠĠĠ Ġprev Text Length Ġ= Ġtext . length ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġdo Test Java Method Colors ( model : ĠJava Method Model , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcall Chart Fill : ĠColor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfl ame Chart Fill : ĠColor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcall Chart Fill Hover : ĠColor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfl ame Chart Fill Hover : ĠColor ) Ġ{ ĊĠĠĠ Ġval Ġcall Chart Ġ= ĠCapture Details . Type . CALL _ CH ART ĊĠĠĠ Ġval Ġfl ame Chart Ġ= ĠCapture Details . Type . FL AME _ CH ART ĊĊĠĠĠ Ġ// ĠCall Ġchart Ġnot Ġun matched ĊĠĠĠ Ġvar Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( call Chart Fill ) ĊĠĠĠ Ġ// ĠCall Ġchart Ġun matched ĊĠĠĠ Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġtrue , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Capture Node H Renderer . to Un match Color ( call Chart Fill )) ĊĠĠĠ Ġ// ĠCall Ġchart Ġhover ĊĠĠĠ Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( call Chart Fill Hover ) ĊĠĠĠ Ġ// ĠFl ame Ġchart Ġnot Ġun matched ĊĠĠĠ Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġfl ame Chart , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( fl ame Chart Fill ) ĊĠĠĠ Ġ// ĠFl ame Ġchart Ġun matched ĊĠĠĠ Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġfl ame Chart , Ġtrue , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Capture Node H Renderer . to Un match Color ( fl ame Chart Fill )) ĊĠĠĠ Ġ// ĠFl ame Ġchart Ġhover ĊĠĠĠ Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġfl ame Chart , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( fl ame Chart Fill Hover ) ĊĠĠĠ Ġ// ĠDe selection Ġcolor ĊĠĠĠ Ġcolor Ġ= ĠJava Method H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġfalse , Ġfalse , Ġtrue ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Data Visualization Colors . getColor ( Data Visualization Colors . BACKGROUND _ DATA _ COLOR , Ġ 0 )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġdo Test Native Colors ( model : ĠNative Node Model , Ġcall Chart Fill : ĠColor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfl ame Chart Fill : ĠColor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcall Chart Fill Hover : ĠColor , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfl ame Chart Fill Hover : ĠColor ) Ġ{ ĊĠĠĠ Ġval Ġcall Chart Ġ= ĠCapture Details . Type . CALL _ CH ART ĊĠĠĠ Ġval Ġfl ame Chart Ġ= ĠCapture Details . Type . FL AME _ CH ART ĊĊĠĠĠ Ġ// ĠCall Ġchart Ġnot Ġun matched ĊĠĠĠ Ġvar Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( call Chart Fill ) ĊĠĠĠ Ġ// ĠCall Ġchart Ġun matched ĊĠĠĠ Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġtrue , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Capture Node H Renderer . to Un match Color ( call Chart Fill )) ĊĠĠĠ Ġ// ĠCall Ġchart Ġhover ĊĠĠĠ Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( call Chart Fill Hover ) ĊĠĠĠ Ġ// ĠFl ame Ġchart Ġnot Ġun matched ĊĠĠĠ Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġfl ame Chart , Ġfalse , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( fl ame Chart Fill ) ĊĠĠĠ Ġ// ĠFl ame Ġchart Ġun matched ĊĠĠĠ Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġfl ame Chart , Ġtrue , Ġfalse , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Capture Node H Renderer . to Un match Color ( fl ame Chart Fill )) ĊĠĠĠ Ġ// ĠFl ame Ġchart Ġhover ĊĠĠĠ Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġfl ame Chart , Ġfalse , Ġtrue , Ġfalse ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( fl ame Chart Fill Hover ) ĊĠĠĠ Ġ// ĠDe selection Ġcolor ĊĠĠĠ Ġcolor Ġ= ĠNative Model H Chart Colors . get Fill Color ( model , Ġcall Chart , Ġfalse , Ġfalse , Ġtrue ) ĊĠĠĠ ĠassertThat ( color ). isEqualTo ( Data Visualization Colors . getColor ( Data Visualization Colors . BACKGROUND _ DATA _ COLOR , Ġ 0 )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġclass ĠTest Graphics 2 D Ġ: ĠGraphics 2 D Delegate ( Image Util . create Image ( 1 , Ġ 1 , ĠBufferedImage . TYPE _ INT _ ARGB ). create Graphics ()) Ġ{ ĊĠĠĠ Ġclass ĠText Info ( val Ġtext : ĠString , Ġval Ġis Bold : ĠBoolean , Ġval Ġpaint : ĠPaint ) ĊĊĠĠĠ Ġvar Ġlast Text Info : ĠText Info ? Ġ= Ġnull ĊĠĠĠ Ġval Ġfill Shapes : ĠMutable List < Shape > Ġ= ĠArrayList () ĊĊĠĠĠ Ġoverride Ġfun Ġdraw String ( s : ĠString , Ġx : ĠFloat , Ġy : ĠFloat ) Ġ{ ĊĠĠĠĠĠ Ġlast Text Info Ġ= ĠText Info ( s , Ġfont . is Bold , Ġpaint ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġfill ( s : ĠShape ) Ġ{ ĊĠĠĠĠĠ Ġfill Shapes . add ( s ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġexpect Fill Shapes ( var arg Ġrect angles : ĠRectangle 2 D ) Ġ{ ĊĠĠĠĠĠ Ġfor Ġ( i Ġin Ġrect angles . indices ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbounds A Ġ= Ġfill Shapes [ i ]. bounds 2 D ĊĠĠĠĠĠĠĠ Ġval Ġbounds B Ġ= Ġrect angles [ i ] ĊĠĠĠĠĠĠĠ ĠassertThat ( bounds A . x ). is Within ( 0 . 0 0 0 1 ). of ( bounds B . x ) ĊĠĠĠĠĠĠĠ ĠassertThat ( bounds A . y ). is Within ( 0 . 0 0 0 1 ). of ( bounds B . y ) ĊĠĠĠĠĠĠĠ ĠassertThat ( bounds A . width ). is Within ( 0 . 0 0 0 1 ). of ( bounds B . width ) ĊĠĠĠĠĠĠĠ ĠassertThat ( bounds A . height ). is Within ( 0 . 0 0 0 1 ). of ( bounds B . height ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġclass ĠTest Text Fit Predicate : ĠCapture Node H Renderer . Text Fits Predicate Ġ{ ĊĠĠĠ Ġvar Ġfitting Length : ĠInt Ġ= Ġ 0 ĊĠĠĠ Ġoverride Ġfun Ġtest ( text : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmetrics : ĠFont Metrics , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwidth : ĠFloat , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġheight : ĠFloat ) Ġ= Ġtext . length Ġ<= Ġfitting Length ĊĠ Ġ} ĊĊĠ Ġprivate Ġclass ĠStub Capture Node Model Ġ: ĠCapture Node Model Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠgetName (): ĠString Ġ{ ĊĠĠĠĠĠ Ġthrow ĠUnsupportedOperationException () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget FullName (): ĠString Ġ{ ĊĠĠĠĠĠ Ġthrow ĠUnsupportedOperationException () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetId (): ĠString Ġ{ ĊĠĠĠĠĠ Ġthrow ĠUnsupportedOperationException () ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ