Skip to content

Commit

Permalink
Corrected typos in comments, strings, and docs
Browse files Browse the repository at this point in the history
Non-comment code changes are limited to:
  * local variable rename in `Scripts/rename-ochamcrestIOS.py`.
  * string value change in `Tests/FunctionalTests/Sources/FTRPinchViewTest.m`
  • Loading branch information
cbracken authored and tirodkar committed May 29, 2019
1 parent 4a544a8 commit 9a90d21
Show file tree
Hide file tree
Showing 29 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion EarlGrey/Action/GREYActions+Internal.h
Expand Up @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @return @c YES if the action succeeded, else @c NO. If an action returns @c NO, it does not
* mean that the action was not performed at all but somewhere during the action execution
* the error occured and so the UI may be in an unrecoverable state.
* the error occurred and so the UI may be in an unrecoverable state.
*
* @remark This is available only for internal testing purposes.
*/
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Action/GREYActions.m
Expand Up @@ -396,7 +396,7 @@ + (void)grey_setText:(NSString *)text onWebElement:(id)element {
*
* @return @c YES if the action succeeded, else @c NO. If an action returns @c NO, it does not
* mean that the action was not performed at all but somewhere during the action execution
* the error occured and so the UI may be in an unrecoverable state.
* the error occurred and so the UI may be in an unrecoverable state.
*/
+ (id<GREYAction>)grey_actionForReplaceText:(NSString *)text {
SEL setTextSelector = NSSelectorFromString(@"setText:");
Expand Down Expand Up @@ -474,7 +474,7 @@ + (void)grey_setText:(NSString *)text onWebElement:(id)element {
*
* @return @c YES if the action succeeded, else @c NO. If an action returns @c NO, it does not
* mean that the action was not performed at all but somewhere during the action execution
* the error occured and so the UI may be in an unrecoverable state.
* the error occurred and so the UI may be in an unrecoverable state.
*/
+ (BOOL)grey_disableAutoCorrectForDelegateAndTypeText:(NSString *)text
inFirstResponder:(id)firstResponder
Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Action/GREYPathGestureUtils.m
Expand Up @@ -209,7 +209,7 @@ + (GREYDirection)grey_relativeDirectionForCurrentOrientationWithDirection:(GREYD
return direction;
}

// Transform the direction assuming it exists on potrait orientation and we would like to apply
// Transform the direction assuming it exists on portrait orientation and we would like to apply
// it in the current interface orientation.
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
switch (orientation) {
Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Action/GREYScrollAction.m
Expand Up @@ -98,7 +98,7 @@ - (BOOL)perform:(id)element error:(__strong NSError **)errorOrNil {
if (![self satisfiesConstraintsForElement:element error:errorOrNil]) {
return NO;
}
// To scroll UIWebView we must use the UIScrollView in its heirarchy and scroll it.
// To scroll UIWebView we must use the UIScrollView in its hierarchy and scroll it.
if ([element isKindOfClass:[UIWebView class]]) {
element = [(UIWebView *)element scrollView];
}
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Action/GREYScrollToContentEdgeAction.m
Expand Up @@ -78,7 +78,7 @@ - (BOOL)perform:(UIScrollView *)element error:(__strong NSError **)errorOrNil {
if (![self satisfiesConstraintsForElement:element error:errorOrNil]) {
return NO;
}
// To scroll UIWebView we must use the UIScrollView in its heirarchy and scroll it.
// To scroll UIWebView we must use the UIScrollView in its hierarchy and scroll it.
if ([element isKindOfClass:[UIWebView class]]) {
element = [(UIWebView *)element scrollView];
}
Expand Down Expand Up @@ -108,7 +108,7 @@ - (BOOL)perform:(UIScrollView *)element error:(__strong NSError **)errorOrNil {
// We have reached the content edge.
return YES;
} else {
// Some other error has occured.
// Some other error has occurred.
if (errorOrNil) {
*errorOrNil = scrollError;
}
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Action/GREYTapAction.h
Expand Up @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN
* A GREYAction that performs a long press with a given @c duration at the given @c location.
*
* @param duration The duration of the long press.
* @param location The location of the long press relative to the element recieving the touch
* @param location The location of the long press relative to the element receiving the touch
* event.
*
* @return An instance of GREYTapAction, initialized with the @c duration and @c location of
Expand All @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param tapType The type of the tap.
* @param numberOfTaps Number of times the element should be tapped.
* @param duration The duration of the tap event if applicable.
* @param tapLocation The location of the tap relative to the element recieving the touch
* @param tapLocation The location of the tap relative to the element receiving the touch
* event.
*
* @return An initialized (to the given parameters) instance of GREYTapAction.
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Additions/XCTestCase+GREYAdditions.h
Expand Up @@ -108,8 +108,8 @@ typedef NS_ENUM(NSUInteger, GREYXCTestCaseStatus) {
* Interrupts the current test case execution immediately and triggers XCTest's error handling
* mechanism to invoke the appropriate methods to tear down the test.
*
* @param line Line number at which the failure occured.
* @param file Name of the file in which the failure occured.
* @param line Line number at which the failure occurred.
* @param file Name of the file in which the failure occurred.
* @param description Full description of the failure.
*/
- (void)grey_markAsFailedAtLine:(NSUInteger)line
Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Common/GREYAnalytics.m
Expand Up @@ -39,7 +39,7 @@ @interface GREYAnalytics() <GREYAnalyticsDelegate>
@end

@implementation GREYAnalytics {
// Overriden GREYAnalytics delegate for custom handling of analytics.
// Overridden GREYAnalytics delegate for custom handling of analytics.
__weak id<GREYAnalyticsDelegate> _delegate;
// Once set, analytics will be sent on next XCTestCase tearDown.
BOOL _earlgreyWasCalledInXCTestContext;
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Common/GREYAppleInternals.h
Expand Up @@ -50,7 +50,7 @@ typedef UInt32 IOOptionBits;
/**
* Event mask detailing the events being dispatched by a digitizer. It is possible for digitizer
* events to contain child digitizer events, effectively, behaving as collections. In the
* collection case, the child event mask field referrence by
* collection case, the child event mask field reference by
* kIOHIDEventFieldDigitizerChildEventMask will detail the cumulative event state of the child
* digitizer events. If you append a child digitizer event to a parent digitizer event, appropriate
* state will be transferred on to the parent.
Expand Down Expand Up @@ -203,7 +203,7 @@ IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef allocator,
* after user stopped dragging it. @c notify determines whether UIScrollViewDelegate will be
* notified that scrolling has finished.
*
* @param notify An indicator specifiying if scrolling has finished.
* @param notify An indicator specifying if scrolling has finished.
*/
- (void)_stopScrollDecelerationNotify:(BOOL)notify;
@end
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Common/GREYConfiguration.m
Expand Up @@ -42,9 +42,9 @@
@implementation GREYConfiguration {
NSMutableDictionary *_defaultConfiguration; // Dict for storing the default configs
NSMutableDictionary *_overridenConfiguration; // Dict for storing the user-defined overrides
NSMutableDictionary *_mergedConfiguration; // Dict for storing the merged default/overriden dicts
NSMutableDictionary *_mergedConfiguration; // Dict for storing the merged default/overridden dicts
BOOL _needsMerge; // Indicates whether the merged configuration was invalidated due to a change
// in the default or overriden configurations
// in the default or overridden configurations
}

- (instancetype)init {
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Core/GREYElementInteraction.m
Expand Up @@ -214,7 +214,7 @@ - (instancetype)performAction:(id<GREYAction>)action error:(__strong NSError **)
NSError *executorError;
__block NSError *actionError = nil;

// Create the user info dictionary for any notificatons and set it up with the action.
// Create the user info dictionary for any notifications and set it up with the action.
NSMutableDictionary *actionUserInfo = [[NSMutableDictionary alloc] init];
[actionUserInfo setObject:action forKey:kGREYActionUserInfoKey];
NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter];
Expand Down Expand Up @@ -369,7 +369,7 @@ - (instancetype)assert:(id<GREYAssertion>)assertion error:(__strong NSError **)e
id element = (elements.count != 0) ?
[strongSelf grey_uniqueElementInMatchedElements:elements andError:&assertionError] : nil;

// Create the user info dictionary for any notificatons and set it up with the assertion.
// Create the user info dictionary for any notifications and set it up with the assertion.
NSMutableDictionary *assertionUserInfo = [[NSMutableDictionary alloc] init];
[assertionUserInfo setObject:assertion forKey:kGREYAssertionUserInfoKey];

Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Event/GREYTouchInjector.h
Expand Up @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @param touchInfo The info that is used to create the UITouch. If it represents a last touch
* in a sequence, the specified @c point value is ignored and injector
* automatically picks the previous point where touch occured to deliver
* automatically picks the previous point where touch occurred to deliver
* the last touch.
*/
- (void)enqueueTouchInfoForDelivery:(GREYTouchInfo *)touchInfo;
Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Provider/GREYUIWindowProvider.h
Expand Up @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)providerWithWindows:(NSArray *)windows;

/**
* Class method to get a provider with all the windows currently registed with the app.
* Class method to get a provider with all the windows currently registered with the app.
*
* @return A GREYUIWindowProvider instance populated by all windows currently
* registered with the app.
Expand Down
12 changes: 6 additions & 6 deletions EarlGrey/Synchronization/GREYDispatchQueueTracker.m
Expand Up @@ -91,7 +91,7 @@ - (void)grey_dispatchSyncCallWithContext:(void *)context work:(dispatch_function
}

/**
* Overriden implementation of @c dispatch_after that calls into the tracker, if one is found for
* Overridden implementation of @c dispatch_after that calls into the tracker, if one is found for
* the dispatch queue passed in.
*
* @param when Same as @c dispatch_after @c when.
Expand All @@ -110,7 +110,7 @@ static void grey_dispatch_after(dispatch_time_t when,
}

/**
* Overriden implementation of @c dispatch_async that calls into the tracker, if one is found for
* Overridden implementation of @c dispatch_async that calls into the tracker, if one is found for
* the dispatch queue passed in.
*
* @param queue Same as @c dispatch_async @c queue.
Expand All @@ -126,7 +126,7 @@ static void grey_dispatch_async(dispatch_queue_t queue, dispatch_block_t block)
}

/**
* Overriden implementation of @c dispatch_sync that calls into the tracker, if one is found for
* Overridden implementation of @c dispatch_sync that calls into the tracker, if one is found for
* the dispatch queue passed in.
*
* @param queue Same as @c dispatch_sync @c queue.
Expand All @@ -142,7 +142,7 @@ static void grey_dispatch_sync(dispatch_queue_t queue, dispatch_block_t block) {
}

/**
* Overriden implementation of @c dispatch_after_f that calls into the tracker, if one is found
* Overridden implementation of @c dispatch_after_f that calls into the tracker, if one is found
* for the dispatch queue passed in.
*
* @param when Same as @c dispatch_after_f @c when.
Expand All @@ -163,7 +163,7 @@ static void grey_dispatch_after_f(dispatch_time_t when,
}

/**
* Overriden implementation of @c dispatch_async_f that calls into the tracker, if one is found
* Overridden implementation of @c dispatch_async_f that calls into the tracker, if one is found
* for the dispatch queue passed in.
*
* @param queue Same as @c dispatch_async_f @c queue.
Expand All @@ -180,7 +180,7 @@ static void grey_dispatch_async_f(dispatch_queue_t queue, void *context, dispatc
}

/**
* Overriden implementation of @c dispatch_sync_f that calls into the tracker, if one is found
* Overridden implementation of @c dispatch_sync_f that calls into the tracker, if one is found
* for the dispatch queue passed in.
*
* @param queue Same as @c dispatch_sync_f @c queue.
Expand Down
4 changes: 2 additions & 2 deletions EarlGrey/Synchronization/GREYRunLoopSpinner.m
Expand Up @@ -230,9 +230,9 @@ - (BOOL)grey_checkConditionInActiveMode:(BOOL (^)(void))stopConditionBlock {
* starts spinning the run loop in the same mode.
*
* @param mode The mode that the observer should be added to.
* @param beforeSourcesBlock Block that will be invoked when the added observer recieves before-
* @param beforeSourcesBlock Block that will be invoked when the added observer receives before-
* sources callbacks and is not nested.
* @param beforeWaitingBlock Block that will be invoked when the added observer recieves before-
* @param beforeWaitingBlock Block that will be invoked when the added observer receives before-
* waiting callbacks and is not nested.
*
* @return The registered observer.
Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Synchronization/GREYUIThreadExecutor.h
Expand Up @@ -84,7 +84,7 @@ typedef void(^GREYExecBlock)(void);
* are in idle.
*
* @remark Be very careful while calling this as you could end up in state where the caller expects
* the callee to mark the thread as idle and callee inadvertantly calls
* the callee to mark the thread as idle and callee inadvertently calls
* GREYUIThreadExecutor::drainUntilIdle:, in which case it will go into an infinite loop
* and the test will have to be force-killed by the test-runner.
*/
Expand Down
2 changes: 1 addition & 1 deletion EarlGrey/Traversal/GREYTraversalDFS.h
Expand Up @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN

/**
* Class method to initialize the object. The hierarchy is unrolled in a DFS fashion and
* an internal represenation is created.
* an internal representation is created.
*
* @param element Single UI element whose UI hierarchy needs to be unrolled.
*
Expand Down
4 changes: 2 additions & 2 deletions Scripts/rename-ochamcrestIOS.py
Expand Up @@ -60,8 +60,8 @@ def _ChangeFrameworkHeaderFileNames():
script_header_dir = 'OCHamcrest.framework/Headers/*'
script_dir = 'OCHamcrest.framework/*'
file_glob = glob.glob(_FilePathRelativeToScriptDirectory(script_header_dir))
extention_glob = glob.glob(_FilePathRelativeToScriptDirectory(script_dir))
file_glob.extend(extention_glob)
extension_glob = glob.glob(_FilePathRelativeToScriptDirectory(script_dir))
file_glob.extend(extension_glob)
for oc_file in file_glob:
os.rename(oc_file, oc_file.replace('OCHamcrestIOS', 'OCHamcrest'))

Expand Down
2 changes: 1 addition & 1 deletion Scripts/travis.sh
Expand Up @@ -75,7 +75,7 @@ execute_xcodebuild() {

set +e
# In case of failure in test's +setUp or +tearDown, Xcode doesn't exit with an error code but logs it.
# Add another check to make sure no unexpected failure occured.
# Add another check to make sure no unexpected failure occurred.
$(grep -q -m 1 -ie ".*[1-9]\d* unexpected" xcodebuild.log)
retval_expected_test_failures=$?
set -e
Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/Sources/FTRBaseAnalyticsTest.m
Expand Up @@ -45,7 +45,7 @@
static id<GREYAnalyticsDelegate> gTestAnalyticsDelegate;

/**
* The current total number of analytics hits recieved.
* The current total number of analytics hits received.
*/
static volatile NSInteger gTotalHitsReceived;

Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/Sources/FTRPinchViewTest.m
Expand Up @@ -152,7 +152,7 @@ - (void)ftr_assertThatInitialSize:(CGSize)initialSize
break;

default:
GREYAssert(NO, @"Unknown comparision result was expected %d", (int)expectedOrder);
GREYAssert(NO, @"Unknown comparison result was expected %d", (int)expectedOrder);
}

GREYAssert(success, @"Image sizes before pinch - %@ and after pinch - %@ must be %@.",
Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/Sources/FTRUIWebViewTest.m
Expand Up @@ -251,7 +251,7 @@ - (void)testAjaxUnTrackedWhenAJAXListenerSchemeIsCompleted {
XCTAssertFalse(isAsyncRequestPending, @"should not be pending");
}

// TODO: Temporarily disable the test due to that it fails to dectect the UIWebView is idling.
// TODO: Temporarily disable the test due to that it fails to detect the UIWebView is idling.
// Link: https://github.com/google/EarlGrey/issues/365
- (void)DISABLED_testLongPressLinkInUIWebView {
// Load local page first.
Expand Down
Expand Up @@ -35,7 +35,7 @@ - (UICollectionViewLayoutAttributes *)grey_layoutAttributesForChar:(char)aChar {
}

NSInteger charIndex = aChar - 'A';
// Compute the char's position from its index. The chars are layed out in a grid of size W X H
// Compute the char's position from its index. The chars are laid out in a grid of size W X H
// where W and H are itemsPerSide.
NSInteger xIndex = charIndex % itemsPerSide;
NSInteger yIndex = charIndex / itemsPerSide;
Expand Down
4 changes: 2 additions & 2 deletions Tests/FunctionalTests/TestRig/Sources/FTRNetworkProxy.h
Expand Up @@ -29,7 +29,7 @@
/**
* Enables (if @c enabled is @c YES) or disables the proxy.
*
* @param enabled A BOOL specifing whether to enable or disable the proxy.
* @param enabled A BOOL specifying whether to enable or disable the proxy.
*/
+ (void)ftr_setProxyEnabled:(BOOL)enabled;

Expand Down Expand Up @@ -58,7 +58,7 @@

/**
* @return Returns an array of all the requests proxied since the proxy was enabled or since it
* was last cleared which ever happend the last.
* was last cleared which ever happened the last.
*/
+ (NSArray *)ftr_requestsReceived;

Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/TestRig/Sources/FTRNetworkProxy.m
Expand Up @@ -48,7 +48,7 @@
static NSString *const kFTRNetworkProxyRuleResponseKey = @"kFTRNetworkProxyRuleResponseKey";

/**
* Error domain for errors occuring in FTRNetworkProxy.
* Error domain for errors occurring in FTRNetworkProxy.
*/
static NSString *const kFTRNetworkProxyErrorDomain =
@"com.google.earlgrey.FTRNetworkProxyErrorDomain";
Expand Down
Expand Up @@ -15,7 +15,7 @@
//

// Class that controls FTRSliderViewController.xib view. The view contains six sliders, each of
// which have propeties listed below. The top slider is slider1 and the bottom most slider6.
// which have properties listed below. The top slider is slider1 and the bottom most slider6.

#import <UIKit/UIKit.h>

Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Sources/CALayer+GREYAdditionsTest.m
Expand Up @@ -402,7 +402,7 @@ - (void)testPausingAndResumingFromNegativeSpeed {
XCTAssertTrue(state & kGREYPendingCAAnimation,
@"State should change after starting an animation.");

// Clear the state change that happend after adding animation.
// Clear the state change that happened after adding animation.
[[GREYAppStateTracker sharedInstance] grey_clearState];

// iOS creates immutable animation objects from added animations.
Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Sources/CGGeometry+GREYAdditionsTest.m
Expand Up @@ -85,7 +85,7 @@ - (void)testCGRectIntegralInside {
{CGRectMake(5, 6, (CGFloat)0.5, (CGFloat)0.5), CGRectMake(5, 6, 0, 0)},
{CGRectMake((CGFloat)5.99, (CGFloat)6.99, (CGFloat).49, (CGFloat).49), CGRectMake(6, 7, 0, 0)},

// inputs w/ non-shrinking-greater-than-1 widths: the compromized width can compensate itself
// inputs w/ non-shrinking-greater-than-1 widths: the compromised width can compensate itself
{CGRectMake((CGFloat)5.9, (CGFloat)5.9, (CGFloat)1.1, (CGFloat)1.1), CGRectMake(6, 6, 1, 1)},
{CGRectMake((CGFloat).95, (CGFloat)0.95, (CGFloat)10.1, (CGFloat)10.1),
CGRectMake(1, 1, 10, 10)},
Expand Down
4 changes: 2 additions & 2 deletions Tests/UnitTests/Sources/NSObject+GREYAdditionsTest.m
Expand Up @@ -212,7 +212,7 @@ - (void)testViewContainingSelfReturnsAccessibilityContainerForNonUIViews {
UIAccessibilityElement *element =
[[UIAccessibilityElement alloc] initWithAccessibilityContainer:container];

// Set up heirarchy: containersContainer -> container -> element
// Set up hierarchy: containersContainer -> container -> element
element.accessibilityContainer = container;
container.accessibilityContainer = containersContainer;
XCTAssertEqualObjects([element grey_viewContainingSelf], containersContainer);
Expand All @@ -226,7 +226,7 @@ - (void)testViewContainingSelfReturnsWebViewForWebAccessibilityObjectWrapper {
[[UIAccessibilityElement alloc] initWithAccessibilityContainer:viewContainer];
id webViewContainer = [OCMockObject mockForClass:NSClassFromString(@"UIWebView")];

// Set up heirarchy: webViewContainer -> viewContainer -> container -> element
// Set up hierarchy: webViewContainer -> viewContainer -> container -> element
[[[element stub] andReturn:container] grey_container];
[[[viewContainer stub] andReturn:webViewContainer] grey_container];
[[[webViewContainer stub] andReturn:nil] grey_container];
Expand Down

0 comments on commit 9a90d21

Please sign in to comment.