Improve FBDiagnostic Semantics

Summary: There were a bunch of changes from an earlier PR that needed to be brought in. These include the ability to define when diagnostics are brought into memory.

Reviewed By: nqmtuan

Differential Revision: D3031329

fb-gh-sync-id: e788d8b06915c82a77779dac26ab6d01722e067a
shipit-source-id: e788d8b06915c82a77779dac26ab6d01722e067a
This commit is contained in:
Lawrence Lomax 2016-03-10 03:27:47 -08:00 коммит произвёл Facebook Github Bot 0
Родитель 02445751d9
Коммит 1599977ba0
12 изменённых файлов: 252 добавлений и 203 удалений

Просмотреть файл

@ -174,6 +174,8 @@
Updates the underlying `FBDiagnostic` with a File Path.
Will replace any data or string associated with the log.
Since the Diagnostic associated with a Path can change, any coercions will happen lazily.
@param path the File Path to update with.
@return the reciever, for chaining.
*/
@ -211,6 +213,14 @@
*/
- (instancetype)updatePathFromBlock:( BOOL (^)(NSString *path) )block;
/**
Updates the underlying `FBDiagnostic` by reading it into memory, if it is backed by a file.
This means that the created FBDiagnostic is effectively immutable since the content cannot change.
@return the reciever, for chaining.
*/
- (instancetype)readIntoMemory;
/**
Returns a new `FBDiagnostic` with the reciever's updates applied.
*/

Просмотреть файл

