/core/externals/update-engine/externals/google-toolbox-for-mac/UnitTesting/GTMCALayer+UnitTesting.h

http://macfuse.googlecode.com/ · C++ Header · 46 lines · 8 code · 4 blank · 34 comment · 0 complexity · 5a9329949cd098a576c6f65cdd200446 MD5 · raw file

  1. //
  2. // GTMCALayer+UnitTesting.h
  3. //
  4. // Code for making unit testing of graphics/UI easier. Generally you
  5. // will only want to look at the macros:
  6. // GTMAssertDrawingEqualToFile
  7. // GTMAssertViewRepEqualToFile
  8. // and the protocol GTMUnitTestCALayerDrawer. When using these routines
  9. // make sure you are using device colors and not calibrated/generic colors
  10. // or else your test graphics WILL NOT match across devices/graphics cards.
  11. //
  12. // Copyright 2006-2008 Google Inc.
  13. //
  14. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  15. // use this file except in compliance with the License. You may obtain a copy
  16. // of the License at
  17. //
  18. // http://www.apache.org/licenses/LICENSE-2.0
  19. //
  20. // Unless required by applicable law or agreed to in writing, software
  21. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  22. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  23. // License for the specific language governing permissions and limitations under
  24. // the License.
  25. //
  26. #import <QuartzCore/QuartzCore.h>
  27. #import "GTMNSObject+UnitTesting.h"
  28. // Category for making unit testing of graphics/UI easier.
  29. // Allows you to take a state of a view. Supports both image and state.
  30. // See GTMNSObject+UnitTesting.h for details.
  31. @interface CALayer (GTMUnitTestingAdditions) <GTMUnitTestingImaging>
  32. // Returns whether gtm_unitTestEncodeState should recurse into sublayers
  33. //
  34. // Returns:
  35. // should gtm_unitTestEncodeState pick up sublayer state.
  36. - (BOOL)gtm_shouldEncodeStateForSublayers;
  37. @end
  38. @interface NSObject (GTMCALayerUnitTestingDelegateMethods)
  39. // Delegate method that allows a delegate for a layer to
  40. // decide whether we should recurse
  41. - (BOOL)gtm_shouldEncodeStateForSublayersOfLayer:(CALayer*)layer;
  42. @end