Merge pull request #7 from niksawtschuk/tappable-area-apple

use 44pt as the default minimum size for tappable elements
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2f4b72a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+## Various settings
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata/
+
+# Carthage
+Carthage/Build
diff --git a/Classes/GTXChecksCollection.h b/Classes/GTXChecksCollection.h
index 9a4c331..3a40141 100644
--- a/Classes/GTXChecksCollection.h
+++ b/Classes/GTXChecksCollection.h
@@ -87,8 +87,13 @@
 + (id<GTXChecking>)checkForMinimumTappableArea;
 
 /**
- *  @return a check that verifies that contrast of all text based elements is at least 3.0.
+ *  @return a check that verifies that contrast of all UILabel elements is at least 3.0.
  */
 + (id<GTXChecking>)checkForSufficientContrastRatio;
 
+/**
+ *  @return a check that verifies that contrast of all UITextView elements is at least 3.0.
+ */
++ (id<GTXChecking>)checkForSufficientTextViewContrastRatio;
+
 @end
diff --git a/Classes/GTXChecksCollection.m b/Classes/GTXChecksCollection.m
index d99b250..51eeae5 100644
--- a/Classes/GTXChecksCollection.m
+++ b/Classes/GTXChecksCollection.m
@@ -31,7 +31,9 @@
 NSString *const kGTXCheckNameAccessibilityTraitsDontConflict =
     @"Accessibility Traits Don't Conflict";
 NSString *const kGTXCheckNameMinimumTappableArea = @"Element has Minimum Tappable Area";
-NSString *const kGTXCheckNameMinimumContrastRatio = @"Element has Minimum Contrast Ratio";
+NSString *const kGTXCheckNameLabelMinimumContrastRatio = @"Label has Minimum Contrast Ratio";
+NSString *const kGTXCheckNameTextViewMinimumContrastRatio = @"TextView has Minimum Contrast Ratio";
+
 
 #pragma mark - Globals
 