@ -522,29 +522,21 @@
- (NSData *)asData
{
if (!self.backingData) {
self.backingData = [[NSData alloc] initWithContentsOfFile:self.backingFilePath];
}
return self.backingData;
return [[NSData alloc] initWithContentsOfFile:self.backingFilePath];
}
- (NSString *)asString
{
if (!self.backingString) {
self.backingString = [[NSString alloc] initWithContentsOfFile:self.backingFilePath usedEncoding:nil error:nil];
}
return self.backingString;
return [[NSString alloc] initWithContentsOfFile:self.backingFilePath usedEncoding:nil error:nil];
}
- (id)asJSON
{
if (!self.backingJSON) {
NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:self.backingFilePath];
[inputStream open];
self.backingJSON = [NSJSONSerialization JSONObjectWithStream:inputStream options:0 error:nil];
[inputStream close];
}
return self.backingJSON;
NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:self.backingFilePath];
[inputStream open];
id json = [NSJSONSerialization JSONObjectWithStream:inputStream options:0 error:nil];
[inputStream close];
return json;
}
- (BOOL)hasLogContent
@ -850,7 +842,12 @@
}
object_setClass(self.diagnostic, FBDiagnostic_Path.class);
self.diagnostic.backingFilePath = path;
self.diagnostic.fileType = [path pathExtension];
if (!self.diagnostic.shortName) {
self.diagnostic.shortName = [[path lastPathComponent] stringByDeletingPathExtension];
}
if (!self.diagnostic.fileType) {
self.diagnostic.fileType = [path pathExtension];
}
return self;
}
@ -884,6 +881,19 @@
return [self updatePath:path];
}
- (instancetype)readIntoMemory
{
if (!self.diagnostic.backingFilePath) {
return self;
}
NSData *data = [self.diagnostic asData];
if (!data) {
return self;
}
return [self updateData:data];
}
- (FBDiagnostic *)build
{
return self.diagnostic;

Просмотреть файл

@ -1,114 +0,0 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <XCTest/XCTest.h>
#import <FBControlCore/FBControlCore.h>
@interface FBDiagnosticTests : XCTestCase
@end
@implementation FBDiagnosticTests
- (void)testBuilderBuilds
{
NSData *data = [@"SOME DATA" dataUsingEncoding:NSUTF8StringEncoding];
FBDiagnostic *diagnostic = [[[[[[FBDiagnosticBuilder builder]
updateShortName:@"shortname"]
updateFileType:@"filetype"]
updateHumanReadableName:@"human"]
updateData:data]
build];
XCTAssertEqualObjects(diagnostic.shortName, @"shortname");
XCTAssertEqualObjects(diagnostic.fileType, @"filetype");
XCTAssertEqualObjects(diagnostic.humanReadableName, @"human");
XCTAssertEqualObjects(diagnostic.asData, data);
}
- (void)testBuilderReplacesExistingProperties
{
NSData *firstData = [@"SOME DATA" dataUsingEncoding:NSUTF8StringEncoding];
FBDiagnostic *diagnostic = [[[[[[FBDiagnosticBuilder builder]
updateShortName:@"shortname"]
updateFileType:@"filetype"]
updateHumanReadableName:@"human"]
updateData:firstData]
build];
NSData *secondData = [@"SOME NEW DATA" dataUsingEncoding:NSUTF8StringEncoding];
diagnostic = [[[[[[FBDiagnosticBuilder builderWithDiagnostic:diagnostic]
updateShortName:@"newshortname"]
updateFileType:@"newfiletype"]
updateHumanReadableName:@"newhuman"]
updateData:secondData]
build];
XCTAssertEqualObjects(diagnostic.shortName, @"newshortname");
XCTAssertEqualObjects(diagnostic.fileType, @"newfiletype");
XCTAssertEqualObjects(diagnostic.humanReadableName, @"newhuman");
XCTAssertEqualObjects(diagnostic.asData, secondData);
}
- (void)testBuilderReplacesStringsAndData
{
NSData *firstData = [@"SOME DATA" dataUsingEncoding:NSUTF8StringEncoding];
FBDiagnostic *diagnostic = [[[FBDiagnosticBuilder builder]
updateData:firstData]
build];
diagnostic = [[[FBDiagnosticBuilder builderWithDiagnostic:diagnostic]
updateString:@"A String"]
build];
XCTAssertEqualObjects(diagnostic.asData, [@"A String" dataUsingEncoding:NSUTF8StringEncoding]);
XCTAssertEqualObjects(diagnostic.asString, @"A String");
diagnostic = [[[[FBDiagnosticBuilder builderWithDiagnostic:diagnostic]
updateString:@"Not me ever"]
updateData:[@"I am now over here" dataUsingEncoding:NSUTF8StringEncoding]]
build];
XCTAssertEqualObjects(diagnostic.asData, [@"I am now over here" dataUsingEncoding:NSUTF8StringEncoding]);
XCTAssertEqualObjects(diagnostic.asString, @"I am now over here");
}
- (void)testStringAccessorReadsFromFile
{
NSString *logString = @"FOO BAR BAZ";
NSString *logPath = [[NSTemporaryDirectory() stringByAppendingPathComponent:@"testBuilderReadsFromFile"] stringByAppendingPathExtension:@"txt"];
[logString writeToFile:logString atomically:YES encoding:NSUTF8StringEncoding error:nil];
FBDiagnostic *diagnostic = [[[FBDiagnosticBuilder builder]
updatePath:logPath]
build];
XCTAssertEqualObjects(diagnostic.asString, diagnostic.asString);
}
- (void)testReadingPathWritesToFile
{
NSString *logString = @"FOO BAR BAZ";
FBDiagnostic *diagnostic = [[[[FBDiagnosticBuilder builder]
updateString:logString]
updateShortName:@"ballooon"]
build];
NSString *writeOutString = [NSString stringWithContentsOfFile:diagnostic.asPath usedEncoding:nil error:nil];
XCTAssertEqualObjects(writeOutString, logString);
}
@end

Просмотреть файл

@ -0,0 +1,60 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
#import <XCTest/XCTest.h>
@class FBDiagnostic;
@class FBProcessInfo;
/**
Fixtures for Tests.
*/
@interface FBControlCoreFixtures : NSObject
/**
A File Path to the first photo.
*/
+ (NSString *)photo0Path;
/**
A File Path to sample system log.
*/
+ (NSString *)simulatorSystemLogPath;
/**
A File Path to the WebDriverAgent Element Tree of Springboard.
*/
+ (NSString *)treeJSONPath;
@end
@interface XCTestCase (FBControlCoreFixtures)
/**
A System Log.
*/
- (FBDiagnostic *)simulatorSystemLog;
/**
A Diagnostic for the WebDriverAgent Element Tree of Springboard.
*/
- (FBDiagnostic *)treeJSONDiagnostic;
/**
A Diagnostic of a PNG.
*/
- (FBDiagnostic *)photoDiagnostic;
/**
A Process.
*/
- (FBProcessInfo *)launchCtlProcess;
@end

Просмотреть файл

@ -0,0 +1,61 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "FBControlCoreFixtures.h"
#import <FBControlCore/FBControlCore.h>
@implementation FBControlCoreFixtures
+ (NSString *)photo0Path
{
return [[NSBundle bundleForClass:self] pathForResource:@"photo0" ofType:@"png"];
}
+ (NSString *)simulatorSystemLogPath
{
return [[NSBundle bundleForClass:self] pathForResource:@"simulator_system" ofType:@"log"];
}
+ (NSString *)treeJSONPath
{
return [[NSBundle bundleForClass:self] pathForResource:@"tree" ofType:@"json"];
}
@end
@implementation XCTestCase (FBControlCoreFixtures)
- (FBDiagnostic *)simulatorSystemLog
{
return [[[FBDiagnosticBuilder builder]
updatePath:FBControlCoreFixtures.simulatorSystemLogPath]
build];
}
- (FBDiagnostic *)treeJSONDiagnostic
{
return [[[FBDiagnosticBuilder builder]
updatePath:FBControlCoreFixtures.treeJSONPath]
build];
}
- (FBDiagnostic *)photoDiagnostic
{
return [[[FBDiagnosticBuilder builder]
updatePath:FBControlCoreFixtures.photo0Path]
build];
}
- (FBProcessInfo *)launchCtlProcess
{
return [[FBProcessQuery new] processInfoFor:NSProcessInfo.processInfo.processIdentifier];
}
@end

Двоичные данные
FBControlCoreTests/Fixtures/photo0.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 49 KiB

Просмотреть файл

@ -9,10 +9,9 @@
#import <XCTest/XCTest.h>
#import <FBSimulatorControl/FBSimulatorControl.h>
#import <FBControlCore/FBControlCore.h>
#import "FBSimulatorControlAssertions.h"
#import "FBSimulatorControlFixtures.h"
#import "FBControlCoreFixtures.h"
@interface FBDiagnosticTests : XCTestCase
@ -137,6 +136,47 @@
XCTAssertEqualObjects(writeOutString, logString);
}
- (void)testInitializesDefaultsWhenPopulatingFromFile
{
FBDiagnostic *diagnostic = [[[FBDiagnosticBuilder builder]
updatePath:FBControlCoreFixtures.simulatorSystemLogPath]
build];
XCTAssertEqualObjects(diagnostic.shortName, @"simulator_system");
XCTAssertEqualObjects(diagnostic.fileType, @"log");
}
- (void)testDoesNotInitializeDefaultsWhenAlreadySpecified
{
FBDiagnostic *diagnostic = [[[[[FBDiagnosticBuilder builder]
updateShortName:@"bibble"]
updateFileType:@"txt"]
updatePath:FBControlCoreFixtures.simulatorSystemLogPath]
build];
XCTAssertEqualObjects(diagnostic.shortName, @"bibble");
XCTAssertEqualObjects(diagnostic.fileType, @"txt");
}
- (void)testUpdatingAFileBackedDiagnostic
{
NSString *file = self.temporaryOutputFile;
XCTAssertTrue([@"FIRST" writeToFile:file atomically:YES encoding:NSUTF8StringEncoding error:nil]);
FBDiagnostic *fileDiagnostic = [[[FBDiagnosticBuilder builder]
updatePath:file]
build];
FBDiagnostic *memoryDiagnostic = [[[FBDiagnosticBuilder builderWithDiagnostic:fileDiagnostic]
readIntoMemory]
build];
XCTAssertEqualObjects(@"FIRST", fileDiagnostic.asString);
XCTAssertEqualObjects(@"FIRST", memoryDiagnostic.asString);
XCTAssertTrue([@"SECOND" writeToFile:file atomically:YES encoding:NSUTF8StringEncoding error:nil]);
XCTAssertEqualObjects(@"SECOND", fileDiagnostic.asString);
XCTAssertEqualObjects(@"FIRST", memoryDiagnostic.asString);
}
- (void)testTextFileCoercions
{
FBDiagnostic *diagnostic = self.simulatorSystemLog;
@ -146,7 +186,7 @@
XCTAssertNil(diagnostic.asJSON);
XCTAssertTrue(diagnostic.hasLogContent);
XCTAssertTrue(diagnostic.isSearchableAsText);
[self assertNeedle:@"layer position 375 667 bounds 0 0 750 1334" inHaystack:diagnostic.asString];
XCTAssertTrue([diagnostic.asString containsString:@"layer position 375 667 bounds 0 0 750 1334"]);
[self assertWritesOutToFile:diagnostic];
}
@ -183,7 +223,7 @@
XCTAssertEqualObjects(diagnostic.asJSON, json);
XCTAssertTrue(diagnostic.hasLogContent);
XCTAssertTrue(diagnostic.isSearchableAsText);
[self assertNeedle:substring inHaystack:diagnostic.asString];
XCTAssertTrue([diagnostic.asString containsString:substring]);
[self assertWritesOutToFile:diagnostic];
}
@ -208,7 +248,7 @@
XCTAssertEqualObjects(diagnostic.asJSON, json);
XCTAssertTrue(diagnostic.hasLogContent);
XCTAssertTrue(diagnostic.isSearchableAsText);
[self assertNeedle:substring inHaystack:diagnostic.asString];
XCTAssertTrue([diagnostic.asString containsString:substring]);
[self assertWritesOutToFile:diagnostic];
}
@ -221,23 +261,23 @@
XCTAssertEqualObjects([[[diagnostic.asJSON objectForKey:@"value"] objectForKey:@"tree"] objectForKey:@"name"], @"SpringBoard");
XCTAssertTrue(diagnostic.hasLogContent);
XCTAssertTrue(diagnostic.isSearchableAsText);
[self assertNeedle:@"Swipe down with three fingers to reveal the notification center" inHaystack:diagnostic.asString];
XCTAssertTrue([diagnostic.asString containsString:@"Swipe down with three fingers to reveal the notification center"]);
[self assertWritesOutToFile:diagnostic];
}
- (void)testJSONSerializableCoercions
{
FBDiagnostic *diagnostic = [[[[FBDiagnosticBuilder builder]
updateShortName:@"applaunch"]
updateJSONSerializable:self.appLaunch1]
updateShortName:@"process_info"]
updateJSONSerializable:self.launchCtlProcess]
build];
XCTAssertNotNil(diagnostic.asPath);
XCTAssertNotNil(diagnostic.asData);
XCTAssertEqualObjects([[diagnostic.asJSON objectForKey:@"environment"] objectForKey:@"FOO"], @"BAR");
XCTAssertEqualObjects([diagnostic.asJSON objectForKey:@"pid"] , @(NSProcessInfo.processInfo.processIdentifier));
XCTAssertTrue(diagnostic.hasLogContent);
XCTAssertTrue(diagnostic.isSearchableAsText);
[self assertNeedle:@"com.example.apple-samplecode.TableSearch" inHaystack:diagnostic.asString];
XCTAssertTrue([diagnostic.asString containsString:[@(NSProcessInfo.processInfo.processIdentifier) stringValue]]);
[self assertWritesOutToFile:diagnostic];
}

