Address comments

pull/18919/head
Muxi Yan 6 years ago
parent fb1a6b1d48
commit caa965bd1d
  1. 2
      src/objective-c/tests/ConfigureCronet.h
  2. 10
      src/objective-c/tests/ConfigureCronet.m
  3. 4
      src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm
  4. 6
      src/objective-c/tests/CronetTests/CronetUnitTests.mm
  5. 4
      src/objective-c/tests/InteropTests/InteropTests.m
  6. 4
      src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m
  7. 26
      src/objective-c/tests/Podfile
  8. 37
      src/objective-c/tests/Tests.xcodeproj/project.pbxproj
  9. 2
      src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTests.xcscheme

@ -25,7 +25,7 @@ extern "C" {
/** /**
* Enable Cronet for once. * Enable Cronet for once.
*/ */
void enableCronet(void); void configureCronet(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -18,13 +18,13 @@
#ifdef GRPC_COMPILE_WITH_CRONET #ifdef GRPC_COMPILE_WITH_CRONET
#import "EnableCronet.h" #import "ConfigureCronet.h"
#import <Cronet/Cronet.h> #import <Cronet/Cronet.h>
void enableCronet(void) { void configureCronet(void) {
static dispatch_once_t enableCronet; static dispatch_once_t configureCronet;
dispatch_once(&enableCronet, ^{ dispatch_once(&configureCronet, ^{
NSLog(@"enableCronet()"); NSLog(@"configureCronet()");
[Cronet setHttp2Enabled:YES]; [Cronet setHttp2Enabled:YES];
[Cronet setSslKeyLogFileName:@"Documents/key"]; [Cronet setSslKeyLogFileName:@"Documents/key"];
[Cronet enableTestCertVerifierForTesting]; [Cronet enableTestCertVerifierForTesting];

@ -49,7 +49,7 @@
#import <Cronet/Cronet.h> #import <Cronet/Cronet.h>
#include <grpc/grpc_cronet.h> #include <grpc/grpc_cronet.h>
#import "../EnableCronet.h" #import "../ConfigureCronet.h"
typedef struct fullstack_secure_fixture_data { typedef struct fullstack_secure_fixture_data {
char *localaddr; char *localaddr;
@ -178,7 +178,7 @@ static char *roots_filename;
grpc_init(); grpc_init();
enableCronet(); configureCronet();
} }
// The tearDown() function is run after all test cases finish running // The tearDown() function is run after all test cases finish running

@ -20,7 +20,7 @@
#import <netinet/in.h> #import <netinet/in.h>
#import <sys/socket.h> #import <sys/socket.h>
#import "../EnableCronet.h" #import "../ConfigureCronet.h"
#import <Cronet/Cronet.h> #import <Cronet/Cronet.h>
#import <grpc/grpc.h> #import <grpc/grpc.h>
@ -40,8 +40,8 @@
#import "test/core/util/test_config.h" #import "test/core/util/test_config.h"
#define GRPC_SHADOW_BORINGSSL_SYMBOLS #define GRPC_SHADOW_BORINGSSL_SYMBOLS
#import <openssl_grpc/ssl.h>"
#import "src/core/tsi/grpc_shadow_boringssl.h" #import "src/core/tsi/grpc_shadow_boringssl.h"
#import <openssl_grpc/ssl.h>"
static void drain_cq(grpc_completion_queue *cq) { static void drain_cq(grpc_completion_queue *cq) {
grpc_event ev; grpc_event ev;
@ -63,7 +63,7 @@ static void drain_cq(grpc_completion_queue *cq) {
grpc_test_init(1, argv); grpc_test_init(1, argv);
grpc_init(); grpc_init();
enableCronet(); configureCronet();
init_ssl(); init_ssl();
} }

@ -36,7 +36,7 @@
#import <grpc/grpc.h> #import <grpc/grpc.h>
#import <grpc/support/log.h> #import <grpc/support/log.h>
#import "../EnableCronet.h" #import "../ConfigureCronet.h"
#import "InteropTestsBlockCallbacks.h" #import "InteropTestsBlockCallbacks.h"
#define TEST_TIMEOUT 32 #define TEST_TIMEOUT 32
@ -115,7 +115,7 @@ BOOL isRemoteInteropTest(NSString *host) {
+ (void)setUp { + (void)setUp {
NSLog(@"InteropTest Started, class: %@", [[self class] description]); NSLog(@"InteropTest Started, class: %@", [[self class] description]);
#ifdef GRPC_COMPILE_WITH_CRONET #ifdef GRPC_COMPILE_WITH_CRONET
enableCronet(); configureCronet();
if ([self useCronet]) { if ([self useCronet]) {
[GRPCCall useCronetWithEngine:[Cronet getGlobalEngine]]; [GRPCCall useCronetWithEngine:[Cronet getGlobalEngine]];
} }

@ -26,7 +26,7 @@
#import <RemoteTest/Test.pbrpc.h> #import <RemoteTest/Test.pbrpc.h>
#import <RxLibrary/GRXBufferedPipe.h> #import <RxLibrary/GRXBufferedPipe.h>
#import "../EnableCronet.h" #import "../ConfigureCronet.h"
#import "InteropTestsBlockCallbacks.h" #import "InteropTestsBlockCallbacks.h"
#define NSStringize_helper(x) #x #define NSStringize_helper(x) #x
@ -87,7 +87,7 @@ dispatch_once_t initCronet;
_remoteService = [RMTTestService serviceWithHost:kRemoteSSLHost callOptions:nil]; _remoteService = [RMTTestService serviceWithHost:kRemoteSSLHost callOptions:nil];
enableCronet(); configureCronet();
// Default stack with remote host // Default stack with remote host
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init]; GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];

@ -21,24 +21,20 @@ target 'MacTests' do
pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true
end end
%w( target 'UnitTests' do
UnitTests platform :ios, '8.0'
).each do |target_name| pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true
target target_name do
platform :ios, '8.0'
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true
pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
pod 'gRPC', :path => GRPC_LOCAL_SRC pod 'gRPC', :path => GRPC_LOCAL_SRC
pod 'gRPC-Core', :path => GRPC_LOCAL_SRC pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true
pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true
end
end end
%w( %w(

@ -11,8 +11,8 @@
5E3F14842278B461007C6D90 /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; }; 5E3F14842278B461007C6D90 /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; };
5E3F14852278BF5D007C6D90 /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; }; 5E3F14852278BF5D007C6D90 /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; };
5E3F14862278BFFF007C6D90 /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; }; 5E3F14862278BFFF007C6D90 /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; };
5E3F148D22792856007C6D90 /* EnableCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F1487227918AA007C6D90 /* EnableCronet.m */; }; 5E3F148D22792856007C6D90 /* ConfigureCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F1487227918AA007C6D90 /* ConfigureCronet.m */; };
5E3F148E22792AF5007C6D90 /* EnableCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F1487227918AA007C6D90 /* EnableCronet.m */; }; 5E3F148E22792AF5007C6D90 /* ConfigureCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F1487227918AA007C6D90 /* ConfigureCronet.m */; };
5E7F486422775B37006656AD /* InteropTestsRemoteWithCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */; }; 5E7F486422775B37006656AD /* InteropTestsRemoteWithCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */; };
5E7F486522775B41006656AD /* CronetUnitTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5EAD6D261E27047400002378 /* CronetUnitTests.mm */; }; 5E7F486522775B41006656AD /* CronetUnitTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5EAD6D261E27047400002378 /* CronetUnitTests.mm */; };
5E7F486E22778086006656AD /* CoreCronetEnd2EndTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E7F486D22778086006656AD /* CoreCronetEnd2EndTests.mm */; }; 5E7F486E22778086006656AD /* CoreCronetEnd2EndTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E7F486D22778086006656AD /* CoreCronetEnd2EndTests.mm */; };
@ -94,8 +94,8 @@
5E0282E8215AA697007AC99D /* NSErrorUnitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSErrorUnitTests.m; sourceTree = "<group>"; }; 5E0282E8215AA697007AC99D /* NSErrorUnitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSErrorUnitTests.m; sourceTree = "<group>"; };
5E3F14822278B42D007C6D90 /* InteropTestsBlockCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InteropTestsBlockCallbacks.h; sourceTree = "<group>"; }; 5E3F14822278B42D007C6D90 /* InteropTestsBlockCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InteropTestsBlockCallbacks.h; sourceTree = "<group>"; };
5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InteropTestsBlockCallbacks.m; sourceTree = "<group>"; }; 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InteropTestsBlockCallbacks.m; sourceTree = "<group>"; };
5E3F1487227918AA007C6D90 /* EnableCronet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EnableCronet.m; sourceTree = "<group>"; }; 5E3F1487227918AA007C6D90 /* ConfigureCronet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ConfigureCronet.m; sourceTree = "<group>"; };
5E3F148A227918C4007C6D90 /* EnableCronet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EnableCronet.h; sourceTree = "<group>"; }; 5E3F148A227918C4007C6D90 /* ConfigureCronet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ConfigureCronet.h; sourceTree = "<group>"; };
5E7F485922775B15006656AD /* CronetTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CronetTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5E7F485922775B15006656AD /* CronetTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CronetTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5E7F486622776AD8006656AD /* Cronet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cronet.framework; path = Pods/CronetFramework/Cronet.framework; sourceTree = "<group>"; }; 5E7F486622776AD8006656AD /* Cronet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cronet.framework; path = Pods/CronetFramework/Cronet.framework; sourceTree = "<group>"; };
5E7F486D22778086006656AD /* CoreCronetEnd2EndTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreCronetEnd2EndTests.mm; sourceTree = "<group>"; }; 5E7F486D22778086006656AD /* CoreCronetEnd2EndTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreCronetEnd2EndTests.mm; sourceTree = "<group>"; };
@ -396,8 +396,8 @@
635697C91B14FC11007A7283 /* Tests */ = { 635697C91B14FC11007A7283 /* Tests */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5E3F148A227918C4007C6D90 /* EnableCronet.h */, 5E3F148A227918C4007C6D90 /* ConfigureCronet.h */,
5E3F1487227918AA007C6D90 /* EnableCronet.m */, 5E3F1487227918AA007C6D90 /* ConfigureCronet.m */,
5EAFE8271F8EFB87007F2189 /* version.h */, 5EAFE8271F8EFB87007F2189 /* version.h */,
635697D71B14FC11007A7283 /* Supporting Files */, 635697D71B14FC11007A7283 /* Supporting Files */,
); );
@ -537,6 +537,7 @@
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
English,
en, en,
); );
mainGroup = 635697BE1B14FC11007A7283; mainGroup = 635697BE1B14FC11007A7283;
@ -591,15 +592,11 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-InteropTests/Pods-InteropTests-frameworks.sh", "${PODS_ROOT}/Target Support Files/Pods-InteropTests/Pods-InteropTests-frameworks.sh",
"${PODS_ROOT}/CronetFramework/Cronet.framework", "${PODS_ROOT}/CronetFramework/Cronet.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework",
); );
@ -613,15 +610,11 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-CronetTests/Pods-CronetTests-frameworks.sh", "${PODS_ROOT}/Target Support Files/Pods-CronetTests/Pods-CronetTests-frameworks.sh",
"${PODS_ROOT}/CronetFramework/Cronet.framework", "${PODS_ROOT}/CronetFramework/Cronet.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework",
); );
@ -635,15 +628,11 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-CronetTests/Pods-CronetTests-resources.sh", "${PODS_ROOT}/Target Support Files/Pods-CronetTests/Pods-CronetTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC-iOS/gRPCCertificates.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-iOS/gRPCCertificates.bundle",
); );
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
); );
@ -679,15 +668,11 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MacTests/Pods-MacTests-resources.sh", "${PODS_ROOT}/Target Support Files/Pods-MacTests/Pods-MacTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC-macOS/gRPCCertificates.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-macOS/gRPCCertificates.bundle",
); );
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
); );
@ -741,15 +726,11 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-InteropTests/Pods-InteropTests-resources.sh", "${PODS_ROOT}/Target Support Files/Pods-InteropTests/Pods-InteropTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC-iOS/gRPCCertificates.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-iOS/gRPCCertificates.bundle",
); );
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
); );
@ -819,7 +800,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5E3F14852278BF5D007C6D90 /* InteropTestsBlockCallbacks.m in Sources */, 5E3F14852278BF5D007C6D90 /* InteropTestsBlockCallbacks.m in Sources */,
5E3F148D22792856007C6D90 /* EnableCronet.m in Sources */, 5E3F148D22792856007C6D90 /* ConfigureCronet.m in Sources */,
5E7F486E22778086006656AD /* CoreCronetEnd2EndTests.mm in Sources */, 5E7F486E22778086006656AD /* CoreCronetEnd2EndTests.mm in Sources */,
5E7F488522778A88006656AD /* InteropTests.m in Sources */, 5E7F488522778A88006656AD /* InteropTests.m in Sources */,
5E7F486422775B37006656AD /* InteropTestsRemoteWithCronet.m in Sources */, 5E7F486422775B37006656AD /* InteropTestsRemoteWithCronet.m in Sources */,
@ -832,7 +813,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5E3F14842278B461007C6D90 /* InteropTestsBlockCallbacks.m in Sources */, 5E3F14842278B461007C6D90 /* InteropTestsBlockCallbacks.m in Sources */,
5E3F148E22792AF5007C6D90 /* EnableCronet.m in Sources */, 5E3F148E22792AF5007C6D90 /* ConfigureCronet.m in Sources */,
5E7F488922778B04006656AD /* InteropTestsRemote.m in Sources */, 5E7F488922778B04006656AD /* InteropTestsRemote.m in Sources */,
5E7F487922778226006656AD /* InteropTestsMultipleChannels.m in Sources */, 5E7F487922778226006656AD /* InteropTestsMultipleChannels.m in Sources */,
5EA477042273617B000F72FC /* InteropTestsLocalCleartext.m in Sources */, 5EA477042273617B000F72FC /* InteropTestsLocalCleartext.m in Sources */,

@ -86,7 +86,7 @@
</MacroExpansion> </MacroExpansion>
</ProfileAction> </ProfileAction>
<AnalyzeAction <AnalyzeAction
buildConfiguration = "Debug"> buildConfiguration = "Cronet">
</AnalyzeAction> </AnalyzeAction>
<ArchiveAction <ArchiveAction
buildConfiguration = "Release" buildConfiguration = "Release"

Loading…
Cancel
Save