@@ -166,6 +168,13 @@
       UIAccessibilityTraits testUITrait = [testTrait unsignedLongLongValue];
       if ((BOOL)(elementAXTraits & testUITrait)) {
         if ([GTXChecksCollection caseInsensitive:elementAXLabel hasSuffix:redundantText]) {
+          if ([element isKindOfClass:[UIButton class]] &&
+              [GTXChecksCollection caseInsensitive:((UIButton *)element).titleLabel.text
+                                         hasSuffix:redundantText]) {
+            // This is a button whose title itself has the word "button", we must ignore this
+            // kind of elements.
+            continue;
+          }
           NSError *error;
           NSString *stringValue = [self stringValueOfUIAccessibilityTraits:testUITrait
                                                                      error:&error];
@@ -302,10 +311,12 @@
 
 + (id<GTXChecking>)checkForSufficientContrastRatio {
   id<GTXChecking> check =
-      [GTXCheckBlock GTXCheckWithName:kGTXCheckNameMinimumContrastRatio
+  [GTXCheckBlock GTXCheckWithName:kGTXCheckNameLabelMinimumContrastRatio
                                 block:^BOOL(id element, GTXErrorRefType errorOrNil) {
     if (![element isKindOfClass:[UILabel class]]) {
       return YES;
+    } else if ([[(UILabel *)element text] length] == 0) {
+      return  YES;
     }
     CGFloat ratio = [GTXImageAndColorUtils contrastRatioOfUILabel:element];
     BOOL hasSufficientContrast =
@@ -318,7 +329,35 @@
                                      (float)kGTXMinContrastRatioForAccessibleText, (float)ratio];
       [NSError gtx_logOrSetGTXCheckFailedError:errorOrNil
                                        element:element
-                                          name:kGTXCheckNameMinimumContrastRatio
+                                          name:kGTXCheckNameLabelMinimumContrastRatio
+                                   description:description];
+    }
+    return hasSufficientContrast;
+  }];
+  return check;
+}
+
++ (id<GTXChecking>)checkForSufficientTextViewContrastRatio {
+  id<GTXChecking> check =
+  [GTXCheckBlock GTXCheckWithName:kGTXCheckNameTextViewMinimumContrastRatio
+                            block:^BOOL(id element, GTXErrorRefType errorOrNil) {
+    if (![element isKindOfClass:[UITextView class]]) {
+      return YES;
+    } else if ([[(UITextView *)element text] length] == 0) {
+      return  YES;
+    }
+    CGFloat ratio = [GTXImageAndColorUtils contrastRatioOfUILabel:element];
+    BOOL hasSufficientContrast =
+      (ratio >= kGTXMinContrastRatioForAccessibleText - kGTXContrastRatioAccuracy);
+    if (!hasSufficientContrast) {
+      NSString *description =
+      [NSString stringWithFormat:@"Suggest increasing this element's contrast ratio to at "
+                                 "least "
+                                 @"%.5f the actual ratio was computed as %.5f",
+                                 (float)kGTXMinContrastRatioForAccessibleText, (float)ratio];
+      [NSError gtx_logOrSetGTXCheckFailedError:errorOrNil
+                                       element:element
+                                          name:kGTXCheckNameTextViewMinimumContrastRatio
                                    description:description];
     }
     return hasSufficientContrast;
diff --git a/Classes/GTXImageAndColorUtils.h b/Classes/GTXImageAndColorUtils.h
index 5d2792c..cefd3b4 100644
--- a/Classes/GTXImageAndColorUtils.h
+++ b/Classes/GTXImageAndColorUtils.h
@@ -61,4 +61,16 @@
  */
 + (CGFloat)contrastRatioOfUILabel:(UILabel *)label;
 
+/**
+ *  Computes contrast ratio of the given text view to its background.
+ *  This method analyses the text view's text color in the context of its view
+    hierarchy in order to compute the contrast ratio, because
+ *  of which the text view must already be in a window before this method can be used.
+ *
+ *  @param view The text view whose contrast ratio is to be computed.
+ *
+ *  @return The contrast ratio (proportional to 1.0) of the text view.
+ */
++ (CGFloat)contrastRatioOfUITextView:(UITextView *)view;
+
 @end
diff --git a/Classes/GTXImageAndColorUtils.m b/Classes/GTXImageAndColorUtils.m
index cd9bb9d..96856bf 100644
--- a/Classes/GTXImageAndColorUtils.m
+++ b/Classes/GTXImageAndColorUtils.m
@@ -56,12 +56,42 @@
 }
 
 + (CGFloat)contrastRatioOfUILabel:(UILabel *)label {
-  NSAssert(label.window, @"Label %@ must be part of view hierarchy to use this method, see API "
-                         @"docs for more info.", label);
-  // Create a block that can take snapshot of the given label.
-  UIImage *(^takeSnapshot)(void) = ^{
-    CGRect labelBounds = [label.window convertRect:label.bounds fromView:label];
-    UIWindow *window = label.window;
+  NSAssert(label.window, @"Label %@ must be part of view hierarchy to use this method, see API"
+                         @" docs for more info.", label);
+
+  // Take snapshot of the label as it exists.
+  UIImage *before = [self gtx_takeSnapshot:label];
+
+  // Update the text color and take another snapshot.
+  UIColor *prevColor = label.textColor;
+  label.textColor = [self gtx_shiftedColorWithColor:prevColor];
+  UIImage *after = [self gtx_takeSnapshot:label];
+  label.textColor = prevColor;
+
+  return [self gtx_contrastRatioWithTextElementImage:before textElementColorShiftedImage:after];
+}
+
++ (CGFloat)contrastRatioOfUITextView:(UITextView *)view {
+  NSAssert(view.window, @"View %@ must be part of view hierarchy to use this method, see API"
+           @" docs for more info.", view);
+
+  // Take snapshot of the text view as it exists.
+  UIImage *before = [self gtx_takeSnapshot:view];
+
+  // Update the text color and take another snapshot.
+  UIColor *prevColor = view.textColor;
+  view.textColor = [self gtx_shiftedColorWithColor:prevColor];
+  UIImage *after = [self gtx_takeSnapshot:view];
+  view.textColor = prevColor;
+
+  return [self gtx_contrastRatioWithTextElementImage:before textElementColorShiftedImage:after];
+}
+
+#pragma mark - Utils
+
++ (UIImage *)gtx_takeSnapshot:(UIView *)element {
+    CGRect labelBounds = [element.window convertRect:element.bounds fromView:element];
+    UIWindow *window = element.window;
     if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
       UIGraphicsBeginImageContextWithOptions(labelBounds.size,
                                              NO, [UIScreen mainScreen].scale);
@@ -76,22 +106,8 @@
     UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
     UIGraphicsEndImageContext();
     return image;
-  };
-
-  // Take snapshot of the label as it exists.
-  UIImage *before = takeSnapshot();
-
-  // Update the text color and take another snapshot.
-  UIColor *prevColor = label.textColor;
-  label.textColor = [self gtx_shiftedColorWithColor:prevColor];
-  UIImage *after = takeSnapshot();
-  label.textColor = prevColor;
-
-  return [self gtx_contrastRatioWithTextElementImage:before textElementColorShiftedImage:after];
 }
 
-#pragma mark - Utils
-
 /**
  *  Computes the contrast ratio for the text in the given image. This method also requires image of
  *  the text element with the text color changed, by comparing both the image pixels its possible to
diff --git a/GTXiLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/GTXiLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/GTXiLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>
diff --git a/GTXiLib.xcodeproj/xcshareddata/xcschemes/GTXiLib.xcscheme b/GTXiLib.xcodeproj/xcshareddata/xcschemes/GTXiLib.xcscheme
new file mode 100644
index 0000000..52587bd
--- /dev/null
+++ b/GTXiLib.xcodeproj/xcshareddata/xcschemes/GTXiLib.xcscheme
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1000"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "613C3F40204A09E7007D44A8"
+               BuildableName = "GTXiLib.framework"
+               BlueprintName = "GTXiLib"
+               ReferencedContainer = "container:GTXiLib.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "6115E785204F5BA2003E32F9"
+               BuildableName = "GTXiUnitTests.xctest"
+               BlueprintName = "GTXiUnitTests"
+               ReferencedContainer = "container:GTXiLib.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "613C3F40204A09E7007D44A8"
+            BuildableName = "GTXiLib.framework"
+            BlueprintName = "GTXiLib"
+            ReferencedContainer = "container:GTXiLib.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "613C3F40204A09E7007D44A8"
+            BuildableName = "GTXiLib.framework"
+            BlueprintName = "GTXiLib"
+            ReferencedContainer = "container:GTXiLib.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "613C3F40204A09E7007D44A8"
+            BuildableName = "GTXiLib.framework"
+            BlueprintName = "GTXiLib"
+            ReferencedContainer = "container:GTXiLib.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>
diff --git a/README.md b/README.md
index cc1115a..d24bbb0 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,13 @@
+[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
+
 ## What is GTXiLib?
 GTXiLib, Google Toolbox for Accessibility for the iOS platform or simply GTX-eye
 is a framework for iOS accessibility testing. GTXiLib has XCTest integration and
-can be used with any XCTest based frameworks such as
+can be used with any XCTest-based frameworks such as
 [EarlGrey](https://github.com/google/EarlGrey). GTXiLib enhances the value of
-your tests by installing "accessibility checks" on them, your existing test
+your tests by installing "accessibility checks" on them; your existing test
 cases can double as accessibility tests with no other code change on your part.
-GTXiLib is able to accomplish this by hooking into the test tear down process
+GTXiLib is able to accomplish this by hooking into the test tear-down process
 and invoking the registered accessibility checks (such as check for presence of
 accessibility label) on all elements on the screen.
 
@@ -16,7 +18,6 @@
 
 ```objective-c
 // Include the GTXiLib umbrella header.
-#import <GTXiLib/GTXiLib.h>
 
 // Note that that is +setUp not -setUp
 + (void)setUp {
@@ -77,12 +78,12 @@
 ## Incremental Accessibility
 
 GTXiLib APIs support a practical solution for improving accessibility of large
-projects which may not have included accessibility from the get go - incremental
+projects which may not have included accessibility from the get-go -- incremental
 accessibility. Adding GTXiLib to a project that is already halfway through
-development may leads to several test failures and fixing them at once can be
+development may lead to several test failures and fixing them at once can be
 time consuming and tedious. To solve this problem incrementally:
 
-+ Use above snippet to add GTXiLib to all test cases but fix errors in a small
++ Use the above snippet to add GTXiLib to all test cases but fix errors in a small
   subset of them.
   + Blacklist elements that you don't control using GTXiLib's blacklist APIs.
 + Then use `GTXTestSuite's` `suiteWithClass:andTests:` method to
@@ -92,7 +93,7 @@
 Once the code is checked into your repo GTXiLib will catch any new failures in
 those tests. From this point:
 
-+ Every new test being added must be added it to the suite.
++ Every new test being added must be added to the suite.
 + Based on team priorities keep moving existing tests into the suite until all
   methods are in the suite.
 
@@ -109,7 +110,7 @@
 
 GTXiLib has APIs that allow for creation of your own accessibility checks (in fact
 it does not have to be related to accessibility, for example i18n layout checks
-or even memory usage checks). To create new checks use `GTXiLib's`
+or even memory usage checks). To create new checks use GTXiLib's
 `checkWithName:block:` API and provide a unique name and block that evaluates
 the check and returns YES/NO for success/failure. Add the newly created check
 to the array of checks being passed on to GTXiLib via the install API call.
@@ -122,7 +123,7 @@
 
 + Temporarily blacklist the test case by using
   `suiteWithAllTestsInClass:exceptTests:`.
-+ Temporarily blacklist the offending element using element blacklist APIs
++ Temporarily blacklist the offending element using element blacklist APIs.
 
 But if you believe GTXiLib has caught a bug that is not an accessibility issue
 please let us know by [filing a bug](https://github.com/google/GTXiLib/issues)
@@ -223,8 +224,8 @@
 
 ## Discuss
 
-Please join us on [ios-accessibility](https://groups.google.com/forum/#!forum/ios-accessibility)
-Google group to discuss all things accessibility and also to keep a tap on all
+Please join us on the [ios-accessibility](https://groups.google.com/forum/#!forum/ios-accessibility)
+Google group to discuss all things accessibility and also to keep a tab on all
 updates to GTXiLib.
 
 ## Contributors
diff --git a/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.h b/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.h
index 8db5588..3f7a2e5 100644
--- a/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.h
+++ b/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.h
@@ -58,29 +58,34 @@
 FOUNDATION_EXTERN NSString *const kAddTinyTappableElement;
 
 /**
- *  Name of the action that adds an element with very high contrast.
+ *  Name of the action that adds a label with very high contrast.
  */
 FOUNDATION_EXTERN NSString *const kAddVeryHighContrastLabel;
 
 /**
- *  Name of the action that adds an element with very low contrast.
+ *  Name of the action that adds a label with very low contrast.
  */
 FOUNDATION_EXTERN NSString *const kAddVeryLowContrastLabel;
 
 /**
- *  Name of the action that adds an element with barely high contrast.
+ *  Name of the action that adds a label with barely high contrast.
  */
 FOUNDATION_EXTERN NSString *const kAddBarelyHighContrastLabel;
 
 /**
- *  Name of the action that adds an element with barely low contrast.
+ *  Name of the action that adds a label with barely low contrast.
  */
 FOUNDATION_EXTERN NSString *const kAddBarelyLowContrastLabel;
 
 /**
- *  Name of the action that adds a low contrast background.
+ *  Name of the action that adds a text view with low contrast.
  */
-FOUNDATION_EXTERN NSString *const kAddLowContrastBackground;
+FOUNDATION_EXTERN NSString *const kAddLowContrastTextView;
+
+/**
+ *  Name of the action that adds a standard text view.
+ */
+FOUNDATION_EXTERN NSString *const kAddStandardUIKitTextView;
 
 /**
  *  Name of the action that adds a high contrast background.
diff --git a/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.m b/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.m
index 2b67d4a..20937e2 100644
--- a/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.m
+++ b/Tests/FunctionalTests/TestApp/Sources/GTXTestViewController.m
@@ -30,6 +30,8 @@
 NSString *const kAddVeryLowContrastLabel = @"Add very low contrast label";
 NSString *const kAddBarelyHighContrastLabel = @"Add barely High contrast label";
 NSString *const kAddBarelyLowContrastLabel = @"Add barely Low contrast label";
+NSString *const kAddLowContrastTextView = @"Add low contrast text view";
+NSString *const kAddStandardUIKitTextView = @"Add standard UIKit text view";
 NSString *const kAddLowContrastBackground = @"Add Low contrast background";
 NSString *const kAddHighContrastBackground = @"Add High contrast backgorund";
 
@@ -140,6 +142,18 @@
                               backgroundColor:[UIColor clearColor]];
     [sSelf.testArea setBackgroundColor:kAlmostRedButDarker];
   }];
+  [self axetest_addActionNamed:kAddStandardUIKitTextView
+                       handler:^(GTXTestViewController *sSelf) {
+    // Add a standard contrast text view: black text on white background.
+    [sSelf axetest_addTextViewWithForgroundColor:nil
+                                 backgroundColor:nil];
+  }];
+  [self axetest_addActionNamed:kAddLowContrastTextView handler:^(GTXTestViewController *sSelf) {
+    // Add a low contrast text view: black text on very dark grey background.
+    UIColor *veryDarkGreyColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
+    [sSelf axetest_addTextViewWithForgroundColor:[UIColor blackColor]
+                                 backgroundColor:veryDarkGreyColor];
+  }];
 }
 
 - (void)axetest_addActionNamed:(NSString *)name handler:(ActionHandler)handler {
@@ -234,6 +248,21 @@
   [self.testArea addSubview:label];
 }
 
+- (void)axetest_addTextViewWithForgroundColor:(UIColor *)foregroundColor
+                              backgroundColor:(UIColor *)backgroundColor {
+  UITextView *view = [[UITextView alloc] initWithFrame:CGRectMake(kMargin, kMargin, 0, 0)];
+  view.font = [UIFont systemFontOfSize:60.0];
+  view.text = @"Hello";
+  if (![foregroundColor isEqual:nil]) {
+    view.textColor = foregroundColor;
+  }
+  if (![backgroundColor isEqual:nil]) {
+    view.backgroundColor = backgroundColor;
+  }
+  [view sizeToFit];
+  [self.testArea addSubview:view];
+}
+
 - (IBAction)userTappedClearFields:(UIButton *)sender {
   [self axetest_clearAllFields];
 }
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestAnalyticsBaseTest.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestAnalyticsBaseTest.m
index 85dfe2e..607e9ed 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestAnalyticsBaseTest.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestAnalyticsBaseTest.m
@@ -26,7 +26,7 @@
 + (void)setUp {
   [super setUp];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:@[checkFailsIfFailingClass]
+                       checks:@[gCheckFailsIfFailingClass]
             elementBlacklists:@[]];
   [GTXTestViewController addElementToTestArea:
       [[GTXTestFailingClass alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]];
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.h b/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.h
index 641ac32..e38cd9d 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.h
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.h
@@ -24,17 +24,17 @@
 /**
  Check that fails if the element is of Class @c GTXTestFailingClass.
  */
-extern id<GTXChecking> checkFailsIfFailingClass;
+extern id<GTXChecking> gCheckFailsIfFailingClass;
 
 /**
  Check that always passes.
  */
-extern id<GTXChecking> alwaysFail;
+extern id<GTXChecking> gAlwaysFail;
 
 /**
  Check that always fails.
  */
-extern id<GTXChecking> alwaysPass;
+extern id<GTXChecking> gAlwaysPass;
 
 /**
  Base test for all GTXiLib functional/integration tests used to setup GTXiLib and capture check
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.m
index 07d8c9f..ff45aa1 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestBaseTest.m
@@ -19,26 +19,26 @@
 #import "GTXTestViewController.h"
 
 static NSInteger gFailureCount = 0;
-id<GTXChecking> checkFailsIfFailingClass;
-id<GTXChecking> alwaysFail;
-id<GTXChecking> alwaysPass;
+id<GTXChecking> gCheckFailsIfFailingClass;
+id<GTXChecking> gAlwaysFail;
+id<GTXChecking> gAlwaysPass;
 
 @implementation GTXTestBaseTest
 
 + (void)setUp {
   [super setUp];
 
-  checkFailsIfFailingClass = [GTXiLib checkWithName:@"checkFailsIfFailingClass"
-                                              block:^BOOL(id element, GTXErrorRefType errorOrNil) {
+  gCheckFailsIfFailingClass = [GTXiLib checkWithName:@"gCheckFailsIfFailingClass"
+                                               block:^BOOL(id element, GTXErrorRefType errorOrNil) {
     return ![element isKindOfClass:[GTXTestFailingClass class]];
   }];
 
-  alwaysFail = [GTXiLib checkWithName:@"AlwaysFail"
-                                block:^BOOL(id element, GTXErrorRefType errorOrNil) {
+  gAlwaysFail = [GTXiLib checkWithName:@"gAlwaysFail"
+                                 block:^BOOL(id element, GTXErrorRefType errorOrNil) {
     return NO;
   }];
-  alwaysPass = [GTXiLib checkWithName:@"AlwaysPass"
-                                block:^BOOL(id element, GTXErrorRefType errorOrNil) {
+  gAlwaysPass = [GTXiLib checkWithName:@"gAlwaysPass"
+                                 block:^BOOL(id element, GTXErrorRefType errorOrNil) {
     return YES;
   }];
 
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestFailingClassFailCheck.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestFailingClassFailCheck.m
index 246512b..84de481 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestFailingClassFailCheck.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestFailingClassFailCheck.m
@@ -24,7 +24,7 @@
 + (void)setUp {
   [super setUp];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:@[checkFailsIfFailingClass]
+                       checks:@[gCheckFailsIfFailingClass]
             elementBlacklists:@[]];
   [GTXTestViewController addElementToTestArea:
       [[GTXTestFailingClass alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]];
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanBlacklistTestCases.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanBlacklistTestCases.m
index 375857c..ec78d3d 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanBlacklistTestCases.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanBlacklistTestCases.m
@@ -27,7 +27,7 @@
   [super setUp];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithClass:self
                                                   andTests:@selector(testMiddle), nil]
-                       checks:@[alwaysFail]
+                       checks:@[gAlwaysFail]
             elementBlacklists:@[]];
 }
 
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailures.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailures.m
index 1ec9b03..11e30d2 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailures.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailures.m
@@ -25,7 +25,7 @@
 + (void)setUp {
   [super setUp];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:@[alwaysFail]
+                       checks:@[gAlwaysFail]
             elementBlacklists:@[]];
 }
 
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailuresInInheritedTests.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailuresInInheritedTests.m
index eb88ce2..689dc80 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailuresInInheritedTests.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanDetectFailuresInInheritedTests.m
@@ -45,7 +45,7 @@
   GTXTestSuite *suite = [GTXTestSuite suiteWithAllTestsFromAllClassesInheritedFromClass:
       [GTXTestSuperClassWithATestMethod class]];
   [GTXiLib installOnTestSuite:suite
-                       checks:@[alwaysFail]
+                       checks:@[gAlwaysFail]
             elementBlacklists:@[]];
   gTeardownCalledAtleastOnce = NO;
 }
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElements.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElements.m
index b39c3a2..0fe7765 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElements.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElements.m
@@ -29,7 +29,7 @@
   NSArray *blacklist =
       @[[GTXBlacklistFactory blacklistWithClassName:className]];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:@[checkFailsIfFailingClass]
+                       checks:@[gCheckFailsIfFailingClass]
             elementBlacklists:blacklist];
   [GTXTestViewController addElementToTestArea:
       [[GTXTestFailingClass alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]];
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElementsOnSpecificCheck.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElementsOnSpecificCheck.m
index 8d3cde0..8a5ce65 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElementsOnSpecificCheck.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanIgnoreElementsOnSpecificCheck.m
@@ -27,13 +27,13 @@
   NSString *className = NSStringFromClass([GTXTestFailingClass class]);
   NSArray *blacklist =
       @[[GTXBlacklistFactory blacklistWithClassName:className
-                                             checkName:checkFailsIfFailingClass.name]];
+                                             checkName:gCheckFailsIfFailingClass.name]];
   id<GTXChecking> secondFailingCheck = [GTXiLib checkWithName:@"secondFailingCheck"
                                             block:^BOOL(id element, GTXErrorRefType errorOrNil) {
     return ![element isKindOfClass:[GTXTestFailingClass class]];
   }];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:@[checkFailsIfFailingClass, secondFailingCheck]
+                       checks:@[gCheckFailsIfFailingClass, secondFailingCheck]
             elementBlacklists:blacklist];
   [GTXTestViewController addElementToTestArea:
       [[GTXTestFailingClass alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]];
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanWhitelistTestCases.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanWhitelistTestCases.m
index f6df136..e22ac51 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanWhitelistTestCases.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxCanWhitelistTestCases.m
@@ -28,7 +28,7 @@
   [super setUp];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithClass:self
                                                   andTests:@selector(testMiddle), nil]
-                       checks:@[alwaysFail]
+                       checks:@[gAlwaysFail]
             elementBlacklists:@[]];
 }
 
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWithDefaultChecks.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWithDefaultChecks.m
index 20260f5..6b943d2 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWithDefaultChecks.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWithDefaultChecks.m
@@ -34,9 +34,11 @@
     [GTXBlacklistFactory blacklistWithAccessibilityIdentifier:kAddInaccessibleButton
                                                     checkName:notRedundantCheckName]
   ];
+  NSMutableArray *checks = [NSMutableArray arrayWithArray:[GTXChecksCollection allGTXChecks]];
+  [checks addObject:[GTXChecksCollection checkForSufficientTextViewContrastRatio]];
   // Install all the default checks on the current test class.
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:[GTXChecksCollection allGTXChecks]
+                       checks:checks
             elementBlacklists:blacklists];
 }
 
@@ -91,26 +93,36 @@
   _expectErrors = YES;
 }
 
-- (void)testLowContrastElementsCauseErrors {
+- (void)testLowContrastLabelsCauseErrors {
   [self _performTestActionNamed:kAddVeryLowContrastLabel];
   _expectErrors = YES;
 }
 
-- (void)testBarelyContrastElementsCauseErrors {
+- (void)testBarelyContrastLabelsCauseErrors {
   [self _performTestActionNamed:kAddBarelyLowContrastLabel];
   _expectErrors = YES;
 }
 
-- (void)testHighContrastElementsDoesNotCauseFailures {
+- (void)testHighContrastLabelsDoesNotCauseFailures {
   [self _performTestActionNamed:kAddVeryHighContrastLabel];
   _expectErrors = NO;
 }
 
-- (void)testBarelyHighContrastElementsDoesNotCauseFailures {
+- (void)testBarelyHighContrastLabelsDoesNotCauseFailures {
   [self _performTestActionNamed:kAddBarelyHighContrastLabel];
   _expectErrors = NO;
 }
 
+- (void)testLowContrastTextViewCausesErrors {
+  [self _performTestActionNamed:kAddLowContrastTextView];
+  _expectErrors = YES;
+}
+
+- (void)testStandardContrastTextViewDoesNotCauseFailures {
+  [self _performTestActionNamed:kAddStandardUIKitTextView];
+  _expectErrors = NO;
+}
+
 #pragma mark - private
 
 /**
diff --git a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWorksForPassingTests.m b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWorksForPassingTests.m
index e32aaef..caae2a4 100644
--- a/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWorksForPassingTests.m
+++ b/Tests/FunctionalTests/TestApp/TestSources/GTXTestGtxWorksForPassingTests.m
@@ -25,7 +25,7 @@
 + (void)setUp {
   [super setUp];
   [GTXiLib installOnTestSuite:[GTXTestSuite suiteWithAllTestsInClass:self]
-                       checks:@[alwaysPass]
+                       checks:@[gAlwaysPass]
             elementBlacklists:@[]];
 }