Просмотреть файл

@ -40,11 +40,13 @@
AA4242FE1C529366008ABD80 /* FBFramebufferVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = AA4242FC1C529366008ABD80 /* FBFramebufferVideo.m */; };
AA4243041C5295FC008ABD80 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA4243031C5295FC008ABD80 /* CoreMedia.framework */; };
AA4243061C529644008ABD80 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA4243051C529644008ABD80 /* CoreVideo.framework */; };
AA4E3B791C8DE911009CCCCA /* simulator_system.log in Resources */ = {isa = PBXBuildFile; fileRef = AA4E3B781C8DE911009CCCCA /* simulator_system.log */; };
AA4E3B7E1C8EC4CD009CCCCA /* tree.json in Resources */ = {isa = PBXBuildFile; fileRef = AA4E3B7D1C8EC4CD009CCCCA /* tree.json */; };
AA5639551C060005009BAFAA /* FBSimulatorControl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA5639541C05FFF5009BAFAA /* FBSimulatorControl.h */; settings = {ATTRIBUTES = (Public, ); }; };
AA59E2861C85AA9400C17ED3 /* FBFramebufferFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = AA59E2841C85AA9400C17ED3 /* FBFramebufferFrame.h */; };
AA59E2871C85AA9400C17ED3 /* FBFramebufferFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = AA59E2851C85AA9400C17ED3 /* FBFramebufferFrame.m */; };
AA6F22441C916A31009F5CE4 /* photo0.png in Resources */ = {isa = PBXBuildFile; fileRef = AA6F22411C916A31009F5CE4 /* photo0.png */; };
AA6F22451C916A31009F5CE4 /* simulator_system.log in Resources */ = {isa = PBXBuildFile; fileRef = AA6F22421C916A31009F5CE4 /* simulator_system.log */; };
AA6F22461C916A31009F5CE4 /* tree.json in Resources */ = {isa = PBXBuildFile; fileRef = AA6F22431C916A31009F5CE4 /* tree.json */; };
AA6F22481C916A44009F5CE4 /* photo0.png in Resources */ = {isa = PBXBuildFile; fileRef = AA6F22471C916A44009F5CE4 /* photo0.png */; };
AA7490051C4E6CBA00F3BDBA /* FBSimulatorLaunchConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7490041C4E6C7700F3BDBA /* FBSimulatorLaunchConfiguration+Private.h */; settings = {ATTRIBUTES = (Public, ); }; };
AA78DCDA1C5005D2006FAB41 /* FBSimulatorLaunchCtl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA78DCD81C5005D2006FAB41 /* FBSimulatorLaunchCtl.h */; settings = {ATTRIBUTES = (Public, ); }; };
AA78DCDB1C5005D2006FAB41 /* FBSimulatorLaunchCtl.m in Sources */ = {isa = PBXBuildFile; fileRef = AA78DCD91C5005D2006FAB41 /* FBSimulatorLaunchCtl.m */; };
@ -143,7 +145,6 @@
AAC241261BB311690054570C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAC241251BB311690054570C /* ApplicationServices.framework */; };
AACA2C371C2976B100979C45 /* FBAddVideoPolyfill.h in Headers */ = {isa = PBXBuildFile; fileRef = AACA2C351C2976B100979C45 /* FBAddVideoPolyfill.h */; settings = {ATTRIBUTES = (Public, ); }; };
AACA2C381C2976B100979C45 /* FBAddVideoPolyfill.m in Sources */ = {isa = PBXBuildFile; fileRef = AACA2C361C2976B100979C45 /* FBAddVideoPolyfill.m */; };
AAD3051F1BD4D5B10047376E /* photo0.png in Resources */ = {isa = PBXBuildFile; fileRef = AAD3051D1BD4D5B10047376E /* photo0.png */; };
AAD305201BD4D5B10047376E /* photo1.png in Resources */ = {isa = PBXBuildFile; fileRef = AAD3051E1BD4D5B10047376E /* photo1.png */; };
AAD4978A1C50F14B00ABC1A7 /* FBMutableSimulatorEventSink.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD497881C50F14B00ABC1A7 /* FBMutableSimulatorEventSink.h */; settings = {ATTRIBUTES = (Public, ); }; };
AAD4978B1C50F14B00ABC1A7 /* FBMutableSimulatorEventSink.m in Sources */ = {isa = PBXBuildFile; fileRef = AAD497891C50F14B00ABC1A7 /* FBMutableSimulatorEventSink.m */; };
@ -151,12 +152,14 @@
AAD51EA01C3ADECA00A763D0 /* FBSimulatorLaunchConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = AAD51E9E1C3ADECA00A763D0 /* FBSimulatorLaunchConfiguration.m */; };
AAD51EA31C3AEFEA00A763D0 /* FBSimulatorLaunchConfiguration+Helpers.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD51EA11C3AEFEA00A763D0 /* FBSimulatorLaunchConfiguration+Helpers.h */; settings = {ATTRIBUTES = (Public, ); }; };
AAD51EA41C3AEFEA00A763D0 /* FBSimulatorLaunchConfiguration+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = AAD51EA21C3AEFEA00A763D0 /* FBSimulatorLaunchConfiguration+Helpers.m */; };
AAEA3A941C90B5E4004F8409 /* FBControlCoreFixtures.m in Sources */ = {isa = PBXBuildFile; fileRef = AAEA3A911C90B5E4004F8409 /* FBControlCoreFixtures.m */; };
AAEA3A951C90B5E4004F8409 /* FBDiagnosticTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AAEA3A931C90B5E4004F8409 /* FBDiagnosticTests.m */; };
AAEA3AAD1C90BF5B004F8409 /* FBControlCoreFixtures.m in Sources */ = {isa = PBXBuildFile; fileRef = AAEA3A911C90B5E4004F8409 /* FBControlCoreFixtures.m */; };
AAF2D3561C33EA3100434516 /* FBSimulatorInteraction+Lifecycle.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF2D3541C33EA3100434516 /* FBSimulatorInteraction+Lifecycle.h */; settings = {ATTRIBUTES = (Public, ); }; };
AAF2D3571C33EA3100434516 /* FBSimulatorInteraction+Lifecycle.m in Sources */ = {isa = PBXBuildFile; fileRef = AAF2D3551C33EA3100434516 /* FBSimulatorInteraction+Lifecycle.m */; };
E7A30F0476B173B900000000 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DD70E2976B173B900000000 /* Cocoa.framework */; };
E7A30F04A6018C7A00000000 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DD70E29A6018C7A00000000 /* CoreGraphics.framework */; };
EEBD60181C90628F00298A07 /* FBControlCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEBD600E1C90628F00298A07 /* FBControlCore.framework */; };
EEBD602A1C9062CB00298A07 /* FBDiagnosticTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EEBD60281C9062CB00298A07 /* FBDiagnosticTests.m */; };
EEBD605B1C9062E900298A07 /* FBASLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = EEBD602C1C9062E900298A07 /* FBASLParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
EEBD605C1C9062E900298A07 /* FBASLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = EEBD602D1C9062E900298A07 /* FBASLParser.m */; };
EEBD605D1C9062E900298A07 /* FBCrashLogInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = EEBD602E1C9062E900298A07 /* FBCrashLogInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -333,11 +336,13 @@
AA4879931BAC74DD007F7D23 /* SimDeviceSet-DVTAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimDeviceSet-DVTAdditions.h"; sourceTree = "<group>"; };
AA4879941BAC74DD007F7D23 /* SimDeviceType-DVTAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimDeviceType-DVTAdditions.h"; sourceTree = "<group>"; };
AA4879951BAC74DD007F7D23 /* SimRuntime-DVTAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimRuntime-DVTAdditions.h"; sourceTree = "<group>"; };
AA4E3B781C8DE911009CCCCA /* simulator_system.log */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = simulator_system.log; sourceTree = "<group>"; };
AA4E3B7D1C8EC4CD009CCCCA /* tree.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = tree.json; sourceTree = "<group>"; };
AA5639541C05FFF5009BAFAA /* FBSimulatorControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBSimulatorControl.h; sourceTree = "<group>"; };
AA59E2841C85AA9400C17ED3 /* FBFramebufferFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBFramebufferFrame.h; sourceTree = "<group>"; };
AA59E2851C85AA9400C17ED3 /* FBFramebufferFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBFramebufferFrame.m; sourceTree = "<group>"; };
AA6F22411C916A31009F5CE4 /* photo0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = photo0.png; sourceTree = "<group>"; };
AA6F22421C916A31009F5CE4 /* simulator_system.log */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = simulator_system.log; sourceTree = "<group>"; };
AA6F22431C916A31009F5CE4 /* tree.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = tree.json; sourceTree = "<group>"; };
AA6F22471C916A44009F5CE4 /* photo0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = photo0.png; sourceTree = "<group>"; };
AA7490041C4E6C7700F3BDBA /* FBSimulatorLaunchConfiguration+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FBSimulatorLaunchConfiguration+Private.h"; sourceTree = "<group>"; };
AA78DCD81C5005D2006FAB41 /* FBSimulatorLaunchCtl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSimulatorLaunchCtl.h; sourceTree = "<group>"; };
AA78DCD91C5005D2006FAB41 /* FBSimulatorLaunchCtl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSimulatorLaunchCtl.m; sourceTree = "<group>"; };
@ -439,7 +444,6 @@
AAC241251BB311690054570C /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; };
AACA2C351C2976B100979C45 /* FBAddVideoPolyfill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBAddVideoPolyfill.h; sourceTree = "<group>"; };
AACA2C361C2976B100979C45 /* FBAddVideoPolyfill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBAddVideoPolyfill.m; sourceTree = "<group>"; };
AAD3051D1BD4D5B10047376E /* photo0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = photo0.png; sourceTree = "<group>"; };
AAD3051E1BD4D5B10047376E /* photo1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = photo1.png; sourceTree = "<group>"; };
AAD497881C50F14B00ABC1A7 /* FBMutableSimulatorEventSink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBMutableSimulatorEventSink.h; sourceTree = "<group>"; };
AAD497891C50F14B00ABC1A7 /* FBMutableSimulatorEventSink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBMutableSimulatorEventSink.m; sourceTree = "<group>"; };
@ -447,12 +451,14 @@
AAD51E9E1C3ADECA00A763D0 /* FBSimulatorLaunchConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSimulatorLaunchConfiguration.m; sourceTree = "<group>"; };
AAD51EA11C3AEFEA00A763D0 /* FBSimulatorLaunchConfiguration+Helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FBSimulatorLaunchConfiguration+Helpers.h"; sourceTree = "<group>"; };
AAD51EA21C3AEFEA00A763D0 /* FBSimulatorLaunchConfiguration+Helpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FBSimulatorLaunchConfiguration+Helpers.m"; sourceTree = "<group>"; };
AAEA3A901C90B5E4004F8409 /* FBControlCoreFixtures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBControlCoreFixtures.h; sourceTree = "<group>"; };
AAEA3A911C90B5E4004F8409 /* FBControlCoreFixtures.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBControlCoreFixtures.m; sourceTree = "<group>"; };
AAEA3A931C90B5E4004F8409 /* FBDiagnosticTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBDiagnosticTests.m; sourceTree = "<group>"; };
AAF2D3541C33EA3100434516 /* FBSimulatorInteraction+Lifecycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FBSimulatorInteraction+Lifecycle.h"; sourceTree = "<group>"; };
AAF2D3551C33EA3100434516 /* FBSimulatorInteraction+Lifecycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FBSimulatorInteraction+Lifecycle.m"; sourceTree = "<group>"; };
EEBD600E1C90628F00298A07 /* FBControlCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FBControlCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
EEBD60171C90628F00298A07 /* FBControlCoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FBControlCoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EEBD60271C9062CB00298A07 /* FBControlCoreTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "FBControlCoreTests-Info.plist"; sourceTree = "<group>"; };
EEBD60281C9062CB00298A07 /* FBDiagnosticTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBDiagnosticTests.m; sourceTree = "<group>"; };
EEBD602C1C9062E900298A07 /* FBASLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBASLParser.h; sourceTree = "<group>"; };
EEBD602D1C9062E900298A07 /* FBASLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBASLParser.m; sourceTree = "<group>"; };
EEBD602E1C9062E900298A07 /* FBCrashLogInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBCrashLogInfo.h; sourceTree = "<group>"; };
@ -910,16 +916,34 @@
children = (
AAAA67C41BC4FED200075197 /* FBSimulatorControlFixtures.h */,
AAAA67C51BC4FED200075197 /* FBSimulatorControlFixtures.m */,
AAD3051D1BD4D5B10047376E /* photo0.png */,
AA6F22471C916A44009F5CE4 /* photo0.png */,
AAD3051E1BD4D5B10047376E /* photo1.png */,
AA4E3B781C8DE911009CCCCA /* simulator_system.log */,
AAAA67C71BC5018500075197 /* TableSearch.app */,
AA4E3B7D1C8EC4CD009CCCCA /* tree.json */,
877123F21BDA797800530B1E /* video0.mp4 */,
);
path = Fixtures;
sourceTree = "<group>";
};
AAEA3A8F1C90B5E4004F8409 /* Fixtures */ = {
isa = PBXGroup;
children = (
AAEA3A901C90B5E4004F8409 /* FBControlCoreFixtures.h */,
AAEA3A911C90B5E4004F8409 /* FBControlCoreFixtures.m */,
AA6F22411C916A31009F5CE4 /* photo0.png */,
AA6F22421C916A31009F5CE4 /* simulator_system.log */,
AA6F22431C916A31009F5CE4 /* tree.json */,
);
path = Fixtures;
sourceTree = "<group>";
};
AAEA3A921C90B5E4004F8409 /* Tests */ = {
isa = PBXGroup;
children = (
AAEA3A931C90B5E4004F8409 /* FBDiagnosticTests.m */,
);
path = Tests;
sourceTree = "<group>";
};
B401C97968022A5500000000 /* Frameworks */ = {
isa = PBXGroup;
children = (
@ -984,7 +1008,8 @@
isa = PBXGroup;
children = (
EEBD60271C9062CB00298A07 /* FBControlCoreTests-Info.plist */,
EEBD60281C9062CB00298A07 /* FBDiagnosticTests.m */,
AAEA3A8F1C90B5E4004F8409 /* Fixtures */,
AAEA3A921C90B5E4004F8409 /* Tests */,
);
path = FBControlCoreTests;
sourceTree = "<group>";
@ -1306,9 +1331,7 @@
877123F31BDA797800530B1E /* video0.mp4 in Resources */,
AAD305201BD4D5B10047376E /* photo1.png in Resources */,
AAAA67C91BC501BB00075197 /* TableSearch.app in Resources */,
AAD3051F1BD4D5B10047376E /* photo0.png in Resources */,
AA4E3B791C8DE911009CCCCA /* simulator_system.log in Resources */,
AA4E3B7E1C8EC4CD009CCCCA /* tree.json in Resources */,
AA6F22481C916A44009F5CE4 /* photo0.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1323,6 +1346,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AA6F22451C916A31009F5CE4 /* simulator_system.log in Resources */,
AA6F22441C916A31009F5CE4 /* photo0.png in Resources */,
AA6F22461C916A31009F5CE4 /* tree.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1406,6 +1432,7 @@
AAB4AC271BBBC6880046F6A1 /* FBSimulatorControlTestCase.m in Sources */,
AA3FD04E1C876E4F001093CA /* FBSimulatorPoolTests.m in Sources */,
AA3FD04D1C876E4F001093CA /* FBSimulatorLaunchTests.m in Sources */,
AAEA3AAD1C90BF5B004F8409 /* FBControlCoreFixtures.m in Sources */,
AA3FD04F1C876E4F001093CA /* FBSimulatorSetTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -1439,7 +1466,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EEBD602A1C9062CB00298A07 /* FBDiagnosticTests.m in Sources */,
AAEA3A951C90B5E4004F8409 /* FBDiagnosticTests.m in Sources */,
AAEA3A941C90B5E4004F8409 /* FBControlCoreFixtures.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

Просмотреть файл

@ -36,16 +36,6 @@
*/
+ (NSString *)video0Path;
/**
A File Path to sample system log.
*/
+ (NSString *)simulatorSystemLogPath;
/**
A File Path to the WebDriverAgent Element Tree of Springboard.
*/
+ (NSString *)treeJSONPath;
@end
/**
@ -105,19 +95,4 @@
*/
- (FBProcessInfo *)processInfo2a;
/**
A System Log.
*/
- (FBDiagnostic *)simulatorSystemLog;
/**
A Diagnostic for the WebDriverAgent Element Tree of Springboard.
*/
- (FBDiagnostic *)treeJSONDiagnostic;
/**
A Diagnostic of a PNG.
*/
- (FBDiagnostic *)photoDiagnostic;
@end

Просмотреть файл

@ -135,25 +135,4 @@
environment:self.appLaunch2.environment];
}
- (FBDiagnostic *)simulatorSystemLog
{
return [[[FBDiagnosticBuilder builder]
updatePath:FBSimulatorControlFixtures.simulatorSystemLogPath]
build];
}
- (FBDiagnostic *)treeJSONDiagnostic
{
return [[[FBDiagnosticBuilder builder]
updatePath:FBSimulatorControlFixtures.treeJSONPath]
build];
}
- (FBDiagnostic *)photoDiagnostic
{
return [[[FBDiagnosticBuilder builder]
updatePath:FBSimulatorControlFixtures.photo0Path]
build];
}
@end