Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Commit

Permalink
Kill USB server support
Browse files Browse the repository at this point in the history
Summary:
`iproxy` is much more handy than using our custom USB support. Time to simplify our life and kill it.
Plus, we got ony one dependency now ;)

Reviewed By: lawrencelomax

Differential Revision: D4753457

fbshipit-source-id: 805ab7deeacf38c21eb312c6f87131fbdf5c4658
  • Loading branch information
Marek Cirkos authored and facebook-github-bot committed Mar 23, 2017
1 parent bb482e3 commit 5428e03
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 696 deletions.
3 changes: 0 additions & 3 deletions Cartfile
@@ -1,5 +1,2 @@
# Used for HTTP routing
github "marekcirkos/RoutingHTTPServer"

# Used for USBOverHTTP
github "marekcirkos/peertalk"
118 changes: 2 additions & 116 deletions WebDriverAgent.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

34 changes: 0 additions & 34 deletions WebDriverAgentLib/Routing/FBHTTPOverUSBServer.h

This file was deleted.

173 changes: 0 additions & 173 deletions WebDriverAgentLib/Routing/FBHTTPOverUSBServer.m

This file was deleted.

11 changes: 0 additions & 11 deletions WebDriverAgentLib/Routing/FBWebServer.m
Expand Up @@ -15,7 +15,6 @@
#import "FBCommandHandler.h"
#import "FBErrorBuilder.h"
#import "FBExceptionHandler.h"
#import "FBHTTPOverUSBServer.h"
#import "FBRouteRequest.h"
#import "FBRuntimeUtils.h"
#import "FBSession.h"
Expand Down Expand Up @@ -45,7 +44,6 @@ - (void)handleResourceNotFound
@interface FBWebServer ()
@property (nonatomic, strong) FBExceptionHandler *exceptionHandler;
@property (nonatomic, strong) RoutingHTTPServer *server;
@property (nonatomic, strong) FBHTTPOverUSBServer *USBServer;
@end

@implementation FBWebServer
Expand All @@ -70,9 +68,6 @@ - (void)startServing
[FBLogger logFmt:@"Built at %s %s", __DATE__, __TIME__];
self.exceptionHandler = [FBExceptionHandler new];
[self startHTTPServer];
if (FBConfiguration.shouldListenOnUSB) {
[self startUSBServer];
}
[[NSRunLoop mainRunLoop] run];
}

Expand Down Expand Up @@ -109,12 +104,6 @@ - (void)startHTTPServer
[FBLogger logFmt:@"%@http://%@:%d%@", FBServerURLBeginMarker, [XCUIDevice sharedDevice].fb_wifiIPAddress ?: @"localhost", [self.server port], FBServerURLEndMarker];
}

- (void)startUSBServer
{
self.USBServer = [[FBHTTPOverUSBServer alloc] initWithRoutingServer:self.server];
[self.USBServer startServing];
}

- (BOOL)attemptToStartServer:(RoutingHTTPServer *)server onPort:(NSInteger)port withError:(NSError **)error
{
server.port = (UInt16)port;
Expand Down
5 changes: 0 additions & 5 deletions WebDriverAgentLib/Utilities/FBConfiguration.h
Expand Up @@ -27,11 +27,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (NSRange)bindingPortRange;

/**
YES if should listen on USB. NO otherwise.
*/
+ (BOOL)shouldListenOnUSB;

/**
YES if verbose logging is enabled. NO otherwise.
*/
Expand Down
9 changes: 0 additions & 9 deletions WebDriverAgentLib/Utilities/FBConfiguration.m
Expand Up @@ -43,15 +43,6 @@ + (NSRange)bindingPortRange
return NSMakeRange(DefaultStartingPort, DefaultPortRange);
}

+ (BOOL)shouldListenOnUSB
{
#if TARGET_OS_SIMULATOR
return NO;
#else
return YES;
#endif
}

+ (BOOL)verboseLoggingEnabled
{
return [NSProcessInfo.processInfo.environment[@"VERBOSE_LOGGING"] boolValue];
Expand Down
1 change: 0 additions & 1 deletion WebDriverAgentLib/WebDriverAgentLib.h
Expand Up @@ -27,7 +27,6 @@ FOUNDATION_EXPORT const unsigned char WebDriverAgentLib_VersionString[];
#import <WebDriverAgentLib/FBErrorBuilder.h>
#import <WebDriverAgentLib/FBExceptionHandler.h>
#import <WebDriverAgentLib/FBFailureProofTestCase.h>
#import <WebDriverAgentLib/FBHTTPOverUSBServer.h>
#import <WebDriverAgentLib/FBKeyboard.h>
#import <WebDriverAgentLib/FBLogger.h>
#import <WebDriverAgentLib/FBMacros.h>
Expand Down

0 comments on commit 5428e03

Please sign in to comment.