Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
white49
Alamofire
提交
ebf8c98e
A
Alamofire
项目概览
white49
/
Alamofire
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Alamofire
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ebf8c98e
编写于
9月 06, 2015
作者:
C
Christian Noon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed a compiler issue on OSX with the creation of a background configuration.
上级
44de2f69
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
61 addition
and
15 deletion
+61
-15
Alamofire.xcodeproj/project.pbxproj
Alamofire.xcodeproj/project.pbxproj
+14
-0
Tests/ManagerTests.swift
Tests/ManagerTests.swift
+1
-10
Tests/NSURLSessionConfiguration+AlamofireTests.swift
Tests/NSURLSessionConfiguration+AlamofireTests.swift
+41
-0
Tests/UploadTests.swift
Tests/UploadTests.swift
+5
-5
未找到文件。
Alamofire.xcodeproj/project.pbxproj
浏览文件 @
ebf8c98e
...
...
@@ -27,6 +27,8 @@
4C33A1441B52089C00873DFF
/* ServerTrustPolicyTests.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C33A1421B52089C00873DFF
/* ServerTrustPolicyTests.swift */
;
};
4C341BBA1B1A865A00C1B34D
/* CacheTests.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C341BB91B1A865A00C1B34D
/* CacheTests.swift */
;
};
4C341BBB1B1A865A00C1B34D
/* CacheTests.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C341BB91B1A865A00C1B34D
/* CacheTests.swift */
;
};
4C7C8D221B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C7C8D211B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
4C7C8D231B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C7C8D211B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
4C811F8D1B51856D00E0F59A
/* ServerTrustPolicy.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C811F8C1B51856D00E0F59A
/* ServerTrustPolicy.swift */
;
};
4C811F8E1B51856D00E0F59A
/* ServerTrustPolicy.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C811F8C1B51856D00E0F59A
/* ServerTrustPolicy.swift */
;
};
4C812C3B1B535F220017E0BF
/* alamofire-root-ca.cer in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4C812C3A1B535F220017E0BF
/* alamofire-root-ca.cer */
;
};
...
...
@@ -146,6 +148,7 @@
4C33A1241B5207DB00873DFF
/* unicorn.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
unicorn.png
;
sourceTree
=
"<group>"
;
};
4C33A1421B52089C00873DFF
/* ServerTrustPolicyTests.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ServerTrustPolicyTests.swift
;
sourceTree
=
"<group>"
;
};
4C341BB91B1A865A00C1B34D
/* CacheTests.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CacheTests.swift
;
sourceTree
=
"<group>"
;
};
4C7C8D211B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"NSURLSessionConfiguration+AlamofireTests.swift"
;
sourceTree
=
"<group>"
;
};
4C811F8C1B51856D00E0F59A
/* ServerTrustPolicy.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ServerTrustPolicy.swift
;
sourceTree
=
"<group>"
;
};
4C812C3A1B535F220017E0BF
/* alamofire-root-ca.cer */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
name
=
"alamofire-root-ca.cer"
;
path
=
"alamofire.org/alamofire-root-ca.cer"
;
sourceTree
=
"<group>"
;
};
4C812C3D1B535F2E0017E0BF
/* alamofire-signing-ca1.cer */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
name
=
"alamofire-signing-ca1.cer"
;
path
=
"alamofire.org/alamofire-signing-ca1.cer"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -339,6 +342,14 @@
name
=
"Signed by CA2"
;
sourceTree
=
"<group>"
;
};
4C7C8D201B9D0D7300948136
/* Extensions */
=
{
isa
=
PBXGroup
;
children
=
(
4C7C8D211B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift */
,
);
name
=
Extensions
;
sourceTree
=
"<group>"
;
};
4C812C381B535F000017E0BF
/* disig.sk */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -431,6 +442,7 @@
children
=
(
4C256A501B096C2C0065714F
/* BaseTestCase.swift */
,
4C256A4E1B09656A0065714F
/* Core */
,
4C7C8D201B9D0D7300948136
/* Extensions */
,
4C256A4F1B09656E0065714F
/* Features */
,
4C3238E91B3617A600FE04AE
/* Resources */
,
F8111E4019A95C8B0040E7D1
/* Supporting Files */
,
...
...
@@ -764,6 +776,7 @@
F8111E6119A9674D0040E7D1
/* ParameterEncodingTests.swift in Sources */
,
F8111E6419A9674D0040E7D1
/* UploadTests.swift in Sources */
,
F8111E6019A9674D0040E7D1
/* DownloadTests.swift in Sources */
,
4C7C8D221B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -787,6 +800,7 @@
F829C6C41A7A950600A2CD59
/* AuthenticationTests.swift in Sources */
,
F829C6C51A7A950600A2CD59
/* ValidationTests.swift in Sources */
,
F86AEFE81AE6A315007D9C76
/* TLSEvaluationTests.swift in Sources */
,
4C7C8D231B9D0D9000948136
/* NSURLSessionConfiguration+AlamofireTests.swift in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
Tests/ManagerTests.swift
浏览文件 @
ebf8c98e
...
...
@@ -124,16 +124,7 @@ class ManagerConfigurationHeadersTestCase: BaseTestCase {
configuration
=
NSURLSessionConfiguration
.
ephemeralSessionConfiguration
()
case
.
Background
:
let
identifier
=
"com.alamofire.test.manager-configuration-tests"
#if os(iOS) || os(watchOS)
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfigurationWithIdentifier
(
identifier
)
#else
if
#available(OSX 10.10, *)
{
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfigurationWithIdentifier
(
identifier
)
}
else
{
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfiguration
(
identifier
)
}
#endif
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfigurationForAllPlatformsWithIdentifier
(
identifier
)
}
var
headers
=
Alamofire
.
Manager
.
defaultHTTPHeaders
...
...
Tests/NSURLSessionConfiguration+AlamofireTests.swift
0 → 100644
浏览文件 @
ebf8c98e
// NSURLSessionConfiguration+AlamofireTests.swift
//
// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
extension
NSURLSessionConfiguration
{
static
func
backgroundSessionConfigurationForAllPlatformsWithIdentifier
(
identifier
:
String
)
->
NSURLSessionConfiguration
{
let
configuration
:
NSURLSessionConfiguration
#if os(iOS) || os(watchOS)
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfigurationWithIdentifier
(
identifier
)
#else
if
#available(OSX 10.10, *)
{
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfigurationWithIdentifier
(
identifier
)
}
else
{
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfiguration
(
identifier
)
}
#endif
return
configuration
}
}
Tests/UploadTests.swift
浏览文件 @
ebf8c98e
...
...
@@ -585,12 +585,12 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
func
testThatUploadingMultipartFormDataOnBackgroundSessionWritesDataToFileToAvoidCrash
()
{
// Given
let
identifier
=
"com.alamofire.uploadtests.
\(
NSUUID
()
.
UUIDString
)
"
let
manager
:
Manager
=
{
let
identifier
=
"com.alamofire.uploadtests.
\(
NSUUID
()
.
UUIDString
)
"
let
configuration
=
NSURLSessionConfiguration
.
backgroundSessionConfigurationForAllPlatformsWithIdentifier
(
identifier
)
let
manager
=
Manager
(
configuration
:
NSURLSessionConfiguration
.
backgroundSessionConfigurationWithIdentifier
(
identifier
),
serverTrustPolicyManager
:
nil
)
return
Manager
(
configuration
:
configuration
,
serverTrustPolicyManager
:
nil
)
}()
let
URLString
=
"https://httpbin.org/post"
let
french
=
"français"
.
dataUsingEncoding
(
NSUTF8StringEncoding
,
allowLossyConversion
:
false
)
!
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录