Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm

Issue 2961663002: Trace loggging: Check for g_event_logger is not null before calling it. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/base/event_tracer.cc ('K') | « webrtc/base/event_tracer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
diff --git a/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm b/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
index 1797feabce077143a3a7615e8da534c3f2bedc24..9b7ac97a0bd6743a2f32e7e767ed24a581f300e7 100644
--- a/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
+++ b/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
@@ -21,9 +21,11 @@
#import "WebRTC/RTCPeerConnectionFactory.h"
#import "WebRTC/RTCIceServer.h"
#import "WebRTC/RTCMediaConstraints.h"
+#import "WebRTC/RTCTracing.h"
@interface RTCPeerConnectionTest : NSObject
- (void)testConfigurationGetter;
+- (void)tracingTestNoInitialization;
tkchin_webrtc 2017/06/27 22:56:40 This shouldn't belong in RTCPeerConnectionTest. Wr
@end
@implementation RTCPeerConnectionTest
@@ -81,6 +83,21 @@
EXPECT_EQ(config.shouldPruneTurnPorts, newConfig.shouldPruneTurnPorts);
}
+- (NSString *)documentsFilePathForFileName:(NSString *)fileName {
+ NSParameterAssert(fileName.length);
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirPath = paths.firstObject;
+ NSString *filePath =
+ [documentsDirPath stringByAppendingPathComponent:fileName];
+ return filePath;
+}
+
+- (void)tracingTestNoInitialization {
+ NSString *filePath = [self documentsFilePathForFileName:@"webrtc-trace.txt"];
+ EXPECT_EQ(NO, RTCStartInternalCapture(filePath));
+ RTCStopInternalCapture();
+}
+
@end
TEST(RTCPeerConnectionTest, ConfigurationGetterTest) {
@@ -90,4 +107,10 @@ TEST(RTCPeerConnectionTest, ConfigurationGetterTest) {
}
}
+TEST(RTCPeerConnectionTest, TracingTestNoInitialization) {
+ @autoreleasepool {
+ RTCPeerConnectionTest *test = [[RTCPeerConnectionTest alloc] init];
+ [test tracingTestNoInitialization];
+ }
+}
« webrtc/base/event_tracer.cc ('K') | « webrtc/base/event_tracer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698