summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.travis.yml8
-rw-r--r--CHANGELOG.md13
-rw-r--r--Makefile20
-rw-r--r--README.md56
-rw-r--r--android/cpp/native_map_view.cpp124
-rw-r--r--android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java46
-rw-r--r--android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml16
-rw-r--r--bin/render.cpp15
-rw-r--r--bin/render.gypi3
-rwxr-xr-xconfigure7
-rw-r--r--gyp/common.gypi2
-rw-r--r--gyp/platform-ios.gypi5
-rw-r--r--gyp/styles.gypi27
-rw-r--r--include/mbgl/android/native_map_view.hpp11
-rw-r--r--include/mbgl/ios/MGLAccountManager.h29
-rw-r--r--include/mbgl/ios/MGLMetricsLocationManager.h13
-rw-r--r--include/mbgl/ios/MGLTypes.h2
-rw-r--r--include/mbgl/ios/MapboxGL.h2
-rw-r--r--include/mbgl/ios/private/MGLMapView_Private.h14
-rw-r--r--include/mbgl/map/environment.hpp1
-rw-r--r--include/mbgl/map/map.hpp4
-rw-r--r--include/mbgl/map/update.hpp1
-rw-r--r--include/mbgl/platform/default/glfw_view.hpp17
-rw-r--r--include/mbgl/platform/gl.hpp157
-rw-r--r--include/mbgl/storage/default_file_source.hpp1
-rw-r--r--include/mbgl/storage/file_source.hpp4
-rw-r--r--include/mbgl/storage/request.hpp4
-rw-r--r--include/mbgl/util/constants.hpp1
-rw-r--r--include/mbgl/util/exclusive.hpp30
-rw-r--r--include/mbgl/util/math.hpp6
-rw-r--r--ios/MapboxGL.podspec5
-rw-r--r--ios/README.md67
-rw-r--r--ios/app/MBXAppDelegate.m27
-rw-r--r--ios/app/MBXViewController.mm18
-rw-r--r--ios/app/Settings.bundle/Root.plist4
-rw-r--r--ios/app/app-info.plist2
-rw-r--r--ios/benchmark/MBXBenchViewController.mm18
-rw-r--r--ios/benchmark/fo/benchmark-ios.gypi1
-rwxr-xr-xios/docs/install_docs.sh15
-rwxr-xr-xios/docs/remove_docs.sh2
-rw-r--r--linux/main.cpp25
-rw-r--r--linux/mapboxgl-app.gypi5
-rw-r--r--macosx/main.mm19
-rw-r--r--macosx/mapboxgl-app.gypi2
-rw-r--r--platform/darwin/http_request_nsurl.mm21
-rw-r--r--platform/default/default_styles.cpp14
-rw-r--r--platform/default/default_styles.hpp17
-rw-r--r--platform/default/glfw_view.cpp107
-rw-r--r--platform/default/headless_view.cpp65
-rw-r--r--platform/default/png_reader.cpp2
-rw-r--r--platform/ios/MGLAccountManager.m54
-rw-r--r--platform/ios/MGLMapView.mm329
-rw-r--r--platform/ios/MGLMapboxEvents.h (renamed from include/mbgl/ios/MGLMapboxEvents.h)9
-rw-r--r--platform/ios/MGLMapboxEvents.m484
-rw-r--r--platform/ios/MGLMetricsLocationManager.m124
-rw-r--r--platform/ios/MGLTypes.m3
-rw-r--r--platform/ios/MGLUserLocation.m2
-rwxr-xr-xscripts/android/install.sh2
-rwxr-xr-xscripts/android/run.sh2
-rwxr-xr-xscripts/compare_images.sh2
-rwxr-xr-xscripts/ios/install.sh3
-rwxr-xr-xscripts/ios/package.sh9
-rwxr-xr-xscripts/ios/run.sh9
-rw-r--r--scripts/ios/setup.sh5
-rwxr-xr-xscripts/linux/after_script.sh15
-rwxr-xr-xscripts/linux/install.sh4
-rwxr-xr-xscripts/linux/run.sh48
-rwxr-xr-xscripts/linux/setup.sh28
-rwxr-xr-xscripts/osx/install.sh3
-rwxr-xr-xscripts/osx/run.sh13
-rwxr-xr-xscripts/osx/setup.sh8
-rwxr-xr-xscripts/travis_helper.sh4
-rw-r--r--src/mbgl/geometry/binpack.hpp4
-rw-r--r--src/mbgl/geometry/glyph_atlas.cpp18
-rw-r--r--src/mbgl/geometry/glyph_atlas.hpp2
-rw-r--r--src/mbgl/geometry/line_atlas.cpp9
-rw-r--r--src/mbgl/geometry/line_atlas.hpp2
-rw-r--r--src/mbgl/geometry/sprite_atlas.cpp33
-rw-r--r--src/mbgl/geometry/sprite_atlas.hpp2
-rw-r--r--src/mbgl/geometry/vao.cpp43
-rw-r--r--src/mbgl/geometry/vao.hpp3
-rw-r--r--src/mbgl/gl/debugging.cpp195
-rw-r--r--src/mbgl/gl/debugging.hpp21
-rw-r--r--src/mbgl/map/environment.cpp15
-rw-r--r--src/mbgl/map/live_tile_data.cpp10
-rw-r--r--src/mbgl/map/map.cpp18
-rw-r--r--src/mbgl/map/map_context.cpp39
-rw-r--r--src/mbgl/map/map_context.hpp3
-rw-r--r--src/mbgl/map/raster_tile_data.cpp6
-rw-r--r--src/mbgl/map/resource_loader.cpp40
-rw-r--r--src/mbgl/map/resource_loader.hpp15
-rw-r--r--src/mbgl/map/source.cpp81
-rw-r--r--src/mbgl/map/source.hpp19
-rw-r--r--src/mbgl/map/tile_cache.cpp2
-rw-r--r--src/mbgl/map/tile_data.cpp19
-rw-r--r--src/mbgl/map/tile_data.hpp35
-rw-r--r--src/mbgl/map/tile_parser.cpp41
-rw-r--r--src/mbgl/map/tile_parser.hpp4
-rw-r--r--src/mbgl/map/transform.cpp38
-rw-r--r--src/mbgl/map/transform_state.hpp8
-rw-r--r--src/mbgl/map/vector_tile_data.cpp30
-rw-r--r--src/mbgl/map/vector_tile_data.hpp13
-rw-r--r--src/mbgl/platform/gl.cpp86
-rw-r--r--src/mbgl/renderer/line_bucket.cpp2
-rw-r--r--src/mbgl/renderer/painter.cpp139
-rw-r--r--src/mbgl/renderer/painter.hpp10
-rw-r--r--src/mbgl/renderer/painter_clipping.cpp3
-rw-r--r--src/mbgl/renderer/painter_debug.cpp9
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp46
-rw-r--r--src/mbgl/renderer/symbol_bucket.hpp19
-rw-r--r--src/mbgl/storage/default_file_source.cpp18
-rw-r--r--src/mbgl/storage/default_file_source_impl.hpp8
-rw-r--r--src/mbgl/storage/request.cpp38
-rw-r--r--src/mbgl/style/filter_expression.cpp6
-rw-r--r--src/mbgl/text/collision.cpp26
-rw-r--r--src/mbgl/text/glyph.hpp2
-rw-r--r--src/mbgl/text/glyph_store.cpp45
-rw-r--r--src/mbgl/text/glyph_store.hpp20
-rw-r--r--src/mbgl/text/placement.cpp13
-rw-r--r--src/mbgl/util/clip_id.cpp4
-rw-r--r--src/mbgl/util/rect.hpp9
-rw-r--r--src/mbgl/util/work_request.cpp30
-rw-r--r--src/mbgl/util/work_request.hpp19
-rw-r--r--src/mbgl/util/work_task.cpp37
-rw-r--r--src/mbgl/util/work_task.hpp27
-rw-r--r--src/mbgl/util/worker.cpp20
-rw-r--r--src/mbgl/util/worker.hpp14
m---------styles0
-rw-r--r--test/fixtures/api/1.pngbin12529 -> 0 bytes
-rw-r--r--test/fixtures/api/2.pngbin115197 -> 0 bytes
-rw-r--r--test/headless/headless.cpp4
-rw-r--r--test/ios/MGLTAppDelegate.m3
-rw-r--r--test/ios/MetricsTests.m287
-rw-r--r--test/ios/OCMock/OCMock/NSNotificationCenter+OCMAdditions.h26
-rw-r--r--test/ios/OCMock/OCMock/OCMArg.h53
-rw-r--r--test/ios/OCMock/OCMock/OCMConstraint.h71
-rw-r--r--test/ios/OCMock/OCMock/OCMLocation.h36
-rw-r--r--test/ios/OCMock/OCMock/OCMMacroState.h45
-rw-r--r--test/ios/OCMock/OCMock/OCMRecorder.h39
-rw-r--r--test/ios/OCMock/OCMock/OCMStubRecorder.h56
-rw-r--r--test/ios/OCMock/OCMock/OCMock.h84
-rw-r--r--test/ios/OCMock/OCMock/OCMockObject.h74
-rw-r--r--test/ios/OCMock/libOCMock.abin0 -> 2071640 bytes
-rw-r--r--test/ios/OHHTTPStubs/.gitignore15
-rw-r--r--test/ios/OHHTTPStubs/.travis.yml14
-rw-r--r--test/ios/OHHTTPStubs/CHANGELOG.md226
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.h13
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.m169
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.xib158
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj382
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Demo.xcscheme113
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata10
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Podfile6
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Podfile.lock14
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h1
l---------test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h1
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json26
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Manifest.lock14
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Pods.xcodeproj/project.pbxproj488
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch5
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig1
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown15
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.plist45
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-environment.h14
-rwxr-xr-xtest/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-resources.sh93
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.debug.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.release.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.jpgbin0 -> 46859 bytes
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.txt3
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/Default-568h@2x.pngbin0 -> 18594 bytes
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Info.plist40
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Prefix.pch14
-rw-r--r--test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/main.m17
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/AppDelegate.swift21
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Main.storyboard196
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/MainViewController.swift145
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.pbxproj378
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme112
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata10
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Podfile7
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Podfile.lock14
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h1
l---------test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h1
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json26
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Manifest.lock14
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Pods.xcodeproj/project.pbxproj562
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Info.plist26
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig9
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch5
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-umbrella.h11
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.modulemap6
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig1
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Info.plist26
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown15
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.plist45
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-environment.h14
-rwxr-xr-xtest/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-frameworks.sh55
-rwxr-xr-xtest/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-resources.sh93
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-umbrella.h6
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.debug.xcconfig8
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.modulemap6
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.release.xcconfig8
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.jpgbin0 -> 46859 bytes
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.txt3
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Default-568h@2x.pngbin0 -> 18594 bytes
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Images.xcassets/AppIcon.appiconset/Contents.json68
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Info.plist45
-rw-r--r--test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/LaunchScreen.xib41
-rw-r--r--test/ios/OHHTTPStubs/LICENSE9
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs.podspec37
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj1021
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme92
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Framework.xcscheme86
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme92
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcworkspace/contents.xcworkspacedata10
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Podfile14
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Podfile.lock30
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h67
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m206
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h308
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m253
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h240
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m321
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h193
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m259
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworking.h44
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h143
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m335
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h328
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m789
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h463
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m1339
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h310
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m793
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h531
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m1079
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/LICENSE19
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/README.md383
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h76
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m171
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h64
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m97
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h96
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m111
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h181
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m293
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h143
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m216
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h38
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h88
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m183
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h64
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m93
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h83
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m151
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h1
l---------test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h1
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Manifest.lock30
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Pods.xcodeproj/project.pbxproj906
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch5
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig1
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown26
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.plist56
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-environment.h44
-rwxr-xr-xtest/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-resources.sh93
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.debug.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.release.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch5
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig1
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown26
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.plist56
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-dummy.m5
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-environment.h50
-rwxr-xr-xtest/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-resources.sh93
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.debug.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.release.xcconfig6
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs+NSURLSessionConfiguration.m71
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.h195
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.m530
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h62
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.m54
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h47
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.m31
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.h271
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.m187
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.h77
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.m35
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs Mac-Info.plist30
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs iOS-Info.plist26
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Fixtures/emptyfile.json0
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/AFNetworkingTests.m226
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionDelegateTests.m394
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionTests.m187
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLSessionTests.m228
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NilValuesTests.m213
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/TimingTests.m162
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/WithContentsOfURLTests.m116
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Info.plist22
-rw-r--r--test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Prefix.pch7
-rw-r--r--test/ios/OHHTTPStubs/README.md113
-rw-r--r--test/ios/OHHTTPStubs/Rakefile55
-rw-r--r--test/ios/ios-tests.xcodeproj/project.pbxproj99
-rw-r--r--test/ios/ios-tests.xcodeproj/project.xcworkspace/xcshareddata/ios-tests.xccheckout12
-rw-r--r--test/miscellaneous/binpack.cpp51
-rw-r--r--test/miscellaneous/comparisons.cpp7
-rw-r--r--test/miscellaneous/map.cpp59
-rw-r--r--test/miscellaneous/map_context.cpp22
-rw-r--r--test/miscellaneous/transform.cpp125
-rw-r--r--test/miscellaneous/worker.cpp104
-rw-r--r--test/storage/http_issue_1369.cpp44
-rw-r--r--test/storage/http_noloop.cpp38
-rw-r--r--test/storage/http_reading.cpp17
m---------test/suite0
-rw-r--r--test/test.gypi6
380 files changed, 23916 insertions, 1818 deletions
diff --git a/.gitignore b/.gitignore
index fa3937dd28..2ea84e9821 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,8 @@
/test/build
/test/node_modules
/test/fixtures/*/*_actual.*
+/test/fixtures/api/1.png
+/test/fixtures/api/2.png
/test/fixtures/database/*.db
/include/mbgl/shader/shaders.hpp
/src/shader/shaders_gl.cpp
diff --git a/.travis.yml b/.travis.yml
index 2f50535cc9..1ac66b3862 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,6 +82,9 @@ env:
- secure: "nQqSM8rd7OHtV4MqmNqVnkrVHqxKqQsaWRYk4/nPdhbeVWtTtkk0df711LrF1TUtbEPEewHxYUvTZ/UXmwJNeoKdzTHavI8hnatRkgjyxGERPn1il1Otelht9I+LQQHf+plrpRjVWBrNIW0Zox1B3cqn6d3NglpbXrEQ2EjYGNA="
- KIF_SCREENSHOTS="${TRAVIS_BUILD_DIR}/screenshots"
+before_install:
+- source ./scripts/travis_helper.sh
+
install:
- ./scripts/${FLAVOR}/install.sh
@@ -89,7 +92,10 @@ script:
- ./scripts/${FLAVOR}/run.sh
after_failure:
-- "[ -f scripts/${FLAVOR}/run.sh ] && scripts/${FLAVOR}/run.sh"
+- "[ -f ./scripts/${FLAVOR}/after_failure.sh ] && ./scripts/${FLAVOR}/after_failure.sh"
+
+after_script:
+- "[ -f ./scripts/${FLAVOR}/after_script.sh ] && ./scripts/${FLAVOR}/after_script.sh"
notifications:
slack:
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000000..a417af376c
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,13 @@
+# Changelog
+
+## 0.3.1
+
+- Temporarily removed `IBDesignable` support on iOS.
+
+## 0.3.0
+
+- Initial iOS beta release.
+
+Known issues:
+
+- None.
diff --git a/Makefile b/Makefile
index 0836bbc65c..748105102a 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ endif
ifeq ($(shell uname -s), Linux)
HOST = linux
JOBS ?= $(shell grep --count processor /proc/cpuinfo)
+BUILD_ROOT = $(shell pwd)
endif
JOBS ?= 1
@@ -92,6 +93,9 @@ osx: Makefile/project
run-osx: osx
"build/osx/$(BUILDTYPE)/Mapbox GL.app/Contents/MacOS/Mapbox GL"
+run-valgrind-osx: osx
+ (valgrind --leak-check=full --suppressions=scripts/valgrind.sup build/osx/$(BUILDTYPE)/Mapbox\ GL.app/Contents/MacOS/Mapbox\ GL)
+
.PHONY: xosx-proj xosx run-xosx
xosx-proj: Xcode/project
open ./build/osx/gyp/osx.xcodeproj
@@ -130,11 +134,11 @@ isim: XCPRETTY := $(shell ./scripts/xcpretty.sh)
isim: Xcode/ios
xcodebuild -sdk iphonesimulator ARCHS="x86_64 i386" -project ./build/ios/gyp/ios.xcodeproj -configuration Debug -target iosapp -jobs $(JOBS) $(XCPRETTY)
-ipackage: clean Xcode/ios
- ./scripts/ios/package.sh
+ipackage: Xcode/ios
+ JOBS=$(JOBS) ./scripts/ios/package.sh
-ipackage-sim: clean Xcode/ios
- ./scripts/ios/package.sh sim
+ipackage-sim: Xcode/ios
+ JOBS=$(JOBS) ./scripts/ios/package.sh sim
itest: ipackage-sim KIF
./scripts/ios/test.sh
@@ -152,6 +156,9 @@ linux: Makefile/project
run-linux: linux
(cd build/$(HOST)/$(BUILDTYPE) && ./mapbox-gl)
+run-valgrind-linux: linux
+ (cd build/$(HOST)/$(BUILDTYPE) && valgrind --leak-check=full --suppressions=$(BUILD_ROOT)/scripts/valgrind.sup ./mapbox-gl)
+
.PHONY: xlinux run-xlinux
xlinux: XCPRETTY := $(shell ./scripts/xcpretty.sh)
xlinux: Xcode/project
@@ -196,9 +203,10 @@ android-project: android-lib
render: Makefile/project
$(MAKE) -C build/$(HOST) BUILDTYPE=$(BUILDTYPE) mbgl-render
-.PHONY: xrender run-xrender
+.PHONY: xrender
+xrender: XCPRETTY := $(shell ./scripts/xcpretty.sh)
xrender: Xcode/project
- xcodebuild -project ./build/osx/gyp/osx.xcodeproj -configuration $(BUILDTYPE) -target mbgl-render -jobs $(JOBS)
+ xcodebuild -project ./build/osx/gyp/osx.xcodeproj -configuration $(BUILDTYPE) -target mbgl-render -jobs $(JOBS) $(XCPRETTY)
##### Maintenace operations ####################################################
diff --git a/README.md b/README.md
index 8f2dd6db2d..6b15f596c6 100644
--- a/README.md
+++ b/README.md
@@ -49,24 +49,23 @@ Target OS X: 10.9+
#### CocoaPods
-CocoaPods is preferred. As of yet, Mapbox GL isn't in the global specs repo, but you can use it like so in your `Podfile`:
+[CocoaPods](https://cocoapods.org) is preferred. Put the following in your `Podfile`:
```ruby
use_frameworks!
-pod 'MapboxGL', :podspec => 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/MapboxGL.podspec'
+pod 'MapboxGL'
```
-Once the library stabilizes, a mere `pod 'MapboxGL'` will work.
-
#### Manually
-0. Use [Homebrew](http://brew.sh/) to install Boost headers and [appledoc](http://gentlebytes.com/appledoc/): `brew install boost appledoc`.
+1. Use [Homebrew](http://brew.sh/) to install Boost headers: `brew install boost`.
+1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) for API docs generation. We recommend [`2.2v963`](https://github.com/tomaz/appledoc/releases/tag/v2.2-963), which currently isn't available in Homebrew.
1. Run `make ipackage`. The packaging script will produce the statically-linked `libMapboxGL.a`, `MapboxGL.bundle` for resources, a `Headers` folder, and a `Docs` folder with HTML API documentation.
-2. Copy the contents of `build/ios/pkg/static` into your project. It should happen automatically, but ensure that:
+1. Copy the contents of `build/ios/pkg/static` into your project. It should happen automatically, but ensure that:
- `Headers` is in your *Header Search Paths* (`HEADER_SEARCH_PATHS`) build setting.
- `MapboxGL.bundle` is in your target's *Copy Bundle Resources* build phase.
- `libMapboxGL.a` is in your target's *Link Binary With Libraries* build phase.
-3. Add the following Cocoa framework dependencies to your target's *Link Binary With Libraries* build phase:
+1. Add the following Cocoa framework dependencies to your target's *Link Binary With Libraries* build phase:
- `CoreTelephony.framework`
- `GLKit.framework`
- `ImageIO.framework`
@@ -76,19 +75,19 @@ Once the library stabilizes, a mere `pod 'MapboxGL'` will work.
- `libc++.dylib`
- `libsqlite3.dylib`
- `libz.dylib`
-4. Add `-ObjC` to your target's "Other Linker Flags" build setting (`OTHER_LDFLAGS`).
-5. [Set the Mapbox API access token](#mapbox-api-access-tokens).
-6. `#import "MapboxGL.h"`
+1. Add `-ObjC` to your target's "Other Linker Flags" build setting (`OTHER_LDFLAGS`).
+1. [Set the Mapbox API access token](#mapbox-api-access-tokens).
+1. `#import "MapboxGL.h"`
-### Development
+### Development
If you want to build from source and/or contribute to development of the project, run `make iproj`, which will create and open an Xcode project which can build the entire library from source as well as an Objective-C test app. If you don't have an Apple Developer account, change the destination from "My Mac" to a simulator such as "iPhone 6" before you run and build the app.
-You can run `make itest` to run the included integration tests. Requires `gem install xcpretty`. If you want to run the tests in Xcode instead, first `make ipackage` to create a local static library version, then open `test/ios/ios-tests.xcodeproj`, and lastly `Command + U` on the `Mapbox GL Tests` application target.
+You can run `make itest` to run the included integration tests. Requires `gem install xcpretty`. If you want to run the tests in Xcode instead, first `make ipackage` to create a local static library version, then open `test/ios/ios-tests.xcodeproj`, and lastly `Command + U` on the `Mapbox GL Tests` application target.
Target devices: iPhone 4S and above (5, 5c, 5s, 6, 6 Plus) and iPad 2 and above (3, 4, Mini, Air, Mini 2, Air 2).
-Target iOS: 7.0 through latest 8.x.
+Target iOS: 7.0 through latest 8.x.
## Linux
@@ -195,6 +194,35 @@ Run:
You can then open `android/java` in Android Studio via "Import Non-Android Studio Project".
+### Setting up Android emulator
+
+If you want to run the test app in the emulator, we recommend the x86 build because it will run a lot faster.
+
+First ensure you have an `MAPBOX_ACCESS_TOKEN` environment variable set, as described below. Then, create an x86 build:
+
+ ANDROID_ABI=x86 make android
+
+In Android Studio, create an x86 AVD (Android Virtual Device):
+- Open AVD Manager via the Tools menu -> Android -> AVD Manager
+- Click "Create Virtual Device" at the bottom on AVD Manager window
+- Select one of the device profiles, for example the Nexus 4
+- Click "Next"
+- Select a Lollipop or Kitkat release with ABI of x86. If the line is greyed out click Download to download the OS files.
+- Click "Next"
+- Under "Emulated Performance" check "Host GPU" and uncheck "Store a snapshot for faster startup"
+- Click "Finish"
+- Close the AVD Manager
+
+Now when you run or debug the Android project you will see a window "Choose Device". Select your new AVD from drop down under "Launch emulator". If you select "Use same device for future launches" Android Studio will remember the selection and not ask again.
+
+### Running on a hardware device
+
+First read the [Google documentation](http://developer.android.com/tools/device.html) to set up your device and your OS to connect to the device.
+
+When you plug your device in and then run or debug the Android project you will see a window "Choose Device". Choose your device from the "Choose a running device" list.
+
+If your device does not show you have not set it up properly, double check the [Google documentation](http://developer.android.com/tools/device.html).
+
# Troubleshooting
To trigger a complete rebuild, run `make clean` and then start over generating the Xcode projects or Makefiles as described above.
@@ -215,7 +243,7 @@ For iOS and OS X use of the demo apps in Xcode, setup the access token by editin
For Linux, set the environment variable `MAPBOX_ACCESS_TOKEN` to your token.
-For Android, gradle will take the value of `MAPBOX_ACCESS_TOKEN` and save it to `android/java/app/src/main/res/raw/token.txt` where the app will read it from.
+For Android, gradle will take the value of `MAPBOX_ACCESS_TOKEN` and save it to `android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/token.txt` where the app will read it from.
# Style
diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp
index 327d1dc598..03530aefff 100644
--- a/android/cpp/native_map_view.cpp
+++ b/android/cpp/native_map_view.cpp
@@ -17,10 +17,6 @@
#include <mbgl/platform/gl.hpp>
#include <mbgl/util/std.hpp>
-#include <pthread.h>
-
-pthread_once_t loadGLExtensions = PTHREAD_ONCE_INIT;
-
namespace mbgl {
namespace android {
@@ -61,9 +57,11 @@ NativeMapView::NativeMapView(JNIEnv *env, jobject obj_)
: mbgl::View(*this),
fileCache(mbgl::android::cachePath + "/mbgl-cache.db"),
fileSource(&fileCache),
- map(*this, fileSource, MapMode::Continuous, true) {
+ map(*this, fileSource, MapMode::Continuous) {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::NativeMapView");
+ map.pause();
+
assert(env != nullptr);
assert(obj_ != nullptr);
@@ -116,10 +114,14 @@ void NativeMapView::activate() {
void NativeMapView::deactivate() {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::deactivate");
- if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
- mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent(EGL_NO_CONTEXT) returned error %d",
- eglGetError());
- throw new std::runtime_error("eglMakeCurrent() failed");
+ if (display != EGL_NO_DISPLAY) {
+ if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
+ mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent(EGL_NO_CONTEXT) returned error %d",
+ eglGetError());
+ throw new std::runtime_error("eglMakeCurrent() failed");
+ }
+ } else {
+ mbgl::Log::Info(mbgl::Event::Android, "Not deactivating as we are not ready");
}
}
@@ -302,8 +304,6 @@ void NativeMapView::terminateContext() {
context = EGL_NO_CONTEXT;
}
-void loadExtensions();
-
void NativeMapView::createSurface(ANativeWindow *window_) {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::createSurface");
@@ -343,9 +343,11 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
"SL Version"); // In the emulator this returns NULL with error code 0?
// https://code.google.com/p/android/issues/detail?id=78977
}
- log_gl_string(GL_EXTENSIONS, "Extensions");
- pthread_once(&loadGLExtensions, loadExtensions);
+ log_gl_string(GL_EXTENSIONS, "Extensions");
+ mbgl::gl::InitializeExtensions([] (const char * name) {
+ return reinterpret_cast<mbgl::gl::glProc>(eglGetProcAddress(name));
+ });
if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
mbgl::Log::Error(mbgl::Event::OpenGL,
@@ -578,102 +580,6 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint numConfi
return configId;
}
-void loadExtensions() {
- const GLubyte *str = glGetString(GL_EXTENSIONS);
- if (str == nullptr) {
- mbgl::Log::Error(mbgl::Event::OpenGL, "glGetString(GL_EXTENSIONS) returned error %d",
- glGetError());
- return;
- }
-
- std::string extensions(reinterpret_cast<const char *>(str));
-
- if (extensions.find("GL_OES_vertex_array_object") != std::string::npos) {
- mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_OES_vertex_array_object.");
- gl::BindVertexArray = reinterpret_cast<gl::PFNGLBINDVERTEXARRAYPROC>(
- eglGetProcAddress("glBindVertexArrayOES"));
- gl::DeleteVertexArrays = reinterpret_cast<gl::PFNGLDELETEVERTEXARRAYSPROC>(
- eglGetProcAddress("glDeleteVertexArraysOES"));
- gl::GenVertexArrays = reinterpret_cast<gl::PFNGLGENVERTEXARRAYSPROC>(
- eglGetProcAddress("glGenVertexArraysOES"));
- gl::IsVertexArray =
- reinterpret_cast<gl::PFNGLISVERTEXARRAYPROC>(eglGetProcAddress("glIsVertexArrayOES"));
- assert(gl::BindVertexArray != nullptr);
- assert(gl::DeleteVertexArrays != nullptr);
- assert(gl::GenVertexArrays != nullptr);
- assert(gl::IsVertexArray != nullptr);
- }
-
- if (extensions.find("GL_OES_packed_depth_stencil") != std::string::npos) {
- mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_OES_packed_depth_stencil.");
- gl::isPackedDepthStencilSupported = true;
- }
-
- if (extensions.find("GL_OES_depth24") != std::string::npos) {
- gl::isDepth24Supported = true;
- }
-
- if (extensions.find("GL_KHR_debug") != std::string::npos) {
- mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_KHR_debug.");
- gl::DebugMessageControl = reinterpret_cast<gl::PFNGLDEBUGMESSAGECONTROLPROC>(
- eglGetProcAddress("glDebugMessageControl"));
- gl::DebugMessageInsert = reinterpret_cast<gl::PFNGLDEBUGMESSAGEINSERTPROC>(
- eglGetProcAddress("glDebugMessageInsert"));
- gl::DebugMessageCallback = reinterpret_cast<gl::PFNGLDEBUGMESSAGECALLBACKPROC>(
- eglGetProcAddress("glDebugMessageCallback"));
- gl::GetDebugMessageLog = reinterpret_cast<gl::PFNGLGETDEBUGMESSAGELOGPROC>(
- eglGetProcAddress("glGetDebugMessageLog"));
- gl::GetPointerv =
- reinterpret_cast<gl::PFNGLGETPOINTERVPROC>(eglGetProcAddress("glGetPointerv"));
- gl::PushDebugGroup =
- reinterpret_cast<gl::PFNGLPUSHDEBUGGROUPPROC>(eglGetProcAddress("glPushDebugGroup"));
- gl::PopDebugGroup =
- reinterpret_cast<gl::PFNGLPOPDEBUGGROUPPROC>(eglGetProcAddress("glPopDebugGroup"));
- gl::ObjectLabel =
- reinterpret_cast<gl::PFNGLOBJECTLABELPROC>(eglGetProcAddress("glObjectLabel"));
- gl::GetObjectLabel =
- reinterpret_cast<gl::PFNGLGETOBJECTLABELPROC>(eglGetProcAddress("glGetObjectLabel"));
- gl::ObjectPtrLabel =
- reinterpret_cast<gl::PFNGLOBJECTPTRLABELPROC>(eglGetProcAddress("glObjectPtrLabel"));
- gl::GetObjectPtrLabel = reinterpret_cast<gl::PFNGLGETOBJECTPTRLABELPROC>(
- eglGetProcAddress("glGetObjectPtrLabel"));
- assert(gl::DebugMessageControl != nullptr);
- assert(gl::DebugMessageInsert != nullptr);
- assert(gl::DebugMessageCallback != nullptr);
- assert(gl::GetDebugMessageLog != nullptr);
- assert(gl::GetPointerv != nullptr);
- assert(gl::PushDebugGroup != nullptr);
- assert(gl::PopDebugGroup != nullptr);
- assert(gl::ObjectLabel != nullptr);
- assert(gl::GetObjectLabel != nullptr);
- assert(gl::ObjectPtrLabel != nullptr);
- assert(gl::GetObjectPtrLabel != nullptr);
- } else {
- if (extensions.find("GL_EXT_debug_marker") != std::string::npos) {
- mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_EXT_debug_marker.");
- gl::InsertEventMarkerEXT = reinterpret_cast<gl::PFNGLINSERTEVENTMARKEREXTPROC>(
- eglGetProcAddress("glInsertEventMarkerEXT"));
- gl::PushGroupMarkerEXT = reinterpret_cast<gl::PFNGLPUSHGROUPMARKEREXTPROC>(
- eglGetProcAddress("glPushGroupMarkerEXT"));
- gl::PopGroupMarkerEXT = reinterpret_cast<gl::PFNGLPOPGROUPMARKEREXTPROC>(
- eglGetProcAddress("glPopGroupMarkerEXT"));
- assert(gl::InsertEventMarkerEXT != nullptr);
- assert(gl::PushGroupMarkerEXT != nullptr);
- assert(gl::PopGroupMarkerEXT != nullptr);
- }
-
- if (extensions.find("GL_EXT_debug_label") != std::string::npos) {
- mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_EXT_debug_label.");
- gl::LabelObjectEXT = reinterpret_cast<gl::PFNGLLABELOBJECTEXTPROC>(
- eglGetProcAddress("glLabelObjectEXT"));
- gl::GetObjectLabelEXT = reinterpret_cast<gl::PFNGLGETOBJECTLABELEXTPROC>(
- eglGetProcAddress("glGetObjectLabelEXT"));
- assert(gl::LabelObjectEXT != nullptr);
- assert(gl::GetObjectLabelEXT != nullptr);
- }
- }
-}
-
void NativeMapView::pause() {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause");
diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java b/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java
index bd7100d98d..65cb17462f 100644
--- a/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java
+++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxgl/testapp/MainActivity.java
@@ -128,8 +128,6 @@ public class MainActivity extends ActionBarActivity {
mClassSpinner = (Spinner) findViewById(R.id.spinner_class);
mOutdoorsClassAdapter = ArrayAdapter.createFromResource(getSupportActionBar().getThemedContext(),
R.array.outdoors_class_list, android.R.layout.simple_spinner_dropdown_item);
- mSatelliteClassAdapter = ArrayAdapter.createFromResource(getSupportActionBar().getThemedContext(),
- R.array.satellite_class_list, android.R.layout.simple_spinner_dropdown_item);
// Prepare for GPS
mLocationClient = new LostApiClient.Builder(this).build();
@@ -318,58 +316,50 @@ public class MainActivity extends ActionBarActivity {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
- // Bright
+
+ // Mapbox Streets
case 0:
- mMapFragment.getMap().setStyleUrl("asset://styles/bright-v7.json");
+ mMapFragment.getMap().setStyleUrl("asset://styles/mapbox-streets-v7.json");
mMapFragment.getMap().removeAllClasses();
mClassSpinner.setVisibility(View.INVISIBLE);
mClassSpinner.setAdapter(null);
mClassSpinner.setOnItemSelectedListener(null);
break;
- // Basic
+ // Emerald
case 1:
- mMapFragment.getMap().setStyleUrl("asset://styles/basic-v7.json");
+ mMapFragment.getMap().setStyleUrl("asset://styles/emerald-v7.json");
mMapFragment.getMap().removeAllClasses();
mClassSpinner.setVisibility(View.INVISIBLE);
mClassSpinner.setAdapter(null);
mClassSpinner.setOnItemSelectedListener(null);
break;
- // Outdoors
+ // Light
case 2:
- mMapFragment.getMap().setStyleUrl("asset://styles/outdoors-v7.json");
+ mMapFragment.getMap().setStyleUrl("asset://styles/light-v7.json");
mMapFragment.getMap().removeAllClasses();
- mClassSpinner.setVisibility(View.VISIBLE);
- mClassSpinner.setAdapter(mOutdoorsClassAdapter);
- mClassSpinner.setOnItemSelectedListener(new OutdoorClassSpinnerListener());
+ mClassSpinner.setVisibility(View.INVISIBLE);
+ mClassSpinner.setAdapter(null);
+ mClassSpinner.setOnItemSelectedListener(null);
break;
- // Satellite
+ // Dark
case 3:
- mMapFragment.getMap().setStyleUrl("asset://styles/satellite-v7.json");
- mMapFragment.getMap().removeAllClasses();
- mClassSpinner.setVisibility(View.VISIBLE);
- mClassSpinner.setAdapter(mSatelliteClassAdapter);
- mClassSpinner.setOnItemSelectedListener(new SatelliteClassSpinnerListener());
- break;
-
- // Pencil
- case 4:
- mMapFragment.getMap().setStyleUrl("asset://styles/pencil-v7.json");
+ mMapFragment.getMap().setStyleUrl("asset://styles/dark-v7.json");
mMapFragment.getMap().removeAllClasses();
mClassSpinner.setVisibility(View.INVISIBLE);
mClassSpinner.setAdapter(null);
mClassSpinner.setOnItemSelectedListener(null);
break;
- // Empty
- case 5:
- mMapFragment.getMap().setStyleUrl("asset://styles/empty-v7.json");
+ // Outdoors
+ case 4:
+ mMapFragment.getMap().setStyleUrl("asset://styles/outdoors-v7.json");
mMapFragment.getMap().removeAllClasses();
- mClassSpinner.setVisibility(View.INVISIBLE);
- mClassSpinner.setAdapter(null);
- mClassSpinner.setOnItemSelectedListener(null);
+ mClassSpinner.setVisibility(View.VISIBLE);
+ mClassSpinner.setAdapter(mOutdoorsClassAdapter);
+ mClassSpinner.setOnItemSelectedListener(new OutdoorClassSpinnerListener());
break;
default:
diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml
index 7b4e51b473..901e231929 100644
--- a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml
+++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/values/strings.xml
@@ -12,12 +12,10 @@
<string name="compass_desc">Map compass. Click to reset the map rotation to North.</string>
<string-array name="style_list">
- <item>Bright</item>
- <item>Basic</item>
- <item>Outdoors</item>
- <item>Satellite</item>
- <item>Pencil</item>
- <item>Empty</item>
+ <item>Mapbox Streets</item>
+ <item>Emerald</item>
+ <item>Light</item>
+ <item>Dark</item>
</string-array>
<string-array name="outdoors_class_list">
@@ -25,10 +23,4 @@
<item>Night</item>
</string-array>
- <string-array name="satellite_class_list">
- <item>Labels + Contours</item>
- <item>Labels Only</item>
- <item>No Labels</item>
- </string-array>
-
</resources>
diff --git a/bin/render.cpp b/bin/render.cpp
index cd7a54f48d..33e216f52a 100644
--- a/bin/render.cpp
+++ b/bin/render.cpp
@@ -39,6 +39,7 @@ int main(int argc, char *argv[]) {
std::string cache_file = "cache.sqlite";
std::vector<std::string> classes;
std::string token;
+ bool debug = false;
po::options_description desc("Allowed options");
desc.add_options()
@@ -51,6 +52,7 @@ int main(int argc, char *argv[]) {
("height,h", po::value(&height)->value_name("pixels")->default_value(height), "Image height")
("class,c", po::value(&classes)->value_name("name"), "Class name")
("token,t", po::value(&token)->value_name("key")->default_value(token), "Mapbox access token")
+ ("debug", po::bool_switch(&debug)->default_value(debug), "Debug mode")
("output,o", po::value(&output)->value_name("file")->default_value(output), "Output file name")
("cache,d", po::value(&cache_file)->value_name("file")->default_value(cache_file), "Cache database file name")
;
@@ -79,11 +81,8 @@ int main(int argc, char *argv[]) {
}
}
-
HeadlessView view;
- Map map(view, fileSource);
-
- map.start(Map::Mode::Still);
+ Map map(view, fileSource, MapMode::Still);
// Set access token if present
if (token.size()) {
@@ -93,10 +92,14 @@ int main(int argc, char *argv[]) {
map.setStyleJSON(style, ".");
map.setClasses(classes);
- view.resize(width, height, pixelRatio);
+ map.resize(width, height, pixelRatio);
map.setLatLngZoom({ lat, lon }, zoom);
map.setBearing(bearing);
+ if (debug) {
+ map.setDebug(debug);
+ }
+
uv_async_t *async = new uv_async_t;
uv_async_init(uv_default_loop(), async, [](uv_async_t *as, int) {
std::unique_ptr<const StillImage> image(reinterpret_cast<const StillImage *>(as->data));
@@ -115,6 +118,4 @@ int main(int argc, char *argv[]) {
// This loop will terminate once the async was fired.
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
-
- map.stop();
}
diff --git a/bin/render.gypi b/bin/render.gypi
index b205e7a959..2e1dbd8f73 100644
--- a/bin/render.gypi
+++ b/bin/render.gypi
@@ -34,12 +34,11 @@
'ldflags': [
'<@(glfw3_ldflags)',
'<@(uv_ldflags)',
- '<@(boost_ldflags)',
- '-lboost_program_options'
],
'libraries': [
'<@(glfw3_static_libs)',
'<@(uv_static_libs)',
+ '<@(boost_program_options_static_libs)'
],
},
diff --git a/configure b/configure
index f49ea21896..c1f7f6da17 100755
--- a/configure
+++ b/configure
@@ -46,6 +46,7 @@ case ${MASON_PLATFORM} in
LIBUV_VERSION=0.10.28
ZLIB_VERSION=system
BOOST_VERSION=1.57.0
+ BOOST_PROGRAM_OPTIONS_VERSION=1.57.0
NUNICODE_VERSION=1.5.1
LIBZIP_VERSION=0.11.2
;;
@@ -104,7 +105,11 @@ CONFIG="# Do not edit. Generated by the configure script.
if [ ! -z ${BOOST_VERSION} ]; then
mason install boost ${BOOST_VERSION}
CONFIG+=" 'boost_cflags%': $(quote_flags $(mason cflags boost ${BOOST_VERSION})),"$LN
- CONFIG+=" 'boost_ldflags%': $(quote_flags $(mason ldflags boost ${BOOST_VERSION})),"$LN
+fi
+
+if [ ! -z ${BOOST_PROGRAM_OPTIONS_VERSION} ]; then
+ mason install boost_libprogram_options ${BOOST_PROGRAM_OPTIONS_VERSION}
+ CONFIG+=" 'boost_program_options_static_libs%': $(quote_flags $(mason static_libs boost_libprogram_options ${BOOST_VERSION})),"$LN
fi
if [ ! -z ${OPENSSL_VERSION} ]; then
diff --git a/gyp/common.gypi b/gyp/common.gypi
index af3f1bffc3..d7d21f761b 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -8,11 +8,11 @@
['OS=="mac"', {
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
- 'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'GCC_ENABLE_CPP_RTTI': 'YES',
'OTHER_CPLUSPLUSFLAGS': [
+ '-std=c++1y',
'-Werror',
'-Wall',
'-Wextra',
diff --git a/gyp/platform-ios.gypi b/gyp/platform-ios.gypi
index 1f96f94702..0034831a91 100644
--- a/gyp/platform-ios.gypi
+++ b/gyp/platform-ios.gypi
@@ -18,7 +18,7 @@
'../platform/darwin/nsthread.mm',
'../platform/darwin/reachability.m',
'../include/mbgl/ios/MapboxGL.h',
- '../include/mbgl/ios/MGLMapboxEvents.h',
+ '../platform/ios/MGLMapboxEvents.h',
'../platform/ios/MGLMapboxEvents.m',
'../include/mbgl/ios/MGLMapView.h',
'../include/mbgl/ios/MGLMapView+IBAdditions.h',
@@ -33,9 +33,8 @@
'../platform/ios/MGLUserLocation.m',
'../platform/ios/MGLUserLocationAnnotationView.h',
'../platform/ios/MGLUserLocationAnnotationView.m',
- '../include/mbgl/ios/MGLMetricsLocationManager.h',
- '../platform/ios/MGLMetricsLocationManager.m',
'../include/mbgl/ios/MGLTypes.h',
+ '../platform/ios/MGLTypes.m',
'../platform/ios/NSBundle+MGLAdditions.h',
'../platform/ios/NSBundle+MGLAdditions.m',
'../platform/ios/NSException+MGLAdditions.h',
diff --git a/gyp/styles.gypi b/gyp/styles.gypi
index 8b3032b58c..06121f2d4c 100644
--- a/gyp/styles.gypi
+++ b/gyp/styles.gypi
@@ -14,21 +14,22 @@
],
},
{
- 'target_name': 'bundle_styles',
+ 'target_name': 'bundle_styles', # use this only for targets that create an App bundle
'type': 'none',
'hard_dependency': 1,
'dependencies': [ 'touch_styles' ], # required for xcode http://openradar.appspot.com/7232149
- 'conditions': [
- ['platform_lib == "osx" or platform_lib == "ios"', {
- 'direct_dependent_settings': {
- 'mac_bundle_resources': [ '../styles/styles' ],
- }
- }, {
- 'direct_dependent_settings': {
- 'copies': [{ 'files': [ '../styles/styles' ], 'destination': '<(PRODUCT_DIR)' }],
- }
- }]
- ],
- }
+ 'direct_dependent_settings': {
+ 'mac_bundle_resources': [ '../styles/styles' ],
+ }
+ },
+ {
+ 'target_name': 'copy_styles', # use this only for targets that don't create an App bundle
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'dependencies': [ 'touch_styles' ],
+ 'direct_dependent_settings': {
+ 'copies': [{ 'files': [ '../styles/styles' ], 'destination': '<(PRODUCT_DIR)' }],
+ }
+ },
]
}
diff --git a/include/mbgl/android/native_map_view.hpp b/include/mbgl/android/native_map_view.hpp
index c6f0c7b351..fae239e070 100644
--- a/include/mbgl/android/native_map_view.hpp
+++ b/include/mbgl/android/native_map_view.hpp
@@ -55,11 +55,6 @@ private:
jobject obj = nullptr;
ANativeWindow *window = nullptr;
-
- mbgl::SQLiteCache fileCache;
- mbgl::DefaultFileSource fileSource;
- mbgl::Map map;
-
EGLDisplay display = EGL_NO_DISPLAY;
EGLSurface surface = EGL_NO_SURFACE;
EGLContext context = EGL_NO_CONTEXT;
@@ -74,6 +69,12 @@ private:
bool fpsEnabled = false;
double fps = 0.0;
+
+ // Ensure these are initialised last
+ mbgl::SQLiteCache fileCache;
+ mbgl::DefaultFileSource fileSource;
+ mbgl::Map map;
+
};
}
}
diff --git a/include/mbgl/ios/MGLAccountManager.h b/include/mbgl/ios/MGLAccountManager.h
index c1b7406b9e..7ec4135f18 100644
--- a/include/mbgl/ios/MGLAccountManager.h
+++ b/include/mbgl/ios/MGLAccountManager.h
@@ -1,6 +1,29 @@
+#import <Foundation/Foundation.h>
+
+/** The MGLAccountManager object provides a global way to set a Mapbox API access token, as well as other settings used framework-wide. */
@interface MGLAccountManager : NSObject
-+ (void) setAccessToken:(NSString *) accessToken;
-+ (NSString *) accessToken;
+/** @name Authorizing Access */
+
+/** Set the Mapbox API access token for the framework.
+*
+* You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
+* @param accessToken The Mapbox API access token. */
++ (void)setAccessToken:(NSString *)accessToken;
+
+/** Retreive the Mapbox API access token for the framework.
+*
+* You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
+* @return accessToken The Mapbox API access token. */
++ (NSString *)accessToken;
+
+/** @name Providing User Metrics Opt-Out */
+
+/** Certain Mapbox plans require the collection of user metrics. If you aren't using a preference switch in an existing or new `Settings.bundle` in your application, set this value to `YES` to indicate that you are providing a metrics opt-out for users within your app's interface directly.
+* @param showsOptOut Whether your application's interface provides a user opt-out preference. The default value is `NO`, meaning a `Settings.bundle` is expected for providing a user opt-out preference. */
++ (void)setMapboxMetricsEnabledSettingShownInApp:(BOOL)showsOptOut;
+
+/** Whether in-app user metrics opt-out is configured. If set to the default value of `NO`, a user opt-out preference is expected in a `Settings.bundle` that shows in the application's section within the system Settings app. */
++ (BOOL)mapboxMetricsEnabledSettingShownInApp;
-@end \ No newline at end of file
+@end
diff --git a/include/mbgl/ios/MGLMetricsLocationManager.h b/include/mbgl/ios/MGLMetricsLocationManager.h
deleted file mode 100644
index f02c76f53c..0000000000
--- a/include/mbgl/ios/MGLMetricsLocationManager.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@interface MGLMetricsLocationManager : NSObject
-
-// These methods can be called from any thread.
-//
-+ (instancetype)sharedManager;
-- (void) startUpdatingLocation;
-- (void) stopUpdatingLocation;
-- (void) startMonitoringVisits;
-- (void) stopMonitoringVisits;
-
-@end
diff --git a/include/mbgl/ios/MGLTypes.h b/include/mbgl/ios/MGLTypes.h
index 9a393b2fd4..d4bc6c2ce2 100644
--- a/include/mbgl/ios/MGLTypes.h
+++ b/include/mbgl/ios/MGLTypes.h
@@ -1,5 +1,7 @@
#import <Foundation/Foundation.h>
+extern NSString * const MGLErrorDomain;
+
/** The mode used to track the user location on the map. */
typedef NS_ENUM(NSUInteger, MGLUserTrackingMode)
{
diff --git a/include/mbgl/ios/MapboxGL.h b/include/mbgl/ios/MapboxGL.h
index 34e080a511..a6d23d3280 100644
--- a/include/mbgl/ios/MapboxGL.h
+++ b/include/mbgl/ios/MapboxGL.h
@@ -1,5 +1,5 @@
+#import "MGLAccountManager.h"
#import "MGLAnnotation.h"
#import "MGLMapView.h"
#import "MGLTypes.h"
#import "MGLUserLocation.h"
-#import "MGLAccountManager.h" \ No newline at end of file
diff --git a/include/mbgl/ios/private/MGLMapView_Private.h b/include/mbgl/ios/private/MGLMapView_Private.h
deleted file mode 100644
index 18c07ef1bb..0000000000
--- a/include/mbgl/ios/private/MGLMapView_Private.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#import <UIKit/UIKit.h>
-
-@interface MGLMapView ()
-
-#pragma mark - Debugging
-
-/** Triggers another render pass even when it is not necessary. */
-- (void)invalidate;
-
-/** Returns whether the map view is currently loading or processing any assets required to render the map */
-- (BOOL)isFullyLoaded;
-
-@end
-
diff --git a/include/mbgl/map/environment.hpp b/include/mbgl/map/environment.hpp
index 07554a7a92..d8068187e7 100644
--- a/include/mbgl/map/environment.hpp
+++ b/include/mbgl/map/environment.hpp
@@ -39,7 +39,6 @@ public:
// #############################################################################################
// File request APIs
- void requestAsync(const Resource&, std::function<void(const Response&)>);
Request* request(const Resource&, std::function<void(const Response&)>);
void cancelRequest(Request*);
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index bdb384b24e..e71c5f5b4d 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -31,8 +31,7 @@ class Map : private util::noncopyable {
public:
explicit Map(View&, FileSource&,
- MapMode mode = MapMode::Continuous,
- bool startPaused = false);
+ MapMode mode = MapMode::Continuous);
~Map();
// Pauses the render thread. The render thread will stop running but will not be terminated and will not lose state until resumed.
@@ -137,6 +136,7 @@ public:
private:
const std::unique_ptr<MapData> data;
const std::unique_ptr<util::Thread<MapContext>> context;
+ bool paused = false;
};
}
diff --git a/include/mbgl/map/update.hpp b/include/mbgl/map/update.hpp
index 49da65d547..b4c6b5f13c 100644
--- a/include/mbgl/map/update.hpp
+++ b/include/mbgl/map/update.hpp
@@ -9,7 +9,6 @@ using UpdateType = uint32_t;
enum class Update : UpdateType {
Nothing = 0,
- Debug = 1 << 1,
DefaultTransitionDuration = 1 << 2,
Classes = 1 << 3,
Zoom = 1 << 4,
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp
index 46baa70023..74dc6fe439 100644
--- a/include/mbgl/platform/default/glfw_view.hpp
+++ b/include/mbgl/platform/default/glfw_view.hpp
@@ -25,19 +25,28 @@ public:
static void onMouseClick(GLFWwindow *window, int button, int action, int modifiers);
static void onMouseMove(GLFWwindow *window, double x, double y);
+ // Callback called when the user presses the key mapped to style change.
+ // The expected action is to set a new style, different to the current one.
+ void setChangeStyleCallback(std::function<void()> callback);
+
+ void setShouldClose();
+
+ void setWindowTitle(const std::string&);
+
void run();
void fps();
-public:
+private:
bool fullscreen = false;
-
- double lastX = 0, lastY = 0;
bool tracking = false;
-
bool rotating = false;
+ double lastX = 0, lastY = 0;
+
double lastClick = -1;
+ std::function<void()> changeStyleCallback;
+
GLFWwindow *window = nullptr;
};
diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp
index 5c10f16105..73f0801fa5 100644
--- a/include/mbgl/platform/gl.hpp
+++ b/include/mbgl/platform/gl.hpp
@@ -3,6 +3,7 @@
#include <string>
#include <stdexcept>
+#include <vector>
#if __APPLE__
#include "TargetConditionals.h"
@@ -39,150 +40,42 @@ struct Error : ::std::runtime_error {
void checkError(const char *cmd, const char *file, int line);
#if defined(DEBUG)
-#define MBGL_CHECK_ERROR(cmd) ([&]() { struct _ { inline ~_() { ::mbgl::gl::checkError(#cmd, __FILE__, __LINE__); } } _; return cmd; }())
+#define MBGL_CHECK_ERROR(cmd) ([&]() { struct __MBGL_C_E { inline ~__MBGL_C_E() { ::mbgl::gl::checkError(#cmd, __FILE__, __LINE__); } } __MBGL_C_E; return cmd; }())
#else
#define MBGL_CHECK_ERROR(cmd) (cmd)
#endif
-// GL_KHR_debug / GL_ARB_debug_output
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
-#define GL_DEBUG_SOURCE_API 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION 0x824A
-#define GL_DEBUG_SOURCE_OTHER 0x824B
-#define GL_DEBUG_TYPE_ERROR 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
-#define GL_DEBUG_TYPE_OTHER 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES 0x9145
-#define GL_DEBUG_SEVERITY_HIGH 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
-#define GL_DEBUG_SEVERITY_LOW 0x9148
-#define GL_DEBUG_TYPE_MARKER 0x8268
-#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
-#define GL_DEBUG_TYPE_POP_GROUP 0x826A
-#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
-#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
-#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
-#define GL_BUFFER 0x82E0
-#define GL_SHADER 0x82E1
-#define GL_PROGRAM 0x82E2
-#define GL_QUERY 0x82E3
-#define GL_PROGRAM_PIPELINE 0x82E4
-#define GL_SAMPLER 0x82E6
-#define GL_MAX_LABEL_LENGTH 0x82E8
-#define GL_DEBUG_OUTPUT 0x92E0
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-#define GL_DISPLAY_LIST 0x82E7
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TEXTURE 0x1702
-#define GL_RENDERBUFFER 0x8D41
-#define GL_FRAMEBUFFER 0x8D40
-typedef void (* GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
-typedef void (* PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
-typedef void (* PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
-typedef void (* PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
-typedef GLuint (* PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
-typedef void (* PFNGLGETPOINTERVPROC) (GLenum pname, void **params);
-typedef void (* PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
-typedef void (* PFNGLPOPDEBUGGROUPPROC) (void);
-typedef void (* PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
-typedef void (* PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
-typedef void (* PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
-typedef void (* PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
-extern PFNGLDEBUGMESSAGECONTROLPROC DebugMessageControl;
-extern PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert;
-extern PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback;
-extern PFNGLGETDEBUGMESSAGELOGPROC GetDebugMessageLog;
-extern PFNGLGETPOINTERVPROC GetPointerv;
-extern PFNGLPUSHDEBUGGROUPPROC PushDebugGroup;
-extern PFNGLPOPDEBUGGROUPPROC PopDebugGroup;
-extern PFNGLOBJECTLABELPROC ObjectLabel;
-extern PFNGLGETOBJECTLABELPROC GetObjectLabel;
-extern PFNGLOBJECTPTRLABELPROC ObjectPtrLabel;
-extern PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel;
-void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
-
-// GL_EXT_debug_marker
-typedef void (* PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (* PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
-typedef void (* PFNGLPOPGROUPMARKEREXTPROC) (void);
-extern PFNGLINSERTEVENTMARKEREXTPROC InsertEventMarkerEXT;
-extern PFNGLPUSHGROUPMARKEREXTPROC PushGroupMarkerEXT;
-extern PFNGLPOPGROUPMARKEREXTPROC PopGroupMarkerEXT;
-
-// GL_EXT_debug_label
-#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
-#define GL_PROGRAM_OBJECT_EXT 0x8B40
-#define GL_SHADER_OBJECT_EXT 0x8B48
-#define GL_BUFFER_OBJECT_EXT 0x9151
-#define GL_QUERY_OBJECT_EXT 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
-typedef void (* PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
-typedef void (* PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
-extern PFNGLLABELOBJECTEXTPROC LabelObjectEXT;
-extern PFNGLGETOBJECTLABELEXTPROC GetObjectLabelEXT;
-
-// GL_ARB_vertex_array_object / GL_OES_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-typedef void (* PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (* PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays);
-typedef void (* PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays);
-typedef GLboolean (* PFNGLISVERTEXARRAYPROC) (GLuint array);
-extern PFNGLBINDVERTEXARRAYPROC BindVertexArray;
-extern PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays;
-extern PFNGLGENVERTEXARRAYSPROC GenVertexArrays;
-extern PFNGLISVERTEXARRAYPROC IsVertexArray;
-
-// GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil
-extern bool isPackedDepthStencilSupported;
-#define GL_DEPTH24_STENCIL8 0x88F0
+class ExtensionFunctionBase {
+public:
+ static std::vector<ExtensionFunctionBase*>& functions();
+ typedef std::pair<const char *, const char *> Probe;
+ std::vector<Probe> probes;
+ void (*ptr)();
+};
-// GL_OES_depth24
-extern bool isDepth24Supported;
-#define GL_DEPTH_COMPONENT24 0x81A6
+template <class>
+class ExtensionFunction;
-// Debug group markers, useful for debugging on iOS
-#if defined(DEBUG)
-// static int indent = 0;
-inline void start_group(const std::string &str) {
- if (gl::PushDebugGroup != nullptr) {
- MBGL_CHECK_ERROR(gl::PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, GLsizei(str.size()), str.c_str()));
- } else if (gl::PushGroupMarkerEXT != nullptr) {
- MBGL_CHECK_ERROR(gl::PushGroupMarkerEXT(GLsizei(str.size() + 1), str.c_str()));
+template <class R, class... Args>
+class ExtensionFunction<R (Args...)> : protected ExtensionFunctionBase {
+public:
+ ExtensionFunction(std::initializer_list<Probe> probes_) {
+ probes = probes_;
+ ExtensionFunctionBase::functions().push_back(this);
}
- // fprintf(stderr, "%s%s\n", std::string(indent * 4, ' ').c_str(), str.c_str());
- // indent++;
-}
-inline void end_group() {
- if (gl::PopDebugGroup != nullptr) {
- MBGL_CHECK_ERROR(gl::PopDebugGroup());
- } else if (gl::PopGroupMarkerEXT != nullptr) {
- MBGL_CHECK_ERROR(gl::PopGroupMarkerEXT());
+ explicit operator bool() const {
+ return ptr;
}
- // indent--;
-}
-#else
-inline void start_group(const std::string &) {}
-inline void end_group() {}
-#endif
-struct group {
- inline group(const std::string &str) { start_group(str); }
- ~group() { end_group(); };
+ R operator()(Args... args) const {
+ return (*reinterpret_cast<R (*)(Args...)>(ptr))(std::forward<Args>(args)...);
+ }
};
+using glProc = void (*)();
+void InitializeExtensions(glProc (*getProcAddress)(const char *));
+
}
}
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp
index d50d5ddea4..405b04a49c 100644
--- a/include/mbgl/storage/default_file_source.hpp
+++ b/include/mbgl/storage/default_file_source.hpp
@@ -18,7 +18,6 @@ public:
// FileSource API
Request* request(const Resource&, uv_loop_t*, Callback) override;
void cancel(Request*) override;
- void request(const Resource&, Callback) override;
public:
class Impl;
diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp
index 535c41e819..7c6e578a9a 100644
--- a/include/mbgl/storage/file_source.hpp
+++ b/include/mbgl/storage/file_source.hpp
@@ -29,10 +29,6 @@ public:
// You can only cancel a request from the same thread it was created in.
virtual Request* request(const Resource&, uv_loop_t*, Callback) = 0;
virtual void cancel(Request*) = 0;
-
- // These can be called from any thread. The callback will be invoked in an arbitrary other thread.
- // You cannot cancel these requests.
- virtual void request(const Resource&, Callback) = 0;
};
}
diff --git a/include/mbgl/storage/request.hpp b/include/mbgl/storage/request.hpp
index 5d979a2813..4b75f23f6e 100644
--- a/include/mbgl/storage/request.hpp
+++ b/include/mbgl/storage/request.hpp
@@ -11,8 +11,8 @@
#include <functional>
#include <memory>
-typedef struct uv_async_s uv_async_t;
typedef struct uv_loop_s uv_loop_t;
+namespace uv { class async; }
namespace mbgl {
@@ -37,7 +37,7 @@ private:
void notifyCallback();
private:
- uv_async_t *async = nullptr;
+ std::unique_ptr<uv::async> async;
struct Canceled;
std::unique_ptr<Canceled> canceled;
Callback callback;
diff --git a/include/mbgl/util/constants.hpp b/include/mbgl/util/constants.hpp
index e598806c20..bb5aad2af3 100644
--- a/include/mbgl/util/constants.hpp
+++ b/include/mbgl/util/constants.hpp
@@ -3,6 +3,7 @@
#include <cmath>
#include <string>
+#include <vector>
namespace mbgl {
diff --git a/include/mbgl/util/exclusive.hpp b/include/mbgl/util/exclusive.hpp
new file mode 100644
index 0000000000..bb3395996b
--- /dev/null
+++ b/include/mbgl/util/exclusive.hpp
@@ -0,0 +1,30 @@
+#ifndef MBGL_UTIL_EXCLUSIVE
+#define MBGL_UTIL_EXCLUSIVE
+
+#include <memory>
+#include <mutex>
+
+
+namespace mbgl {
+namespace util {
+
+template <class T>
+class exclusive {
+public:
+ inline exclusive(T* val, std::unique_ptr<std::lock_guard<std::mutex>> mtx) : ptr(val), lock(std::move(mtx)) {}
+
+ inline T* operator->() { return ptr; }
+ inline const T* operator->() const { return ptr; }
+ inline T* operator*() { return ptr; }
+ inline const T* operator*() const { return ptr; }
+
+private:
+ T *ptr;
+ std::unique_ptr<std::lock_guard<std::mutex>> lock;
+};
+
+
+} // end namespace util
+} // end namespace mbgl
+
+#endif
diff --git a/include/mbgl/util/math.hpp b/include/mbgl/util/math.hpp
index 6dea628e93..5fcf3dce80 100644
--- a/include/mbgl/util/math.hpp
+++ b/include/mbgl/util/math.hpp
@@ -100,7 +100,11 @@ inline T mag(const S& a) {
template <typename S>
inline S unit(const S& a) {
- return a * (1 / mag(a));
+ auto magnitude = mag(a);
+ if (magnitude == 0) {
+ return a;
+ }
+ return a * (1 / magnitude);
}
template <typename T>
diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec
index 90257c82d3..67bcc95710 100644
--- a/ios/MapboxGL.podspec
+++ b/ios/MapboxGL.podspec
@@ -1,15 +1,16 @@
Pod::Spec.new do |m|
m.name = 'MapboxGL'
- m.version = '0.2.21'
+ m.version = '0.3.1'
m.summary = 'Open source vector map solution for iOS with full styling capabilities.'
m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.'
- m.homepage = 'https://www.mapbox.com/blog/mapbox-gl/'
+ m.homepage = 'https://www.mapbox.com/mapbox-gl-ios/'
m.license = 'BSD'
m.author = { 'Mapbox' => 'mobile@mapbox.com' }
m.screenshot = 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/screenshot.png'
m.social_media_url = 'https://twitter.com/mapbox'
+ m.documentation_url = 'https://www.mapbox.com/mapbox-gl-ios'
m.source = {
:http => "http://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-gl-ios-#{m.version.to_s}.zip",
diff --git a/ios/README.md b/ios/README.md
index 2af03691e2..4c387f322f 100644
--- a/ios/README.md
+++ b/ios/README.md
@@ -1,68 +1,7 @@
# Mapbox GL for iOS
-Use or edit this project to get access to vector maps (via [Mapbox Vector Tiles](https://www.mapbox.com/blog/vector-tiles)) and dynamic OpenGL-based styling in your iOS apps by using `MGLMapView`.
+An open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.
-![](./screenshot.png)
+For more information, check out [our online overview](https://www.mapbox.com/mapbox-gl-ios/).
-## Installation
-
-Currently in flux. See the parent `mapbox-gl-native` project `README` for details on building this library yourself.
-
-Static and dynamic prebuilt binaries are coming back, as is CocoaPods support.
-
-## Example usage
-
-### Objective-C
-
-```objective-c
-MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)
- accessToken:@"<access token string>"];
-
-[mapView setCenterCoordinate:CLLocationCoordinate2DMake(28.369334, -80.743779)
- zoomLevel:13
- animated:NO];
-
-[mapView useBundledStyleNamed:@"outdoors"];
-
-[self.view addSubview:mapView];
-```
-
-### Swift
-
-```swift
-let mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 400, height: 400),
- accessToken: "<access token string>")
-
-mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 46.049900, longitude: -122.095678),
- zoomLevel: 12,
- animated: false)
-
-mapView.useBundledStyleNamed("outdoors")
-
-view.addSubview(mapView)
-```
-
-## Development
-
-If you'd like to contribute to this project, go up to [Mapbox GL native](https://github.com/mapbox/mapbox-gl-native) and clone the project.
-
-## Testing
-
-Currently in flux and not functioning.
-
-## Requirements
-
- * iOS 7+
- * a sense of adventure
-
-## Styling
-
-See the [online style reference](https://www.mapbox.com/mapbox-gl-style-spec/) for the latest documentation. Contained within the `MapboxGL.bundle` assets are a couple of starter styles in JSON format.
-
-The project will eventually get a programmatic styling API as well.
-
-## Related Projects
-
- * https://github.com/mapbox/mapbox-gl-style-spec
- * https://github.com/mapbox/mapbox-gl-js
- * https://github.com/mapbox/vector-tile-spec
+![](https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/screenshot.png)
diff --git a/ios/app/MBXAppDelegate.m b/ios/app/MBXAppDelegate.m
index 90c552aba0..dc04105083 100644
--- a/ios/app/MBXAppDelegate.m
+++ b/ios/app/MBXAppDelegate.m
@@ -1,8 +1,6 @@
#import "MBXAppDelegate.h"
#import "MBXViewController.h"
#import <mbgl/ios/MapboxGL.h>
-#import <mbgl/ios/MGLAccountManager.h>
-#import <mbgl/ios/MGLMapboxEvents.h>
@implementation MBXAppDelegate
@@ -21,6 +19,9 @@
}
if ( ! accessToken) NSLog(@"No access token set. Mapbox vector tiles won't work.");
+ // Signal To SDK That Opt Out Is In App UI
+// [MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES];
+
// Start Mapbox GL SDK
[MGLAccountManager setAccessToken:accessToken];
@@ -31,26 +32,4 @@
return YES;
}
-/**
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
- // Example of how to resume Metrics Collection
-
- // Reasons for needing to resume:
- // 1. In UIBackground and app starts listening for Location Updates where it previously had not been listening.
- // 2. App is entering foreground where it had called pauseMetricsCollection.
- [MGLMapboxEvents resumeMetricsCollection];
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
- // Example of how to pause Metrics Collection
-
- // Reason for needing to pause:
- // 1. Either entering or already in UIBackground and app stops listening for Location Updates
- // via any CLLocationManager instance it may have.
- [MGLMapboxEvents pauseMetricsCollection];
-}
-*/
-
@end
diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm
index eb77a2ec80..9ccda7ac6d 100644
--- a/ios/app/MBXViewController.mm
+++ b/ios/app/MBXViewController.mm
@@ -83,10 +83,7 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
[self restoreState:nil];
}
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-parameter"
-
-- (void)saveState:(NSNotification *)notification
+- (void)saveState:(__unused NSNotification *)notification
{
if (self.mapView && settings)
{
@@ -101,7 +98,7 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
}
}
-- (void)restoreState:(NSNotification *)notification
+- (void)restoreState:(__unused NSNotification *)notification
{
if (self.mapView && settings) {
settings->load();
@@ -113,8 +110,6 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
}
}
-#pragma clang diagnostic pop
-
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
@@ -277,17 +272,14 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
}
}
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-parameter"
-
#pragma mark - MGLMapViewDelegate
-- (BOOL)mapView:(MGLMapView *)mapView annotationCanShowCallout:(id <MGLAnnotation>)annotation
+- (BOOL)mapView:(__unused MGLMapView *)mapView annotationCanShowCallout:(__unused id <MGLAnnotation>)annotation
{
return YES;
}
-- (void)mapView:(MGLMapView *)mapView didChangeUserTrackingMode:(MGLUserTrackingMode)mode animated:(BOOL)animated
+- (void)mapView:(__unused MGLMapView *)mapView didChangeUserTrackingMode:(MGLUserTrackingMode)mode animated:(__unused BOOL)animated
{
UIImage *newButtonImage;
@@ -310,6 +302,4 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
}];
}
-#pragma clang diagnostic pop
-
@end
diff --git a/ios/app/Settings.bundle/Root.plist b/ios/app/Settings.bundle/Root.plist
index f3a995024e..076f402e1e 100644
--- a/ios/app/Settings.bundle/Root.plist
+++ b/ios/app/Settings.bundle/Root.plist
@@ -4,7 +4,7 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
- <dict>
+ <dict>
<key>Title</key>
<string>Privacy Settings</string>
<key>Type</key>
@@ -16,7 +16,7 @@
<key>DefaultValue</key>
<true/>
<key>Key</key>
- <string>mapbox_metrics_enabled_preference</string>
+ <string>MGLMapboxMetricsEnabled</string>
<key>Title</key>
<string>Mapbox Metrics</string>
<key>Type</key>
diff --git a/ios/app/app-info.plist b/ios/app/app-info.plist
index fd03e73241..85afe3e7a2 100644
--- a/ios/app/app-info.plist
+++ b/ios/app/app-info.plist
@@ -47,5 +47,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
+ <key>MGLMetricsTestServerURL</key>
+ <string>https://cloudfront-staging.tilestream.net</string>
</dict>
</plist>
diff --git a/ios/benchmark/MBXBenchViewController.mm b/ios/benchmark/MBXBenchViewController.mm
index 1876a0c546..dfd3b254a3 100644
--- a/ios/benchmark/MBXBenchViewController.mm
+++ b/ios/benchmark/MBXBenchViewController.mm
@@ -1,12 +1,23 @@
#import "MBXBenchViewController.h"
#import <mbgl/ios/MGLMapView.h>
-#import <mbgl/ios/private/MGLMapView_Private.h>
#include "locations.hpp"
#include <chrono>
+@interface MGLMapView (MBXBenchmarkAdditions)
+
+#pragma mark - Debugging
+
+/** Triggers another render pass even when it is not necessary. */
+- (void)invalidate;
+
+/** Returns whether the map view is currently loading or processing any assets required to render the map */
+- (BOOL)isFullyLoaded;
+
+@end
+
@interface MBXBenchViewController () <MGLMapViewDelegate>
@property (nonatomic) MGLMapView *mapView;
@@ -77,11 +88,8 @@ static const int benchmarkDuration = 200; // frames
}
}
-- (void)mapViewDidFinishRenderingMap:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered
+- (void)mapViewDidFinishRenderingMap:(MGLMapView *)mapView fullyRendered:(__unused BOOL)fullyRendered
{
- (void)mapView;
- (void)fullyRendered;
-
if (state == State::Benchmarking)
{
frames++;
diff --git a/ios/benchmark/fo/benchmark-ios.gypi b/ios/benchmark/fo/benchmark-ios.gypi
index ff004add53..0a3440d5cd 100644
--- a/ios/benchmark/fo/benchmark-ios.gypi
+++ b/ios/benchmark/fo/benchmark-ios.gypi
@@ -26,7 +26,6 @@
'sources': [
'./main.m',
- '../../include/mbgl/ios/MGLMapView_private.h',
'./MBXBenchAppDelegate.h',
'./MBXBenchAppDelegate.m',
'./MBXBenchViewController.h',
diff --git a/ios/docs/install_docs.sh b/ios/docs/install_docs.sh
index df1d366e6a..7d4bf279f3 100755
--- a/ios/docs/install_docs.sh
+++ b/ios/docs/install_docs.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if [ -z `which appledoc` ]; then
echo "Unable to find appledoc. Consider installing it from source or Homebrew."
@@ -8,14 +8,21 @@ fi
OUTPUT="/tmp/`uuidgen`"
VERSION=$( git tag -l ios\* --sort -v:refname | sed -n '1p' | sed 's/ios-v//' )
-echo "Creating new docs for $VERSION..."
+echo "Creating new docs for ${VERSION}..."
echo
+README="/tmp/GL-README.md"
+cat ../README.md > ${README}
+echo >> ${README}
+echo -n "#" >> ${README}
+cat ../../CHANGELOG.md >> ${README}
+
appledoc \
- --output $OUTPUT \
- --project-name "Mapbox GL for iOS $VERSION" \
+ --output ${OUTPUT} \
+ --project-name "Mapbox GL for iOS ${VERSION}" \
--project-company Mapbox \
--create-docset \
--company-id com.mapbox \
--ignore ../../include/mbgl/ios/private \
+ --index-desc ${README} \
../../include/mbgl/ios
diff --git a/ios/docs/remove_docs.sh b/ios/docs/remove_docs.sh
index 09e2c1d399..747ca0a3ae 100755
--- a/ios/docs/remove_docs.sh
+++ b/ios/docs/remove_docs.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
echo
echo "Removing docs from ~/Library/Developer/Shared/Documentation/DocSets..."
diff --git a/linux/main.cpp b/linux/main.cpp
index 738bbfb0aa..d279e9d8fe 100644
--- a/linux/main.cpp
+++ b/linux/main.cpp
@@ -1,4 +1,5 @@
#include <mbgl/mbgl.hpp>
+#include "../platform/default/default_styles.hpp"
#include <mbgl/util/std.hpp>
#include <mbgl/util/uv.hpp>
#include <mbgl/platform/log.hpp>
@@ -13,14 +14,16 @@
#include <fstream>
#include <sstream>
+namespace {
std::unique_ptr<GLFWView> view;
+}
+
void quit_handler(int) {
if (view) {
mbgl::Log::Info(mbgl::Event::Setup, "waiting for quit...");
- glfwSetWindowShouldClose(view->window, true);
- glfwPostEmptyEvent();
+ view->setShouldClose();
} else {
exit(0);
}
@@ -75,6 +78,20 @@ int main(int argc, char *argv[]) {
map.setBearing(settings.bearing);
map.setDebug(settings.debug);
+ view->setChangeStyleCallback([&map] () {
+ static uint8_t currentStyleIndex;
+
+ if (++currentStyleIndex == mbgl::util::defaultStyles.size()) {
+ currentStyleIndex = 0;
+ }
+
+ const auto& newStyle = mbgl::util::defaultStyles[currentStyleIndex];
+ map.setStyleURL(newStyle.first);
+ view->setWindowTitle(newStyle.second);
+
+ mbgl::Log::Info(mbgl::Event::Setup, std::string("Changed style to: ") + newStyle.first);
+ });
+
// Set access token if present
const char *token = getenv("MAPBOX_ACCESS_TOKEN");
if (token == nullptr) {
@@ -85,7 +102,9 @@ int main(int argc, char *argv[]) {
// Load style
if (style.empty()) {
- style = std::string("asset://") + std::string("styles/bright-v7.json");
+ const auto& newStyle = mbgl::util::defaultStyles.front();
+ style = newStyle.first;
+ view->setWindowTitle(newStyle.second);
}
map.setStyleURL(style);
diff --git a/linux/mapboxgl-app.gypi b/linux/mapboxgl-app.gypi
index 433a061e43..35ca322e29 100644
--- a/linux/mapboxgl-app.gypi
+++ b/linux/mapboxgl-app.gypi
@@ -13,15 +13,18 @@
'../mbgl.gyp:http-<(http_lib)',
'../mbgl.gyp:asset-<(asset_lib)',
'../mbgl.gyp:cache-<(cache_lib)',
- '../mbgl.gyp:bundle_styles',
+ '../mbgl.gyp:copy_styles',
'../mbgl.gyp:copy_certificate_bundle',
],
'sources': [
'main.cpp',
'../platform/default/settings_json.cpp',
+ '../platform/default/glfw_view.hpp',
'../platform/default/glfw_view.cpp',
'../platform/default/log_stderr.cpp',
+ '../platform/default/default_styles.hpp',
+ '../platform/default/default_styles.cpp',
],
'variables' : {
diff --git a/macosx/main.mm b/macosx/main.mm
index 28d78e442a..e5a711753f 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -1,4 +1,5 @@
#include <mbgl/platform/log.hpp>
+#include "../platform/default/default_styles.hpp"
#include <mbgl/platform/platform.hpp>
#include <mbgl/platform/darwin/settings_nsuserdefaults.hpp>
#include <mbgl/platform/darwin/Reachability.h>
@@ -125,13 +126,29 @@ int main() {
map.setBearing(settings.bearing);
map.setDebug(settings.debug);
+ view.setChangeStyleCallback([&map, &view] () {
+ static uint8_t currentStyleIndex;
+
+ if (++currentStyleIndex == mbgl::util::defaultStyles.size()) {
+ currentStyleIndex = 0;
+ }
+
+ const auto& newStyle = mbgl::util::defaultStyles[currentStyleIndex];
+ map.setStyleURL(newStyle.first);
+ view.setWindowTitle(newStyle.second);
+
+ mbgl::Log::Info(mbgl::Event::Setup, std::string("Changed style to: ") + newStyle.first);
+ });
+
// Set access token if present
NSString *accessToken = [[NSProcessInfo processInfo] environment][@"MAPBOX_ACCESS_TOKEN"];
if (!accessToken) mbgl::Log::Warning(mbgl::Event::Setup, "No access token set. Mapbox vector tiles won't work.");
if (accessToken) map.setAccessToken([accessToken cStringUsingEncoding:[NSString defaultCStringEncoding]]);
// Load style
- map.setStyleURL("asset://styles/bright-v7.json");
+ const auto& newStyle = mbgl::util::defaultStyles.front();
+ map.setStyleURL(newStyle.first);
+ view.setWindowTitle(newStyle.second);
view.run();
diff --git a/macosx/mapboxgl-app.gypi b/macosx/mapboxgl-app.gypi
index 3817954042..c56bca659f 100644
--- a/macosx/mapboxgl-app.gypi
+++ b/macosx/mapboxgl-app.gypi
@@ -28,6 +28,8 @@
'../platform/darwin/reachability.m',
'../platform/default/glfw_view.hpp',
'../platform/default/glfw_view.cpp',
+ '../platform/default/default_styles.hpp',
+ '../platform/default/default_styles.cpp',
],
'variables' : {
diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm
index 509e158afd..ad16a69acf 100644
--- a/platform/darwin/http_request_nsurl.mm
+++ b/platform/darwin/http_request_nsurl.mm
@@ -91,6 +91,7 @@ public:
NSURLSession *session = nil;
NSString *userAgent = nil;
+ NSInteger accountType = 0;
};
HTTPNSURLContext::HTTPNSURLContext(uv_loop_t *loop_) : HTTPContext(loop_) {
@@ -107,6 +108,8 @@ HTTPNSURLContext::HTTPNSURLContext(uv_loop_t *loop_) : HTTPContext(loop_) {
// Write user agent string
userAgent = @"MapboxGL";
+
+ accountType = [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"];
}
}
@@ -153,18 +156,15 @@ void HTTPRequest::start() {
@autoreleasepool {
- NSMutableString *url = [[NSMutableString alloc] initWithString:@(resource.url.c_str())];
- if ([[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) {
- if ([url rangeOfString:@"?"].location == NSNotFound) {
- [url appendString:@"?"];
- } else {
- [url appendString:@"&"];
- }
- [url appendString:@"events=true"];
+ NSURL *url = [NSURL URLWithString:@(resource.url.c_str())];
+ if (context->accountType == 0 &&
+ ([url.host isEqualToString:@"mapbox.com"] || [url.host hasSuffix:@".mapbox.com"])) {
+ NSString *absoluteString = [url.absoluteString stringByAppendingFormat:
+ (url.query ? @"&%@" : @"?%@"), @"events=true"];
+ url = [NSURL URLWithString:absoluteString];
}
- NSMutableURLRequest *req = [[NSMutableURLRequest alloc]
- initWithURL:[NSURL URLWithString:url]];
+ NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
if (existingResponse) {
if (!existingResponse->etag.empty()) {
[req addValue:@(existingResponse->etag.c_str()) forHTTPHeaderField:@"If-None-Match"];
@@ -179,7 +179,6 @@ void HTTPRequest::start() {
task = [context->session dataTaskWithRequest:req
completionHandler:^(NSData *data, NSURLResponse *res,
NSError *error) { handleResult(data, res, error); }];
- [req release];
[task retain];
[task resume];
}
diff --git a/platform/default/default_styles.cpp b/platform/default/default_styles.cpp
new file mode 100644
index 0000000000..a631008a4b
--- /dev/null
+++ b/platform/default/default_styles.cpp
@@ -0,0 +1,14 @@
+#include "default_styles.hpp"
+
+namespace mbgl {
+namespace util {
+
+const std::vector<std::pair<std::string, std::string>> defaultStyles = {
+ { "asset://styles/mapbox-streets-v7.json", "Mapbox Streets" },
+ { "asset://styles/emerald-v7.json", "Emerald" },
+ { "asset://styles/light-v7.json", "Light" },
+ { "asset://styles/dark-v7.json", "Dark" }
+};
+
+} // end namespace util
+} // end namespace mbgl
diff --git a/platform/default/default_styles.hpp b/platform/default/default_styles.hpp
new file mode 100644
index 0000000000..dc10009305
--- /dev/null
+++ b/platform/default/default_styles.hpp
@@ -0,0 +1,17 @@
+#ifndef MBGL_PLATFORM_DEFAULT_STYLES
+#define MBGL_PLATFORM_DEFAULT_STYLES
+
+#include <vector>
+#include <string>
+
+namespace mbgl {
+namespace util {
+
+// A list of default styles, with the first string being the URL
+// and the second being the user-visible name.
+extern const std::vector<std::pair<std::string, std::string>> defaultStyles;
+
+} // end namespace util
+} // end namespace mbgl
+
+#endif
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index 56aeaf30a3..8265bb8bb6 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -4,9 +4,6 @@
#include <mbgl/util/gl_helper.hpp>
#include <cassert>
-#include <pthread.h>
-
-pthread_once_t loadGLExtensions = PTHREAD_ONCE_INIT;
void glfwError(int error, const char *description) {
mbgl::Log::Error(mbgl::Event::OpenGL, "GLFW error (%i): %s", error, description);
@@ -14,10 +11,6 @@ void glfwError(int error, const char *description) {
}
GLFWView::GLFWView(bool fullscreen_) : fullscreen(fullscreen_) {
-#ifdef NVIDIA
- glDiscardFramebufferEXT = reinterpret_cast<PFNGLDISCARDFRAMEBUFFEREXTPROC>(glfwGetProcAddress("glDiscardFramebufferEXT"));
-#endif
-
glfwSetErrorCallback(glfwError);
if (!glfwInit()) {
@@ -65,88 +58,7 @@ GLFWView::GLFWView(bool fullscreen_) : fullscreen(fullscreen_) {
glfwSetScrollCallback(window, onScroll);
glfwSetKeyCallback(window, onKey);
- pthread_once(&loadGLExtensions, [] {
- const std::string extensions = reinterpret_cast<const char *>(MBGL_CHECK_ERROR(glGetString(GL_EXTENSIONS)));
- using namespace mbgl;
-
- if (extensions.find("GL_KHR_debug") != std::string::npos) {
- gl::DebugMessageControl = reinterpret_cast<gl::PFNGLDEBUGMESSAGECONTROLPROC>(glfwGetProcAddress("glDebugMessageControl"));
- gl::DebugMessageInsert = reinterpret_cast<gl::PFNGLDEBUGMESSAGEINSERTPROC>(glfwGetProcAddress("glDebugMessageInsert"));
- gl::DebugMessageCallback = reinterpret_cast<gl::PFNGLDEBUGMESSAGECALLBACKPROC>(glfwGetProcAddress("glDebugMessageCallback"));
- gl::GetDebugMessageLog = reinterpret_cast<gl::PFNGLGETDEBUGMESSAGELOGPROC>(glfwGetProcAddress("glGetDebugMessageLog"));
- gl::GetPointerv = reinterpret_cast<gl::PFNGLGETPOINTERVPROC>(glfwGetProcAddress("glGetPointerv"));
- gl::PushDebugGroup = reinterpret_cast<gl::PFNGLPUSHDEBUGGROUPPROC>(glfwGetProcAddress("glPushDebugGroup"));
- gl::PopDebugGroup = reinterpret_cast<gl::PFNGLPOPDEBUGGROUPPROC>(glfwGetProcAddress("glPopDebugGroup"));
- gl::ObjectLabel = reinterpret_cast<gl::PFNGLOBJECTLABELPROC>(glfwGetProcAddress("glObjectLabel"));
- gl::GetObjectLabel = reinterpret_cast<gl::PFNGLGETOBJECTLABELPROC>(glfwGetProcAddress("glGetObjectLabel"));
- gl::ObjectPtrLabel = reinterpret_cast<gl::PFNGLOBJECTPTRLABELPROC>(glfwGetProcAddress("glObjectPtrLabel"));
- gl::GetObjectPtrLabel = reinterpret_cast<gl::PFNGLGETOBJECTPTRLABELPROC>(glfwGetProcAddress("glGetObjectPtrLabel"));
- assert(gl::DebugMessageControl != nullptr);
- assert(gl::DebugMessageInsert != nullptr);
- assert(gl::DebugMessageCallback != nullptr);
- assert(gl::GetDebugMessageLog != nullptr);
- assert(gl::GetPointerv != nullptr);
- assert(gl::PushDebugGroup != nullptr);
- assert(gl::PopDebugGroup != nullptr);
- assert(gl::ObjectLabel != nullptr);
- assert(gl::GetObjectLabel != nullptr);
- assert(gl::ObjectPtrLabel != nullptr);
- assert(gl::GetObjectPtrLabel != nullptr);
- } else {
- if (extensions.find("GL_ARB_debug_output") != std::string::npos) {
- gl::DebugMessageControl = reinterpret_cast<gl::PFNGLDEBUGMESSAGECONTROLPROC>(glfwGetProcAddress("glDebugMessageControlARB"));
- gl::DebugMessageInsert = reinterpret_cast<gl::PFNGLDEBUGMESSAGEINSERTPROC>(glfwGetProcAddress("glDebugMessageInsertARB"));
- gl::DebugMessageCallback = reinterpret_cast<gl::PFNGLDEBUGMESSAGECALLBACKPROC>(glfwGetProcAddress("glDebugMessageCallbackARB"));
- gl::GetDebugMessageLog = reinterpret_cast<gl::PFNGLGETDEBUGMESSAGELOGPROC>(glfwGetProcAddress("glGetDebugMessageLogARB"));
- gl::GetPointerv = reinterpret_cast<gl::PFNGLGETPOINTERVPROC>(glfwGetProcAddress("glGetPointerv"));
- assert(gl::DebugMessageControl != nullptr);
- assert(gl::DebugMessageInsert != nullptr);
- assert(gl::DebugMessageCallback != nullptr);
- assert(gl::GetDebugMessageLog != nullptr);
- assert(gl::GetPointerv != nullptr);
- }
-
- if (extensions.find("GL_EXT_debug_marker") != std::string::npos) {
- gl::InsertEventMarkerEXT = reinterpret_cast<gl::PFNGLINSERTEVENTMARKEREXTPROC>(glfwGetProcAddress("glInsertEventMarkerEXT"));
- gl::PushGroupMarkerEXT = reinterpret_cast<gl::PFNGLPUSHGROUPMARKEREXTPROC>(glfwGetProcAddress("glPushGroupMarkerEXT"));
- gl::PopGroupMarkerEXT = reinterpret_cast<gl::PFNGLPOPGROUPMARKEREXTPROC>(glfwGetProcAddress("glPopGroupMarkerEXT"));
- assert(gl::InsertEventMarkerEXT != nullptr);
- assert(gl::PushGroupMarkerEXT != nullptr);
- assert(gl::PopGroupMarkerEXT != nullptr);
- }
-
- if (extensions.find("GL_EXT_debug_label") != std::string::npos) {
- gl::LabelObjectEXT = reinterpret_cast<gl::PFNGLLABELOBJECTEXTPROC>(glfwGetProcAddress("glLabelObjectEXT"));
- gl::GetObjectLabelEXT = reinterpret_cast<gl::PFNGLGETOBJECTLABELEXTPROC>(glfwGetProcAddress("glGetObjectLabelEXT"));
- assert(gl::LabelObjectEXT != nullptr);
- assert(gl::GetObjectLabelEXT != nullptr);
- }
- }
-
- if (extensions.find("GL_ARB_vertex_array_object") != std::string::npos) {
- gl::BindVertexArray = reinterpret_cast<gl::PFNGLBINDVERTEXARRAYPROC>(glfwGetProcAddress("glBindVertexArray"));
- gl::DeleteVertexArrays = reinterpret_cast<gl::PFNGLDELETEVERTEXARRAYSPROC>(glfwGetProcAddress("glDeleteVertexArrays"));
- gl::GenVertexArrays = reinterpret_cast<gl::PFNGLGENVERTEXARRAYSPROC>(glfwGetProcAddress("glGenVertexArrays"));
- gl::IsVertexArray = reinterpret_cast<gl::PFNGLISVERTEXARRAYPROC>(glfwGetProcAddress("glIsVertexArray"));
- assert(gl::BindVertexArray != nullptr);
- assert(gl::DeleteVertexArrays != nullptr);
- assert(gl::GenVertexArrays != nullptr);
- assert(gl::IsVertexArray != nullptr);
- } else if (extensions.find("GL_APPLE_vertex_array_object") != std::string::npos) {
- gl::BindVertexArray = reinterpret_cast<gl::PFNGLBINDVERTEXARRAYPROC>(glfwGetProcAddress("glBindVertexArrayAPPLE"));
- gl::DeleteVertexArrays = reinterpret_cast<gl::PFNGLDELETEVERTEXARRAYSPROC>(glfwGetProcAddress("glDeleteVertexArraysAPPLE"));
- gl::GenVertexArrays = reinterpret_cast<gl::PFNGLGENVERTEXARRAYSPROC>(glfwGetProcAddress("glGenVertexArraysAPPLE"));
- gl::IsVertexArray = reinterpret_cast<gl::PFNGLISVERTEXARRAYPROC>(glfwGetProcAddress("glIsVertexArrayAPPLE"));
- assert(gl::BindVertexArray != nullptr);
- assert(gl::DeleteVertexArrays != nullptr);
- assert(gl::GenVertexArrays != nullptr);
- assert(gl::IsVertexArray != nullptr);
- }
-
- // Require packed depth stencil
- gl::isPackedDepthStencilSupported = true;
- gl::isDepth24Supported = true;
- });
+ mbgl::gl::InitializeExtensions(glfwGetProcAddress);
glfwMakeContextCurrent(nullptr);
}
@@ -179,6 +91,10 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
if (!mods)
view->map->resetPosition();
break;
+ case GLFW_KEY_S:
+ if (view->changeStyleCallback)
+ view->changeStyleCallback();
+ break;
case GLFW_KEY_R:
if (!mods) {
view->map->setDefaultTransitionDuration(std::chrono::milliseconds(300));
@@ -306,6 +222,19 @@ void GLFWView::fps() {
}
}
+void GLFWView::setChangeStyleCallback(std::function<void()> callback) {
+ changeStyleCallback = callback;
+}
+
+void GLFWView::setShouldClose() {
+ glfwSetWindowShouldClose(window, true);
+ glfwPostEmptyEvent();
+}
+
+void GLFWView::setWindowTitle(const std::string& title) {
+ glfwSetWindowTitle(window, (std::string { "Mapbox GL: " } + title).c_str());
+}
+
namespace mbgl {
namespace platform {
diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp
index 35c796e923..aa07706d84 100644
--- a/platform/default/headless_view.cpp
+++ b/platform/default/headless_view.cpp
@@ -13,26 +13,8 @@
#include <cstring>
#include <cassert>
-pthread_once_t loadGLExtensions = PTHREAD_ONCE_INIT;
-
#ifdef MBGL_USE_CGL
#include <CoreFoundation/CoreFoundation.h>
-
-typedef void (* CGLProc)(void);
-CGLProc CGLGetProcAddress(const char *proc) {
- static CFBundleRef framework = nullptr;
- if (!framework) {
- framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
- if (!framework) {
- throw std::runtime_error("Failed to load OpenGL framework.");
- }
- }
-
- CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, proc, kCFStringEncodingASCII);
- CGLProc symbol = reinterpret_cast<CGLProc>(CFBundleGetFunctionPointerForName(framework, name));
- CFRelease(name);
- return symbol;
-}
#elif MBGL_USE_GLX
#include <GL/glx.h>
#endif
@@ -61,43 +43,26 @@ void HeadlessView::loadExtensions() {
return;
}
- pthread_once(&loadGLExtensions, [] {
- const char *extensionPtr = reinterpret_cast<const char *>(MBGL_CHECK_ERROR(glGetString(GL_EXTENSIONS)));
-
- if (!extensionPtr) {
- return;
- }
- const std::string extensions = extensionPtr;
-
#ifdef MBGL_USE_CGL
- if (extensions.find("GL_APPLE_vertex_array_object") != std::string::npos) {
- gl::BindVertexArray = reinterpret_cast<gl::PFNGLBINDVERTEXARRAYPROC>(CGLGetProcAddress("glBindVertexArrayAPPLE"));
- gl::DeleteVertexArrays = reinterpret_cast<gl::PFNGLDELETEVERTEXARRAYSPROC>(CGLGetProcAddress("glDeleteVertexArraysAPPLE"));
- gl::GenVertexArrays = reinterpret_cast<gl::PFNGLGENVERTEXARRAYSPROC>(CGLGetProcAddress("glGenVertexArraysAPPLE"));
- gl::IsVertexArray = reinterpret_cast<gl::PFNGLISVERTEXARRAYPROC>(CGLGetProcAddress("glIsVertexArrayAPPLE"));
- assert(gl::BindVertexArray != nullptr);
- assert(gl::DeleteVertexArrays != nullptr);
- assert(gl::GenVertexArrays != nullptr);
- assert(gl::IsVertexArray != nullptr);
+ gl::InitializeExtensions([](const char * name) {
+ static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
+ if (!framework) {
+ throw std::runtime_error("Failed to load OpenGL framework.");
}
+
+ CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII);
+ void* symbol = CFBundleGetFunctionPointerForName(framework, str);
+ CFRelease(str);
+
+ return reinterpret_cast<gl::glProc>(symbol);
+ });
#endif
+
#ifdef MBGL_USE_GLX
- if (extensions.find("GL_ARB_vertex_array_object") != std::string::npos) {
- gl::BindVertexArray = reinterpret_cast<gl::PFNGLBINDVERTEXARRAYPROC>(glXGetProcAddress((const GLubyte *)"glBindVertexArray"));
- gl::DeleteVertexArrays = reinterpret_cast<gl::PFNGLDELETEVERTEXARRAYSPROC>(glXGetProcAddress((const GLubyte *)"glDeleteVertexArrays"));
- gl::GenVertexArrays = reinterpret_cast<gl::PFNGLGENVERTEXARRAYSPROC>(glXGetProcAddress((const GLubyte *)"glGenVertexArrays"));
- gl::IsVertexArray = reinterpret_cast<gl::PFNGLISVERTEXARRAYPROC>(glXGetProcAddress((const GLubyte *)"glIsVertexArray"));
- assert(gl::BindVertexArray != nullptr);
- assert(gl::DeleteVertexArrays != nullptr);
- assert(gl::GenVertexArrays != nullptr);
- assert(gl::IsVertexArray != nullptr);
- }
-#endif
+ gl::InitializeExtensions([](const char * name) {
+ return glXGetProcAddress(reinterpret_cast<const GLubyte *>(name));
});
-
- // HeadlessView requires packed depth stencil
- gl::isPackedDepthStencilSupported = true;
- gl::isDepth24Supported = true;
+#endif
extensionsLoaded = true;
}
diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp
index 91fe007bcf..4f8596a7b0 100644
--- a/platform/default/png_reader.cpp
+++ b/platform/default/png_reader.cpp
@@ -157,7 +157,7 @@ void PngReader<T>::read(unsigned x0, unsigned y0, unsigned w, unsigned h, char *
double gamma;
if (png_get_gAMA(png_ptr, info_ptr, &gamma))
png_set_gamma(png_ptr, 2.2, gamma);
- png_set_alpha_mode(png_ptr, PNG_ALPHA_PREMULTIPLIED, 2.2);
+ png_set_alpha_mode(png_ptr, PNG_ALPHA_PREMULTIPLIED, PNG_GAMMA_LINEAR);
if (x0 == 0 && y0 == 0 && w >= width_ && h >= height_)
{
diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m
index b1a80fd6a7..a49433777d 100644
--- a/platform/ios/MGLAccountManager.m
+++ b/platform/ios/MGLAccountManager.m
@@ -1,11 +1,12 @@
#import <Foundation/Foundation.h>
#import "MGLAccountManager.h"
-#import "NSProcessInfo+MGLAdditions.h"
#import "MGLMapboxEvents.h"
+#import "NSProcessInfo+MGLAdditions.h"
@interface MGLAccountManager()
+@property (atomic) BOOL mapboxMetricsEnabledSettingShownInApp;
@property (atomic) NSString *accessToken;
@end
@@ -13,40 +14,49 @@
@implementation MGLAccountManager
-static MGLAccountManager *_sharedManager;
-
// Can be called from any thread.
//
-+ (instancetype) sharedInstance {
++ (instancetype) sharedManager {
+ if (NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
+ return nil;
+ }
static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
- void (^setupBlock)() = ^{
- _sharedManager = [[self alloc] init];
- };
- if ( ! [[NSThread currentThread] isMainThread]) {
- dispatch_sync(dispatch_get_main_queue(), ^{
- setupBlock();
- });
- }
- else {
- setupBlock();
- }
- }
- });
+ static MGLAccountManager *_sharedManager;
+ void (^setupBlock)() = ^{
+ dispatch_once(&onceToken, ^{
+ _sharedManager = [[self alloc] init];
+ _sharedManager.mapboxMetricsEnabledSettingShownInApp = NO;
+ });
+ };
+ if ( ! [[NSThread currentThread] isMainThread]) {
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ setupBlock();
+ });
+ }
+ else {
+ setupBlock();
+ }
return _sharedManager;
}
++ (void) setMapboxMetricsEnabledSettingShownInApp:(BOOL)shown {
+ [MGLAccountManager sharedManager].mapboxMetricsEnabledSettingShownInApp = shown;
+}
+
++ (BOOL) mapboxMetricsEnabledSettingShownInApp {
+ return [MGLAccountManager sharedManager].mapboxMetricsEnabledSettingShownInApp;
+}
+
+ (void) setAccessToken:(NSString *) accessToken {
- [[MGLAccountManager sharedInstance] setAccessToken:accessToken];
+ [[MGLAccountManager sharedManager] setAccessToken:accessToken];
// Update MGLMapboxEvents
// NOTE: This is (likely) the initial setup of MGLMapboxEvents
- [MGLMapboxEvents setToken:accessToken];
+ [MGLMapboxEvents sharedManager];
}
+ (NSString *) accessToken {
- return [MGLAccountManager sharedInstance].accessToken;
+ return [MGLAccountManager sharedManager].accessToken;
}
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 53c7526602..5d14107518 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -15,27 +15,23 @@
#include <mbgl/util/geo.hpp>
#include <mbgl/util/constants.hpp>
-#import "MGLTypes.h"
+#import "MapboxGL.h"
+
#import "NSBundle+MGLAdditions.h"
#import "NSString+MGLAdditions.h"
#import "NSProcessInfo+MGLAdditions.h"
#import "NSException+MGLAdditions.h"
-#import "MGLAnnotation.h"
#import "MGLUserLocationAnnotationView.h"
#import "MGLUserLocation_Private.h"
#import "MGLFileCache.h"
+#import "MGLMapboxEvents.h"
#import "SMCalloutView.h"
-#import "MGLMapboxEvents.h"
-#import "MapboxGL.h"
-
#import <algorithm>
class MBGLView;
-static dispatch_once_t loadGLExtensions;
-
NSString *const MGLDefaultStyleName = @"mapbox-streets";
NSString *const MGLStyleVersion = @"7";
NSString *const MGLDefaultStyleMarkerSymbolName = @"default_marker";
@@ -54,7 +50,7 @@ static NSURL *MGLURLForBundledStyleNamed(NSString *styleName)
#pragma mark - Private -
-@interface MGLMapView () <UIGestureRecognizerDelegate, GLKViewDelegate, CLLocationManagerDelegate>
+@interface MGLMapView () <UIGestureRecognizerDelegate, GLKViewDelegate, CLLocationManagerDelegate, UIActionSheetDelegate>
@property (nonatomic) EAGLContext *context;
@property (nonatomic) GLKView *glView;
@@ -63,6 +59,7 @@ static NSURL *MGLURLForBundledStyleNamed(NSString *styleName)
@property (nonatomic) UIImageView *compass;
@property (nonatomic) UIImageView *logoBug;
@property (nonatomic) UIButton *attributionButton;
+@property (nonatomic) UIActionSheet *attributionSheet;
@property (nonatomic) UIPanGestureRecognizer *pan;
@property (nonatomic) UIPinchGestureRecognizer *pinch;
@property (nonatomic) UIRotationGestureRecognizer *rotate;
@@ -78,6 +75,7 @@ static NSURL *MGLURLForBundledStyleNamed(NSString *styleName)
@property (nonatomic) CGFloat scale;
@property (nonatomic) CGFloat angle;
@property (nonatomic) CGFloat quickZoomStart;
+@property (nonatomic, getter=isDormant) BOOL dormant;
@property (nonatomic, getter=isAnimatingGesture) BOOL animatingGesture;
@property (nonatomic, readonly, getter=isRotationAllowed) BOOL rotationAllowed;
@@ -156,7 +154,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
- (void)setAccessToken:(NSString *)accessToken
{
_mbglMap->setAccessToken(accessToken ? (std::string)[accessToken UTF8String] : "");
- [MGLMapboxEvents setToken:accessToken.mgl_stringOrNilIfEmpty];
+ [MGLAccountManager setAccessToken:accessToken.mgl_stringOrNilIfEmpty];
}
+ (NSSet *)keyPathsForValuesAffectingStyleURL
@@ -173,27 +171,27 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
- (void)setStyleURL:(NSURL *)styleURL
{
if (_isTargetingInterfaceBuilder) return;
-
+
if ( ! styleURL)
{
styleURL = MGLURLForBundledStyleNamed([NSString stringWithFormat:@"%@-v%@",
MGLDefaultStyleName.lowercaseString,
MGLStyleVersion]);
}
-
+
if ( ! [styleURL scheme])
{
// Assume a relative path into the developer’s bundle.
styleURL = [[NSBundle mainBundle] URLForResource:styleURL.path withExtension:nil];
}
-
+
_mbglMap->setStyleURL([[styleURL absoluteString] UTF8String]);
}
- (BOOL)commonInit
{
_isTargetingInterfaceBuilder = NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent;
-
+
// create context
//
_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
@@ -208,14 +206,6 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
// setup accessibility
//
self.accessibilityLabel = @"Map";
-
- // metrics: initial setup
- NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
- NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
- NSString *appBuildNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
- if (appName != nil) [MGLMapboxEvents setAppName:appName];
- if (appVersion != nil) [MGLMapboxEvents setAppVersion:appVersion];
- if (appBuildNumber != nil) [MGLMapboxEvents setAppBuildNumber:appBuildNumber];
// create GL view
//
@@ -232,38 +222,23 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
[self insertSubview:_glView atIndex:0];
_glView.contentMode = UIViewContentModeCenter;
-
+
self.backgroundColor = [UIColor clearColor];
self.clipsToBounds = YES;
// load extensions
//
- dispatch_once(&loadGLExtensions, ^
- {
- const std::string extensions = (char *)glGetString(GL_EXTENSIONS);
-
- using namespace mbgl;
-
- if (extensions.find("GL_OES_vertex_array_object") != std::string::npos) {
- gl::BindVertexArray = glBindVertexArrayOES;
- gl::DeleteVertexArrays = glDeleteVertexArraysOES;
- gl::GenVertexArrays = glGenVertexArraysOES;
- gl::IsVertexArray = glIsVertexArrayOES;
+ mbgl::gl::InitializeExtensions([](const char * name) {
+ static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles"));
+ if (!framework) {
+ throw std::runtime_error("Failed to load OpenGL framework.");
}
- if (extensions.find("GL_EXT_debug_marker") != std::string::npos) {
- gl::InsertEventMarkerEXT = glInsertEventMarkerEXT;
- gl::PushGroupMarkerEXT = glPushGroupMarkerEXT;
- gl::PopGroupMarkerEXT = glPopGroupMarkerEXT;
- }
-
- if (extensions.find("GL_OES_packed_depth_stencil") != std::string::npos) {
- gl::isPackedDepthStencilSupported = YES;
- }
+ CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII);
+ void* symbol = CFBundleGetFunctionPointerForName(framework, str);
+ CFRelease(str);
- if (extensions.find("GL_OES_depth24") != std::string::npos) {
- gl::isDepth24Supported = YES;
- }
+ return reinterpret_cast<mbgl::gl::glProc>(symbol);
});
// setup mbgl map
@@ -272,7 +247,10 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
_mbglFileSource = new mbgl::DefaultFileSource([MGLFileCache obtainSharedCacheWithObject:self]);
// Start paused on the IB canvas
- _mbglMap = new mbgl::Map(*_mbglView, *_mbglFileSource, mbgl::MapMode::Continuous, _isTargetingInterfaceBuilder);
+ _mbglMap = new mbgl::Map(*_mbglView, *_mbglFileSource, mbgl::MapMode::Continuous);
+ if (_isTargetingInterfaceBuilder) {
+ _mbglMap->pause();
+ }
_mbglMap->resize(self.bounds.size.width, self.bounds.size.height, _glView.contentScaleFactor);
// Notify map object when network reachability status changes.
@@ -302,9 +280,19 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
//
_attributionButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
_attributionButton.accessibilityLabel = @"Attribution info";
- [_attributionButton addTarget:self action:@selector(showAttribution:) forControlEvents:UIControlEventTouchUpInside];
+ [_attributionButton addTarget:self action:@selector(showAttribution) forControlEvents:UIControlEventTouchUpInside];
_attributionButton.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_attributionButton];
+
+ _attributionSheet = [[UIActionSheet alloc] initWithTitle:@"Mapbox GL for iOS"
+ delegate:self
+ cancelButtonTitle:@"Cancel"
+ destructiveButtonTitle:nil
+ otherButtonTitles:
+ @"© Mapbox",
+ @"© OpenStreetMap",
+ @"Improve This Map",
+ nil];
// setup compass
//
@@ -361,8 +349,10 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
// observe app activity
//
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sleepGL:) name:UIApplicationWillResignActiveNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sleepGL:) name:UIApplicationDidEnterBackgroundNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wakeGL:) name:UIApplicationWillEnterForegroundNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wakeGL:) name:UIApplicationDidBecomeActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
// set initial position
@@ -433,7 +423,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
- (void)setDelegate:(id<MGLMapViewDelegate>)delegate
{
if (_delegate == delegate) return;
-
+
_delegate = delegate;
}
@@ -613,7 +603,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
// This is the delegate of the GLKView object's display call.
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
- if ( ! self.glSnapshotView || self.glSnapshotView.hidden)
+ if ( ! self.isDormant)
{
[self notifyMapChange:@(mbgl::MapChangeWillStartRenderingMap)];
@@ -639,44 +629,78 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
- (void)layoutSubviews
{
[super layoutSubviews];
-
+
if ( ! _isTargetingInterfaceBuilder)
{
_mbglMap->update();
}
+
+ if (self.attributionSheet.visible)
+ {
+ [self.attributionSheet dismissWithClickedButtonIndex:self.attributionSheet.cancelButtonIndex animated:YES];
+ }
+
+ if (self.compass.alpha)
+ {
+ [self updateHeadingForDeviceOrientation];
+ [self updateCompass];
+ }
}
#pragma mark - Life Cycle -
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-parameter"
-
-- (void)appDidBackground:(NSNotification *)notification
+- (void)sleepGL:(__unused NSNotification *)notification
{
- [MGLMapboxEvents flush];
+ MGLAssertIsMainThread();
- if ( ! self.glSnapshotView)
+ if ( ! self.isDormant)
{
- self.glSnapshotView = [[UIImageView alloc] initWithFrame:self.glView.frame];
- self.glSnapshotView.autoresizingMask = self.glView.autoresizingMask;
- [self insertSubview:self.glSnapshotView aboveSubview:self.glView];
- }
+ self.dormant = YES;
+
+ [MGLMapboxEvents flush];
+
+ if ( ! self.glSnapshotView)
+ {
+ self.glSnapshotView = [[UIImageView alloc] initWithFrame:self.glView.frame];
+ self.glSnapshotView.autoresizingMask = self.glView.autoresizingMask;
+ [self insertSubview:self.glSnapshotView aboveSubview:self.glView];
+ }
- self.glSnapshotView.image = self.glView.snapshot;
- self.glSnapshotView.hidden = NO;
+ self.glSnapshotView.image = self.glView.snapshot;
+ self.glSnapshotView.hidden = NO;
- _mbglMap->pause();
+ if (_mbglMap->getDebug() && [self.glSnapshotView.subviews count] == 0)
+ {
+ UIView *snapshotTint = [[UIView alloc] initWithFrame:self.glSnapshotView.bounds];
+ snapshotTint.autoresizingMask = self.glSnapshotView.autoresizingMask;
+ snapshotTint.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.25];
+ [self.glSnapshotView addSubview:snapshotTint];
+ }
- [self.glView deleteDrawable];
+ _mbglMap->pause();
+
+ [self.glView deleteDrawable];
+ }
}
-- (void)appWillForeground:(NSNotification *)notification
+- (void)wakeGL:(__unused NSNotification *)notification
{
- self.glSnapshotView.hidden = YES;
+ MGLAssertIsMainThread();
+
+ if (self.isDormant)
+ {
+ self.dormant = NO;
+
+ [MGLMapboxEvents validate];
+
+ self.glSnapshotView.hidden = YES;
- [self.glView bindDrawable];
+ [self.glSnapshotView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
- _mbglMap->resume();
+ [self.glView bindDrawable];
+
+ _mbglMap->resume();
+ }
}
- (void)tintColorDidChange
@@ -693,19 +717,15 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
#pragma mark - Gestures -
-- (void)handleCompassTapGesture:(id)sender
+- (void)handleCompassTapGesture:(__unused id)sender
{
[self resetNorthAnimated:YES];
if (self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) self.userTrackingMode = MGLUserTrackingModeFollow;
}
-#pragma clang diagnostic pop
-
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
+- (void)touchesBegan:(__unused NSSet *)touches withEvent:(__unused UIEvent *)event
{
- (void)touches;
- (void)event;
_mbglMap->cancelTransitions();
_mbglMap->setGestureInProgress(false);
self.animatingGesture = NO;
@@ -735,7 +755,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
_mbglMap->moveBy(delta.x, delta.y);
self.centerPoint = CGPointMake(self.centerPoint.x + delta.x, self.centerPoint.y + delta.y);
-
+
[self notifyMapChange:@(mbgl::MapChangeRegionDidChangeAnimated)];
}
else if (pan.state == UIGestureRecognizerStateEnded || pan.state == UIGestureRecognizerStateCancelled)
@@ -746,7 +766,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
// Not enough velocity to overcome friction
velocity = CGPointZero;
}
-
+
CGFloat duration = UIScrollViewDecelerationRateNormal;
if ( ! CGPointEqualToPoint(velocity, CGPointZero))
{
@@ -816,12 +836,17 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
else if (pinch.state == UIGestureRecognizerStateEnded || pinch.state == UIGestureRecognizerStateCancelled)
{
CGFloat velocity = pinch.velocity;
+ if (isnan(velocity))
+ {
+ // UIPinchGestureRecognizer sometimes returns NaN for the velocity
+ velocity = 0;
+ }
if (velocity > -0.5 && velocity < 3)
{
velocity = 0;
}
CGFloat duration = velocity > 0 ? 1 : 0.25;
-
+
CGFloat scale = self.scale * pinch.scale;
CGFloat newScale = scale;
if (velocity >= 0)
@@ -832,22 +857,22 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
{
newScale += scale / (velocity * duration) * 0.1;
}
-
+
if (newScale <= 0 || log2(newScale) < _mbglMap->getMinZoom())
{
velocity = 0;
}
-
+
if (velocity)
{
CGPoint pinchCenter = [pinch locationInView:pinch.view];
_mbglMap->setScale(newScale, pinchCenter.x, pinchCenter.y, secondsAsDuration(duration));
}
-
+
_mbglMap->setGestureInProgress(false);
-
+
[self unrotateIfNeededAnimated:YES];
-
+
if (velocity)
{
self.animatingGesture = YES;
@@ -903,37 +928,37 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
else if (rotate.state == UIGestureRecognizerStateEnded || rotate.state == UIGestureRecognizerStateCancelled)
{
CGFloat velocity = rotate.velocity;
-
+
if (fabs(velocity) > 3)
{
CGFloat radians = self.angle + rotate.rotation;
CGFloat duration = UIScrollViewDecelerationRateNormal;
CGFloat newRadians = radians + velocity * duration * 0.1;
CGFloat newDegrees = [MGLMapView radiansToDegrees:newRadians] * -1;
-
+
_mbglMap->setBearing(newDegrees, secondsAsDuration(duration));
-
+
_mbglMap->setGestureInProgress(false);
-
+
self.animatingGesture = YES;
-
+
__weak MGLMapView *weakSelf = self;
-
+
[self animateWithDelay:duration animations:^
{
weakSelf.animatingGesture = NO;
-
+
[weakSelf unrotateIfNeededAnimated:YES];
-
+
[weakSelf notifyMapChange:@(mbgl::MapChangeRegionDidChangeAnimated)];
}];
}
else
{
_mbglMap->setGestureInProgress(false);
-
+
[self unrotateIfNeededAnimated:YES];
-
+
[self notifyMapChange:@(mbgl::MapChangeRegionDidChange)];
}
}
@@ -1079,22 +1104,19 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
{
CGPoint doubleTapPoint = [doubleTap locationInView:doubleTap.view];
- CGPoint zoomInPoint;
-
+ CGPoint zoomInPoint = doubleTapPoint;
+ CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self];
if (self.userTrackingMode != MGLUserTrackingModeNone)
{
- CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self];
CGRect userLocationRect = CGRectMake(userPoint.x - 40, userPoint.y - 40, 80, 80);
if (CGRectContainsPoint(userLocationRect, doubleTapPoint))
{
zoomInPoint = userPoint;
}
}
- else
+ if ( ! CGPointEqualToPoint(zoomInPoint, userPoint))
{
self.userTrackingMode = MGLUserTrackingModeNone;
-
- zoomInPoint = doubleTapPoint;
}
_mbglMap->scaleBy(2, zoomInPoint.x, zoomInPoint.y, secondsAsDuration(MGLAnimationDuration));
@@ -1222,6 +1244,34 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
}];
}
+#pragma mark - Attribution -
+
+- (void)showAttribution
+{
+ [self.attributionSheet showFromRect:self.attributionButton.frame inView:self animated:YES];
+}
+
+- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
+{
+ if (buttonIndex == actionSheet.firstOtherButtonIndex)
+ {
+ [[UIApplication sharedApplication] openURL:
+ [NSURL URLWithString:@"https://www.mapbox.com/about/maps/"]];
+ }
+ else if (buttonIndex == actionSheet.firstOtherButtonIndex + 1)
+ {
+ [[UIApplication sharedApplication] openURL:
+ [NSURL URLWithString:@"http://www.openstreetmap.org/about/"]];
+ }
+ else if (buttonIndex == actionSheet.firstOtherButtonIndex + 2)
+ {
+ NSString *feedbackURL = [NSString stringWithFormat:@"https://www.mapbox.com/map-feedback/#/%.5f/%.5f/%i",
+ self.longitude, self.latitude, (int)round(self.zoomLevel)];
+ [[UIApplication sharedApplication] openURL:
+ [NSURL URLWithString:feedbackURL]];
+ }
+}
+
#pragma mark - Properties -
+ (NSSet *)keyPathsForValuesAffectingZoomEnabled
@@ -1239,16 +1289,6 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
return [NSSet setWithObject:@"allowsRotating"];
}
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-parameter"
-
-- (void)showAttribution:(id)sender
-{
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.mapbox.com/about/maps/"]];
-}
-
-#pragma clang diagnostic pop
-
- (void)setDebugActive:(BOOL)debugActive
{
_mbglMap->setDebug(debugActive);
@@ -1381,14 +1421,14 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
// NOTE: does not disrupt tracking mode
CLLocationCoordinate2D center = CLLocationCoordinate2DMake((northEastCoordinate.latitude + southWestCoordinate.latitude) / 2, (northEastCoordinate.longitude + southWestCoordinate.longitude) / 2);
-
+
CGFloat scale = _mbglMap->getScale();
CGFloat scaleX = _mbglMap->getWidth() / (northEastCoordinate.longitude - southWestCoordinate.longitude);
CGFloat scaleY = _mbglMap->getHeight() / (northEastCoordinate.latitude - southWestCoordinate.latitude);
CGFloat minZoom = _mbglMap->getMinZoom();
CGFloat maxZoom = _mbglMap->getMaxZoom();
CGFloat zoomLevel = MAX(MIN(log(scale * MIN(scaleX, scaleY)) / log(2), maxZoom), minZoom);
-
+
[self setCenterCoordinate:center zoomLevel:zoomLevel animated:animated];
}
@@ -1660,7 +1700,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
{
assert([annotation conformsToProtocol:@protocol(MGLAnnotation)]);
- annotationIDsToRemove.push_back([[[self.annotationIDsByAnnotation objectForKey:annotation]
+ annotationIDsToRemove.push_back([[[self.annotationIDsByAnnotation objectForKey:annotation]
objectForKey:MGLAnnotationIDKey] unsignedIntValue]);
[self.annotationIDsByAnnotation removeObjectForKey:annotation];
@@ -1696,7 +1736,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
if ( ! annotation) return;
if ( ! [self viewportBounds].contains(coordinateToLatLng(annotation.coordinate))) return;
-
+
if (annotation == self.selectedAnnotation) return;
self.userTrackingMode = MGLUserTrackingModeNone;
@@ -1815,22 +1855,22 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
- (void)setShowsUserLocation:(BOOL)showsUserLocation
{
if (showsUserLocation == _showsUserLocation) return;
-
+
_showsUserLocation = showsUserLocation;
-
+
if (showsUserLocation)
{
if ([self.delegate respondsToSelector:@selector(mapViewWillStartLocatingUser:)])
{
[self.delegate mapViewWillStartLocatingUser:self];
}
-
+
self.userLocationAnnotationView = [[MGLUserLocationAnnotationView alloc] initInMapView:self];
self.userLocationAnnotationView.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);
-
+
self.locationManager = [CLLocationManager new];
-
+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
// enable iOS 8+ location authorization API
//
@@ -1843,7 +1883,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
[self.locationManager requestWhenInUseAuthorization];
}
#endif
-
+
self.locationManager.headingFilter = 5.0;
self.locationManager.delegate = self;
[self.locationManager startUpdatingLocation];
@@ -1861,7 +1901,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
[self setUserTrackingMode:MGLUserTrackingModeNone animated:YES];
-
+
[self.userLocationAnnotationView removeFromSuperview];
self.userLocationAnnotationView = nil;
}
@@ -1971,10 +2011,8 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
}
-- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
+- (void)locationManager:(__unused CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
- (void)manager;
-
if ( ! _showsUserLocation || ! newLocation || ! CLLocationCoordinate2DIsValid(newLocation.coordinate)) return;
if ([newLocation distanceFromLocation:oldLocation] || ! oldLocation)
@@ -2026,7 +2064,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
CLLocationCoordinate2D actualNorthEast = [self convertPoint:CGPointMake(userLocationPoint.x + pixelRadius,
userLocationPoint.y + pixelRadius)
toCoordinateFromView:self];
-
+
if (desiredNorthEast.latitude != actualNorthEast.latitude ||
desiredNorthEast.longitude != actualNorthEast.longitude ||
desiredSouthWest.latitude != actualSouthWest.latitude ||
@@ -2047,19 +2085,15 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager
{
- (void)manager;
-
- if (self.displayHeadingCalibration) [self.locationManager performSelector:@selector(dismissHeadingCalibrationDisplay)
- withObject:nil
- afterDelay:10.0];
+ if (self.displayHeadingCalibration) [manager performSelector:@selector(dismissHeadingCalibrationDisplay)
+ withObject:nil
+ afterDelay:10.0];
return self.displayHeadingCalibration;
}
-- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
+- (void)locationManager:(__unused CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
- (void)manager;
-
if ( ! _showsUserLocation || self.pan.state == UIGestureRecognizerStateBegan || newHeading.headingAccuracy < 0) return;
self.userLocation.heading = newHeading;
@@ -2079,10 +2113,8 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
}
-- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
+- (void)locationManager:(__unused CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
{
- (void)manager;
-
if (status == kCLAuthorizationStatusDenied || status == kCLAuthorizationStatusRestricted)
{
self.userTrackingMode = MGLUserTrackingModeNone;
@@ -2090,10 +2122,8 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
}
-- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
+- (void)locationManager:(__unused CLLocationManager *)manager didFailWithError:(NSError *)error
{
- (void)manager;
-
if ([error code] == kCLErrorDenied)
{
self.userTrackingMode = MGLUserTrackingModeNone;
@@ -2302,9 +2332,10 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
}
case mbgl::MapChangeDidFailLoadingMap:
{
- if ([self.delegate respondsToSelector:@selector(mapViewDidFailLoadingMap:withError::)])
+ if ([self.delegate respondsToSelector:@selector(mapViewDidFailLoadingMap:withError:)])
{
- [self.delegate mapViewDidFailLoadingMap:self withError:nil];
+ NSError *error = [NSError errorWithDomain:MGLErrorDomain code:0 userInfo:nil];
+ [self.delegate mapViewDidFailLoadingMap:self withError:error];
}
break;
}
@@ -2429,17 +2460,17 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
- (void)prepareForInterfaceBuilder
{
[super prepareForInterfaceBuilder];
-
+
self.layer.borderColor = [UIColor colorWithWhite:184/255. alpha:1].CGColor;
self.layer.borderWidth = 1;
-
+
if (self.accessToken)
{
self.layer.backgroundColor = [UIColor colorWithRed:59/255.
green:178/255.
blue:208/255.
alpha:0.8].CGColor;
-
+
UIImage *image = [[self class] resourceImageNamed:@"mapbox.png"];
UIImageView *previewView = [[UIImageView alloc] initWithImage:image];
previewView.translatesAutoresizingMaskIntoConstraints = NO;
@@ -2466,7 +2497,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
UIView *diagnosticView = [[UIView alloc] init];
diagnosticView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:diagnosticView];
-
+
// Headline
UILabel *headlineLabel = [[UILabel alloc] init];
headlineLabel.text = @"No Access Token";
@@ -2477,7 +2508,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
[headlineLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultLow
forAxis:UILayoutConstraintAxisHorizontal];
[diagnosticView addSubview:headlineLabel];
-
+
// Explanation
UILabel *explanationLabel = [[UILabel alloc] init];
explanationLabel.text = @"To display a map here, you must provide a Mapbox access token. Get an access token from:";
@@ -2487,7 +2518,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
[explanationLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultLow
forAxis:UILayoutConstraintAxisHorizontal];
[diagnosticView addSubview:explanationLabel];
-
+
// Link
UIButton *linkButton = [UIButton buttonWithType:UIButtonTypeSystem];
[linkButton setTitle:MGLMapboxAccessTokenManagerURLDisplayString forState:UIControlStateNormal];
@@ -2495,7 +2526,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
[linkButton setContentCompressionResistancePriority:UILayoutPriorityDefaultLow
forAxis:UILayoutConstraintAxisHorizontal];
[diagnosticView addSubview:linkButton];
-
+
// More explanation
UILabel *explanationLabel2 = [[UILabel alloc] init];
explanationLabel2.text = @"and enter it into the Access Token field in the Attributes inspector.";
@@ -2505,7 +2536,7 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng)
[explanationLabel2 setContentCompressionResistancePriority:UILayoutPriorityDefaultLow
forAxis:UILayoutConstraintAxisHorizontal];
[diagnosticView addSubview:explanationLabel2];
-
+
// Constraints
NSDictionary *views = @{
@"container": diagnosticView,
diff --git a/include/mbgl/ios/MGLMapboxEvents.h b/platform/ios/MGLMapboxEvents.h
index c70c7cb335..94aa8be783 100644
--- a/include/mbgl/ios/MGLMapboxEvents.h
+++ b/platform/ios/MGLMapboxEvents.h
@@ -30,12 +30,10 @@ extern NSString *const MGLEventGestureRotateStart;
@interface MGLMapboxEvents : NSObject <NSURLSessionDelegate>
++ (instancetype)sharedManager;
+
// You must call these methods from the main thread.
//
-+ (void) setToken:(NSString *)token;
-+ (void) setAppName:(NSString *)appName;
-+ (void) setAppVersion:(NSString *)appVersion;
-+ (void) setAppBuildNumber:(NSString *)appBuildNumber;
+ (void) pauseMetricsCollection;
+ (void) resumeMetricsCollection;
@@ -58,4 +56,7 @@ extern NSString *const MGLEventGestureRotateStart;
//
+ (void) flush;
+// Main thread only
++ (void)validate;
+
@end
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index 36ed63d334..98bfe21cfe 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -4,8 +4,9 @@
#import <SystemConfiguration/CaptiveNetwork.h>
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
+#import <CoreLocation/CoreLocation.h>
-#import "MGLMetricsLocationManager.h"
+#import "MGLAccountManager.h"
#import "NSProcessInfo+MGLAdditions.h"
#import "NSBundle+MGLAdditions.h"
#import "NSException+MGLAdditions.h"
@@ -13,7 +14,7 @@
#include <sys/sysctl.h>
static NSString *const MGLMapboxEventsUserAgent = @"MapboxEventsiOS/1.0";
-static NSString *const MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com";
+static NSString *MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com";
NSString *const MGLEventTypeMapLoad = @"map.load";
NSString *const MGLEventTypeMapTap = @"map.click";
@@ -43,6 +44,79 @@ NSString *const MGLEventGesturePanStart = @"Pan";
NSString *const MGLEventGesturePinchStart = @"Pinch";
NSString *const MGLEventGestureRotateStart = @"Rotation";
+const NSUInteger MGLMaximumEventsPerFlush = 20;
+const NSTimeInterval MGLFlushInterval = 60;
+
+@interface MGLMapboxEventsData : NSObject
+
+// All of the following properties are written to only from
+// the main thread, but can be read on any thread.
+//
+@property (atomic) NSString *instanceID;
+@property (atomic) NSString *advertiserId;
+@property (atomic) NSString *vendorId;
+@property (atomic) NSString *model;
+@property (atomic) NSString *iOSVersion;
+@property (atomic) NSString *carrier;
+@property (atomic) CGFloat scale;
+
+@end
+
+@implementation MGLMapboxEventsData
+
+- (instancetype)init {
+ if (self = [super init]) {
+ _instanceID = [[NSUUID UUID] UUIDString];
+
+ // Dynamic detection of ASIdentifierManager from Mixpanel
+ // https://github.com/mixpanel/mixpanel-iphone/blob/master/LICENSE
+ _advertiserId = @"";
+ Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager");
+ if (ASIdentifierManagerClass) {
+ SEL sharedManagerSelector = NSSelectorFromString(@"sharedManager");
+ id sharedManager = ((id (*)(id, SEL))[ASIdentifierManagerClass methodForSelector:sharedManagerSelector])(ASIdentifierManagerClass, sharedManagerSelector);
+ // Add check here
+ SEL isAdvertisingTrackingEnabledSelector = NSSelectorFromString(@"isAdvertisingTrackingEnabled");
+ BOOL trackingEnabled = ((BOOL (*)(id, SEL))[sharedManager methodForSelector:isAdvertisingTrackingEnabledSelector])(sharedManager, isAdvertisingTrackingEnabledSelector);
+ if (trackingEnabled) {
+ SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier");
+ NSUUID *uuid = ((NSUUID* (*)(id, SEL))[sharedManager methodForSelector:advertisingIdentifierSelector])(sharedManager, advertisingIdentifierSelector);
+ _advertiserId = [uuid UUIDString];
+ }
+ }
+ _vendorId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
+
+ _model = [self sysInfoByName:"hw.machine"];
+ _iOSVersion = [NSString stringWithFormat:@"%@ %@", [UIDevice currentDevice].systemName, [UIDevice currentDevice].systemVersion];
+ if ([UIScreen instancesRespondToSelector:@selector(nativeScale)]) {
+ _scale = [UIScreen mainScreen].nativeScale;
+ } else {
+ _scale = [UIScreen mainScreen].scale;
+ }
+ CTCarrier *carrierVendor = [[[CTTelephonyNetworkInfo alloc] init] subscriberCellularProvider];
+ _carrier = [carrierVendor carrierName];
+ }
+ return self;
+}
+
+// Can be called from any thread.
+//
+- (NSString *)sysInfoByName:(char *)typeSpecifier
+{
+ size_t size;
+ sysctlbyname(typeSpecifier, NULL, &size, NULL, 0);
+
+ char *answer = malloc(size);
+ sysctlbyname(typeSpecifier, answer, &size, NULL, 0);
+
+ NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding];
+
+ free(answer);
+ return results;
+}
+
+@end
+
//
// Threadsafety conventions:
//
@@ -59,30 +133,23 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// strong references.
//
-@interface MGLMapboxEvents()
+@interface MGLMapboxEvents () <CLLocationManagerDelegate>
// All of the following properties are written to only from
// the main thread, but can be read on any thread.
//
-@property (atomic) NSString *token;
+@property (atomic) MGLMapboxEventsData *data;
+@property (atomic) NSString *appBundleId;
@property (atomic) NSString *appName;
@property (atomic) NSString *appVersion;
@property (atomic) NSString *appBuildNumber;
-@property (atomic) NSString *instanceID;
-@property (atomic) NSString *advertiserId;
-@property (atomic) NSString *vendorId;
-@property (atomic) NSString *appBundleId;
-@property (atomic) NSString *userAgent;
-@property (atomic) NSString *model;
-@property (atomic) NSString *iOSVersion;
-@property (atomic) NSString *carrier;
-@property (atomic) NSUInteger flushAt;
@property (atomic) NSDateFormatter *rfc3339DateFormatter;
-@property (atomic) CGFloat scale;
@property (atomic) NSURLSession *session;
@property (atomic) NSData *digicertCert;
@property (atomic) NSData *geoTrustCert;
+// Main thread only
+@property (nonatomic) CLLocationManager *locationManager;
// The paused state tracker is only ever accessed from the main thread.
//
@@ -92,10 +159,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
//
@property (nonatomic) NSTimer *timer;
-// The flush expiration time is only ever accessed from the main thread.
-//
-@property (nonatomic) NSTimeInterval flushAfter;
-
// This is an array of events to push. All access to it will be
// from our own serial queue.
//
@@ -107,7 +170,23 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
@end
-@implementation MGLMapboxEvents
+@implementation MGLMapboxEvents {
+ id _userDefaultsObserver;
+}
+
++ (void)initialize {
+ if (self == [MGLMapboxEvents class]) {
+ [[NSUserDefaults standardUserDefaults] registerDefaults:@{
+ @"MGLMapboxAccountType": @0,
+ @"MGLMapboxMetricsEnabled": @YES,
+ }];
+ }
+}
+
++ (BOOL)isEnabled {
+ return ([[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsEnabled"] &&
+ [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0);
+}
// Must be called from the main thread. Only called internally.
//
@@ -116,33 +195,47 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
self = [super init];
if (self) {
-
- // Put Settings bundle into memory
- NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
- if(!appSettingsBundle) {
- NSLog(@"Could not find Settings.bundle");
- } else {
- // Dynamic Settings.bundle loading based on:
- // http://stackoverflow.com/questions/510216/can-you-make-the-settings-in-settings-bundle-default-even-if-you-dont-open-the
- NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[appSettingsBundle stringByAppendingPathComponent:@"Root.plist"]];
- NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
- NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];
- for(NSDictionary *prefSpecification in preferences) {
- NSString *key = [prefSpecification objectForKey:@"Key"];
- if(key && [[prefSpecification allKeys] containsObject:@"DefaultValue"]) {
- [defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key];
+ if (! [MGLAccountManager mapboxMetricsEnabledSettingShownInApp]) {
+ // Opt Out is not configured in UI, so check for Settings.bundle
+ // Put Settings bundle into memory
+ id defaultEnabledValue;
+ NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
+
+ if (appSettingsBundle) {
+ // Dynamic Settings.bundle loading based on:
+ // http://stackoverflow.com/questions/510216/can-you-make-the-settings-in-settings-bundle-default-even-if-you-dont-open-the
+ NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[appSettingsBundle stringByAppendingPathComponent:@"Root.plist"]];
+ NSArray *preferences = settings[@"PreferenceSpecifiers"];
+ for (NSDictionary *prefSpecification in preferences) {
+ if ([prefSpecification[@"Key"] isEqualToString:@"MGLMapboxMetricsEnabled"]) {
+ defaultEnabledValue = prefSpecification[@"DefaultValue"];
+ }
}
}
-
- [[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
+
+ NSAssert(defaultEnabledValue, @"End users must be able to opt out of Metrics in your app, either inside Settings (via Settings.bundle) or inside this app. If you implement the opt-out control inside this app, disable this assertion by setting [MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES] before the app initializes any Mapbox GL classes.");
+ [[NSUserDefaults standardUserDefaults] registerDefaults:@{
+ @"MGLMapboxMetricsEnabled": defaultEnabledValue,
+ }];
}
+
_appBundleId = [[NSBundle mainBundle] bundleIdentifier];
+ _appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
+ _appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
+ _appBuildNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
+
NSString *uniqueID = [[NSProcessInfo processInfo] globallyUniqueString];
_serialQueue = dispatch_queue_create([[NSString stringWithFormat:@"%@.%@.events.serial", _appBundleId, uniqueID] UTF8String], DISPATCH_QUEUE_SERIAL);
// Configure Events Infrastructure
// ===============================
+ // Check for TEST Metrics URL
+ NSString *testURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMetricsTestServerURL"];
+ if (testURL != nil) {
+ MGLMapboxEventsAPIBase = testURL;
+ }
+
_paused = YES;
[self resumeMetricsCollection];
NSBundle *resourceBundle = [NSBundle bundleWithPath:[NSBundle mgl_resourceBundlePath]];
@@ -154,7 +247,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
_geoTrustCert = [NSData dataWithContentsOfFile:cerPath];
}
- cerPath = nil;
cerPath = [resourceBundle pathForResource:@"api_mapbox_com-digicert" ofType:@"der"];
if (cerPath != nil) {
_digicertCert = [NSData dataWithContentsOfFile:cerPath];
@@ -162,40 +254,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Events Control
_eventQueue = [[NSMutableArray alloc] init];
- _flushAt = 20;
- _flushAfter = 60;
- _token = nil;
- _instanceID = [[NSUUID UUID] UUIDString];
-
- // Dynamic detection of ASIdentifierManager from Mixpanel
- // https://github.com/mixpanel/mixpanel-iphone/blob/master/LICENSE
- _advertiserId = @"";
- Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager");
- if (ASIdentifierManagerClass) {
- SEL sharedManagerSelector = NSSelectorFromString(@"sharedManager");
- id sharedManager = ((id (*)(id, SEL))[ASIdentifierManagerClass methodForSelector:sharedManagerSelector])(ASIdentifierManagerClass, sharedManagerSelector);
- // Add check here
- SEL isAdvertisingTrackingEnabledSelector = NSSelectorFromString(@"isAdvertisingTrackingEnabled");
- BOOL trackingEnabled = ((BOOL (*)(id, SEL))[sharedManager methodForSelector:isAdvertisingTrackingEnabledSelector])(sharedManager, isAdvertisingTrackingEnabledSelector);
- if (trackingEnabled) {
- SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier");
- NSUUID *uuid = ((NSUUID* (*)(id, SEL))[sharedManager methodForSelector:advertisingIdentifierSelector])(sharedManager, advertisingIdentifierSelector);
- _advertiserId = [uuid UUIDString];
- }
- }
- _vendorId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
-
- _model = [self getSysInfoByName:"hw.machine"];
- _iOSVersion = [NSString stringWithFormat:@"%@ %@", [UIDevice currentDevice].systemName, [UIDevice currentDevice].systemVersion];
- if ([UIScreen instancesRespondToSelector:@selector(nativeScale)]) {
- _scale = [UIScreen mainScreen].nativeScale;
- } else {
- _scale = [UIScreen mainScreen].scale;
- }
- CTCarrier *carrierVendor = [[[CTTelephonyNetworkInfo alloc] init] subscriberCellularProvider];
- _carrier = [carrierVendor carrierName];
-
- _userAgent = MGLMapboxEventsUserAgent;
// Setup Date Format
_rfc3339DateFormatter = [[NSDateFormatter alloc] init];
@@ -209,6 +267,16 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Enable Battery Monitoring
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
+
+ __weak MGLMapboxEvents *weakSelf = self;
+ _userDefaultsObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSUserDefaultsDidChangeNotification
+ object:nil
+ queue:[NSOperationQueue mainQueue]
+ usingBlock:
+ ^(NSNotification *notification) {
+ MGLMapboxEvents *strongSelf = weakSelf;
+ [strongSelf validate];
+ }];
}
return self;
}
@@ -217,57 +285,62 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// public class convenience methods. May return nil if this feature is disabled.
//
+ (instancetype)sharedManager {
+ if (NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
+ return nil;
+ }
static dispatch_once_t onceToken;
static MGLMapboxEvents *_sharedManager;
- dispatch_once(&onceToken, ^{
- if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent &&
- [[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) {
- void (^setupBlock)() = ^{
- _sharedManager = [[self alloc] init];
- };
- if ( ! [[NSThread currentThread] isMainThread]) {
- dispatch_sync(dispatch_get_main_queue(), ^{
- setupBlock();
- });
- }
- else {
- setupBlock();
- }
- }
- });
+ void (^setupBlock)() = ^{
+ dispatch_once(&onceToken, ^{
+ _sharedManager = [[self alloc] init];
+ });
+ };
+ if ( ! [[NSThread currentThread] isMainThread]) {
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ setupBlock();
+ });
+ }
+ else {
+ setupBlock();
+ }
return _sharedManager;
}
- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:_userDefaultsObserver];
[self pauseMetricsCollection];
}
-// Must be called from the main thread.
-//
-+ (void) setToken:(NSString *)token {
- MGLAssertIsMainThread();
- [MGLMapboxEvents sharedManager].token = token;
++ (void)validate {
+ [[MGLMapboxEvents sharedManager] validate];
}
-// Must be called from the main thread.
-//
-+ (void) setAppName:(NSString *)appName {
- MGLAssertIsMainThread();
- [MGLMapboxEvents sharedManager].appName = appName;
-}
-
-// Must be called from the main thread.
-//
-+ (void) setAppVersion:(NSString *)appVersion {
+- (void)validate {
MGLAssertIsMainThread();
- [MGLMapboxEvents sharedManager].appVersion = appVersion;
+ BOOL enabledInSettings = [[self class] isEnabled];
+ if (self.paused && enabledInSettings) {
+ [self resumeMetricsCollection];
+ } else if (!self.paused && !enabledInSettings) {
+ [self pauseMetricsCollection];
+ }
+
+ [self validateUpdatingLocation];
}
-// Must be called from the main thread.
-//
-+ (void) setAppBuildNumber:(NSString *)appBuildNumber {
+- (void)validateUpdatingLocation {
MGLAssertIsMainThread();
- [MGLMapboxEvents sharedManager].appBuildNumber = appBuildNumber;
+ if (self.paused) {
+ [self stopUpdatingLocation];
+ } else {
+ CLAuthorizationStatus authStatus = [CLLocationManager authorizationStatus];
+ if (authStatus == kCLAuthorizationStatusDenied ||
+ authStatus == kCLAuthorizationStatusRestricted) {
+ [self stopUpdatingLocation];
+ } else if (authStatus == kCLAuthorizationStatusAuthorized ||
+ authStatus == kCLAuthorizationStatusAuthorizedWhenInUse) {
+ [self startUpdatingLocation];
+ }
+ }
}
+ (void)pauseMetricsCollection {
@@ -282,11 +355,25 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
return;
}
self.paused = YES;
+ [_timer invalidate];
+ _timer = nil;
+ [_eventQueue removeAllObjects];
+ _data = nil;
[_session invalidateAndCancel];
_session = nil;
- MGLMetricsLocationManager *sharedLocationManager = [MGLMetricsLocationManager sharedManager];
- [sharedLocationManager stopUpdatingLocation];
- [sharedLocationManager stopMonitoringVisits];
+
+ [self validateUpdatingLocation];
+}
+
+- (void)stopUpdatingLocation {
+ [_locationManager stopUpdatingLocation];
+
+ // -[CLLocationManager stopMonitoringVisits] is only available in iOS 8+.
+ if ([_locationManager respondsToSelector:@selector(stopMonitoringVisits)]) {
+ [_locationManager stopMonitoringVisits];
+ }
+
+ _locationManager = nil;
}
+ (void)resumeMetricsCollection {
@@ -297,14 +384,34 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
//
- (void)resumeMetricsCollection {
MGLAssertIsMainThread();
- if (!self.isPaused) {
+ if (!self.paused || ![[self class] isEnabled]) {
return;
}
self.paused = NO;
+ _data = [[MGLMapboxEventsData alloc] init];
_session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:nil];
- MGLMetricsLocationManager *sharedLocationManager = [MGLMetricsLocationManager sharedManager];
- [sharedLocationManager startUpdatingLocation];
- [sharedLocationManager startMonitoringVisits];
+
+ [self validateUpdatingLocation];
+}
+
+- (void)startUpdatingLocation {
+ MGLAssertIsMainThread();
+ if (_locationManager || _paused) {
+ NSAssert(!(_locationManager && _paused),
+ @"MGLMapboxEvents should not have a CLLocationManager while paused.");
+ return;
+ }
+ _locationManager = [[CLLocationManager alloc] init];
+ _locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
+ _locationManager.distanceFilter = 10;
+ _locationManager.delegate = self;
+
+ [_locationManager startUpdatingLocation];
+
+ // -[CLLocationManager startMonitoringVisits] is only available in iOS 8+.
+ if ([_locationManager respondsToSelector:@selector(startMonitoringVisits)]) {
+ [_locationManager startMonitoringVisits];
+ }
}
// Can be called from any thread. Can be called rapidly from
@@ -326,12 +433,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
MGLMapboxEvents *strongSelf = weakSelf;
if ( ! strongSelf) return;
- // Opt Out Checking When Built
- if (![[NSUserDefaults standardUserDefaults] boolForKey:@"mapbox_metrics_enabled_preference"]) {
- [_eventQueue removeAllObjects];
- return;
- }
-
// Metrics Collection Has Been Paused
if (_paused) {
return;
@@ -344,34 +445,34 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
[evt setObject:event forKey:@"event"];
[evt setObject:@(1) forKey:@"version"];
[evt setObject:[strongSelf.rfc3339DateFormatter stringFromDate:[NSDate date]] forKey:@"created"];
- [evt setObject:strongSelf.instanceID forKey:@"instance"];
- [evt setObject:strongSelf.advertiserId forKey:@"advertiserId"];
- [evt setObject:strongSelf.vendorId forKey:@"vendorId"];
+ [evt setObject:strongSelf.data.instanceID forKey:@"instance"];
+ [evt setObject:strongSelf.data.advertiserId forKey:@"advertiserId"];
+ [evt setObject:strongSelf.data.vendorId forKey:@"vendorId"];
[evt setObject:strongSelf.appBundleId forKeyedSubscript:@"appBundleId"];
// mapbox-events-ios stock attributes
- [evt setValue:strongSelf.model forKey:@"model"];
- [evt setValue:strongSelf.iOSVersion forKey:@"operatingSystem"];
- [evt setValue:[strongSelf getDeviceOrientation] forKey:@"orientation"];
+ [evt setValue:strongSelf.data.model forKey:@"model"];
+ [evt setValue:strongSelf.data.iOSVersion forKey:@"operatingSystem"];
+ [evt setValue:[strongSelf deviceOrientation] forKey:@"orientation"];
[evt setValue:@((int)(100 * [UIDevice currentDevice].batteryLevel)) forKey:@"batteryLevel"];
- [evt setValue:@(strongSelf.scale) forKey:@"resolution"];
- [evt setValue:strongSelf.carrier forKey:@"carrier"];
+ [evt setValue:@(strongSelf.data.scale) forKey:@"resolution"];
+ [evt setValue:strongSelf.data.carrier forKey:@"carrier"];
- NSString *cell = [strongSelf getCurrentCellularNetworkConnectionType];
+ NSString *cell = [strongSelf currentCellularNetworkConnectionType];
if (cell) {
[evt setValue:cell forKey:@"cellularNetworkType"];
} else {
[evt setObject:[NSNull null] forKey:@"cellularNetworkType"];
}
- NSString *wifi = [strongSelf getWifiNetworkName];
+ NSString *wifi = [strongSelf wifiNetworkName];
if (wifi) {
[evt setValue:wifi forKey:@"wifi"];
} else {
[evt setObject:[NSNull null] forKey:@"wifi"];
}
- [evt setValue:@([strongSelf getContentSizeScale]) forKey:@"accessibilityFontScale"];
+ [evt setValue:@([strongSelf contentSizeScale]) forKey:@"accessibilityFontScale"];
// Make Immutable Version
NSDictionary *finalEvent = [NSDictionary dictionaryWithDictionary:evt];
@@ -380,12 +481,12 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
[_eventQueue addObject:finalEvent];
// Has Flush Limit Been Reached?
- if (_eventQueue.count >= strongSelf.flushAt) {
+ if (_eventQueue.count >= MGLMaximumEventsPerFlush) {
[strongSelf flush];
+ } else if (_eventQueue.count == 1) {
+ // If this is first new event on queue start timer,
+ [strongSelf startTimer];
}
-
- // Reset Timer (Initial Starting of Timer after first event is pushed)
- [strongSelf startTimer];
});
}
@@ -398,33 +499,28 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Can be called from any thread.
//
- (void) flush {
- if (self.token == nil) return;
+ if ([MGLAccountManager accessToken] == nil) return;
__weak MGLMapboxEvents *weakSelf = self;
dispatch_async(_serialQueue, ^{
MGLMapboxEvents *strongSelf = weakSelf;
- if ( ! strongSelf) return;
-
- __block NSArray *events;
+ if ( ! strongSelf || [_eventQueue count] == 0) return;
+
+ // Make an immutable copy
+ NSArray *events = [NSArray arrayWithArray:_eventQueue];
- NSUInteger upper = strongSelf.flushAt;
- if (strongSelf.flushAt > [_eventQueue count]) {
- if ([_eventQueue count] == 0) {
- return;
- }
- upper = [_eventQueue count];
- }
-
- // Create Array of Events to push to the Server
- NSRange theRange = NSMakeRange(0, upper);
- events = [_eventQueue subarrayWithRange:theRange];
-
// Update Queue to remove events sent to server
- [_eventQueue removeObjectsInRange:theRange];
+ [_eventQueue removeAllObjects];
// Send Array of Events to Server
[strongSelf postEvents:events];
+
+ // Cancel Any Timer That May Running
+ if (strongSelf.timer) {
+ [strongSelf.timer invalidate];
+ strongSelf.timer = nil;
+ }
});
}
@@ -439,9 +535,9 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
if (!strongSelf) return;
// Setup URL Request
- NSString *url = [NSString stringWithFormat:@"%@/events/v1?access_token=%@", MGLMapboxEventsAPIBase, strongSelf.token];
+ NSString *url = [NSString stringWithFormat:@"%@/events/v1?access_token=%@", MGLMapboxEventsAPIBase, [MGLAccountManager accessToken]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
- [request setValue:[strongSelf getUserAgent] forHTTPHeaderField:@"User-Agent"];
+ [request setValue:strongSelf.userAgent forHTTPHeaderField:@"User-Agent"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPMethod:@"POST"];
@@ -462,14 +558,11 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
- (void) startTimer {
void (^timerBlock)() = ^{
// Stop Timer if it already exists
- if (_timer) {
- [_timer invalidate];
- _timer = nil;
- }
+ [_timer invalidate];
// Start New Timer
- _timer = [NSTimer scheduledTimerWithTimeInterval:_flushAfter
- target:[self class]
+ _timer = [NSTimer scheduledTimerWithTimeInterval:MGLFlushInterval
+ target:self
selector:@selector(flush)
userInfo:nil
repeats:YES];
@@ -486,22 +579,13 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Can be called from any thread.
//
-- (NSString *) getUserAgent {
- if (self.appName != nil && self.appVersion != nil && self.appBuildNumber != nil && ([self.userAgent rangeOfString:self.appName].location == NSNotFound)) {
- self.userAgent = [NSString stringWithFormat:@"%@/%@/%@ %@", self.appName, self.appVersion, self.appBuildNumber, self.userAgent];
- }
- return self.userAgent;
-}
-
-// Can be called from any thread.
-//
-- (NSString *) formatDate:(NSDate *)date {
- return [self.rfc3339DateFormatter stringFromDate:date];
+- (NSString *) userAgent {
+ return [NSString stringWithFormat:@"%@/%@/%@ %@", self.appName, self.appVersion, self.appBuildNumber, MGLMapboxEventsUserAgent];
}
// Can be called from any thread.
//
-- (NSString *) getDeviceOrientation {
+- (NSString *) deviceOrientation {
__block NSString *result;
NSString *(^deviceOrientationBlock)(void) = ^{
@@ -548,7 +632,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Can be called from any thread.
//
-- (NSInteger) getContentSizeScale {
+- (NSInteger) contentSizeScale {
__block NSInteger result = -9999;
NSInteger (^contentSizeScaleBlock)(void) = ^{
@@ -596,31 +680,16 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Can be called from any thread.
//
-- (NSString *)getSysInfoByName:(char *)typeSpecifier
-{
- size_t size;
- sysctlbyname(typeSpecifier, NULL, &size, NULL, 0);
-
- char *answer = malloc(size);
- sysctlbyname(typeSpecifier, answer, &size, NULL, 0);
-
- NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding];
-
- free(answer);
- return results;
-}
-
-// Can be called from any thread.
-//
-- (NSString *) getWifiNetworkName {
+- (NSString *) wifiNetworkName {
NSString *ssid = nil;
CFArrayRef interfaces = CNCopySupportedInterfaces();
if (interfaces) {
- NSDictionary *info = (__bridge NSDictionary *)CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0));
+ NSDictionary *info = CFBridgingRelease(CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0)));
if (info) {
ssid = info[@"SSID"];
}
+ CFRelease(interfaces);
}
return ssid;
@@ -628,7 +697,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
// Can be called from any thread.
//
-- (NSString *) getCurrentCellularNetworkConnectionType {
+- (NSString *) currentCellularNetworkConnectionType {
CTTelephonyNetworkInfo *telephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
NSString *radioTech = telephonyInfo.currentRadioAccessTechnology;
@@ -693,13 +762,42 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
return result;
}
+#pragma mark CLLocationManagerDelegate
+- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
+ // Iterate through locations to pass all data
+ for (CLLocation *loc in locations) {
+ [MGLMapboxEvents pushEvent:MGLEventTypeLocation withAttributes:@{
+ MGLEventKeyLatitude: @(loc.coordinate.latitude),
+ MGLEventKeyLongitude: @(loc.coordinate.longitude),
+ MGLEventKeySpeed: @(loc.speed),
+ MGLEventKeyCourse: @(loc.course),
+ MGLEventKeyAltitude: @(loc.altitude),
+ MGLEventKeyHorizontalAccuracy: @(loc.horizontalAccuracy),
+ MGLEventKeyVerticalAccuracy: @(loc.verticalAccuracy)
+ }];
+ }
+}
+
+- (void)locationManager:(CLLocationManager *)manager didVisit:(CLVisit *)visit {
+ [MGLMapboxEvents pushEvent:MGLEventTypeVisit withAttributes:@{
+ MGLEventKeyLatitude: @(visit.coordinate.latitude),
+ MGLEventKeyLongitude: @(visit.coordinate.longitude),
+ MGLEventKeyHorizontalAccuracy: @(visit.horizontalAccuracy),
+ MGLEventKeyArrivalDate: [[NSDate distantPast] isEqualToDate:visit.arrivalDate] ? [NSNull null] : [_rfc3339DateFormatter stringFromDate:visit.arrivalDate],
+ MGLEventKeyDepartureDate: [[NSDate distantFuture] isEqualToDate:visit.departureDate] ? [NSNull null] : [_rfc3339DateFormatter stringFromDate:visit.departureDate]
+ }];
+}
+
+- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
+ [self validateUpdatingLocation];
+}
+
#pragma mark NSURLSessionDelegate
- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^) (NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler {
if([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
SecTrustRef serverTrust = [[challenge protectionSpace] serverTrust];
- NSString *domain = [[challenge protectionSpace] host];
SecTrustResultType trustResult;
// Validate the certificate chain with the device's trust store anyway
diff --git a/platform/ios/MGLMetricsLocationManager.m b/platform/ios/MGLMetricsLocationManager.m
deleted file mode 100644
index 848b4a051d..0000000000
--- a/platform/ios/MGLMetricsLocationManager.m
+++ /dev/null
@@ -1,124 +0,0 @@
-#import "MGLMapboxEvents.h"
-#import "MGLMetricsLocationManager.h"
-
-#import <CoreLocation/CoreLocation.h>
-
-@interface MGLMetricsLocationManager() <CLLocationManagerDelegate>
-
-@property (nonatomic) CLLocationManager *locationManager;
-@property (atomic) NSDateFormatter *rfc3339DateFormatter;
-
-@end
-
-@implementation MGLMetricsLocationManager
-
-- (instancetype) init {
- if (self = [super init]) {
- _locationManager = [[CLLocationManager alloc] init];
- _locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
- _locationManager.distanceFilter = 10;
- [_locationManager setDelegate:self];
-
- _rfc3339DateFormatter = [[NSDateFormatter alloc] init];
- NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
-
- [_rfc3339DateFormatter setLocale:enUSPOSIXLocale];
- [_rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ssZ"];
- // Clear Any System TimeZone Cache
- [NSTimeZone resetSystemTimeZone];
- [_rfc3339DateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
- }
- return self;
-}
-
-+ (instancetype)sharedManager {
- static dispatch_once_t onceToken;
- static MGLMetricsLocationManager *sharedManager;
- dispatch_once(&onceToken, ^{
- sharedManager = [[self alloc] init];
- });
- return sharedManager;
-}
-
-- (void)startUpdatingLocation {
- [self.locationManager startUpdatingLocation];
-}
-
-- (void)stopUpdatingLocation {
- [self.locationManager stopUpdatingLocation];
-}
-
-- (void)startMonitoringVisits {
- // -[CLLocationManager startMonitoringVisits] is only available in iOS 8+.
- if ([self.locationManager respondsToSelector:@selector(startMonitoringVisits)]) {
- [self.locationManager startMonitoringVisits];
- }
-}
-
-- (void)stopMonitoringVisits {
- // -[CLLocationManager stopMonitoringVisits] is only available in iOS 8+.
- if ([self.locationManager respondsToSelector:@selector(stopMonitoringVisits)]) {
- [self.locationManager stopMonitoringVisits];
- }
-}
-
-#pragma mark CLLocationManagerDelegate
-- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
- // Iterate through locations to pass all data
- for (CLLocation *loc in locations) {
- [MGLMapboxEvents pushEvent:MGLEventTypeLocation withAttributes:@{
- MGLEventKeyLatitude: @(loc.coordinate.latitude),
- MGLEventKeyLongitude: @(loc.coordinate.longitude),
- MGLEventKeySpeed: @(loc.speed),
- MGLEventKeyCourse: @(loc.course),
- MGLEventKeyAltitude: @(loc.altitude),
- MGLEventKeyHorizontalAccuracy: @(loc.horizontalAccuracy),
- MGLEventKeyVerticalAccuracy: @(loc.verticalAccuracy)
- }];
- }
-}
-
-- (void)locationManager:(CLLocationManager *)manager didVisit:(CLVisit *)visit {
- [MGLMapboxEvents pushEvent:MGLEventTypeVisit withAttributes:@{
- MGLEventKeyLatitude: @(visit.coordinate.latitude),
- MGLEventKeyLongitude: @(visit.coordinate.longitude),
- MGLEventKeyHorizontalAccuracy: @(visit.horizontalAccuracy),
- MGLEventKeyArrivalDate: [[NSDate distantPast] isEqualToDate:visit.arrivalDate] ? [NSNull null] : [_rfc3339DateFormatter stringFromDate:visit.arrivalDate],
- MGLEventKeyDepartureDate: [[NSDate distantFuture] isEqualToDate:visit.departureDate] ? [NSNull null] : [_rfc3339DateFormatter stringFromDate:visit.departureDate]
- }];
-}
-
-- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
- NSString *newStatus = nil;
- switch (status) {
- case kCLAuthorizationStatusNotDetermined:
- newStatus = @"User Hasn't Determined Yet";
- break;
- case kCLAuthorizationStatusRestricted:
- newStatus = @"Restricted and Can't Be Changed By User";
- break;
- case kCLAuthorizationStatusDenied:
- newStatus = @"User Explcitly Denied";
- [self stopUpdatingLocation];
- [self stopMonitoringVisits];
- break;
- case kCLAuthorizationStatusAuthorized:
- newStatus = @"User Has Authorized / Authorized Always";
- [self startUpdatingLocation];
- [self startMonitoringVisits];
- break;
-// case kCLAuthorizationStatusAuthorizedAlways:
-// newStatus = @"Not Determined";
-// break;
- case kCLAuthorizationStatusAuthorizedWhenInUse:
- newStatus = @"User Has Authorized When In Use Only";
- [self startUpdatingLocation];
- [self startMonitoringVisits];
- break;
- default:
- newStatus = @"Unknown";
- break;
- }
-}
-
-@end
diff --git a/platform/ios/MGLTypes.m b/platform/ios/MGLTypes.m
new file mode 100644
index 0000000000..01e9a1467c
--- /dev/null
+++ b/platform/ios/MGLTypes.m
@@ -0,0 +1,3 @@
+#import "MGLTypes.h"
+
+NSString * const MGLErrorDomain = @"MGLErrorDomain";
diff --git a/platform/ios/MGLUserLocation.m b/platform/ios/MGLUserLocation.m
index 91e8e30103..cdeae3a9ce 100644
--- a/platform/ios/MGLUserLocation.m
+++ b/platform/ios/MGLUserLocation.m
@@ -63,7 +63,7 @@
- (NSString *)title
{
- return (_title ? _title : @"Current Location");
+ return (_title ? _title : @"You Are Here");
}
@end
diff --git a/scripts/android/install.sh b/scripts/android/install.sh
index 656465cf2f..fe2b816064 100755
--- a/scripts/android/install.sh
+++ b/scripts/android/install.sh
@@ -3,8 +3,6 @@
set -e
set -o pipefail
-source ./scripts/travis_helper.sh
-
mapbox_time "checkout_mason" \
git submodule update --init .mason
diff --git a/scripts/android/run.sh b/scripts/android/run.sh
index 7a909ffe3c..38749f79f5 100755
--- a/scripts/android/run.sh
+++ b/scripts/android/run.sh
@@ -9,8 +9,6 @@ export HOST=android
export MASON_PLATFORM=android
export MASON_ANDROID_ABI=${ANDROID_ABI:-arm-v7}
-source ./scripts/travis_helper.sh
-
# Add Mason to PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
diff --git a/scripts/compare_images.sh b/scripts/compare_images.sh
index f9e1a81edb..2407726469 100755
--- a/scripts/compare_images.sh
+++ b/scripts/compare_images.sh
@@ -3,4 +3,4 @@
set -e
set -o pipefail
-(cd ./test/suite/ && (./bin/compare_images.py || true))
+(cd ./test/suite/ && ./bin/compare_images.py native)
diff --git a/scripts/ios/install.sh b/scripts/ios/install.sh
index 274557c5d7..ffa714f36f 100755
--- a/scripts/ios/install.sh
+++ b/scripts/ios/install.sh
@@ -3,11 +3,8 @@
set -e
set -o pipefail
-source ./scripts/travis_helper.sh
-
mapbox_time "checkout_mason" \
git submodule update --init .mason
-export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
mapbox_time "install_xcpretty" \
gem install xcpretty --no-rdoc --no-ri --no-document --quiet
diff --git a/scripts/ios/package.sh b/scripts/ios/package.sh
index 7691b0c5f3..35162ce5d1 100755
--- a/scripts/ios/package.sh
+++ b/scripts/ios/package.sh
@@ -4,8 +4,6 @@ set -e
set -o pipefail
set -u
-source ./scripts/travis_helper.sh
-
NAME=MapboxGL
OUTPUT=build/ios/pkg
IOS_SDK_VERSION=`xcrun --sdk iphoneos --show-sdk-version`
@@ -105,6 +103,11 @@ if [ -z `which appledoc` ]; then
fi
DOCS_OUTPUT="${OUTPUT}/static/Docs"
DOCS_VERSION=$( git tag -l ios\* --sort -v:refname | sed -n '1p' | sed 's/ios-v//' )
+README="/tmp/GL-README.md"
+cat ios/README.md > ${README}
+echo >> ${README}
+echo -n "#" >> ${README}
+cat CHANGELOG.md >> ${README}
appledoc \
--output ${DOCS_OUTPUT} \
--project-name "Mapbox GL for iOS ${DOCS_VERSION}" \
@@ -113,4 +116,6 @@ appledoc \
--no-create-docset \
--no-install-docset \
--company-id com.mapbox \
+ --ignore include/mbgl/ios/private \
+ --index-desc ${README} \
include/mbgl/ios
diff --git a/scripts/ios/run.sh b/scripts/ios/run.sh
index 30c2551a68..dbf785081b 100755
--- a/scripts/ios/run.sh
+++ b/scripts/ios/run.sh
@@ -4,12 +4,9 @@ set -e
set -o pipefail
set -u
-BUILDTYPE=${BUILDTYPE:-Release}
-
-source ./scripts/travis_helper.sh
+source ./scripts/ios/setup.sh
-# Add Mason to PATH
-export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
+BUILDTYPE=${BUILDTYPE:-Release}
PUBLISH_TAG=($(git show -s --format=%B | sed -n 's/.*\[publish \([a-z]\{1,\}\)-v\([0-9.]\{1,\}\)\].*/\1 \2/p'))
PUBLISH_PLATFORM=${PUBLISH_TAG[0],-}
@@ -31,5 +28,5 @@ if [[ ${PUBLISH_PLATFORM} = 'ios' ]]; then
else
# build & test iOS
mapbox_time "run_ios_tests" \
- make itest
+ make ipackage-sim
fi
diff --git a/scripts/ios/setup.sh b/scripts/ios/setup.sh
new file mode 100644
index 0000000000..d115cf9020
--- /dev/null
+++ b/scripts/ios/setup.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+# This script is sourced; do not set -e or -o pipefail here.
+
+# Ensure mason is on the PATH
+export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
diff --git a/scripts/linux/after_script.sh b/scripts/linux/after_script.sh
new file mode 100755
index 0000000000..c38af0a797
--- /dev/null
+++ b/scripts/linux/after_script.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
+ # Install and add awscli to PATH for uploading the results
+ mapbox_time "install_awscli" \
+ pip install --user awscli
+ export PATH="`python -m site --user-base`/bin:${PATH}"
+
+ mapbox_time_start "deploy_results"
+ (cd ./test/suite/ && ./bin/deploy_results.sh)
+ mapbox_time_finish
+fi
diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh
index a6ffacf5fe..a254d312ec 100755
--- a/scripts/linux/install.sh
+++ b/scripts/linux/install.sh
@@ -3,11 +3,9 @@
set -e
set -o pipefail
-source ./scripts/travis_helper.sh
-
mapbox_time "checkout_mason" \
git submodule update --init .mason
-export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
+PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" \
mapbox_time "install_mesa" \
mason install mesa 10.4.3
diff --git a/scripts/linux/run.sh b/scripts/linux/run.sh
index c4731b97ec..42d2a16d90 100755
--- a/scripts/linux/run.sh
+++ b/scripts/linux/run.sh
@@ -3,35 +3,9 @@
set -e
set -o pipefail
-BUILDTYPE=${BUILDTYPE:-Release}
-
-source ./scripts/travis_helper.sh
-
-# Add Mason to PATH
-export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
-
-# Set the core file limit to unlimited so a core file is generated upon crash
-ulimit -c unlimited -S
-
-################################################################################
-# X Server setup
-################################################################################
-
-# Start the mock X server
-if [ -f /etc/init.d/xvfb ] ; then
- mapbox_time "start_xvfb" \
- sh -e /etc/init.d/xvfb start
- sleep 2 # sometimes, xvfb takes some time to start up
-fi
-
-# Make sure we're connecting to xvfb
-export DISPLAY=:99.0
+source ./scripts/linux/setup.sh
-# Make sure we're loading the 10.4.3 libs we installed manually
-export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
-
-mapbox_time "glxinfo" \
-glxinfo
+BUILDTYPE=${BUILDTYPE:-Release}
################################################################################
# Build
@@ -43,6 +17,9 @@ git submodule update --init styles
mapbox_time "compile_program" \
make linux -j${JOBS} BUILDTYPE=${BUILDTYPE}
+mapbox_time "compile_render_binary" \
+make render -j${JOBS} BUILDTYPE=${BUILDTYPE}
+
mapbox_time "compile_tests" \
make test -j${JOBS} BUILDTYPE=${BUILDTYPE}
@@ -58,18 +35,3 @@ make test-* BUILDTYPE=${BUILDTYPE}
mapbox_time "compare_results" \
./scripts/compare_images.sh
-
-################################################################################
-# Deploy
-################################################################################
-
-if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
- # Install and add awscli to PATH for uploading the results
- mapbox_time "install_awscli" \
- pip install --user awscli
- export PATH="`python -m site --user-base`/bin:${PATH}"
-
- mapbox_time_start "deploy_results"
- (cd ./test/suite/ && ./bin/deploy_results.sh)
- mapbox_time_finish
-fi
diff --git a/scripts/linux/setup.sh b/scripts/linux/setup.sh
new file mode 100755
index 0000000000..af0eafb5cf
--- /dev/null
+++ b/scripts/linux/setup.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# This script is sourced; do not set -e or -o pipefail here.
+
+# Ensure mason is on the PATH
+export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
+
+# Set the core file limit to unlimited so a core file is generated upon crash
+ulimit -c unlimited -S
+
+################################################################################
+# X Server setup
+################################################################################
+
+# Start the mock X server
+if [ -f /etc/init.d/xvfb ] ; then
+ mapbox_time "start_xvfb" \
+ sh -e /etc/init.d/xvfb start
+ sleep 2 # sometimes, xvfb takes some time to start up
+fi
+
+# Make sure we're connecting to xvfb
+export DISPLAY=:99.0
+
+# Make sure we're loading the 10.4.3 libs we installed manually
+export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
+
+mapbox_time "glxinfo" \
+glxinfo
diff --git a/scripts/osx/install.sh b/scripts/osx/install.sh
index 1994d371d0..d6d9c065cf 100755
--- a/scripts/osx/install.sh
+++ b/scripts/osx/install.sh
@@ -3,11 +3,8 @@
set -e
set -o pipefail
-source ./scripts/travis_helper.sh
-
mapbox_time "checkout_mason" \
git submodule update --init .mason
-export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
mapbox_time "install_xcpretty" \
gem install xcpretty --no-rdoc --no-ri --no-document --quiet
diff --git a/scripts/osx/run.sh b/scripts/osx/run.sh
index b84ed04c21..70d54c5ce9 100755
--- a/scripts/osx/run.sh
+++ b/scripts/osx/run.sh
@@ -3,15 +3,9 @@
set -e
set -o pipefail
-BUILDTYPE=${BUILDTYPE:-Release}
-
-source ./scripts/travis_helper.sh
-
-# Add Mason to PATH
-export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
+source ./scripts/osx/setup.sh
-# Set the core file limit to unlimited so a core file is generated upon crash
-ulimit -c unlimited -S
+BUILDTYPE=${BUILDTYPE:-Release}
################################################################################
# Build
@@ -23,5 +17,8 @@ git submodule update --init styles
mapbox_time "compile_program" \
make xosx -j${JOBS} BUILDTYPE=${BUILDTYPE}
+mapbox_time "compile_render_binary" \
+make xrender -j${JOBS} BUILDTYPE=${BUILDTYPE}
+
mapbox_time "compile_tests" \
make xtest -j${JOBS} BUILDTYPE=${BUILDTYPE}
diff --git a/scripts/osx/setup.sh b/scripts/osx/setup.sh
new file mode 100755
index 0000000000..502d61d44d
--- /dev/null
+++ b/scripts/osx/setup.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# This script is sourced; do not set -e or -o pipefail here.
+
+# Ensure mason is on the PATH
+export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
+
+# Set the core file limit to unlimited so a core file is generated upon crash
+ulimit -c unlimited -S
diff --git a/scripts/travis_helper.sh b/scripts/travis_helper.sh
index 5e7dd46f4f..5a765b131d 100755
--- a/scripts/travis_helper.sh
+++ b/scripts/travis_helper.sh
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
+# This script is sourced, so do not set -e or -o pipefail here. Doing so would
+# bleed into Travis' wrapper script, which messes with their workflow, e.g.
+# preventing after_failure scripts to be triggered.
+
case `uname -s` in
'Darwin') JOBS=$((`sysctl -n hw.ncpu` + 2)) ;;
'Linux') JOBS=$((`nproc` + 2)) ;;
diff --git a/src/mbgl/geometry/binpack.hpp b/src/mbgl/geometry/binpack.hpp
index 9aadaa202c..504417f452 100644
--- a/src/mbgl/geometry/binpack.hpp
+++ b/src/mbgl/geometry/binpack.hpp
@@ -23,7 +23,11 @@ public:
if (width <= ref.w && height <= ref.h) {
if (smallest == free.end() || (ref.y <= rect.y && ref.x <= rect.x)) {
smallest = it;
+ } else {
+ // Our current "smallest" rect is already closer to 0/0.
}
+ } else {
+ // The rect in the free list is not big enough.
}
}
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp
index f2978de980..02271b9c74 100644
--- a/src/mbgl/geometry/glyph_atlas.cpp
+++ b/src/mbgl/geometry/glyph_atlas.cpp
@@ -4,6 +4,8 @@
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
+#include <mbgl/util/std.hpp>
+
#include <cassert>
#include <algorithm>
@@ -14,7 +16,7 @@ GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_)
: width(width_),
height(height_),
bin(width_, height_),
- data(new char[width_ *height_]),
+ data(util::make_unique<uint8_t[]>(width_ * height_)),
dirty(true) {
}
@@ -67,8 +69,9 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uintptr_t tileUID,
uint16_t buffered_height = glyph.metrics.height + buffer * 2;
// Add a 1px border around every image.
- uint16_t pack_width = buffered_width;
- uint16_t pack_height = buffered_height;
+ const uint16_t padding = 1;
+ uint16_t pack_width = buffered_width + 2 * padding;
+ uint16_t pack_height = buffered_height + 2 * padding;
// Increase to next number divisible by 4, but at least 1.
// This is so we can scale down the texture coordinates and pack them
@@ -88,13 +91,12 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uintptr_t tileUID,
face.emplace(glyph.id, GlyphValue { rect, tileUID });
// Copy the bitmap
- char *target = data.get();
- const char *source = glyph.bitmap.data();
+ const uint8_t* source = reinterpret_cast<const uint8_t*>(glyph.bitmap.data());
for (uint32_t y = 0; y < buffered_height; y++) {
- uint32_t y1 = width * (rect.y + y) + rect.x;
+ uint32_t y1 = width * (rect.y + y + padding) + rect.x + padding;
uint32_t y2 = buffered_width * y;
for (uint32_t x = 0; x < buffered_width; x++) {
- target[y1 + x] = source[y2 + x];
+ data[y1 + x] = source[y2 + x];
}
}
@@ -116,7 +118,7 @@ void GlyphAtlas::removeGlyphs(uintptr_t tileUID) {
const Rect<uint16_t>& rect = value.rect;
// Clear out the bitmap.
- char *target = data.get();
+ uint8_t *target = data.get();
for (uint32_t y = 0; y < rect.h; y++) {
uint32_t y1 = width * (rect.y + y) + rect.x;
for (uint32_t x = 0; x < rect.w; x++) {
diff --git a/src/mbgl/geometry/glyph_atlas.hpp b/src/mbgl/geometry/glyph_atlas.hpp
index dfa568f0fd..8bc21da09f 100644
--- a/src/mbgl/geometry/glyph_atlas.hpp
+++ b/src/mbgl/geometry/glyph_atlas.hpp
@@ -49,7 +49,7 @@ private:
std::mutex mtx;
BinPack<uint16_t> bin;
std::map<std::string, std::map<uint32_t, GlyphValue>> index;
- std::unique_ptr<char[]> data;
+ const std::unique_ptr<uint8_t[]> data;
std::atomic<bool> dirty;
uint32_t texture = 0;
};
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index 42d2380777..91ac15639b 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -3,6 +3,7 @@
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
+#include <mbgl/util/std.hpp>
#include <boost/functional/hash.hpp>
@@ -14,7 +15,7 @@ using namespace mbgl;
LineAtlas::LineAtlas(uint16_t w, uint16_t h)
: width(w),
height(h),
- data(new char[w * h]),
+ data(util::make_unique<uint8_t[]>(w * h)),
dirty(true) {
}
@@ -23,8 +24,6 @@ LineAtlas::~LineAtlas() {
Environment::Get().abandonTexture(texture);
texture = 0;
-
- delete[] data;
}
LinePatternPos LineAtlas::getDashPosition(const std::vector<float> &dasharray, bool round) {
@@ -162,7 +161,7 @@ void LineAtlas::bind() {
0, // GLint border
GL_ALPHA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
- data // const GLvoid * data
+ data.get() // const GLvoid * data
));
} else {
MBGL_CHECK_ERROR(glTexSubImage2D(
@@ -174,7 +173,7 @@ void LineAtlas::bind() {
height, // GLsizei height
GL_ALPHA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
- data // const GLvoid *pixels
+ data.get() // const GLvoid *pixels
));
}
diff --git a/src/mbgl/geometry/line_atlas.hpp b/src/mbgl/geometry/line_atlas.hpp
index 3683272f98..296c997f74 100644
--- a/src/mbgl/geometry/line_atlas.hpp
+++ b/src/mbgl/geometry/line_atlas.hpp
@@ -34,7 +34,7 @@ public:
private:
std::recursive_mutex mtx;
- char *const data = nullptr;
+ const std::unique_ptr<uint8_t[]> data;
std::atomic<bool> dirty;
uint32_t texture = 0;
int nextRow = 0;
diff --git a/src/mbgl/geometry/sprite_atlas.cpp b/src/mbgl/geometry/sprite_atlas.cpp
index 9d0aeac8b7..4e05c94ad1 100644
--- a/src/mbgl/geometry/sprite_atlas.cpp
+++ b/src/mbgl/geometry/sprite_atlas.cpp
@@ -33,9 +33,7 @@ bool SpriteAtlas::resize(const float newRatio) {
pixelRatio = newRatio;
if (data) {
- uint32_t *old_data = data;
-
- data = nullptr;
+ const auto oldData = std::move(data);
allocate();
const int old_w = width * oldRatio;
@@ -44,19 +42,15 @@ bool SpriteAtlas::resize(const float newRatio) {
const int new_h = height * newRatio;
// Basic image scaling. TODO: Replace this with better image scaling.
- uint32_t *img_new = reinterpret_cast<uint32_t *>(data);
- const uint32_t *img_old = reinterpret_cast<const uint32_t *>(old_data);
-
for (int y = 0; y < new_h; y++) {
const int old_yoffset = ((y * old_h) / new_h) * old_w;
const int new_yoffset = y * new_w;
for (int x = 0; x < new_w; x++) {
const int old_x = (x * old_w) / new_w;
- img_new[new_yoffset + x] = img_old[old_yoffset + old_x];
+ data[new_yoffset + x] = oldData[old_yoffset + old_x];
}
}
- ::operator delete(old_data);
dirty = true;
fullUploadRequired = true;
@@ -133,10 +127,12 @@ SpriteAtlasPosition SpriteAtlas::getPosition(const std::string& name, bool repea
rect.h = pos.height / pos.pixelRatio;
}
+ const float padding = 1;
+
return SpriteAtlasPosition {
{{ float(rect.w), float(rect.h) }},
- {{ float(rect.x) / width, float(rect.y) / height }},
- {{ float(rect.x + rect.w) / width, float(rect.y + rect.h) / height }}
+ {{ float(rect.x + padding) / width, float(rect.y + padding) / height }},
+ {{ float(rect.x + padding + rect.w) / width, float(rect.y + padding + rect.h) / height }}
};
}
@@ -144,8 +140,8 @@ void SpriteAtlas::allocate() {
if (!data) {
dimension w = static_cast<dimension>(width * pixelRatio);
dimension h = static_cast<dimension>(height * pixelRatio);
- data = static_cast<uint32_t*>(::operator new(w * h * sizeof(uint32_t)));
- std::fill(data, data + w * h, 0);
+ data = util::make_unique<uint32_t[]>(w * h);
+ std::fill(data.get(), data.get() + w * h, 0);
}
}
@@ -157,12 +153,14 @@ void SpriteAtlas::copy(const Rect<dimension>& dst, const SpritePosition& src, co
const vec2<uint32_t> srcSize { sprite->raster->getWidth(), sprite->raster->getHeight() };
const Rect<uint32_t> srcPos { src.x, src.y, src.width, src.height };
+ const int offset = 1;
+
allocate();
- uint32_t *dstData = reinterpret_cast<uint32_t *>(data);
+ uint32_t *const dstData = data.get();
const vec2<uint32_t> dstSize { static_cast<unsigned int>(width * pixelRatio),
static_cast<unsigned int>(height * pixelRatio) };
- const Rect<uint32_t> dstPos { static_cast<uint32_t>(dst.x * pixelRatio),
- static_cast<uint32_t>(dst.y * pixelRatio),
+ const Rect<uint32_t> dstPos { static_cast<uint32_t>((offset + dst.x) * pixelRatio),
+ static_cast<uint32_t>((offset + dst.y) * pixelRatio),
static_cast<uint32_t>(dst.originalW * pixelRatio),
static_cast<uint32_t>(dst.originalH * pixelRatio) };
@@ -274,7 +272,7 @@ void SpriteAtlas::bind(bool linear) {
0, // GLint border
GL_RGBA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
- data // const GLvoid * data
+ data.get() // const GLvoid * data
));
fullUploadRequired = false;
} else {
@@ -287,7 +285,7 @@ void SpriteAtlas::bind(bool linear) {
height * pixelRatio, // GLsizei height
GL_RGBA, // GLenum format
GL_UNSIGNED_BYTE, // GLenum type
- data // const GLvoid *pixels
+ data.get() // const GLvoid *pixels
));
}
@@ -303,5 +301,4 @@ SpriteAtlas::~SpriteAtlas() {
std::lock_guard<std::recursive_mutex> lock(mtx);
Environment::Get().abandonTexture(texture);
texture = 0;
- ::operator delete(data), data = nullptr;
}
diff --git a/src/mbgl/geometry/sprite_atlas.hpp b/src/mbgl/geometry/sprite_atlas.hpp
index 6c4a381aa1..d34013cd6c 100644
--- a/src/mbgl/geometry/sprite_atlas.hpp
+++ b/src/mbgl/geometry/sprite_atlas.hpp
@@ -77,7 +77,7 @@ private:
util::ptr<Sprite> sprite;
std::map<std::string, Rect<dimension>> images;
std::set<std::string> uninitialized;
- uint32_t *data = nullptr;
+ std::unique_ptr<uint32_t[]> data;
std::atomic<bool> dirty;
bool fullUploadRequired = true;
uint32_t texture = 0;
diff --git a/src/mbgl/geometry/vao.cpp b/src/mbgl/geometry/vao.cpp
index fef74396a9..440e48c578 100644
--- a/src/mbgl/geometry/vao.cpp
+++ b/src/mbgl/geometry/vao.cpp
@@ -5,11 +5,46 @@
namespace mbgl {
+static gl::ExtensionFunction<
+ void (GLuint array)>
+ BindVertexArray({
+ {"GL_ARB_vertex_array_object", "glBindVertexArray"},
+ {"GL_OES_vertex_array_object", "glBindVertexArrayOES"},
+ {"GL_APPLE_vertex_array_object", "glBindVertexArrayAPPLE"}
+ });
+
+static gl::ExtensionFunction<
+ void (GLsizei n,
+ const GLuint* arrays)>
+ DeleteVertexArrays({
+ {"GL_ARB_vertex_array_object", "glDeleteVertexArrays"},
+ {"GL_OES_vertex_array_object", "glDeleteVertexArraysOES"},
+ {"GL_APPLE_vertex_array_object", "glDeleteVertexArraysAPPLE"}
+ });
+
+static gl::ExtensionFunction<
+ void (GLsizei n,
+ GLuint* arrays)>
+ GenVertexArrays({
+ {"GL_ARB_vertex_array_object", "glGenVertexArrays"},
+ {"GL_OES_vertex_array_object", "glGenVertexArraysOES"},
+ {"GL_APPLE_vertex_array_object", "glGenVertexArraysAPPLE"}
+ });
+
+void VertexArrayObject::Unbind() {
+ if (!BindVertexArray) return;
+ MBGL_CHECK_ERROR(BindVertexArray(0));
+}
+
+void VertexArrayObject::Delete(GLsizei n, const GLuint* arrays) {
+ MBGL_CHECK_ERROR(DeleteVertexArrays(n, arrays));
+}
+
VertexArrayObject::VertexArrayObject() {
}
VertexArrayObject::~VertexArrayObject() {
- if (!gl::DeleteVertexArrays) return;
+ if (!DeleteVertexArrays) return;
if (vao) {
Environment::Get().abandonVAO(vao);
@@ -17,7 +52,7 @@ VertexArrayObject::~VertexArrayObject() {
}
void VertexArrayObject::bindVertexArrayObject() {
- if (!gl::GenVertexArrays || !gl::BindVertexArray) {
+ if (!GenVertexArrays || !BindVertexArray) {
static bool reported = false;
if (!reported) {
Log::Warning(Event::OpenGL, "Not using Vertex Array Objects");
@@ -27,9 +62,9 @@ void VertexArrayObject::bindVertexArrayObject() {
}
if (!vao) {
- MBGL_CHECK_ERROR(gl::GenVertexArrays(1, &vao));
+ MBGL_CHECK_ERROR(GenVertexArrays(1, &vao));
}
- MBGL_CHECK_ERROR(gl::BindVertexArray(vao));
+ MBGL_CHECK_ERROR(BindVertexArray(vao));
}
void VertexArrayObject::verifyBinding(Shader &shader, GLuint vertexBuffer, GLuint elementsBuffer,
diff --git a/src/mbgl/geometry/vao.hpp b/src/mbgl/geometry/vao.hpp
index 72bacfd793..e512a3e480 100644
--- a/src/mbgl/geometry/vao.hpp
+++ b/src/mbgl/geometry/vao.hpp
@@ -11,6 +11,9 @@ namespace mbgl {
class VertexArrayObject : public util::noncopyable {
public:
+ static void Unbind();
+ static void Delete(GLsizei n, const GLuint* arrays);
+
VertexArrayObject();
~VertexArrayObject();
diff --git a/src/mbgl/gl/debugging.cpp b/src/mbgl/gl/debugging.cpp
new file mode 100644
index 0000000000..5fc90e8274
--- /dev/null
+++ b/src/mbgl/gl/debugging.cpp
@@ -0,0 +1,195 @@
+#include <mbgl/gl/debugging.hpp>
+#include <mbgl/platform/gl.hpp>
+#include <mbgl/platform/event.hpp>
+#include <mbgl/platform/log.hpp>
+
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
+#define GL_DEBUG_SOURCE_API 0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
+#define GL_DEBUG_SOURCE_APPLICATION 0x824A
+#define GL_DEBUG_SOURCE_OTHER 0x824B
+#define GL_DEBUG_TYPE_ERROR 0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY 0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
+#define GL_DEBUG_TYPE_OTHER 0x8251
+#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES 0x9145
+#define GL_DEBUG_SEVERITY_HIGH 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
+#define GL_DEBUG_SEVERITY_LOW 0x9148
+#define GL_DEBUG_TYPE_MARKER 0x8268
+#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
+#define GL_DEBUG_TYPE_POP_GROUP 0x826A
+#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
+#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
+#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
+#define GL_BUFFER 0x82E0
+#define GL_SHADER 0x82E1
+#define GL_PROGRAM 0x82E2
+#define GL_QUERY 0x82E3
+#define GL_PROGRAM_PIPELINE 0x82E4
+#define GL_SAMPLER 0x82E6
+#define GL_MAX_LABEL_LENGTH 0x82E8
+#define GL_DEBUG_OUTPUT 0x92E0
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#define GL_DISPLAY_LIST 0x82E7
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_TRANSFORM_FEEDBACK 0x8E22
+#define GL_TEXTURE 0x1702
+#define GL_RENDERBUFFER 0x8D41
+#define GL_FRAMEBUFFER 0x8D40
+
+namespace mbgl {
+namespace gl {
+namespace debugging {
+
+typedef void (*GLDEBUGPROC)(GLenum source,
+ GLenum type,
+ GLuint id,
+ GLenum severity,
+ GLsizei length,
+ const GLchar *message,
+ const void *userParam);
+
+static ExtensionFunction<
+ void (GLenum source,
+ GLenum type,
+ GLenum severity,
+ GLsizei count,
+ const GLuint *ids,
+ GLboolean enabled)>
+ DebugMessageControl({
+ {"GL_KHR_debug", "glDebugMessageControl"},
+ {"GL_ARB_debug_output", "glDebugMessageControlARB"}
+ });
+
+static ExtensionFunction<
+ void (GLDEBUGPROC callback,
+ const void *userParam)>
+ DebugMessageCallback({
+ {"GL_KHR_debug", "glDebugMessageCallback"},
+ {"GL_ARB_debug_output", "glDebugMessageCallbackARB"}
+ });
+
+static ExtensionFunction<
+ void (GLenum source,
+ GLuint id,
+ GLsizei length,
+ const GLchar *message)>
+ PushDebugGroup({
+ {"GL_KHR_debug", "glPushDebugGroup"}
+ });
+
+static ExtensionFunction<
+ void ()>
+ PopDebugGroup({
+ {"GL_KHR_debug", "glPopDebugGroup"}
+ });
+
+static ExtensionFunction<
+ void (GLsizei length,
+ const GLchar *marker)>
+ PushGroupMarkerEXT({
+ {"GL_EXT_debug_marker", "glPushGroupMarkerEXT"}
+ });
+
+static ExtensionFunction<
+ void ()>
+ PopGroupMarkerEXT({
+ {"GL_EXT_debug_marker", "glPopGroupMarkerEXT"}
+ });
+
+void debugCallback(GLenum source,
+ GLenum type,
+ GLuint id,
+ GLenum severity,
+ GLsizei /*length*/,
+ const GLchar* message,
+ const void* /*userParam*/)
+{
+ std::string strSource;
+ switch (source) {
+ case GL_DEBUG_SOURCE_API: strSource = "DEBUG_SOURCE_API"; break;
+ case GL_DEBUG_SOURCE_WINDOW_SYSTEM: strSource = "DEBUG_SOURCE_WINDOW_SYSTEM"; break;
+ case GL_DEBUG_SOURCE_SHADER_COMPILER: strSource = "DEBUG_SOURCE_SHADER_COMPILER"; break;
+ case GL_DEBUG_SOURCE_THIRD_PARTY: strSource = "DEBUG_SOURCE_THIRD_PARTY"; break;
+ case GL_DEBUG_SOURCE_APPLICATION: strSource = "DEBUG_SOURCE_APPLICATION"; break;
+ case GL_DEBUG_SOURCE_OTHER: strSource = "DEBUG_SOURCE_OTHER"; break;
+ default: strSource = "(unknown)"; break;
+ }
+
+ std::string strType;
+ switch (type) {
+ case GL_DEBUG_TYPE_ERROR: strType = "DEBUG_TYPE_ERROR"; break;
+ case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: strType = "DEBUG_TYPE_DEPRECATED_BEHAVIOR"; break;
+ case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: strType = "DEBUG_TYPE_UNDEFINED_BEHAVIOR"; break;
+ case GL_DEBUG_TYPE_PERFORMANCE: strType = "DEBUG_TYPE_PERFORMANCE"; break;
+ case GL_DEBUG_TYPE_PORTABILITY: strType = "DEBUG_TYPE_PORTABILITY"; break;
+ case GL_DEBUG_TYPE_OTHER: strType = "DEBUG_TYPE_OTHER"; break;
+ case GL_DEBUG_TYPE_MARKER: strType = "DEBUG_TYPE_MARKER"; break;
+ case GL_DEBUG_TYPE_PUSH_GROUP: strType = "DEBUG_TYPE_OTHER"; break;
+ case GL_DEBUG_TYPE_POP_GROUP: strType = "DEBUG_TYPE_POP_GROUP"; break;
+ default: strSource = "(unknown)"; break;
+ }
+
+ std::string strSeverity;
+ mbgl::EventSeverity evtSeverity;
+ switch (severity) {
+ case GL_DEBUG_SEVERITY_HIGH: strSeverity = "DEBUG_SEVERITY_HIGH"; evtSeverity = mbgl::EventSeverity::Error; break;
+ case GL_DEBUG_SEVERITY_MEDIUM: strSeverity = "DEBUG_SEVERITY_MEDIUM"; evtSeverity = mbgl::EventSeverity::Warning; break;
+ case GL_DEBUG_SEVERITY_LOW: strSeverity = "DEBUG_SEVERITY_LOW"; evtSeverity = mbgl::EventSeverity::Info; break;
+ case GL_DEBUG_SEVERITY_NOTIFICATION: strSeverity = "DEBUG_SEVERITY_NOTIFICATION"; evtSeverity = mbgl::EventSeverity::Debug; break;
+ default: strSource = "(unknown)"; evtSeverity = mbgl::EventSeverity::Debug; break;
+ }
+
+ mbgl::Log::Record(evtSeverity, mbgl::Event::OpenGL, "GL_%s GL_%s %u GL_%s - %s", strSource.c_str(), strType.c_str(), id, strSeverity.c_str(), message);
+}
+
+void enable() {
+ if (!DebugMessageControl || !DebugMessageCallback) {
+ return;
+ }
+
+ // This will enable all messages including performance hints
+ //MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE));
+
+ // This will only enable high and medium severity messages
+ MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr, GL_TRUE));
+ MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, nullptr, GL_TRUE));
+ MBGL_CHECK_ERROR(DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE));
+
+ MBGL_CHECK_ERROR(DebugMessageCallback(debugCallback, nullptr));
+}
+
+#if defined(DEBUG)
+group::group(const std::string& str) {
+ if (PushDebugGroup) {
+ PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, GLsizei(str.size()), str.c_str());
+ } else if (PushGroupMarkerEXT) {
+ PushGroupMarkerEXT(GLsizei(str.size()), str.c_str());
+ }
+}
+
+group::~group() {
+ if (PopDebugGroup) {
+ PopDebugGroup();
+ } else if (PopGroupMarkerEXT) {
+ PopGroupMarkerEXT();
+ }
+}
+#else
+group::group(const std::string&) {}
+group::~group() = default;
+#endif
+
+}
+}
+}
diff --git a/src/mbgl/gl/debugging.hpp b/src/mbgl/gl/debugging.hpp
new file mode 100644
index 0000000000..82d08a53fb
--- /dev/null
+++ b/src/mbgl/gl/debugging.hpp
@@ -0,0 +1,21 @@
+#ifndef MBGL_GL_DEBUG_MESSAGES
+#define MBGL_GL_DEBUG_MESSAGES
+
+#include <string>
+
+namespace mbgl {
+namespace gl {
+namespace debugging {
+
+void enable();
+
+struct group {
+ group(const std::string&);
+ ~group();
+};
+
+}
+}
+}
+
+#endif
diff --git a/src/mbgl/map/environment.cpp b/src/mbgl/map/environment.cpp
index 5857d4bdf6..f2112c61b2 100644
--- a/src/mbgl/map/environment.cpp
+++ b/src/mbgl/map/environment.cpp
@@ -2,6 +2,7 @@
#include <mbgl/storage/file_source.hpp>
#include <mbgl/platform/gl.hpp>
#include <mbgl/util/run_loop.hpp>
+#include <mbgl/geometry/vao.hpp>
#include <uv.h>
@@ -35,10 +36,7 @@ public:
void registerThread(Environment* env, ThreadType type, const std::string& name) {
std::lock_guard<std::mutex> lock(mtx);
- // FIXME: We should never need to overwrite a thread here and we only allow
- // this today because on the Static mode, the Map thread and the Main thread
- // are same. Replace this with emplace() when this gets fixed.
- threadSet[std::this_thread::get_id()] = ThreadInfo{ env, type, name };
+ threadSet.emplace(std::this_thread::get_id(), ThreadInfo{ env, type, name });
}
void unregisterThread() {
@@ -121,11 +119,6 @@ unsigned Environment::getID() const {
return id;
}
-void Environment::requestAsync(const Resource& resource,
- std::function<void(const Response&)> callback) {
- fileSource.request(resource, std::move(callback));
-}
-
Request* Environment::request(const Resource& resource,
std::function<void(const Response&)> callback) {
return fileSource.request(resource, util::RunLoop::current.get()->get(), std::move(callback));
@@ -160,8 +153,8 @@ void Environment::performCleanup() {
assert(currentlyOn(ThreadType::Map));
if (!abandonedVAOs.empty()) {
- MBGL_CHECK_ERROR(gl::DeleteVertexArrays(static_cast<GLsizei>(abandonedVAOs.size()),
- abandonedVAOs.data()));
+ MBGL_CHECK_ERROR(VertexArrayObject::Delete(static_cast<GLsizei>(abandonedVAOs.size()),
+ abandonedVAOs.data()));
abandonedVAOs.clear();
}
diff --git a/src/mbgl/map/live_tile_data.cpp b/src/mbgl/map/live_tile_data.cpp
index 096e899d8f..59f7b4de3d 100644
--- a/src/mbgl/map/live_tile_data.cpp
+++ b/src/mbgl/map/live_tile_data.cpp
@@ -21,7 +21,7 @@ LiveTileData::LiveTileData(const TileID& id_,
spriteAtlas_, sprite_, source_),
annotationManager(annotationManager_) {
// live features are always ready
- state = State::loaded;
+ setState(State::loaded);
}
LiveTileData::~LiveTileData() {
@@ -31,7 +31,7 @@ LiveTileData::~LiveTileData() {
}
void LiveTileData::parse() {
- if (state != State::loaded) {
+ if (getState() != State::loaded) {
return;
}
@@ -46,12 +46,12 @@ void LiveTileData::parse() {
parser.parse();
} catch (const std::exception& ex) {
Log::Error(Event::ParseTile, "Live-parsing [%d/%d/%d] failed: %s", id.z, id.x, id.y, ex.what());
- state = State::obsolete;
+ setState(State::obsolete);
return;
}
}
- if (state != State::obsolete) {
- state = State::parsed;
+ if (getState() != State::obsolete) {
+ setState(State::parsed);
}
}
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 91b43f7b7b..8514c6ecb2 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -9,9 +9,9 @@
namespace mbgl {
-Map::Map(View& view, FileSource& fileSource, MapMode mode, bool startPaused)
+Map::Map(View& view, FileSource& fileSource, MapMode mode)
: data(util::make_unique<MapData>(view, mode)),
- context(util::make_unique<util::Thread<MapContext>>("Map", util::ThreadPriority::Regular, view, fileSource, *data, startPaused))
+ context(util::make_unique<util::Thread<MapContext>>("Map", util::ThreadPriority::Regular, view, fileSource, *data))
{
view.initialize(this);
}
@@ -23,13 +23,17 @@ Map::~Map() {
void Map::pause() {
assert(data->mode == MapMode::Continuous);
- std::unique_lock<std::mutex> lockPause(data->mutexPause);
- context->invoke(&MapContext::pause);
- data->condPaused.wait(lockPause);
+ if (!paused) {
+ std::unique_lock<std::mutex> lockPause(data->mutexPause);
+ context->invoke(&MapContext::pause);
+ data->condPaused.wait(lockPause);
+ paused = true;
+ }
}
void Map::resume() {
data->condResume.notify_all();
+ paused = false;
}
void Map::renderStill(StillImageCallback callback) {
@@ -274,12 +278,12 @@ LatLngBounds Map::getBoundsForAnnotations(const std::vector<uint32_t>& annotatio
void Map::setDebug(bool value) {
data->setDebug(value);
- update(Update::Debug);
+ update();
}
void Map::toggleDebug() {
data->toggleDebug();
- update(Update::Debug);
+ update();
}
bool Map::getDebug() const {
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index 2352e09c2b..f373274ebd 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -29,31 +29,23 @@
namespace mbgl {
-MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, MapData& data_, bool startPaused)
+MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, MapData& data_)
: view(view_),
data(data_),
env(fileSource),
envScope(env, ThreadType::Map, "Map"),
updated(static_cast<UpdateType>(Update::Nothing)),
asyncUpdate(util::make_unique<uv::async>(loop, [this] { update(); })),
- glyphStore(util::make_unique<GlyphStore>(env)),
+ glyphStore(util::make_unique<GlyphStore>(loop, env)),
glyphAtlas(util::make_unique<GlyphAtlas>(1024, 1024)),
spriteAtlas(util::make_unique<SpriteAtlas>(512, 512)),
lineAtlas(util::make_unique<LineAtlas>(512, 512)),
- texturePool(util::make_unique<TexturePool>()),
- painter(util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas))
-{
+ texturePool(util::make_unique<TexturePool>()) {
assert(Environment::currentlyOn(ThreadType::Map));
asyncUpdate->unref();
view.activate();
-
- if (startPaused) {
- pause();
- }
-
- painter->setup();
}
MapContext::~MapContext() {
@@ -142,6 +134,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
resourceLoader->setAccessToken(data.getAccessToken());
resourceLoader->setObserver(this);
resourceLoader->setStyle(style.get());
+ resourceLoader->setGlyphStore(glyphStore.get());
triggerUpdate(Update::Zoom);
}
@@ -149,8 +142,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
void MapContext::updateTiles() {
assert(Environment::currentlyOn(ThreadType::Map));
- resourceLoader->update(data, transformState, *glyphAtlas, *glyphStore,
- *spriteAtlas, *texturePool);
+ resourceLoader->update(data, transformState, *glyphAtlas, *spriteAtlas, *texturePool);
}
void MapContext::updateAnnotationTiles(const std::vector<TileID>& ids) {
@@ -173,11 +165,6 @@ void MapContext::update() {
updated |= data.transform.updateTransitions(now);
transformState = data.transform.currentState();
- if (updated & static_cast<UpdateType>(Update::Debug)) {
- assert(painter);
- painter->setDebug(data.getDebug());
- }
-
if (style) {
if (updated & static_cast<UpdateType>(Update::DefaultTransitionDuration)) {
style->setDefaultTransitionDuration(data.getDefaultTransitionDuration());
@@ -194,7 +181,7 @@ void MapContext::update() {
updateTiles();
- if (style->isLoaded()) {
+ if (style->isLoaded() && resourceLoader->getSprite()->isLoaded()) {
if (!data.getFullyLoaded()) {
data.setFullyLoaded(true);
}
@@ -229,12 +216,22 @@ void MapContext::render() {
// Cleanup OpenGL objects that we abandoned since the last render call.
env.performCleanup();
+ if (data.mode == MapMode::Still && (!callback || !data.getFullyLoaded())) {
+ // We are either not waiting for a map to be rendered, or we don't have all resources yet.
+ return;
+ }
+
assert(style);
- assert(painter);
+ if (!painter) {
+ painter = util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas);
+ painter->setup();
+ }
+
+ painter->setDebug(data.getDebug());
painter->render(*style, transformState, data.getAnimationTime());
- if (data.mode == MapMode::Still && callback && style->isLoaded() && resourceLoader->getSprite()->isLoaded()) {
+ if (data.mode == MapMode::Still) {
callback(view.readStillImage());
callback = nullptr;
}
diff --git a/src/mbgl/map/map_context.hpp b/src/mbgl/map/map_context.hpp
index 0463d076b6..c842454849 100644
--- a/src/mbgl/map/map_context.hpp
+++ b/src/mbgl/map/map_context.hpp
@@ -35,7 +35,7 @@ struct LatLngBounds;
class MapContext : public ResourceLoader::Observer {
public:
- MapContext(uv_loop_t*, View&, FileSource&, MapData&, bool startPaused);
+ MapContext(uv_loop_t*, View&, FileSource&, MapData&);
~MapContext();
void pause();
@@ -63,7 +63,6 @@ public:
void onTileDataChanged() override;
private:
- util::ptr<Sprite> getSprite();
void updateTiles();
// Update the state indicated by the accumulated Update flags, then render.
diff --git a/src/mbgl/map/raster_tile_data.cpp b/src/mbgl/map/raster_tile_data.cpp
index 20c07b573d..0f8efe3b48 100644
--- a/src/mbgl/map/raster_tile_data.cpp
+++ b/src/mbgl/map/raster_tile_data.cpp
@@ -15,14 +15,14 @@ RasterTileData::~RasterTileData() {
}
void RasterTileData::parse() {
- if (state != State::loaded) {
+ if (getState() != State::loaded) {
return;
}
if (bucket.setImage(data)) {
- state = State::parsed;
+ setState(State::parsed);
} else {
- state = State::invalid;
+ setState(State::invalid);
}
}
diff --git a/src/mbgl/map/resource_loader.cpp b/src/mbgl/map/resource_loader.cpp
index fba61cc649..2be86dc5e2 100644
--- a/src/mbgl/map/resource_loader.cpp
+++ b/src/mbgl/map/resource_loader.cpp
@@ -25,6 +25,10 @@ ResourceLoader::~ResourceLoader() {
if (sprite_) {
sprite_->setObserver(nullptr);
}
+
+ if (glyphStore_) {
+ glyphStore_->setObserver(nullptr);
+ }
}
void ResourceLoader::setObserver(Observer* observer) {
@@ -45,6 +49,18 @@ void ResourceLoader::setStyle(Style* style) {
}
}
+void ResourceLoader::setGlyphStore(GlyphStore* glyphStore) {
+ assert(glyphStore);
+
+ if (glyphStore_) {
+ glyphStore_->setObserver(nullptr);
+ }
+
+ glyphStore_ = glyphStore;
+ glyphStore_->setObserver(this);
+}
+
+
void ResourceLoader::setAccessToken(const std::string& accessToken) {
accessToken_ = accessToken;
}
@@ -52,7 +68,6 @@ void ResourceLoader::setAccessToken(const std::string& accessToken) {
void ResourceLoader::update(MapData& data,
const TransformState& transform,
GlyphAtlas& glyphAtlas,
- GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas,
TexturePool& texturePool) {
if (!style_) {
@@ -68,13 +83,24 @@ void ResourceLoader::update(MapData& data,
spriteAtlas.setSprite(sprite_);
}
+ bool allTilesUpdated = true;
for (const auto& source : style_->sources) {
- source->update(
- data, transform, *style_, glyphAtlas, glyphStore, spriteAtlas, sprite_, texturePool);
+ if (!source->update(data, transform, *style_, glyphAtlas, *glyphStore_,
+ spriteAtlas, sprite_, texturePool, shouldReparsePartialTiles_)) {
+ allTilesUpdated = false;
+ }
+ }
+
+ // We can only stop updating "partial" tiles when all of them
+ // were notified of the arrival of the new resources.
+ if (allTilesUpdated) {
+ shouldReparsePartialTiles_ = false;
}
}
void ResourceLoader::onGlyphRangeLoaded() {
+ shouldReparsePartialTiles_ = true;
+
emitTileDataChanged();
}
@@ -82,11 +108,17 @@ void ResourceLoader::onSourceLoaded() {
emitTileDataChanged();
}
-void ResourceLoader::onTileLoaded() {
+void ResourceLoader::onTileLoaded(bool isNewTile) {
+ if (isNewTile) {
+ shouldReparsePartialTiles_ = true;
+ }
+
emitTileDataChanged();
}
void ResourceLoader::onSpriteLoaded() {
+ shouldReparsePartialTiles_ = true;
+
emitTileDataChanged();
}
diff --git a/src/mbgl/map/resource_loader.hpp b/src/mbgl/map/resource_loader.hpp
index a4d10d038e..379444135e 100644
--- a/src/mbgl/map/resource_loader.hpp
+++ b/src/mbgl/map/resource_loader.hpp
@@ -43,13 +43,17 @@ public:
// a new style we will go through all of them and try to load.
void setStyle(Style* style);
+ // TODO: Move GlyphStore to ResourceLoader. We cannot do it now
+ // because we reset the ResourceLoader every time we change the
+ // style.
+ void setGlyphStore(GlyphStore* glyphStore);
+
// Set the access token to be used for loading the tile data.
void setAccessToken(const std::string& accessToken);
// Fetch the tiles needed by the current viewport and emit a signal when
// a tile is ready so observers can render the tile.
- void update(MapData&, const TransformState&, GlyphAtlas&, GlyphStore&,
- SpriteAtlas&, TexturePool&);
+ void update(MapData&, const TransformState&, GlyphAtlas&, SpriteAtlas&, TexturePool&);
// FIXME: There is probably a better place for this.
inline util::ptr<Sprite> getSprite() const {
@@ -61,7 +65,7 @@ public:
// Source::Observer implementation.
void onSourceLoaded() override;
- void onTileLoaded() override;
+ void onTileLoaded(bool isNewTile) override;
// Sprite::Observer implementation.
void onSpriteLoaded() override;
@@ -69,9 +73,14 @@ public:
private:
void emitTileDataChanged();
+ bool shouldReparsePartialTiles_ = false;
+
std::string accessToken_;
util::ptr<Sprite> sprite_;
+
+ GlyphStore* glyphStore_ = nullptr;
Style* style_ = nullptr;
+
Observer* observer_ = nullptr;
};
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp
index 8b0bf905ff..e8dc3468d3 100644
--- a/src/mbgl/map/source.cpp
+++ b/src/mbgl/map/source.cpp
@@ -21,6 +21,7 @@
#include <mbgl/map/raster_tile_data.hpp>
#include <mbgl/map/live_tile_data.hpp>
#include <mbgl/style/style.hpp>
+#include <mbgl/gl/debugging.hpp>
#include <algorithm>
@@ -127,7 +128,7 @@ bool Source::isLoaded() const {
}
for (const auto& tile : tiles) {
- if (tile.second->data->state != TileData::State::parsed) {
+ if (tile.second->data->getState() != TileData::State::parsed) {
return false;
}
}
@@ -144,11 +145,9 @@ void Source::load(const std::string& accessToken) {
return;
}
- util::ptr<Source> source = shared_from_this();
-
const std::string url = util::mapbox::normalizeSourceURL(info.url, accessToken);
- req = Environment::Get().request({ Resource::Kind::JSON, url }, [source](const Response &res) {
- source->clearRequest();
+ req = Environment::Get().request({ Resource::Kind::JSON, url }, [this](const Response &res) {
+ req = nullptr;
if (res.status != Response::Successful) {
Log::Warning(Event::General, "Failed to load source TileJSON: %s", res.message.c_str());
@@ -163,10 +162,10 @@ void Source::load(const std::string& accessToken) {
return;
}
- source->info.parseTileJSONProperties(d);
- source->loaded = true;
+ info.parseTileJSONProperties(d);
+ loaded = true;
- source->emitSourceLoaded();
+ emitSourceLoaded();
});
}
@@ -181,7 +180,7 @@ void Source::updateMatrices(const mat4 &projMatrix, const TransformState &transf
void Source::drawClippingMasks(Painter &painter) {
for (const auto& pair : tiles) {
Tile &tile = *pair.second;
- gl::group group(std::string { "mask: " } + std::string(tile.id));
+ gl::debugging::group group(std::string { "mask: " } + std::string(tile.id));
painter.drawClippingMask(tile.matrix, tile.clip);
}
}
@@ -193,11 +192,11 @@ void Source::finishRender(Painter &painter) {
}
}
-std::forward_list<Tile *> Source::getLoadedTiles() const {
- std::forward_list<Tile *> ptrs;
+std::forward_list<Tile*> Source::getLoadedTiles() const {
+ std::forward_list<Tile*> ptrs;
auto it = ptrs.before_begin();
- for (const auto &pair : tiles) {
- if (pair.second->data->ready()) {
+ for (const auto& pair : tiles) {
+ if (pair.second->data->isReady()) {
it = ptrs.insert_after(it, pair.second.get());
}
}
@@ -211,30 +210,39 @@ const std::vector<Tile*>& Source::getTiles() const {
TileData::State Source::hasTile(const TileID& id) {
auto it = tiles.find(id);
if (it != tiles.end()) {
- Tile &tile = *it->second;
+ Tile& tile = *it->second;
if (tile.id == id && tile.data) {
- return tile.data->state;
+ return tile.data->getState();
}
}
return TileData::State::invalid;
}
-void Source::handlePartialTile(const TileID &id, Worker &worker) {
+bool Source::handlePartialTile(const TileID& id, Worker& worker) {
const TileID normalized_id = id.normalized();
auto it = tile_data.find(normalized_id);
if (it == tile_data.end()) {
- return;
+ return true;
}
util::ptr<TileData> data = it->second.lock();
if (!data) {
- return;
+ return true;
}
- auto callback = std::bind(&Source::emitTileLoaded, this);
- data->reparse(worker, callback);
+ // The signal is only emitted if there was an actual change on the tile. The
+ // tile can be in a "partial" state waiting for resources and get reparsed on
+ // the arrival of new resources that were needed by another tile.
+ size_t bucketCount = static_cast<VectorTileData*>(data.get())->countBuckets();
+ auto callback = [this, data, bucketCount]() {
+ if (static_cast<VectorTileData*>(data.get())->countBuckets() > bucketCount) {
+ emitTileLoaded(false);
+ }
+ };
+
+ return data->reparse(worker, callback);
}
TileData::State Source::addTile(MapData& data,
@@ -265,7 +273,7 @@ TileData::State Source::addTile(MapData& data,
new_tile.data = it->second.lock();
}
- if (new_tile.data && new_tile.data->state == TileData::State::obsolete) {
+ if (new_tile.data && new_tile.data->getState() == TileData::State::obsolete) {
// Do not consider the tile if it's already obsolete.
new_tile.data.reset();
}
@@ -274,7 +282,7 @@ TileData::State Source::addTile(MapData& data,
new_tile.data = cache.get(normalized_id.to_uint64());
}
- auto callback = std::bind(&Source::emitTileLoaded, this);
+ auto callback = std::bind(&Source::emitTileLoaded, this, true);
if (!new_tile.data) {
// If we don't find working tile data, we're just going to load it.
if (info.type == SourceType::Vector) {
@@ -296,7 +304,7 @@ TileData::State Source::addTile(MapData& data,
tile_data.emplace(new_tile.data->id, new_tile.data);
}
- return new_tile.data->state;
+ return new_tile.data->getState();
}
double Source::getZoom(const TransformState& state) const {
@@ -378,16 +386,19 @@ bool Source::findLoadedParent(const TileID& id, int32_t minCoveringZoom, std::fo
return false;
}
-void Source::update(MapData& data,
+bool Source::update(MapData& data,
const TransformState& transformState,
Style& style,
GlyphAtlas& glyphAtlas,
GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas,
util::ptr<Sprite> sprite,
- TexturePool& texturePool) {
+ TexturePool& texturePool,
+ bool shouldReparsePartialTiles) {
+ bool allTilesUpdated = true;
+
if (!loaded || data.getAnimationTime() <= updated) {
- return;
+ return allTilesUpdated;
}
int32_t zoom = std::floor(getZoom(transformState));
@@ -408,7 +419,11 @@ void Source::update(MapData& data,
switch (state) {
case TileData::State::partial:
- handlePartialTile(id, style.workers);
+ if (shouldReparsePartialTiles) {
+ if (!handlePartialTile(id, style.workers)) {
+ allTilesUpdated = false;
+ }
+ }
break;
case TileData::State::invalid:
state = addTile(data, transformState, style, glyphAtlas, glyphStore,
@@ -453,7 +468,7 @@ void Source::update(MapData& data,
bool obsolete = std::find(retain.begin(), retain.end(), tile.id) == retain.end();
if (!obsolete) {
retain_data.insert(tile.data->id);
- } else if (type != SourceType::Raster && tile.data->state == TileData::State::parsed) {
+ } else if (type != SourceType::Raster && tile.data->getState() == TileData::State::parsed) {
// Partially parsed tiles are never added to the cache because otherwise
// they never get updated if the go out from the viewport and the pending
// resources arrive.
@@ -483,6 +498,8 @@ void Source::update(MapData& data,
updateTilePtrs();
updated = data.getAnimationTime();
+
+ return allTilesUpdated;
}
void Source::invalidateTiles(const std::vector<TileID>& ids) {
@@ -509,10 +526,6 @@ void Source::onLowMemory() {
cache.clear();
}
-void Source::clearRequest() {
- req = nullptr;
-}
-
void Source::setObserver(Observer* observer) {
observer_ = observer;
}
@@ -523,9 +536,9 @@ void Source::emitSourceLoaded() {
}
}
-void Source::emitTileLoaded() {
+void Source::emitTileLoaded(bool isNewTile) {
if (observer_) {
- observer_->onTileLoaded();
+ observer_->onTileLoaded(isNewTile);
}
}
diff --git a/src/mbgl/map/source.hpp b/src/mbgl/map/source.hpp
index eb7950225d..9d3de81b70 100644
--- a/src/mbgl/map/source.hpp
+++ b/src/mbgl/map/source.hpp
@@ -51,14 +51,14 @@ public:
std::string tileURL(const TileID& id, float pixelRatio) const;
};
-class Source : public std::enable_shared_from_this<Source>, private util::noncopyable {
+class Source : private util::noncopyable {
public:
class Observer {
public:
virtual ~Observer() = default;
virtual void onSourceLoaded() = 0;
- virtual void onTileLoaded() = 0;
+ virtual void onTileLoaded(bool isNewTile) = 0;
};
Source();
@@ -68,14 +68,20 @@ public:
bool isLoaded() const;
void load(MapData&, Environment&, std::function<void()> callback);
- void update(MapData&,
+
+ // Request or parse all the tiles relevant for the "TransformState". This method
+ // will return true if all the tiles were scheduled for updating of false if
+ // they were not. shouldReparsePartialTiles must be set to "true" if there is
+ // new data available that a tile in the "partial" state might be interested at.
+ bool update(MapData&,
const TransformState&,
Style&,
GlyphAtlas&,
GlyphStore&,
SpriteAtlas&,
util::ptr<Sprite>,
- TexturePool&);
+ TexturePool&,
+ bool shouldReparsePartialTiles);
void invalidateTiles(const std::vector<TileID>&);
@@ -88,7 +94,6 @@ public:
void setCacheSize(size_t);
void onLowMemory();
- void clearRequest();
void setObserver(Observer* observer);
@@ -97,9 +102,9 @@ public:
private:
void emitSourceLoaded();
- void emitTileLoaded();
+ void emitTileLoaded(bool isNewTile);
- void handlePartialTile(const TileID &id, Worker &worker);
+ bool handlePartialTile(const TileID &id, Worker &worker);
bool findLoadedChildren(const TileID& id, int32_t maxCoveringZoom, std::forward_list<TileID>& retain);
bool findLoadedParent(const TileID& id, int32_t minCoveringZoom, std::forward_list<TileID>& retain);
int32_t coveringZoomLevel(const TransformState&) const;
diff --git a/src/mbgl/map/tile_cache.cpp b/src/mbgl/map/tile_cache.cpp
index 25aed6d15e..37acf628a0 100644
--- a/src/mbgl/map/tile_cache.cpp
+++ b/src/mbgl/map/tile_cache.cpp
@@ -46,7 +46,7 @@ std::shared_ptr<TileData> TileCache::get(uint64_t key) {
data = it->second;
tiles.erase(it);
orderedKeys.remove(key);
- assert(data->ready());
+ assert(data->isReady());
}
return data;
diff --git a/src/mbgl/map/tile_data.cpp b/src/mbgl/map/tile_data.cpp
index 4025bacfcb..e9084bdff2 100644
--- a/src/mbgl/map/tile_data.cpp
+++ b/src/mbgl/map/tile_data.cpp
@@ -4,6 +4,7 @@
#include <mbgl/storage/file_source.hpp>
#include <mbgl/util/worker.hpp>
+#include <mbgl/util/work_request.hpp>
#include <mbgl/platform/log.hpp>
using namespace mbgl;
@@ -11,10 +12,9 @@ using namespace mbgl;
TileData::TileData(const TileID& id_, const SourceInfo& source_)
: id(id_),
name(id),
- state(State::initial),
- parsing(ATOMIC_FLAG_INIT),
source(source_),
env(Environment::Get()),
+ state(State::initial),
debugBucket(debugFontBuffer) {
// Initialize tile debug coordinates
debugFontBuffer.addText(name.c_str(), 50, 200, 5);
@@ -28,6 +28,12 @@ const std::string TileData::toString() const {
return std::string { "[tile " } + name + "]";
}
+void TileData::setState(const State& state_) {
+ assert(!isImmutable());
+
+ state = state_;
+}
+
void TileData::request(Worker& worker, float pixelRatio, std::function<void()> callback) {
std::string url = source.tileURL(id, pixelRatio);
state = State::loading;
@@ -56,9 +62,7 @@ void TileData::cancel() {
env.cancelRequest(req);
req = nullptr;
}
- if (workRequest) {
- workRequest.join();
- }
+ workRequest.reset();
}
bool TileData::mayStartParsing() {
@@ -69,10 +73,11 @@ void TileData::endParsing() {
parsing.clear(std::memory_order_release);
}
-void TileData::reparse(Worker& worker, std::function<void()> callback) {
+bool TileData::reparse(Worker& worker, std::function<void()> callback) {
if (!mayStartParsing()) {
- return;
+ return false;
}
workRequest = worker.send([this] { parse(); endParsing(); }, callback);
+ return true;
}
diff --git a/src/mbgl/map/tile_data.hpp b/src/mbgl/map/tile_data.hpp
index 3be10dc034..3945a32147 100644
--- a/src/mbgl/map/tile_data.hpp
+++ b/src/mbgl/map/tile_data.hpp
@@ -7,7 +7,6 @@
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/ptr.hpp>
-#include <mbgl/util/work_request.hpp>
#include <atomic>
#include <string>
@@ -21,6 +20,7 @@ class SourceInfo;
class StyleLayer;
class Request;
class Worker;
+class WorkRequest;
class TileData : private util::noncopyable {
public:
@@ -45,14 +45,34 @@ public:
~TileData();
void request(Worker&, float pixelRatio, std::function<void ()> callback);
- void reparse(Worker&, std::function<void ()> callback);
+
+ // Schedule a tile reparse on a worker thread and call the callback on
+ // completion. It will return true if the work was schedule or false it was
+ // not, which can occur if the tile is already being parsed by another
+ // worker (see "mayStartParsing()").
+ bool reparse(Worker&, std::function<void ()> callback);
+
void cancel();
const std::string toString() const;
- inline bool ready() const {
+ inline bool isReady() const {
return isReadyState(state);
}
+ // Returns true if the TileData is in a final state and we cannot
+ // make changes to it anymore.
+ inline bool isImmutable() const {
+ return state == State::parsed || state == State::obsolete;
+ }
+
+ // We let subclasses override setState() so they
+ // can intercept the state change and react accordingly.
+ virtual void setState(const State& state);
+
+ inline State getState() const {
+ return state;
+ }
+
void endParsing();
// Override this in the child class.
@@ -61,8 +81,7 @@ public:
const TileID id;
const std::string name;
- std::atomic<State> state;
- std::atomic_flag parsing;
+ std::atomic_flag parsing = ATOMIC_FLAG_INIT;
protected:
// Set the internal parsing state to true so we prevent
@@ -79,8 +98,12 @@ protected:
Request *req = nullptr;
std::string data;
- WorkRequest workRequest;
+ std::unique_ptr<WorkRequest> workRequest;
+private:
+ std::atomic<State> state;
+
+protected:
// Contains the tile ID string for painting debug information.
DebugFontBuffer debugFontBuffer;
diff --git a/src/mbgl/map/tile_parser.cpp b/src/mbgl/map/tile_parser.cpp
index 65b445a6cf..a932453136 100644
--- a/src/mbgl/map/tile_parser.cpp
+++ b/src/mbgl/map/tile_parser.cpp
@@ -8,7 +8,6 @@
#include <mbgl/renderer/line_bucket.hpp>
#include <mbgl/renderer/symbol_bucket.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/text/collision.hpp>
#include <mbgl/util/std.hpp>
#include <mbgl/style/style.hpp>
@@ -35,13 +34,13 @@ TileParser::TileParser(const GeometryTile& geometryTile_,
glyphStore(glyphStore_),
spriteAtlas(spriteAtlas_),
sprite(sprite_),
- collision(util::make_unique<Collision>(tile.id.z, 4096, tile.source.tile_size, tile.depth)),
partialParse(false) {
assert(sprite);
- assert(collision);
}
-bool TileParser::obsolete() const { return tile.state == TileData::State::obsolete; }
+bool TileParser::obsolete() const {
+ return tile.getState() == TileData::State::obsolete;
+}
void TileParser::parse() {
for (const auto& layer_desc : style.layers) {
@@ -119,14 +118,7 @@ std::unique_ptr<Bucket> TileParser::createBucket(const StyleBucket &bucketDesc)
} else if (bucketDesc.type == StyleLayerType::Line) {
return createLineBucket(*layer, bucketDesc);
} else if (bucketDesc.type == StyleLayerType::Symbol) {
- bool needsResources = false;
- auto symbolBucket = createSymbolBucket(*layer, bucketDesc, needsResources);
- if (needsResources) {
- partialParse = true;
- return nullptr;
- } else {
- return std::move(symbolBucket);
- }
+ return createSymbolBucket(*layer, bucketDesc);
} else if (bucketDesc.type == StyleLayerType::Raster) {
return nullptr;
} else {
@@ -187,14 +179,8 @@ std::unique_ptr<Bucket> TileParser::createLineBucket(const GeometryTileLayer& la
}
std::unique_ptr<Bucket> TileParser::createSymbolBucket(const GeometryTileLayer& layer,
- const StyleBucket& bucket_desc,
- bool& needsResources) {
- if (!sprite->isLoaded()) {
- needsResources = true;
- return nullptr;
- }
-
- auto bucket = util::make_unique<SymbolBucket>(*collision);
+ const StyleBucket& bucket_desc) {
+ auto bucket = util::make_unique<SymbolBucket>(*tile.getCollision());
const float z = tile.id.z;
auto& layout = bucket->layout;
@@ -237,14 +223,21 @@ std::unique_ptr<Bucket> TileParser::createSymbolBucket(const GeometryTileLayer&
applyLayoutProperty(PropertyKey::TextOffset, bucket_desc.layout, layout.text.offset, z);
applyLayoutProperty(PropertyKey::TextAllowOverlap, bucket_desc.layout, layout.text.allow_overlap, z);
- bucket->addFeatures(
- layer, bucket_desc.filter, reinterpret_cast<uintptr_t>(&tile), spriteAtlas, *sprite, glyphAtlas, glyphStore);
+ if (bucket->needsDependencies(layer, bucket_desc.filter, glyphStore, *sprite)) {
+ partialParse = true;
+ }
- if (bucket->needsGlyphs()) {
- needsResources = true;
+ // We do not proceed if the parser is in a "partial" state because
+ // the layer ordering needs to be respected when calculating text
+ // collisions. Although, at this point, we requested all the resources
+ // needed by this tile.
+ if (partialParse) {
return nullptr;
}
+ bucket->addFeatures(
+ reinterpret_cast<uintptr_t>(&tile), spriteAtlas, *sprite, glyphAtlas, glyphStore);
+
return bucket->hasData() ? std::move(bucket) : nullptr;
}
diff --git a/src/mbgl/map/tile_parser.hpp b/src/mbgl/map/tile_parser.hpp
index 18184e27a3..88e5687804 100644
--- a/src/mbgl/map/tile_parser.hpp
+++ b/src/mbgl/map/tile_parser.hpp
@@ -29,7 +29,6 @@ class StyleLayoutRaster;
class StyleLayoutLine;
class StyleLayoutSymbol;
class VectorTileData;
-class Collision;
class TileParser : private util::noncopyable {
public:
@@ -54,7 +53,7 @@ private:
std::unique_ptr<Bucket> createBucket(const StyleBucket&);
std::unique_ptr<Bucket> createFillBucket(const GeometryTileLayer&, const StyleBucket&);
std::unique_ptr<Bucket> createLineBucket(const GeometryTileLayer&, const StyleBucket&);
- std::unique_ptr<Bucket> createSymbolBucket(const GeometryTileLayer&, const StyleBucket&, bool& needsResources);
+ std::unique_ptr<Bucket> createSymbolBucket(const GeometryTileLayer&, const StyleBucket&);
template <class Bucket>
void addBucketGeometries(Bucket&, const GeometryTileLayer&, const FilterExpression&);
@@ -69,7 +68,6 @@ private:
SpriteAtlas& spriteAtlas;
util::ptr<Sprite> sprite;
- std::unique_ptr<Collision> collision;
bool partialParse;
};
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index 1239f96f5e..f5e9f00998 100644
--- a/src/mbgl/map/transform.cpp
+++ b/src/mbgl/map/transform.cpp
@@ -23,7 +23,7 @@ static double _normalizeAngle(double angle, double anchorAngle)
if (std::abs(angle + util::M2PI - anchorAngle) < diff) {
angle += util::M2PI;
}
-
+
return angle;
}
@@ -61,6 +61,10 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio,
#pragma mark - Position
void Transform::moveBy(const double dx, const double dy, const Duration duration) {
+ if (std::isnan(dx) || std::isnan(dy)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
_moveBy(dx, dy, duration);
@@ -104,6 +108,10 @@ void Transform::_moveBy(const double dx, const double dy, const Duration duratio
}
void Transform::setLatLng(const LatLng latLng, const Duration duration) {
+ if (std::isnan(latLng.latitude) || std::isnan(latLng.longitude)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
const double m = 1 - 1e-15;
@@ -116,6 +124,10 @@ void Transform::setLatLng(const LatLng latLng, const Duration duration) {
}
void Transform::setLatLngZoom(const LatLng latLng, const double zoom, const Duration duration) {
+ if (std::isnan(latLng.latitude) || std::isnan(latLng.longitude) || std::isnan(zoom)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
double new_scale = std::pow(2.0, zoom);
@@ -137,6 +149,10 @@ void Transform::setLatLngZoom(const LatLng latLng, const double zoom, const Dura
#pragma mark - Zoom
void Transform::scaleBy(const double ds, const double cx, const double cy, const Duration duration) {
+ if (std::isnan(ds) || std::isnan(cx) || std::isnan(cy)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
// clamp scale to min/max values
@@ -152,12 +168,20 @@ void Transform::scaleBy(const double ds, const double cx, const double cy, const
void Transform::setScale(const double scale, const double cx, const double cy,
const Duration duration) {
+ if (std::isnan(scale) || std::isnan(cx) || std::isnan(cy)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
_setScale(scale, cx, cy, duration);
}
void Transform::setZoom(const double zoom, const Duration duration) {
+ if (std::isnan(zoom)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
_setScale(std::pow(2.0, zoom), -1, -1, duration);
@@ -287,6 +311,10 @@ void Transform::constrain(double& scale, double& y) const {
void Transform::rotateBy(const double start_x, const double start_y, const double end_x,
const double end_y, const Duration duration) {
+ if (std::isnan(start_x) || std::isnan(start_y) || std::isnan(end_x) || std::isnan(end_y)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
double center_x = static_cast<double>(current.width) / 2.0, center_y = static_cast<double>(current.height) / 2.0;
@@ -317,12 +345,20 @@ void Transform::rotateBy(const double start_x, const double start_y, const doubl
}
void Transform::setAngle(const double new_angle, const Duration duration) {
+ if (std::isnan(new_angle)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
_setAngle(new_angle, duration);
}
void Transform::setAngle(const double new_angle, const double cx, const double cy) {
+ if (std::isnan(new_angle) || std::isnan(cx) || std::isnan(cy)) {
+ return;
+ }
+
std::lock_guard<std::recursive_mutex> lock(mtx);
double dx = 0, dy = 0;
diff --git a/src/mbgl/map/transform_state.hpp b/src/mbgl/map/transform_state.hpp
index f6a00a4a3d..e09be8ca63 100644
--- a/src/mbgl/map/transform_state.hpp
+++ b/src/mbgl/map/transform_state.hpp
@@ -3,6 +3,7 @@
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/geo.hpp>
+#include <mbgl/util/constants.hpp>
#include <mbgl/util/vec.hpp>
#include <cstdint>
@@ -71,9 +72,6 @@ private:
// map scale factor
float pixelRatio = 0;
- // cache values for spherical mercator math
- double Bc, Cc;
-
// animation state
bool rotating = false;
bool scaling = false;
@@ -84,6 +82,10 @@ private:
double x = 0, y = 0;
double angle = 0;
double scale = 1;
+
+ // cache values for spherical mercator math
+ double Bc = (scale * util::tileSize) / 360;
+ double Cc = (scale * util::tileSize) / util::M2PI;
};
}
diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp
index 7560168ed7..801d9a7c57 100644
--- a/src/mbgl/map/vector_tile_data.cpp
+++ b/src/mbgl/map/vector_tile_data.cpp
@@ -6,6 +6,7 @@
#include <mbgl/map/source.hpp>
#include <mbgl/geometry/glyph_atlas.hpp>
#include <mbgl/platform/log.hpp>
+#include <mbgl/text/collision.hpp>
#include <mbgl/util/pbf.hpp>
using namespace mbgl;
@@ -19,12 +20,13 @@ VectorTileData::VectorTileData(const TileID& id_,
util::ptr<Sprite> sprite_,
const SourceInfo& source_)
: TileData(id_, source_),
+ depth(id_.z >= source_.max_zoom ? mapMaxZoom - id_.z : 1),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
spriteAtlas(spriteAtlas_),
sprite(sprite_),
style(style_),
- depth(id.z >= source.max_zoom ? mapMaxZoom - id.z : 1) {
+ collision(util::make_unique<Collision>(id_.z, 4096, source_.tile_size, depth)) {
}
VectorTileData::~VectorTileData() {
@@ -35,7 +37,7 @@ VectorTileData::~VectorTileData() {
}
void VectorTileData::parse() {
- if (state != State::loaded && state != State::partial) {
+ if (getState() != State::loaded && getState() != State::partial) {
return;
}
@@ -48,24 +50,24 @@ void VectorTileData::parse() {
TileParser parser(*vt, *this, style, glyphAtlas, glyphStore, spriteAtlas, sprite);
parser.parse();
- if (state == State::obsolete) {
+ if (getState() == State::obsolete) {
return;
}
if (parser.isPartialParse()) {
- state = State::partial;
+ setState(State::partial);
} else {
- state = State::parsed;
+ setState(State::parsed);
}
} catch (const std::exception& ex) {
Log::Error(Event::ParseTile, "Parsing [%d/%d/%d] failed: %s", id.z, id.x, id.y, ex.what());
- state = State::obsolete;
+ setState(State::obsolete);
return;
}
}
Bucket* VectorTileData::getBucket(StyleLayer const& layer) {
- if (!ready() || !layer.bucket) {
+ if (!isReady() || !layer.bucket) {
return nullptr;
}
@@ -80,6 +82,12 @@ Bucket* VectorTileData::getBucket(StyleLayer const& layer) {
return it->second.get();
}
+size_t VectorTileData::countBuckets() const {
+ std::lock_guard<std::mutex> lock(bucketsMutex);
+
+ return buckets.size();
+}
+
void VectorTileData::setBucket(StyleLayer const& layer, std::unique_ptr<Bucket> bucket) {
assert(layer.bucket);
@@ -91,3 +99,11 @@ void VectorTileData::setBucket(StyleLayer const& layer, std::unique_ptr<Bucket>
buckets[layer.bucket->name] = std::move(bucket);
}
+
+void VectorTileData::setState(const State& state_) {
+ TileData::setState(state_);
+
+ if (isImmutable()) {
+ collision.reset();
+ }
+}
diff --git a/src/mbgl/map/vector_tile_data.hpp b/src/mbgl/map/vector_tile_data.hpp
index 146bc93229..6549c106e4 100644
--- a/src/mbgl/map/vector_tile_data.hpp
+++ b/src/mbgl/map/vector_tile_data.hpp
@@ -16,6 +16,7 @@
namespace mbgl {
class Bucket;
+class Collision;
class Painter;
class SourceInfo;
class StyleLayer;
@@ -43,8 +44,17 @@ public:
void parse() override;
virtual Bucket* getBucket(StyleLayer const &layer_desc) override;
+ size_t countBuckets() const;
void setBucket(StyleLayer const &layer_desc, std::unique_ptr<Bucket> bucket);
+ void setState(const State& state) override;
+
+ inline Collision* getCollision() const {
+ return collision.get();
+ }
+
+ const float depth;
+
protected:
// Holds the actual geometries in this tile.
FillVertexBuffer fillVertexBuffer;
@@ -69,8 +79,7 @@ private:
std::unordered_map<std::string, std::unique_ptr<Bucket>> buckets;
mutable std::mutex bucketsMutex;
-public:
- const float depth;
+ std::unique_ptr<Collision> collision;
};
}
diff --git a/src/mbgl/platform/gl.cpp b/src/mbgl/platform/gl.cpp
index b18ca3da25..76be580b91 100644
--- a/src/mbgl/platform/gl.cpp
+++ b/src/mbgl/platform/gl.cpp
@@ -1,78 +1,36 @@
#include <mbgl/platform/gl.hpp>
-#include <mbgl/platform/log.hpp>
-
-#include <iostream>
+#include <mutex>
namespace mbgl {
namespace gl {
-PFNGLDEBUGMESSAGECONTROLPROC DebugMessageControl = nullptr;
-PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert = nullptr;
-PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback = nullptr;
-PFNGLGETDEBUGMESSAGELOGPROC GetDebugMessageLog = nullptr;
-PFNGLGETPOINTERVPROC GetPointerv = nullptr;
-PFNGLPUSHDEBUGGROUPPROC PushDebugGroup = nullptr;
-PFNGLPOPDEBUGGROUPPROC PopDebugGroup = nullptr;
-PFNGLOBJECTLABELPROC ObjectLabel = nullptr;
-PFNGLGETOBJECTLABELPROC GetObjectLabel = nullptr;
-PFNGLOBJECTPTRLABELPROC ObjectPtrLabel = nullptr;
-PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel = nullptr;
-
-void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei, const GLchar *message, const void *) {
- std::string strSource;
- switch (source) {
- case GL_DEBUG_SOURCE_API: strSource = "DEBUG_SOURCE_API"; break;
- case GL_DEBUG_SOURCE_WINDOW_SYSTEM: strSource = "DEBUG_SOURCE_WINDOW_SYSTEM"; break;
- case GL_DEBUG_SOURCE_SHADER_COMPILER: strSource = "DEBUG_SOURCE_SHADER_COMPILER"; break;
- case GL_DEBUG_SOURCE_THIRD_PARTY: strSource = "DEBUG_SOURCE_THIRD_PARTY"; break;
- case GL_DEBUG_SOURCE_APPLICATION: strSource = "DEBUG_SOURCE_APPLICATION"; break;
- case GL_DEBUG_SOURCE_OTHER: strSource = "DEBUG_SOURCE_OTHER"; break;
- default: strSource = "(unknown)"; break;
- }
-
- std::string strType;
- switch (type) {
- case GL_DEBUG_TYPE_ERROR: strType = "DEBUG_TYPE_ERROR"; break;
- case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: strType = "DEBUG_TYPE_DEPRECATED_BEHAVIOR"; break;
- case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: strType = "DEBUG_TYPE_UNDEFINED_BEHAVIOR"; break;
- case GL_DEBUG_TYPE_PERFORMANCE: strType = "DEBUG_TYPE_PERFORMANCE"; break;
- case GL_DEBUG_TYPE_PORTABILITY: strType = "DEBUG_TYPE_PORTABILITY"; break;
- case GL_DEBUG_TYPE_OTHER: strType = "DEBUG_TYPE_OTHER"; break;
- case GL_DEBUG_TYPE_MARKER: strType = "DEBUG_TYPE_MARKER"; break;
- case GL_DEBUG_TYPE_PUSH_GROUP: strType = "DEBUG_TYPE_OTHER"; break;
- case GL_DEBUG_TYPE_POP_GROUP: strType = "DEBUG_TYPE_POP_GROUP"; break;
- default: strSource = "(unknown)"; break;
- }
-
- std::string strSeverity;
- mbgl::EventSeverity evtSeverity;
- switch (severity) {
- case GL_DEBUG_SEVERITY_HIGH: strSeverity = "DEBUG_SEVERITY_HIGH"; evtSeverity = mbgl::EventSeverity::Error; break;
- case GL_DEBUG_SEVERITY_MEDIUM: strSeverity = "DEBUG_SEVERITY_MEDIUM"; evtSeverity = mbgl::EventSeverity::Warning; break;
- case GL_DEBUG_SEVERITY_LOW: strSeverity = "DEBUG_SEVERITY_LOW"; evtSeverity = mbgl::EventSeverity::Info; break;
- case GL_DEBUG_SEVERITY_NOTIFICATION: strSeverity = "DEBUG_SEVERITY_NOTIFICATION"; evtSeverity = mbgl::EventSeverity::Debug; break;
- default: strSource = "(unknown)"; evtSeverity = mbgl::EventSeverity::Debug; break;
- }
-
- mbgl::Log::Record(evtSeverity, mbgl::Event::OpenGL, "GL_%s GL_%s %u GL_%s - %s", strSource.c_str(), strType.c_str(), id, strSeverity.c_str(), message);
+std::vector<ExtensionFunctionBase*>& ExtensionFunctionBase::functions() {
+ static std::vector<ExtensionFunctionBase*> functions;
+ return functions;
}
-PFNGLINSERTEVENTMARKEREXTPROC InsertEventMarkerEXT = nullptr;
-PFNGLPUSHGROUPMARKEREXTPROC PushGroupMarkerEXT = nullptr;
-PFNGLPOPGROUPMARKEREXTPROC PopGroupMarkerEXT = nullptr;
-
-PFNGLLABELOBJECTEXTPROC LabelObjectEXT = nullptr;
-PFNGLGETOBJECTLABELEXTPROC GetObjectLabelEXT = nullptr;
+static std::once_flag initializeExtensionsOnce;
-PFNGLBINDVERTEXARRAYPROC BindVertexArray = nullptr;
-PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays = nullptr;
-PFNGLGENVERTEXARRAYSPROC GenVertexArrays = nullptr;
-PFNGLISVERTEXARRAYPROC IsVertexArray = nullptr;
+void InitializeExtensions(glProc (*getProcAddress)(const char *)) {
+ std::call_once(initializeExtensionsOnce, [getProcAddress] {
+ const char * extensionsPtr = reinterpret_cast<const char *>(
+ MBGL_CHECK_ERROR(glGetString(GL_EXTENSIONS)));
-bool isPackedDepthStencilSupported = false;
+ if (!extensionsPtr)
+ return;
-bool isDepth24Supported = false;
+ const std::string extensions = extensionsPtr;
+ for (auto fn : ExtensionFunctionBase::functions()) {
+ for (auto probe : fn->probes) {
+ if (extensions.find(probe.first) != std::string::npos) {
+ fn->ptr = getProcAddress(probe.second);
+ break;
+ }
+ }
+ }
+ });
+}
void checkError(const char *cmd, const char *file, int line) {
const GLenum err = glGetError();
diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp
index 651b4986e4..bbfc02ead1 100644
--- a/src/mbgl/renderer/line_bucket.cpp
+++ b/src/mbgl/renderer/line_bucket.cpp
@@ -143,7 +143,7 @@ void LineBucket::addGeometry(const std::vector<Coordinate>& vertices) {
// Find the cosine of the angle between the next and join normals
// using dot product. The inverse of that is the miter length.
const float cosHalfAngle = joinNormal.x * nextNormal.x + joinNormal.y * nextNormal.y;
- const float miterLength = 1 / cosHalfAngle;
+ const float miterLength = cosHalfAngle != 0 ? 1 / cosHalfAngle: 1;
// The join if a middle vertex, otherwise the cap
const bool middleVertex = prevVertex && nextVertex;
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp
index b70f919068..bcbb75e69a 100644
--- a/src/mbgl/renderer/painter.cpp
+++ b/src/mbgl/renderer/painter.cpp
@@ -4,6 +4,7 @@
#include <mbgl/map/tile.hpp>
#include <mbgl/platform/log.hpp>
+#include <mbgl/gl/debugging.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/style_layer.hpp>
@@ -56,18 +57,7 @@ bool Painter::needsAnimation() const {
}
void Painter::setup() {
- // Enable GL debugging
- if ((gl::DebugMessageControl != nullptr) && (gl::DebugMessageCallback != nullptr)) {
- // This will enable all messages including performance hints
- //MBGL_CHECK_ERROR(gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE));
-
- // This will only enable high and medium severity messages
- MBGL_CHECK_ERROR(gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr, GL_TRUE));
- MBGL_CHECK_ERROR(gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, nullptr, GL_TRUE));
- MBGL_CHECK_ERROR(gl::DebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE));
-
- MBGL_CHECK_ERROR(gl::DebugMessageCallback(gl::debug_callback, nullptr));
- }
+ gl::debugging::enable();
setupShaders();
@@ -160,7 +150,7 @@ void Painter::changeMatrix() {
}
void Painter::clear() {
- gl::group group("clear");
+ gl::debugging::group group("clear");
config.stencilTest = true;
config.stencilMask = 0xFF;
config.depthTest = false;
@@ -169,20 +159,6 @@ void Painter::clear() {
MBGL_CHECK_ERROR(glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
}
-void Painter::setOpaque() {
- if (pass != RenderPass::Opaque) {
- pass = RenderPass::Opaque;
- config.blend = false;
- }
-}
-
-void Painter::setTranslucent() {
- if (pass != RenderPass::Translucent) {
- pass = RenderPass::Translucent;
- config.blend = true;
- }
-}
-
void Painter::setStrata(float value) {
strata = value;
}
@@ -212,7 +188,7 @@ void Painter::render(const Style& style, TransformState state_, TimePoint time)
// - UPLOAD PASS -------------------------------------------------------------------------------
// Uploads all required buffers and images before we do any actual rendering.
{
- const gl::group upload("upload");
+ const gl::debugging::group upload("upload");
tileStencilBuffer.upload();
tileBorderBuffer.upload();
@@ -231,7 +207,7 @@ void Painter::render(const Style& style, TransformState state_, TimePoint time)
// - CLIPPING MASKS ----------------------------------------------------------------------------
// Draws the clipping masks to the stencil buffer.
{
- const gl::group clip("clip");
+ const gl::debugging::group clip("clip");
// Update all clipping IDs.
ClipIDGenerator generator;
@@ -251,72 +227,26 @@ void Painter::render(const Style& style, TransformState state_, TimePoint time)
if (debug::renderTree) { Log::Info(Event::Render, "{"); indent++; }
// TODO: Correctly compute the number of layers recursively beforehand.
- const float strata_thickness = 1.0f / (order.size() + 1);
-
- // Layer index
- int i = 0;
+ const float strataThickness = 1.0f / (order.size() + 1);
// - OPAQUE PASS -------------------------------------------------------------------------------
// Render everything top-to-bottom by using reverse iterators. Render opaque objects first.
- {
- const gl::group _("opaque");
-
- if (debug::renderTree) {
- Log::Info(Event::Render, "%*s%s", indent++ * 4, "", "OPAQUE {");
- }
- i = 0;
- setOpaque();
- for (auto it = order.rbegin(), end = order.rend(); it != end; ++it, ++i) {
- const auto& item = *it;
- if (item.bucket && item.tile) {
- if (item.hasRenderPass(RenderPass::Opaque)) {
- const gl::group group(item.layer.id + " - " + std::string(item.tile->id));
- setStrata(i * strata_thickness);
- prepareTile(*item.tile);
- item.bucket->render(*this, item.layer, item.tile->id, item.tile->matrix);
- }
- } else {
- const gl::group group("background");
- renderBackground(item.layer);
- }
- }
- if (debug::renderTree) {
- Log::Info(Event::Render, "%*s%s", --indent * 4, "", "}");
- }
- }
+ renderPass(RenderPass::Opaque,
+ order.rbegin(), order.rend(),
+ 0, 1, strataThickness);
// - TRANSLUCENT PASS --------------------------------------------------------------------------
// Make a second pass, rendering translucent objects. This time, we render bottom-to-top.
- {
- const gl::group _("translucent");
-
- if (debug::renderTree) {
- Log::Info(Event::Render, "%*s%s", indent++ * 4, "", "TRANSLUCENT {");
- }
- --i; // After the last iteration, this is incremented, so we have to decrement it again.
- setTranslucent();
- for (auto it = order.begin(), end = order.end(); it != end; ++it, --i) {
- const auto& item = *it;
- if (item.bucket && item.tile) {
- if (item.hasRenderPass(RenderPass::Translucent)) {
- const gl::group group(item.layer.id + " - " + std::string(item.tile->id));
- setStrata(i * strata_thickness);
- prepareTile(*item.tile);
- item.bucket->render(*this, item.layer, item.tile->id, item.tile->matrix);
- }
- }
- }
- if (debug::renderTree) {
- Log::Info(Event::Render, "%*s%s", --indent * 4, "", "}");
- }
- }
+ renderPass(RenderPass::Translucent,
+ order.begin(), order.end(),
+ order.size() - 1, -1, strataThickness);
if (debug::renderTree) { Log::Info(Event::Render, "}"); indent--; }
// - DEBUG PASS --------------------------------------------------------------------------------
// Renders debug overlays.
{
- const gl::group _("debug");
+ const gl::debugging::group _("debug");
// Finalize the rendering, e.g. by calling debug render calls per tile.
// This guarantees that we have at least one function per tile called.
@@ -330,10 +260,47 @@ void Painter::render(const Style& style, TransformState state_, TimePoint time)
// TODO: Find a better way to unbind VAOs after we're done with them without introducing
// unnecessary bind(0)/bind(N) sequences.
{
- const gl::group _("cleanup");
+ const gl::debugging::group _("cleanup");
MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, 0));
- MBGL_CHECK_ERROR(gl::BindVertexArray(0));
+ MBGL_CHECK_ERROR(VertexArrayObject::Unbind());
+ }
+}
+
+template <class Iterator>
+void Painter::renderPass(RenderPass pass_,
+ Iterator it, Iterator end,
+ std::size_t i, int8_t increment,
+ const float strataThickness) {
+ pass = pass_;
+
+ const char * passName = pass == RenderPass::Opaque ? "opaque" : "translucent";
+ const gl::debugging::group _(passName);
+
+ if (debug::renderTree) {
+ Log::Info(Event::Render, "%*s%s {", indent++ * 4, "", passName);
+ }
+
+ config.blend = pass == RenderPass::Translucent;
+
+ for (; it != end; ++it, i += increment) {
+ const auto& item = *it;
+ if (item.bucket && item.tile) {
+ if (item.hasRenderPass(pass)) {
+ const gl::debugging::group group(item.layer.id + " - " + std::string(item.tile->id));
+ setStrata(i * strataThickness);
+ prepareTile(*item.tile);
+ item.bucket->render(*this, item.layer, item.tile->id, item.tile->matrix);
+ }
+ } else {
+ const gl::debugging::group group("background");
+ setStrata(i * strataThickness);
+ renderBackground(item.layer);
+ }
+ }
+
+ if (debug::renderTree) {
+ Log::Info(Event::Render, "%*s%s", --indent * 4, "", "}");
}
}
@@ -380,7 +347,7 @@ std::vector<RenderItem> Painter::determineRenderOrder(const Style& style) {
const auto& tiles = layer.bucket->source->getTiles();
for (auto tile : tiles) {
assert(tile);
- if (!tile->data && !tile->data->ready()) {
+ if (!tile->data && !tile->data->isReady()) {
continue;
}
diff --git a/src/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp
index 54c23b393a..871612ef43 100644
--- a/src/mbgl/renderer/painter.hpp
+++ b/src/mbgl/renderer/painter.hpp
@@ -123,10 +123,6 @@ public:
// Changes whether debug information is drawn onto the map
void setDebug(bool enabled);
- // Opaque/Translucent pass setting
- void setOpaque();
- void setTranslucent();
-
// Configures the painter strata that is used for early z-culling of fragments.
void setStrata(float strata);
@@ -148,6 +144,12 @@ private:
std::vector<RenderItem> determineRenderOrder(const Style& style);
static RenderPass determineRenderPasses(const StyleLayer&);
+ template <class Iterator>
+ void renderPass(RenderPass,
+ Iterator it, Iterator end,
+ std::size_t i, int8_t iIncrement,
+ const float strataThickness);
+
void prepareTile(const Tile& tile);
template <typename BucketProperties, typename StyleProperties>
diff --git a/src/mbgl/renderer/painter_clipping.cpp b/src/mbgl/renderer/painter_clipping.cpp
index c495359282..c2a8e6f500 100644
--- a/src/mbgl/renderer/painter_clipping.cpp
+++ b/src/mbgl/renderer/painter_clipping.cpp
@@ -2,6 +2,7 @@
#include <mbgl/map/source.hpp>
#include <mbgl/shader/plain_shader.hpp>
#include <mbgl/util/clip_id.hpp>
+#include <mbgl/gl/debugging.hpp>
#ifndef BUFFER_OFFSET
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -10,7 +11,7 @@
using namespace mbgl;
void Painter::drawClippingMasks(const std::set<Source*>& sources) {
- gl::group group("clipping masks");
+ gl::debugging::group group("clipping masks");
useProgram(plainShader->program);
config.stencilTest = true;
diff --git a/src/mbgl/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp
index b252e2e835..d4306d3e1a 100644
--- a/src/mbgl/renderer/painter_debug.cpp
+++ b/src/mbgl/renderer/painter_debug.cpp
@@ -4,6 +4,7 @@
#include <mbgl/map/tile_data.hpp>
#include <mbgl/shader/plain_shader.hpp>
#include <mbgl/util/string.hpp>
+#include <mbgl/gl/debugging.hpp>
#ifndef BUFFER_OFFSET
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -12,7 +13,7 @@
using namespace mbgl;
void Painter::renderTileDebug(const Tile& tile) {
- gl::group group(std::string { "debug " } + std::string(tile.id));
+ gl::debugging::group group(std::string { "debug " } + std::string(tile.id));
assert(tile.data);
if (debug) {
prepareTile(tile);
@@ -22,7 +23,7 @@ void Painter::renderTileDebug(const Tile& tile) {
}
void Painter::renderDebugText(DebugBucket& bucket, const mat4 &matrix) {
- gl::group group("debug text");
+ gl::debugging::group group("debug text");
config.depthTest = false;
@@ -49,7 +50,7 @@ void Painter::renderDebugText(DebugBucket& bucket, const mat4 &matrix) {
}
void Painter::renderDebugFrame(const mat4 &matrix) {
- gl::group group("debug frame");
+ gl::debugging::group group("debug frame");
// Disable depth test and don't count this towards the depth buffer,
// but *don't* disable stencil test, as we want to clip the red tile border
@@ -72,7 +73,7 @@ void Painter::renderDebugText(const std::vector<std::string> &strings) {
return;
}
- gl::group group("debug text");
+ gl::debugging::group group("debug text");
config.depthTest = false;
config.stencilTest = true;
diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp
index dbaa177fcb..d984752f1a 100644
--- a/src/mbgl/renderer/symbol_bucket.cpp
+++ b/src/mbgl/renderer/symbol_bucket.cpp
@@ -29,7 +29,7 @@
namespace mbgl {
SymbolBucket::SymbolBucket(Collision &collision_)
- : collision(collision_), needsGlyphs_(false) {
+ : collision(collision_) {
}
SymbolBucket::~SymbolBucket() {
@@ -62,16 +62,15 @@ bool SymbolBucket::hasTextData() const { return !text.groups.empty(); }
bool SymbolBucket::hasIconData() const { return !icon.groups.empty(); }
-std::vector<SymbolFeature> SymbolBucket::processFeatures(const GeometryTileLayer& layer,
- const FilterExpression& filter,
- GlyphStore &glyphStore) {
+bool SymbolBucket::needsDependencies(const GeometryTileLayer& layer,
+ const FilterExpression& filter,
+ GlyphStore& glyphStore,
+ Sprite& sprite) {
const bool has_text = !layout.text.field.empty() && !layout.text.font.empty();
const bool has_icon = !layout.icon.image.empty();
- std::vector<SymbolFeature> features;
-
if (!has_text && !has_icon) {
- return features;
+ return false;
}
// Determine and load glyph ranges
@@ -135,28 +134,21 @@ std::vector<SymbolFeature> SymbolBucket::processFeatures(const GeometryTileLayer
}
if (glyphStore.requestGlyphRangesIfNeeded(layout.text.font, ranges)) {
- needsGlyphs_ = true;
- return {};
+ return true;
+ }
+
+ if (!sprite.isLoaded()) {
+ return true;
}
- return features;
+ return false;
}
-void SymbolBucket::addFeatures(const GeometryTileLayer& layer,
- const FilterExpression& filter,
- uintptr_t tileUID,
+void SymbolBucket::addFeatures(uintptr_t tileUID,
SpriteAtlas& spriteAtlas,
Sprite& sprite,
GlyphAtlas& glyphAtlas,
GlyphStore& glyphStore) {
- const std::vector<SymbolFeature> features = processFeatures(layer, filter, glyphStore);
-
- // Stop if we still need glyphs because the
- // bucket will be discarded.
- if (needsGlyphs()) {
- return;
- }
-
float horizontalAlign = 0.5;
float verticalAlign = 0.5;
@@ -198,7 +190,7 @@ void SymbolBucket::addFeatures(const GeometryTileLayer& layer,
if (layout.text.justify == TextJustifyType::Right) justify = 1;
else if (layout.text.justify == TextJustifyType::Left) justify = 0;
- auto* fontStack = glyphStore.getFontStack(layout.text.font);
+ auto fontStack = glyphStore.getFontStack(layout.text.font);
for (const auto& feature : features) {
if (!feature.geometry.size()) continue;
@@ -222,7 +214,7 @@ void SymbolBucket::addFeatures(const GeometryTileLayer& layer,
// Add the glyphs we need for this label to the glyph atlas.
if (shaping.size()) {
- glyphAtlas.addGlyphs(tileUID, feature.label, layout.text.font, *fontStack, face);
+ glyphAtlas.addGlyphs(tileUID, feature.label, layout.text.font, **fontStack, face);
}
}
@@ -236,7 +228,7 @@ void SymbolBucket::addFeatures(const GeometryTileLayer& layer,
}
// if either shaping or icon position is present, add the feature
- if (shaping.size() || image) {
+ if (shaping.size() || image.hasArea()) {
for (const auto& line : feature.geometry) {
if (line.size()) {
addFeature(line, shaping, face, image);
@@ -244,6 +236,8 @@ void SymbolBucket::addFeatures(const GeometryTileLayer& layer,
}
}
}
+
+ features.clear();
}
bool byScale(const Anchor &a, const Anchor &b) { return a.scale < b.scale; }
@@ -265,7 +259,7 @@ void SymbolBucket::addFeature(const std::vector<Coordinate> &line, const Shaping
const float textBoxScale = collision.tilePixelRatio * fontScale;
const float iconBoxScale = collision.tilePixelRatio * layout.icon.max_size;
const bool iconWithoutText = layout.text.optional || !shaping.size();
- const bool textWithoutIcon = layout.icon.optional || !image;
+ const bool textWithoutIcon = layout.icon.optional || !image.hasArea();
const bool avoidEdges = layout.avoid_edges && layout.placement != PlacementType::Line;
Anchors anchors;
@@ -322,7 +316,7 @@ void SymbolBucket::addFeature(const std::vector<Coordinate> &line, const Shaping
continue;
}
- if (image) {
+ if (image.hasArea()) {
iconPlacement = Placement::getIcon(anchor, image, iconBoxScale, line, layout);
iconScale =
layout.icon.allow_overlap
diff --git a/src/mbgl/renderer/symbol_bucket.hpp b/src/mbgl/renderer/symbol_bucket.hpp
index 9c67d66a52..d0b133bc77 100644
--- a/src/mbgl/renderer/symbol_bucket.hpp
+++ b/src/mbgl/renderer/symbol_bucket.hpp
@@ -61,25 +61,22 @@ public:
bool hasTextData() const;
bool hasIconData() const;
- void addFeatures(const GeometryTileLayer&,
- const FilterExpression&,
- uintptr_t tileUID,
+ void addFeatures(uintptr_t tileUID,
SpriteAtlas&,
Sprite&,
GlyphAtlas&,
GlyphStore&);
- inline bool needsGlyphs() const { return needsGlyphs_; }
-
void drawGlyphs(SDFShader& shader);
void drawIcons(SDFShader& shader);
void drawIcons(IconShader& shader);
-private:
- std::vector<SymbolFeature> processFeatures(const GeometryTileLayer&,
- const FilterExpression&,
- GlyphStore&);
+ bool needsDependencies(const GeometryTileLayer&,
+ const FilterExpression&,
+ GlyphStore&,
+ Sprite&);
+private:
void addFeature(const std::vector<Coordinate> &line, const Shaping &shaping, const GlyphPositions &face, const Rect<uint16_t> &image);
// Adds placed items to the buffer.
@@ -92,6 +89,7 @@ public:
private:
Collision &collision;
+ std::vector<SymbolFeature> features;
struct TextBuffer {
TextVertexBuffer vertices;
@@ -104,9 +102,8 @@ private:
TriangleElementsBuffer triangles;
std::vector<std::unique_ptr<IconElementGroup>> groups;
} icon;
-
- bool needsGlyphs_;
};
+
}
#endif
diff --git a/src/mbgl/storage/default_file_source.cpp b/src/mbgl/storage/default_file_source.cpp
index ddfcc89845..e8831f5465 100644
--- a/src/mbgl/storage/default_file_source.cpp
+++ b/src/mbgl/storage/default_file_source.cpp
@@ -37,24 +37,14 @@ DefaultFileSource::~DefaultFileSource() {
Request* DefaultFileSource::request(const Resource& resource,
uv_loop_t* l,
Callback callback) {
+ assert(l);
auto req = new Request(resource, l, std::move(callback));
-
- // This function can be called from any thread. Make sure we're executing the actual call in the
- // file source loop by sending it over the queue.
thread->invoke(&Impl::add, req);
-
return req;
}
-void DefaultFileSource::request(const Resource& resource, Callback callback) {
- request(resource, nullptr, std::move(callback));
-}
-
void DefaultFileSource::cancel(Request *req) {
req->cancel();
-
- // This function can be called from any thread. Make sure we're executing the actual call in the
- // file source loop by sending it over the queue.
thread->invoke(&Impl::cancel, req);
}
@@ -85,7 +75,7 @@ void DefaultFileSource::Impl::add(Request* req) {
return;
}
- request = &pending.emplace(resource, DefaultFileRequest(resource)).first->second;
+ request = &pending.emplace(resource, resource).first->second;
request->observers.insert(req);
if (cache) {
@@ -101,9 +91,11 @@ void DefaultFileSource::Impl::startCacheRequest(const Resource& resource) {
cache->get(resource, [this, resource](std::unique_ptr<Response> response) {
DefaultFileRequest* request = find(resource);
- if (!request) {
+ if (!request || request->request) {
// There is no request for this URL anymore. Likely, the request was canceled
// before we got around to process the cache result.
+ // The second possibility is that a request has already been started by another cache
+ // request. In this case, we don't have to do anything either.
return;
}
diff --git a/src/mbgl/storage/default_file_source_impl.hpp b/src/mbgl/storage/default_file_source_impl.hpp
index ed2d248d0a..3845014e97 100644
--- a/src/mbgl/storage/default_file_source_impl.hpp
+++ b/src/mbgl/storage/default_file_source_impl.hpp
@@ -19,8 +19,14 @@ struct DefaultFileRequest {
std::set<Request*> observers;
RequestBase* request = nullptr;
- DefaultFileRequest(const Resource& resource_)
+ inline DefaultFileRequest(const Resource& resource_)
: resource(resource_) {}
+
+ // Make it movable-only
+ DefaultFileRequest(const DefaultFileRequest&) = delete;
+ inline DefaultFileRequest(DefaultFileRequest&&) = default;
+ DefaultFileRequest& operator=(const DefaultFileRequest&) = delete;
+ inline DefaultFileRequest& operator=(DefaultFileRequest&&) = default;
};
class DefaultFileSource::Impl {
diff --git a/src/mbgl/storage/request.cpp b/src/mbgl/storage/request.cpp
index 53a882f2a6..a6d845ce4a 100644
--- a/src/mbgl/storage/request.cpp
+++ b/src/mbgl/storage/request.cpp
@@ -5,9 +5,7 @@
#include <mbgl/util/util.hpp>
#include <mbgl/util/std.hpp>
-#include <mbgl/util/uv.hpp>
-
-#include <uv.h>
+#include <mbgl/util/uv_detail.hpp>
#include <cassert>
#include <functional>
@@ -18,18 +16,9 @@ struct Request::Canceled { std::mutex mutex; bool confirmed = false; };
// Note: This requires that loop is running in the current thread (or not yet running).
Request::Request(const Resource &resource_, uv_loop_t *loop, Callback callback_)
- : callback(callback_), resource(resource_) {
- // When there is no loop supplied (== nullptr), the callback will be fired in an arbitrary
- // thread (the thread notify() is called from) rather than kicking back to the calling thread.
- if (loop) {
- async = new uv_async_t;
- async->data = this;
-#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
- uv_async_init(loop, async, [](uv_async_t *a, int) { reinterpret_cast<Request *>(a->data)->notifyCallback(); });
-#else
- uv_async_init(loop, async, [](uv_async_t *a) { reinterpret_cast<Request *>(a->data)->notifyCallback(); });
-#endif
- }
+ : async(util::make_unique<uv::async>(loop, [this] { notifyCallback(); })),
+ callback(callback_),
+ resource(resource_) {
}
// Called in the originating thread.
@@ -59,27 +48,14 @@ void Request::invoke() {
delete this;
}
-Request::~Request() {
- if (async) {
- uv_close(reinterpret_cast<uv_handle_t*>(async), [](uv_handle_t* handle) {
- delete reinterpret_cast<uv_async_t*>(handle);
- });
- }
-}
+Request::~Request() = default;
// Called in the FileSource thread.
void Request::notify(const std::shared_ptr<const Response> &response_) {
assert(!response);
response = response_;
assert(response);
-
- if (async) {
- uv_async_send(async);
- } else {
- // This request is not cancelable. This means that the callback will be executed in an
- // arbitrary thread (== FileSource thread).
- invoke();
- }
+ async->send();
}
// Called in the originating thread.
@@ -97,7 +73,7 @@ void Request::destruct() {
assert(canceled);
std::unique_lock<std::mutex> lock(canceled->mutex);
canceled->confirmed = true;
- uv_async_send(async);
+ async->send();
// after this method returns, the FileSource thread has no knowledge of
// this object anymore.
}
diff --git a/src/mbgl/style/filter_expression.cpp b/src/mbgl/style/filter_expression.cpp
index 684715b026..bb755c5644 100644
--- a/src/mbgl/style/filter_expression.cpp
+++ b/src/mbgl/style/filter_expression.cpp
@@ -59,7 +59,11 @@ FilterExpression parseSetFilter(const rapidjson::Value& value) {
Expression expression;
expression.key = { value[1u].GetString(), value[1u].GetStringLength() };
for (rapidjson::SizeType i = 2; i < value.Size(); ++i) {
- expression.values.push_back(parseValue(value[i]));
+ Value parsedValue = parseValue(value[i]);
+ if (expression.key == "$type") {
+ parsedValue = parseFeatureType(parsedValue);
+ }
+ expression.values.push_back(parsedValue);
}
return expression;
}
diff --git a/src/mbgl/text/collision.cpp b/src/mbgl/text/collision.cpp
index 422cd0a60a..ba32b87d2f 100644
--- a/src/mbgl/text/collision.cpp
+++ b/src/mbgl/text/collision.cpp
@@ -157,14 +157,24 @@ float Collision::getPlacementScale(const GlyphBoxes &glyphs, float minPlacementS
float padding = std::fmax(pad, placement.padding) * 8.0f;
// Original algorithm:
- float s1 = (ob.tl.x - nb.br.x - padding) /
- (na.x - oa.x); // scale at which new box is to the left of old box
- float s2 = (ob.br.x - nb.tl.x + padding) /
- (na.x - oa.x); // scale at which new box is to the right of old box
- float s3 = (ob.tl.y - nb.br.y - padding) /
- (na.y - oa.y); // scale at which new box is to the top of old box
- float s4 = (ob.br.y - nb.tl.y + padding) /
- (na.y - oa.y); // scale at which new box is to the bottom of old box
+ float sx = (na.x - oa.x);
+ float s1 = 1;
+ float s2 = 1;
+ if (sx != 0) {
+ s1 = (ob.tl.x - nb.br.x - padding) /
+ sx; // scale at which new box is to the left of old box
+ s2 = (ob.br.x - nb.tl.x + padding) /
+ sx; // scale at which new box is to the right of old box
+ }
+ float sy = (na.y - oa.y);
+ float s3 = 1;
+ float s4 = 1;
+ if (sy != 0) {
+ s3 = (ob.tl.y - nb.br.y - padding) /
+ sy; // scale at which new box is to the top of old box
+ s4 = (ob.br.y - nb.tl.y + padding) /
+ sy; // scale at which new box is to the bottom of old box
+ }
if (std::isnan(s1) || std::isnan(s2)) {
s1 = s2 = 1;
diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp
index 4fbb75fc1e..b0af261cc6 100644
--- a/src/mbgl/text/glyph.hpp
+++ b/src/mbgl/text/glyph.hpp
@@ -35,7 +35,7 @@ struct Glyph {
: rect(rect_), metrics(metrics_) {}
operator bool() const {
- return metrics || rect;
+ return metrics || rect.hasArea();
}
const Rect<uint16_t> rect;
diff --git a/src/mbgl/text/glyph_store.cpp b/src/mbgl/text/glyph_store.cpp
index 71c1be6d95..4ee853b1ef 100644
--- a/src/mbgl/text/glyph_store.cpp
+++ b/src/mbgl/text/glyph_store.cpp
@@ -9,6 +9,7 @@
#include <mbgl/util/constants.hpp>
#include <mbgl/util/token.hpp>
#include <mbgl/util/math.hpp>
+#include <mbgl/util/uv_detail.hpp>
#include <mbgl/storage/file_source.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
@@ -19,19 +20,16 @@ namespace mbgl {
void FontStack::insert(uint32_t id, const SDFGlyph &glyph) {
- std::lock_guard<std::mutex> lock(mtx);
metrics.emplace(id, glyph.metrics);
bitmaps.emplace(id, glyph.bitmap);
sdfs.emplace(id, glyph);
}
const std::map<uint32_t, GlyphMetrics> &FontStack::getMetrics() const {
- std::lock_guard<std::mutex> lock(mtx);
return metrics;
}
const std::map<uint32_t, SDFGlyph> &FontStack::getSDFs() const {
- std::lock_guard<std::mutex> lock(mtx);
return sdfs;
}
@@ -39,8 +37,6 @@ const Shaping FontStack::getShaping(const std::u32string &string, const float ma
const float lineHeight, const float horizontalAlign,
const float verticalAlign, const float justify,
const float spacing, const vec2<float> &translate) const {
- std::lock_guard<std::mutex> lock(mtx);
-
Shaping shaping;
int32_t x = std::round(translate.x * 24); // one em
@@ -166,7 +162,6 @@ GlyphPBF::GlyphPBF(const std::string& glyphURL,
// parse the data we received. We are not doing this here since this callback is being
// called from another (unknown) thread.
data = res.data;
- parsed = true;
callback(this);
}
});
@@ -179,8 +174,6 @@ GlyphPBF::~GlyphPBF() {
}
void GlyphPBF::parse(FontStack &stack) {
- std::lock_guard<std::mutex> lock(mtx);
-
if (!data.size()) {
// If there is no data, this means we either haven't received any data, or
// we have already parsed the data.
@@ -230,14 +223,19 @@ void GlyphPBF::parse(FontStack &stack) {
}
data.clear();
+
+ parsed = true;
}
bool GlyphPBF::isParsed() const {
return parsed;
}
-GlyphStore::GlyphStore(Environment& env_)
- : env(env_), observer(nullptr) {
+GlyphStore::GlyphStore(uv_loop_t* loop, Environment& env_)
+ : env(env_),
+ asyncEmitGlyphRangeLoaded(util::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoaded(); })),
+ observer(nullptr) {
+ asyncEmitGlyphRangeLoaded->unref();
}
GlyphStore::~GlyphStore() {
@@ -248,7 +246,7 @@ void GlyphStore::setURL(const std::string &url) {
glyphURL = url;
}
-bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStack,
+bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStackName,
const std::set<GlyphRange>& glyphRanges) {
bool requestIsNeeded = false;
@@ -256,18 +254,19 @@ bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStack,
return requestIsNeeded;
}
- auto callback = [this, fontStack](GlyphPBF* glyph) {
- glyph->parse(*createFontStack(fontStack));
- emitGlyphRangeLoaded();
+ auto callback = [this, fontStackName](GlyphPBF* glyph) {
+ auto fontStack = createFontStack(fontStackName);
+ glyph->parse(**fontStack);
+ asyncEmitGlyphRangeLoaded->send();
};
std::lock_guard<std::mutex> lock(rangesMutex);
- auto& rangeSets = ranges[fontStack];
+ auto& rangeSets = ranges[fontStackName];
for (const auto& range : glyphRanges) {
const auto& rangeSets_it = rangeSets.find(range);
if (rangeSets_it == rangeSets.end()) {
- auto glyph = util::make_unique<GlyphPBF>(glyphURL, fontStack, range, env, callback);
+ auto glyph = util::make_unique<GlyphPBF>(glyphURL, fontStackName, range, env, callback);
rangeSets.emplace(range, std::move(glyph));
requestIsNeeded = true;
continue;
@@ -281,26 +280,26 @@ bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStack,
return requestIsNeeded;
}
-FontStack* GlyphStore::createFontStack(const std::string &fontStack) {
- std::lock_guard<std::mutex> lock(stacksMutex);
+util::exclusive<FontStack> GlyphStore::createFontStack(const std::string &fontStack) {
+ auto lock = util::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
auto stack_it = stacks.find(fontStack);
if (stack_it == stacks.end()) {
stack_it = stacks.emplace(fontStack, util::make_unique<FontStack>()).first;
}
- return stack_it->second.get();
+ return { stack_it->second.get(), std::move(lock) };
}
-FontStack* GlyphStore::getFontStack(const std::string &fontStack) {
- std::lock_guard<std::mutex> lock(stacksMutex);
+util::exclusive<FontStack> GlyphStore::getFontStack(const std::string &fontStack) {
+ auto lock = util::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
const auto& stack_it = stacks.find(fontStack);
if (stack_it == stacks.end()) {
- return nullptr;
+ return { nullptr, nullptr };
}
- return stack_it->second.get();
+ return { stack_it->second.get(), std::move(lock) };
}
void GlyphStore::setObserver(Observer* observer_) {
diff --git a/src/mbgl/text/glyph_store.hpp b/src/mbgl/text/glyph_store.hpp
index a41eec5330..e13ed1f1d7 100644
--- a/src/mbgl/text/glyph_store.hpp
+++ b/src/mbgl/text/glyph_store.hpp
@@ -4,6 +4,7 @@
#include <mbgl/text/glyph.hpp>
#include <mbgl/util/vec.hpp>
#include <mbgl/util/ptr.hpp>
+#include <mbgl/util/exclusive.hpp>
#include <cstdint>
#include <vector>
@@ -13,6 +14,14 @@
#include <string>
#include <unordered_map>
+typedef struct uv_loop_s uv_loop_t;
+
+namespace uv {
+
+class async;
+
+}
+
namespace mbgl {
class FileSource;
@@ -45,7 +54,6 @@ private:
std::map<uint32_t, std::string> bitmaps;
std::map<uint32_t, GlyphMetrics> metrics;
std::map<uint32_t, SDFGlyph> sdfs;
- mutable std::mutex mtx;
};
class GlyphPBF {
@@ -73,8 +81,6 @@ private:
Environment& env;
Request* req = nullptr;
-
- mutable std::mutex mtx;
};
// Manages Glyphrange PBF loading.
@@ -87,7 +93,7 @@ public:
virtual void onGlyphRangeLoaded() = 0;
};
- GlyphStore(Environment &);
+ GlyphStore(uv_loop_t* loop, Environment &);
~GlyphStore();
// Asynchronously request for GlyphRanges and when it gets loaded, notifies the
@@ -96,7 +102,7 @@ public:
// GlyphRanges are already available, and thus, no request is performed.
bool requestGlyphRangesIfNeeded(const std::string &fontStack, const std::set<GlyphRange> &glyphRanges);
- FontStack* getFontStack(const std::string &fontStack);
+ util::exclusive<FontStack> getFontStack(const std::string &fontStack);
void setURL(const std::string &url);
@@ -105,7 +111,7 @@ public:
private:
void emitGlyphRangeLoaded();
- FontStack* createFontStack(const std::string &fontStack);
+ util::exclusive<FontStack> createFontStack(const std::string &fontStack);
std::string glyphURL;
Environment &env;
@@ -116,6 +122,8 @@ private:
std::unordered_map<std::string, std::unique_ptr<FontStack>> stacks;
std::mutex stacksMutex;
+ std::unique_ptr<uv::async> asyncEmitGlyphRangeLoaded;
+
Observer* observer;
};
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 8a221e16f7..6c24d26fd0 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -53,6 +53,9 @@ void getSegmentGlyphs(std::back_insert_iterator<GlyphInstances> glyphs, Anchor &
while (true) {
const float dist = util::dist<float>(newAnchor, end);
+ if (dist == 0) {
+ break;
+ }
const float scale = offset / dist;
float angle =
-std::atan2(end.x - newAnchor.x, end.y - newAnchor.y) + direction * M_PI / 2.0f;
@@ -132,11 +135,12 @@ GlyphBox getMergedBoxes(const GlyphBoxes &glyphs, const Anchor &anchor) {
Placement Placement::getIcon(Anchor &anchor, const Rect<uint16_t> &image, float boxScale,
const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout) {
+ const float padding = 1.0f;
const float dx = layout.icon.offset[0];
const float dy = layout.icon.offset[1];
- float x1 = dx - image.originalW / 2.0f;
+ float x1 = dx - image.originalW / 2.0f - padding;
float x2 = x1 + image.w;
- float y1 = dy - image.originalH / 2.0f;
+ float y1 = dy - image.originalH / 2.0f - padding;
float y2 = y1 + image.h;
vec2<float> tl{x1, y1};
@@ -209,7 +213,8 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const
Placement placement;
- const uint32_t buffer = 3;
+ const uint32_t glyphPadding = 1;
+ const uint32_t buffer = 3 + glyphPadding;
for (const auto& shape : shaping) {
auto face_it = face.find(shape.glyph);
@@ -221,7 +226,7 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const
if (!glyph)
continue;
- if (!rect)
+ if (!rect.hasArea())
continue;
const float x = (origin.x + shape.x + glyph.metrics.left - buffer + rect.w / 2) * boxScale;
diff --git a/src/mbgl/util/clip_id.cpp b/src/mbgl/util/clip_id.cpp
index be359c18c3..c475369c20 100644
--- a/src/mbgl/util/clip_id.cpp
+++ b/src/mbgl/util/clip_id.cpp
@@ -75,14 +75,14 @@ void ClipIDGenerator::update(std::forward_list<Tile *> tiles) {
if (pool.size()) {
const uint32_t bit_count = util::ceil_log2(pool.size() + 1);
- const std::bitset<8> mask = uint64_t(((1 << bit_count) - 1) << bit_offset);
+ const std::bitset<8> mask = uint64_t(((1ul << bit_count) - 1) << bit_offset);
// We are starting our count with 1 since we need at least 1 bit set to distinguish between
// areas without any tiles whatsoever and the current area.
uint8_t count = 1;
for (auto& leaf : pool) {
leaf.tile.clip.mask = mask;
- leaf.tile.clip.reference = count++ << bit_offset;
+ leaf.tile.clip.reference = uint32_t(count++) << bit_offset;
}
bit_offset += bit_count;
diff --git a/src/mbgl/util/rect.hpp b/src/mbgl/util/rect.hpp
index 5cc398d821..f4eb0679c4 100644
--- a/src/mbgl/util/rect.hpp
+++ b/src/mbgl/util/rect.hpp
@@ -12,11 +12,16 @@ struct Rect {
T originalW = 0, originalH = 0;
template <typename Number>
- Rect operator *(Number value) const {
+ inline Rect operator *(Number value) const {
return Rect(x * value, y * value, w * value, h * value);
}
- operator bool() const { return w != 0 && h != 0; }
+ template <typename R>
+ inline bool operator==(const R& r) const {
+ return x == r.x && y == r.y && w == r.w && h == r.h;
+ }
+
+ inline bool hasArea() const { return w != 0 && h != 0; }
};
}
diff --git a/src/mbgl/util/work_request.cpp b/src/mbgl/util/work_request.cpp
index 05fe535802..69e9397288 100644
--- a/src/mbgl/util/work_request.cpp
+++ b/src/mbgl/util/work_request.cpp
@@ -1,34 +1,16 @@
#include <mbgl/util/work_request.hpp>
+#include <mbgl/util/work_task.hpp>
-namespace mbgl {
-
-WorkRequest::WorkRequest() = default;
+#include <cassert>
-WorkRequest::WorkRequest(Future&& future)
- : complete(std::move(future)) {
-}
+namespace mbgl {
-WorkRequest::WorkRequest(WorkRequest&& o)
- : complete(std::move(o.complete)) {
+WorkRequest::WorkRequest(Task task_) : task(task_) {
+ assert(task);
}
WorkRequest::~WorkRequest() {
- if (complete.valid()) {
- complete.get();
- }
-}
-
-WorkRequest& WorkRequest::operator=(WorkRequest&& o) {
- complete = std::move(o.complete);
- return *this;
-}
-
-WorkRequest::operator bool() const {
- return complete.valid();
-}
-
-void WorkRequest::join() {
- complete.get();
+ task->cancel();
}
}
diff --git a/src/mbgl/util/work_request.hpp b/src/mbgl/util/work_request.hpp
index 8c26abb60f..f2aa2bbacc 100644
--- a/src/mbgl/util/work_request.hpp
+++ b/src/mbgl/util/work_request.hpp
@@ -3,27 +3,20 @@
#include <mbgl/util/noncopyable.hpp>
-#include <future>
+#include <memory>
namespace mbgl {
+class WorkTask;
+
class WorkRequest : public util::noncopyable {
public:
- using Future = std::future<void>;
-
- WorkRequest();
- WorkRequest(Future&&);
- WorkRequest(WorkRequest&&);
+ using Task = std::shared_ptr<WorkTask>;
+ WorkRequest(Task);
~WorkRequest();
- WorkRequest& operator=(WorkRequest&&);
- operator bool() const;
-
- // Wait for the worker task to complete.
- void join();
-
private:
- Future complete;
+ std::shared_ptr<WorkTask> task;
};
}
diff --git a/src/mbgl/util/work_task.cpp b/src/mbgl/util/work_task.cpp
new file mode 100644
index 0000000000..ebec420dec
--- /dev/null
+++ b/src/mbgl/util/work_task.cpp
@@ -0,0 +1,37 @@
+#include <mbgl/util/work_task.hpp>
+
+#include <cassert>
+
+namespace mbgl {
+
+WorkTask::WorkTask(std::function<void()> task_, std::function<void()> after_)
+ : task(task_), after(after_) {
+ assert(after);
+}
+
+void WorkTask::runTask() {
+ // We are only running the task when there's an after callback to call. This means that an
+ // empty after callback will be treated as a cancelled request. The mutex will be locked while
+ // processing so that the cancel() callback will block.
+ std::lock_guard<std::mutex> lock(mutex);
+ if (after) {
+ task();
+ }
+}
+
+void WorkTask::runAfter() {
+ if (after) {
+ after();
+ }
+}
+
+void WorkTask::cancel() {
+ // Remove the after callback to indicate that this callback has been canceled. The mutex will
+ // block when the task is currently in progres. When the task has not begun yet, the runTask()
+ // method will not do anything. When the task has been completed already, and the after callback
+ // was run as well, this will also do nothing.
+ std::lock_guard<std::mutex> lock(mutex);
+ after = {};
+}
+
+} // end namespace mbgl
diff --git a/src/mbgl/util/work_task.hpp b/src/mbgl/util/work_task.hpp
new file mode 100644
index 0000000000..f730a31c56
--- /dev/null
+++ b/src/mbgl/util/work_task.hpp
@@ -0,0 +1,27 @@
+#ifndef MBGL_UTIL_WORK_TASK
+#define MBGL_UTIL_WORK_TASK
+
+#include <mbgl/util/noncopyable.hpp>
+
+#include <functional>
+#include <mutex>
+
+namespace mbgl {
+
+class WorkTask : private util::noncopyable {
+public:
+ WorkTask(std::function<void()> task, std::function<void()> after);
+
+ void runTask();
+ void runAfter();
+ void cancel();
+
+private:
+ const std::function<void()> task;
+ std::function<void()> after;
+ std::mutex mutex;
+};
+
+} // end namespace mbgl
+
+#endif
diff --git a/src/mbgl/util/worker.cpp b/src/mbgl/util/worker.cpp
index 7f5620e1fa..984c55c95e 100644
--- a/src/mbgl/util/worker.cpp
+++ b/src/mbgl/util/worker.cpp
@@ -1,4 +1,6 @@
#include <mbgl/util/worker.hpp>
+#include <mbgl/util/work_task.hpp>
+#include <mbgl/util/work_request.hpp>
#include <mbgl/platform/platform.hpp>
#include <cassert>
@@ -10,8 +12,8 @@ class Worker::Impl {
public:
Impl(uv_loop_t*) {}
- void doWork(std::packaged_task<void ()>& task) {
- task();
+ void doWork(std::shared_ptr<WorkTask>& task) {
+ task->runTask();
}
};
@@ -23,14 +25,16 @@ Worker::Worker(std::size_t count) {
Worker::~Worker() = default;
-WorkRequest Worker::send(Fn work, Fn after) {
- std::packaged_task<void ()> task(work);
- std::future<void> future = task.get_future();
+std::unique_ptr<WorkRequest> Worker::send(Fn work, Fn after) {
+ auto task = std::make_shared<WorkTask>(work, after);
+ auto request = util::make_unique<WorkRequest>(task);
- threads[current]->invokeWithResult(&Worker::Impl::doWork, std::move(after), task);
+ threads[current]->invokeWithResult(&Worker::Impl::doWork, [task] {
+ task->runAfter();
+ }, task);
current = (current + 1) % threads.size();
- return WorkRequest(std::move(future));
+ return request;
}
-}
+} // end namespace mbgl
diff --git a/src/mbgl/util/worker.hpp b/src/mbgl/util/worker.hpp
index c4a4c376e2..0c001e419b 100644
--- a/src/mbgl/util/worker.hpp
+++ b/src/mbgl/util/worker.hpp
@@ -2,13 +2,15 @@
#define MBGL_UTIL_WORKER
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/work_request.hpp>
#include <mbgl/util/thread.hpp>
#include <functional>
+#include <memory>
namespace mbgl {
+class WorkRequest;
+
class Worker : public mbgl::util::noncopyable {
public:
using Fn = std::function<void ()>;
@@ -21,10 +23,12 @@ public:
// work is complete.
//
// The return value represents the request to perform the work asynchronously.
- // Its destructor guarantees that the work is either cancelled and will never
- // execute, or has finished executing. In other words, the WorkRequest is
- // guaranteed to outlive any references held by the work function.
- WorkRequest send(Fn work, Fn after);
+ // Its destructor guarantees that the work function has finished executing, and
+ // that the after function has either finished executing or will not execute.
+ // Together, this means that an object may make a work request with lambdas which
+ // bind references to itself, and if and when those lambdas execute, the references
+ // will still be valid.
+ std::unique_ptr<WorkRequest> send(Fn work, Fn after);
private:
class Impl;
diff --git a/styles b/styles
-Subproject 81be4f715e23b1cce9d920ab65ac673e6248ea4
+Subproject 93a23d762332a4c75e3dae1c547c4d810101e97
diff --git a/test/fixtures/api/1.png b/test/fixtures/api/1.png
deleted file mode 100644
index 69e3c8ca95..0000000000
--- a/test/fixtures/api/1.png
+++ /dev/null
Binary files differ
diff --git a/test/fixtures/api/2.png b/test/fixtures/api/2.png
deleted file mode 100644
index 2a28c639a5..0000000000
--- a/test/fixtures/api/2.png
+++ /dev/null
Binary files differ
diff --git a/test/headless/headless.cpp b/test/headless/headless.cpp
index 38fbf63b59..a02062dbdd 100644
--- a/test/headless/headless.cpp
+++ b/test/headless/headless.cpp
@@ -104,14 +104,12 @@ TEST_P(HeadlessTest, render) {
ASSERT_FALSE(infoDoc.HasParseError());
ASSERT_TRUE(infoDoc.IsObject());
- Log::setObserver(util::make_unique<FixtureLogObserver>());
-
for (auto it = infoDoc.MemberBegin(), end = infoDoc.MemberEnd(); it != end; it++) {
const std::string name {
it->name.GetString(), it->name.GetStringLength()
};
- Log::Info(Event::General, "test fixture %s %s", base.c_str(), name.c_str());
+ Log::Info(Event::General, "%s %s", base.c_str(), name.c_str());
const rapidjson::Value& value = it->value;
ASSERT_TRUE(value.IsObject());
diff --git a/test/ios/MGLTAppDelegate.m b/test/ios/MGLTAppDelegate.m
index 4bd6b64882..bbd67821fe 100644
--- a/test/ios/MGLTAppDelegate.m
+++ b/test/ios/MGLTAppDelegate.m
@@ -1,5 +1,6 @@
#import "MGLTAppDelegate.h"
#import "MGLTViewController.h"
+#import "MapboxGL.h"
@implementation MGLTAppDelegate
@@ -12,6 +13,8 @@
wrapper.toolbarHidden = YES;
[self.window makeKeyAndVisible];
+ [MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES]; // a lie, but a convenient one
+
return YES;
}
diff --git a/test/ios/MetricsTests.m b/test/ios/MetricsTests.m
new file mode 100644
index 0000000000..5b1a7956ea
--- /dev/null
+++ b/test/ios/MetricsTests.m
@@ -0,0 +1,287 @@
+#import "MGLMapboxEvents.h"
+
+#import "KIFTestActor+MapboxGL.h"
+
+#import <KIF/KIF.h>
+#import <OCMock/OCMock.h>
+
+#import "MapboxGL.h"
+#import "OHHTTPStubs.h"
+
+@interface MGLMapboxEvents (Testing)
+
+- (NSString *)appBundleId;
+- (NSString *)token;
+- (BOOL)isPaused;
+- (NSURLSession *)session;
+- (void)pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary;
+- (NSMutableArray *)eventQueue;
+- (void)postEvents:(NSArray *)events;
+- (NSTimer *)timer;
+- (NSUInteger)flushAt;
+- (NSTimeInterval)flushAfter;
+- (void)setFlushAfter:(NSTimeInterval)newFlushAfter;
+- (void)flush;
+- (void)startTimer;
+
+@end
+
+@interface MetricsTests : KIFTestCase
+
+@property (nonatomic) NSTimeInterval defaultFlushAfter;
+
+@end
+
+@implementation MetricsTests
+
+- (void)beforeAll {
+ [tester acknowledgeSystemAlert];
+ self.defaultFlushAfter = [[MGLMapboxEvents sharedManager] flushAfter];
+}
+
+- (void)beforeEach {
+ [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"MGLMapboxMetricsEnabled"];
+ [MGLMapboxEvents resumeMetricsCollection];
+
+ [MGLAccountManager setAccessToken:@"pk.eyJ1IjoianVzdGluIiwiYSI6IlpDbUJLSUEifQ.4mG8vhelFMju6HpIY-Hi5A"];
+
+ [[MGLMapboxEvents sharedManager] setFlushAfter:self.defaultFlushAfter];
+}
+
+- (void)afterEach {
+ [MGLMapboxEvents pauseMetricsCollection];
+}
+
+- (void)pushFakeEvent {
+ [MGLMapboxEvents pushEvent:@"test_event" withAttributes:@{ @"foo" : @"one", @"bar" : @(2) }];
+}
+
+- (void)testAppBundleID {
+ XCTAssertEqualObjects([[MGLMapboxEvents sharedManager] appBundleId], @"com.mapbox.Mapbox-GL-Tests");
+}
+
+- (void)testTokenSetViaMapView {
+ [tester.mapView setAccessToken:@"test_token"];
+
+ XCTAssertEqualObjects([[MGLMapboxEvents sharedManager] token], @"test_token");
+}
+
+- (void)testResumeMetricsCollection {
+ [MGLMapboxEvents resumeMetricsCollection];
+
+ XCTAssertFalse([[MGLMapboxEvents sharedManager] isPaused]);
+ XCTAssertNotNil([[MGLMapboxEvents sharedManager] session]);
+}
+
+- (void)testPauseMetricsCollection {
+ [MGLMapboxEvents pauseMetricsCollection];
+
+ XCTAssertTrue([[MGLMapboxEvents sharedManager] isPaused]);
+ XCTAssertNil([[MGLMapboxEvents sharedManager] session]);
+}
+
+- (void)testFlushAtThreshold {
+ NSUInteger startCount = [[[MGLMapboxEvents sharedManager] eventQueue] count];
+ NSUInteger flushAt = [[MGLMapboxEvents sharedManager] flushAt];
+
+ XCTestExpectation *queueItemsExpectation = [self expectationWithDescription:@"queue should contain events"];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] > 0) {
+ [queueItemsExpectation fulfill];
+ break;
+ }
+ }
+ });
+
+ for (NSUInteger i = 0; i < (flushAt - startCount - 1); i++) {
+ [self pushFakeEvent];
+ }
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+
+ XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
+ [emptyQueueExpectation fulfill];
+ break;
+ }
+ }
+ });
+
+ [self pushFakeEvent];
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+}
+
+- (void)testTimerDestroyedAfterFlush {
+ XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
+ [emptyQueueExpectation fulfill];
+ break;
+ }
+ }
+ });
+
+ [[MGLMapboxEvents sharedManager] flush];
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+
+ XCTAssertNil([[MGLMapboxEvents sharedManager] timer]);
+}
+
+- (void)testTimerCreatedAfterEventPushed {
+ XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
+ [emptyQueueExpectation fulfill];
+ break;
+ }
+ }
+ });
+
+ [[MGLMapboxEvents sharedManager] flush];
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+
+ [[MGLMapboxEvents sharedManager] setFlushAfter:5];
+
+ id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]];
+ [[[eventsMock expect] andForwardToRealObject] startTimer];
+ [self pushFakeEvent];
+ [eventsMock verifyWithDelay:0.1];
+
+ XCTAssertEqual([[[MGLMapboxEvents sharedManager] eventQueue] count], 1);
+ XCTAssertNotNil([[MGLMapboxEvents sharedManager] timer]);
+ XCTAssertEqual([[MGLMapboxEvents sharedManager] flushAfter], [[[MGLMapboxEvents sharedManager] timer] timeInterval]);
+}
+
+- (void)testTimerFiresFlush {
+ XCTestExpectation *emptyQueueExpectation = [self expectationWithDescription:@"queue should be empty"];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0) {
+ [emptyQueueExpectation fulfill];
+ break;
+ }
+ }
+ });
+
+ [[MGLMapboxEvents sharedManager] flush];
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+
+ [[MGLMapboxEvents sharedManager] setFlushAfter:5];
+ [self pushFakeEvent];
+ id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]];
+ [[eventsMock expect] flush];
+ [eventsMock verifyWithDelay:[[MGLMapboxEvents sharedManager] flushAfter]];
+}
+
+- (void)testFlushPostsEvents {
+ NSArray *events = [NSArray arrayWithArray:[[MGLMapboxEvents sharedManager] eventQueue]];
+
+ id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]];
+ [[eventsMock expect] postEvents:events];
+ [[MGLMapboxEvents sharedManager] flush];
+ [eventsMock verifyWithDelay:1.0];
+
+ XCTAssertTrue([[[MGLMapboxEvents sharedManager] eventQueue] count] == 0);
+}
+
+- (void)testPostEventsNetworkRequest {
+ XCTestExpectation *requestExpectation = [self expectationWithDescription:@"posting events generates network request"];
+ XCTestExpectation *contentTypeExpectation = [self expectationWithDescription:@"events are posted as JSON"];
+ XCTestExpectation *userAgentExpectation = [self expectationWithDescription:@"events are posted with proper user agent"];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return [request.URL.path hasPrefix:@"/events/v1"];
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ if ([request.URL.absoluteString isEqualToString:[@"https://api.tiles.mapbox.com/events/v1?access_token=" stringByAppendingString:[MGLAccountManager accessToken]]]) {
+ [requestExpectation fulfill];
+ }
+
+ if ([request.allHTTPHeaderFields[@"Content-Type"] isEqualToString:@"application/json"]) {
+ [contentTypeExpectation fulfill];
+ }
+
+ if ([request.allHTTPHeaderFields[@"User-Agent"] isEqualToString:[NSString stringWithFormat:@"%@/1.0/1.0 MapboxEventsiOS/1.0", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]]]) {
+ [userAgentExpectation fulfill];
+ }
+
+ return nil;
+ }];
+
+ [self pushFakeEvent];
+ [MGLMapboxEvents flush];
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+}
+
+- (void)testPushEventAddsToEventQueue {
+ XCTestExpectation *queueSizeIncreaseExpectation = [self expectationWithDescription:@"event queue size increase"];
+
+ NSUInteger beforeCount = [[[MGLMapboxEvents sharedManager] eventQueue] count];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] == (beforeCount + 1)) {
+ [queueSizeIncreaseExpectation fulfill];
+ break;
+ }
+ }
+ });
+
+ [self pushFakeEvent];
+
+ [self waitForExpectationsWithTimeout:1.0 handler:nil];
+}
+
+- (void)testOptOutUpfrontDisablesMetrics {
+ [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"MGLMapboxMetricsEnabled"];
+
+ NSUInteger startingCount = [[[MGLMapboxEvents sharedManager] eventQueue] count];
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ while (true) {
+ if ([[[MGLMapboxEvents sharedManager] eventQueue] count] > startingCount) {
+ XCTFail(@"queue should not receive events when opted-out");
+ break;
+ }
+ }
+ });
+
+ [self pushFakeEvent];
+
+ [tester waitForTimeInterval:1.0];
+}
+
+- (void)testOptOutAtRuntimeDisablesMetrics {
+ XCTAssertTrue([[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsEnabled"]);
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return [request.URL.path hasPrefix:@"/events/v1"];
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ XCTFail(@"opt-out should not post events");
+ return nil;
+ }];
+
+ [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"MGLMapboxMetricsEnabled"];
+
+ [self pushFakeEvent];
+
+ [[MGLMapboxEvents sharedManager] flush];
+
+ [tester waitForTimeInterval:1.0];
+}
+
+@end
diff --git a/test/ios/OCMock/OCMock/NSNotificationCenter+OCMAdditions.h b/test/ios/OCMock/OCMock/NSNotificationCenter+OCMAdditions.h
new file mode 100644
index 0000000000..c20a9c2b20
--- /dev/null
+++ b/test/ios/OCMock/OCMock/NSNotificationCenter+OCMAdditions.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2009-2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class OCObserverMockObject;
+
+
+@interface NSNotificationCenter(OCMAdditions)
+
+- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender;
+
+@end
diff --git a/test/ios/OCMock/OCMock/OCMArg.h b/test/ios/OCMock/OCMock/OCMArg.h
new file mode 100644
index 0000000000..d53437cb7d
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMArg.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009-2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface OCMArg : NSObject
+
+// constraining arguments
+
++ (id)any;
++ (SEL)anySelector;
++ (void *)anyPointer;
++ (id __autoreleasing *)anyObjectRef;
++ (id)isNil;
++ (id)isNotNil;
++ (id)isEqual:(id)value;
++ (id)isNotEqual:(id)value;
++ (id)isKindOfClass:(Class)cls;
++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject;
++ (id)checkWithBlock:(BOOL (^)(id obj))block;
+
+// manipulating arguments
+
++ (id *)setTo:(id)value;
++ (void *)setToValue:(NSValue *)value;
+
+// internal use only
+
++ (id)resolveSpecialValues:(NSValue *)value;
+
+@end
+
+#define OCMOCK_ANY [OCMArg any]
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+ #define OCMOCK_VALUE(variable) \
+ ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; })
+#else
+ #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))]
+#endif
diff --git a/test/ios/OCMock/OCMock/OCMConstraint.h b/test/ios/OCMock/OCMock/OCMConstraint.h
new file mode 100644
index 0000000000..777966ab7d
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMConstraint.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2007-2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+
+@interface OCMConstraint : NSObject
+
++ (instancetype)constraint;
+- (BOOL)evaluate:(id)value;
+
+// if you are looking for any, isNil, etc, they have moved to OCMArg
+
+// try to use [OCMArg checkWith...] instead of the constraintWith... methods below
+
++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject;
++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue;
+
+
+@end
+
+@interface OCMAnyConstraint : OCMConstraint
+@end
+
+@interface OCMIsNilConstraint : OCMConstraint
+@end
+
+@interface OCMIsNotNilConstraint : OCMConstraint
+@end
+
+@interface OCMIsNotEqualConstraint : OCMConstraint
+{
+ @public
+ id testValue;
+}
+
+@end
+
+@interface OCMInvocationConstraint : OCMConstraint
+{
+ @public
+ NSInvocation *invocation;
+}
+
+@end
+
+@interface OCMBlockConstraint : OCMConstraint
+{
+ BOOL (^block)(id);
+}
+
+- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block;
+
+@end
+
+
+#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]
+#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]
diff --git a/test/ios/OCMock/OCMock/OCMLocation.h b/test/ios/OCMock/OCMock/OCMLocation.h
new file mode 100644
index 0000000000..e510db7aaf
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMLocation.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface OCMLocation : NSObject
+{
+ id testCase;
+ NSString *file;
+ NSUInteger line;
+}
+
++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
+
+- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
+
+- (id)testCase;
+- (NSString *)file;
+- (NSUInteger)line;
+
+@end
+
+extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line);
diff --git a/test/ios/OCMock/OCMock/OCMMacroState.h b/test/ios/OCMock/OCMock/OCMMacroState.h
new file mode 100644
index 0000000000..4b2d635086
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMMacroState.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class OCMLocation;
+@class OCMRecorder;
+@class OCMStubRecorder;
+@class OCMockObject;
+
+
+@interface OCMMacroState : NSObject
+{
+ OCMRecorder *recorder;
+}
+
++ (void)beginStubMacro;
++ (OCMStubRecorder *)endStubMacro;
+
++ (void)beginExpectMacro;
++ (OCMStubRecorder *)endExpectMacro;
+
++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation;
++ (void)endVerifyMacro;
+
++ (OCMMacroState *)globalState;
+
+- (OCMRecorder *)recorder;
+
+- (void)switchToClassMethod;
+
+@end
diff --git a/test/ios/OCMock/OCMock/OCMRecorder.h b/test/ios/OCMock/OCMock/OCMRecorder.h
new file mode 100644
index 0000000000..f56d2ca4c0
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMRecorder.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class OCMockObject;
+@class OCMInvocationMatcher;
+
+
+@interface OCMRecorder : NSProxy
+{
+ OCMockObject *mockObject;
+ OCMInvocationMatcher *invocationMatcher;
+}
+
+- (instancetype)init;
+- (instancetype)initWithMockObject:(OCMockObject *)aMockObject;
+
+- (void)setMockObject:(OCMockObject *)aMockObject;
+
+- (OCMInvocationMatcher *)invocationMatcher;
+
+- (id)classMethod;
+- (id)ignoringNonObjectArgs;
+
+@end
diff --git a/test/ios/OCMock/OCMock/OCMStubRecorder.h b/test/ios/OCMock/OCMock/OCMStubRecorder.h
new file mode 100644
index 0000000000..890c9ef3bc
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMStubRecorder.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2004-2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import "OCMRecorder.h"
+
+
+@interface OCMStubRecorder : OCMRecorder
+
+- (id)andReturn:(id)anObject;
+- (id)andReturnValue:(NSValue *)aValue;
+- (id)andThrow:(NSException *)anException;
+- (id)andPost:(NSNotification *)aNotification;
+- (id)andCall:(SEL)selector onObject:(id)anObject;
+- (id)andDo:(void (^)(NSInvocation *invocation))block;
+- (id)andForwardToRealObject;
+
+@end
+
+
+@interface OCMStubRecorder (Properties)
+
+#define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; }))
+@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *);
+
+#define andThrow(anException) _andThrow(anException)
+@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *);
+
+#define andPost(aNotification) _andPost(aNotification)
+@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *);
+
+#define andCall(anObject, aSelector) _andCall(anObject, aSelector)
+@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL);
+
+#define andDo(aBlock) _andDo(aBlock)
+@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *));
+
+#define andForwardToRealObject() _andForwardToRealObject()
+@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void);
+
+@end
+
+
+
diff --git a/test/ios/OCMock/OCMock/OCMock.h b/test/ios/OCMock/OCMock/OCMock.h
new file mode 100644
index 0000000000..f0083b3507
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMock.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2004-2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <OCMock/OCMockObject.h>
+#import <OCMock/OCMRecorder.h>
+#import <OCMock/OCMStubRecorder.h>
+#import <OCMock/OCMConstraint.h>
+#import <OCMock/OCMArg.h>
+#import <OCMock/OCMLocation.h>
+#import <OCMock/OCMMacroState.h>
+#import <OCMock/NSNotificationCenter+OCMAdditions.h>
+
+
+#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls]
+
+#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls]
+
+#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol]
+
+#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol]
+
+#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj]
+
+#define OCMObserverMock() [OCMockObject observerMock]
+
+
+#define OCMStub(invocation) \
+({ \
+ _OCMSilenceWarnings( \
+ [OCMMacroState beginStubMacro]; \
+ invocation; \
+ [OCMMacroState endStubMacro]; \
+ ); \
+})
+
+#define OCMExpect(invocation) \
+({ \
+ _OCMSilenceWarnings( \
+ [OCMMacroState beginExpectMacro]; \
+ invocation; \
+ [OCMMacroState endExpectMacro]; \
+ ); \
+})
+
+#define ClassMethod(invocation) \
+ _OCMSilenceWarnings( \
+ [[OCMMacroState globalState] switchToClassMethod]; \
+ invocation; \
+ );
+
+
+#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]
+
+#define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)]
+
+#define OCMVerify(invocation) \
+({ \
+ _OCMSilenceWarnings( \
+ [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \
+ invocation; \
+ [OCMMacroState endVerifyMacro]; \
+ ); \
+})
+
+#define _OCMSilenceWarnings(macro) \
+({ \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wunused-value\"") \
+ macro \
+ _Pragma("clang diagnostic pop") \
+})
diff --git a/test/ios/OCMock/OCMock/OCMockObject.h b/test/ios/OCMock/OCMock/OCMockObject.h
new file mode 100644
index 0000000000..63f2bae2be
--- /dev/null
+++ b/test/ios/OCMock/OCMock/OCMockObject.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2004-2014 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class OCMLocation;
+@class OCMInvocationStub;
+@class OCMStubRecorder;
+@class OCMInvocationMatcher;
+@class OCMInvocationExpectation;
+
+
+@interface OCMockObject : NSProxy
+{
+ BOOL isNice;
+ BOOL expectationOrderMatters;
+ NSMutableArray *stubs;
+ NSMutableArray *expectations;
+ NSMutableArray *exceptions;
+ NSMutableArray *invocations;
+}
+
++ (id)mockForClass:(Class)aClass;
++ (id)mockForProtocol:(Protocol *)aProtocol;
++ (id)partialMockForObject:(NSObject *)anObject;
+
++ (id)niceMockForClass:(Class)aClass;
++ (id)niceMockForProtocol:(Protocol *)aProtocol;
+
++ (id)observerMock;
+
+- (instancetype)init;
+
+- (void)setExpectationOrderMatters:(BOOL)flag;
+
+- (id)stub;
+- (id)expect;
+- (id)reject;
+
+- (id)verify;
+- (id)verifyAtLocation:(OCMLocation *)location;
+
+- (void)verifyWithDelay:(NSTimeInterval)delay;
+- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location;
+
+- (void)stopMocking;
+
+// internal use only
+
+- (void)addStub:(OCMInvocationStub *)aStub;
+- (void)addExpectation:(OCMInvocationExpectation *)anExpectation;
+
+- (BOOL)handleInvocation:(NSInvocation *)anInvocation;
+- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation;
+- (BOOL)handleSelector:(SEL)sel;
+
+- (void)verifyInvocation:(OCMInvocationMatcher *)matcher;
+- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location;
+
+@end
+
diff --git a/test/ios/OCMock/libOCMock.a b/test/ios/OCMock/libOCMock.a
new file mode 100644
index 0000000000..9bb38e21a3
--- /dev/null
+++ b/test/ios/OCMock/libOCMock.a
Binary files differ
diff --git a/test/ios/OHHTTPStubs/.gitignore b/test/ios/OHHTTPStubs/.gitignore
new file mode 100644
index 0000000000..a1e5f0b70e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/.gitignore
@@ -0,0 +1,15 @@
+# Xcode
+build/*
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata
+profile
+*.moved-aside
+.DS_Store
+*.xccheckout
diff --git a/test/ios/OHHTTPStubs/.travis.yml b/test/ios/OHHTTPStubs/.travis.yml
new file mode 100644
index 0000000000..42f139e918
--- /dev/null
+++ b/test/ios/OHHTTPStubs/.travis.yml
@@ -0,0 +1,14 @@
+language: objective-c
+
+before_install:
+ - gem install xcpretty --no-rdoc --no-ri --no-document --quiet
+
+env:
+ #- RAKETASK="simlist"
+ #- RAKETASK="ios[iOS StaticLib,7.1,test]"
+ - RAKETASK="ios[iOS StaticLib,latest,test]"
+ - RAKETASK="ios[iOS Framework,latest,analyze]"
+ - RAKETASK="osx[Mac Framework,x86_64,test]"
+
+script:
+ - rake "$RAKETASK"
diff --git a/test/ios/OHHTTPStubs/CHANGELOG.md b/test/ios/OHHTTPStubs/CHANGELOG.md
new file mode 100644
index 0000000000..40a1315c54
--- /dev/null
+++ b/test/ios/OHHTTPStubs/CHANGELOG.md
@@ -0,0 +1,226 @@
+_You can download previous versions [here](https://github.com/AliSoftware/OHHTTPStubs/tags) and latest version [here](https://github.com/AliSoftware/OHHTTPStubs/zipball/master) (ZIP files generated by GitHub on the fly)_
+
+## [4.0.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/4.0.1)
+
+* Fix threading in `NSURLProtocol` subclass calling `NSURLProtocolClient` callbacks from wrong thread. ([@nsprogrammer](https://github.com/nsprogrammer), [#96](https://github.com/AliSoftware/OHHTTPStubs/pull/96))
+
+## [4.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/4.0.0) — Improvements for Swift
+
+* Annotated the library with _nullability_ attributes to generate a better API when used in Swift
+* Migrated the path utility macros to functions in `OHPathHelpers.h`, for Swift compatibility ([#100](https://github.com/AliSoftware/OHHTTPStubs/issues/100)).
+* Added a complete Swift Demo Project ([#88](https://github.com/AliSoftware/OHHTTPStubs/issues/88))
+* Removed the `XCTestExpectation` subspec that was added for Xcode 5 support — Now that Xcode 6 is widely adopted, you shouldn't need this anymore (but in case you still need it, I will probably create a dedicated pod for that)
+
+## [3.1.12](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.12)
+
+* Fixed issue with HTTP 300 return code (multiple-choice) that is not supposed to redirect. ([@tarbrain](https://github.com/tarbrain), [#92](https://github.com/AliSoftware/OHHTTPStubs/pull/92))
+
+## [3.1.11](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.11)
+
+* Added [Carthage](https://github.com/Carthage/Carthage) support
+* Splitted the Xcode projects for more clarity (one dedicated to build the lib and run Unit Tests, and one for the Demo)
+* Got rid of the `git submodule` used for Unit Tests against [AFNetworking](https://github.com/AFNetworking/AFNetworking) — it is now imported using [CocoaPods](http://cocoapods.org) and only for the lib's Unit Tests targets ([@corinnekrych](https://github.com/corinnekrych), [#90](https://github.com/AliSoftware/OHHTTPStubs/pull/90))
+* Improved [Travis-CI](https://travis-ci.org/AliSoftware/OHHTTPStubs) integration. We now use a build matrix to have paralellized and independant builds for each scheme (iOS Static Lib, iOS Dynamic Framework, OSX Framework)
+* Fixed [#80](https://github.com/AliSoftware/OHHTTPStubs/issues/80) again (there was still an issue for people using Xcode 5 & SDK 7.1… if those people still exists)
+
+## [3.1.10](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.10)
+
+* Fix headers for people still building with Xcode 5 & SDK 7 ([#80](https://github.com/AliSoftware/OHHTTPStubs/issues/80))
+
+## [3.1.9](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.9)
+
+* Use `NS_DESIGNATED_INITIALIZER` macro on designated initializer methods ([#79](https://github.com/AliSoftware/OHHTTPStubs/pull/79))
+
+## [3.1.8](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.8)
+
+* Use `application/json` instead of `text/json` in `README`'s example ([#75](https://github.com/AliSoftware/OHHTTPStubs/pull/75))
+* Fixed an issue with empty files (when using `responseWithFileAtPath:statusCode:headers:` but the file at the specified path is empty)
+
+## [3.1.7](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.7)
+
+* Added `DEFINES_MODULE` Flag to be easily imported in Swift ([#74](https://github.com/AliSoftware/OHHTTPStubs/pull/74))
+
+_(I also moved [Travis-CI build system](https://travis-ci.org/AliSoftware/OHHTTPStubs) so it now uses `xcpretty` instead of `xctool` to run Unit Tests)_
+
+## [3.1.6](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.6)
+
+* Fixed issue with the main thread stalling when an `NSException` was raised in the response block
+* Fixed an issue with `OHHTTPStubs/XCTestExpectation` conditional compilation in Xcode 6.0 & OSX SDK.
+ _(the condition was previously testing available SDKs instead of Xcode version, which led to errors with Xcode 6.0 not having the latest 10.10 SDK yet, but still having the `XCTestExpectation` already anyway)_
+
+## [3.1.5](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.5)
+
+* Migrated Unit Tests to XCTest.
+* Added `XCTestExpectation` subspec containing my own implementation for Xcode 5 support
+
+## [3.1.4](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.4)
+
+* Fix issue that made stubs never being called on iOS8 (#65).
+
+> _As of Xcode6 Beta4, **`OHHTTPStubs` compatibility with iOS8** has been validated now._
+
+
+## [3.1.3](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.3)
+
+* Fix #66: Use the ivar directly in initialization (to avoid KVO side effects)
+
+## [3.1.2](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.2)
+
+* Fix broken link in README (#61)
+* Don't override Content-Length header when already set (#62)
+
+## [3.1.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.1)
+
+* Fixing a crash when using very very long data #57/#59
+* Fixing issue #51 regarding a probable race condition when stubs were removed before the request has finished
+* Shorten the README.md file and moved all the usage examples in a dedicated wiki page to avoid a endless and frightening README
+
+## [3.1.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.1.0)
+
+* The `OHHTTPStubsDescriptor` protocol now inherits from the `NSObject` protocol
+
+## [3.0.4](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.4)
+
+Fixing issue #47 when stubs were not called, especially when the `OHHTTPStubs` pod were loaded both by the application AND the test target/bundle. See also [[A tricky case with Application Tests]].
+
+* `NSURLSessionConfiguration` 's swizzling (to add automatic support of `OHHTTPStubs` to `NSURLSession`) is now done in the `+load` method of an `NSURLSessionConfiguration` category, to be sure it is loaded (and swizzled) only once, even if `OHHTTPStubs` is loaded by two different bundles.
+* The stubs activation of `NSURLSessionConfiguration` no longer uses `objc_getClass` but uses a call to the `OHHTTPStubs` class instead, which ensure that it uses the correct `OHHTTPStubs` class in the current bundle instead of always using the one loaded from the main bundle.
+
+## [3.0.3](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.3)
+
+* Adding Mac framework & Mac Test Target (#44)
+* Adding known limitations in README
+
+## [3.0.2](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.2)
+
+* Fixed issue with cookies when `request.URL` is `nil` ([#39](https://github.com/AliSoftware/OHHTTPStubs/pull/39))
+* Fixed missing `-ObjC` flag in Unit Tests target _(that made it unable to call category methods)_
+* Fixed Unit Tests on iOS6 _(`NSURLSession`-related Unit Tests now only executed when run on iOS7+ or OSX10.9+, and skipped if targeted for an earlier OS version, as `NSURLSession` was not available then)_
+
+## [3.0.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.1)
+
+* Fixed issue with `NSURLSessionConfiguration` auto-swizzling (#37 & #38)
+
+> _Now `OHHTTPStubs` automagically works with `NSURLSessionConfiguration` **without the need** to enable it for every `NSURLSessionConfiguration` before creating the `NSURLSession`: the `defaultSessionConfiguration` and `ephemeralSessionConfiguration` are now preconfigured automatically to work with `OHHTTPStubs`)_
+
+## [3.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/3.0.0)
+
+* Removed deprecated methods.
+
+> The Old API has now totally disappeared, leaving only a clean and simple API without the spam due to old deprecated methods.
+
+Note: **If you have already removed the calls to all `OHHTTPStubs` deprecated API in your code, you can switch to this `3.0.0` version without any further changes in your code**.
+
+## [2.4.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.4.0)
+
+* Added support for `NSURLSession` (thx to @ndonald2) [#31](https://github.com/AliSoftware/OHHTTPStubs/issues/31) [#34](https://github.com/AliSoftware/OHHTTPStubs/issues/34)
+
+## [2.3.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.3.1)
+
+* Fixed bug with OHHTTPStubsResponse+JSON when `nil` headers dictionary
+
+## [2.3.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.3.0)
+
+* Added the ability to give a name to a stub, for debugging purposes (property `name` of `id<OHHTTPStubsDescriptor>`)
+* Added `allStubs` method to list all installed stubs (with their name if they have one, see previous point)
+* Added `+[OHHTTPStubs onStubActivation:]` method to execute arbitrary code each time a stub is activated. Useful to log which stub is used for each request for example.
+
+## [2.2.1](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.2.1)
+
+* Complete refactoring to use `NSInputStream` instead of direct use of `NSData` (Thanks to @kcharwood - #28)
+* Some other code refactoring to split the code in categories and make it clearer
+* Some API changes to make `OHHTTPStubs` to fit the new possibility of setting both `requestTime` and `responseTime`.
+ * Old API is still there but deprecated, and will be removed in next major version
+ * To convert to the new API, you will mainly simply:
+ * extract the `responseTime:` parameter to a method call of its own (`return [OHHTTPStubsResponse responseWithData:data statusCode:code responseTime:time headers:header];` will become `return [[OHHTTPStubsResponse responseWithData:data statusCode:code headers:headers] responseTime:time];` etc.)
+ * convert `responseWithFile:filename` to `responseWithFileAtPath:OHPathForFileInBundle(filename,nil)`
+
+> Note: version `2.1.0-RC`, `2.1.0-rc.1`, `2.2.0-RC` and `2.2.1-RC` were intermediate Release Candidate versions during the big refactoring and migration to `2.2.1`, with the same new features as listed above basicaly, but without the last-minute bugfixes before official release.
+
+## [2.0.0](https://github.com/AliSoftware/OHHTTPStubs/releases/tag/2.0.0)
+
+* Simplified API
+ * removed instance methods, no more public `sharedInstance`: directly call class methods on the `OHHTTPStubs` class
+ * The old and problematic `addRequestHandler:` method has been deprecated and should not be used anymore. Use `stubRequestsPassingTest:withStubResponse:` instead, which is more efficient
+* Added API documentation in the headers
+* Remove all internal uses of Apple's private APIs
+
+> _Be careful: if you forgot to remove your use of `OHHTTPStubs` and your stubs from the binary you sent to the AppStore, your app would have been rejected by Apple before 2.0.0, as it was using private API (which was a way to make sure not to forget to remove them), but now it would be accepted silently. So don't forget to remove your stubs and `OHHTTPStubs` from your final binary!_
+
+## [1.2.2](https://github.com/AliSoftware/OHHTTPStubs/tree/1.2.2)
+
+* Fixed Deadlock introduced by 1.2.1
+
+## [1.2.1](https://github.com/AliSoftware/OHHTTPStubs/tree/1.2.1)
+
+* Improved thread-safety (#21)
+* Stop sending messages to `NSURLProtoclClient` after `stopLoading`
+
+> _This version is buggy as it introduced a deadlock when performing a request on the main thread. 1.2.2 fixes that issue._
+
+## [1.2.0](https://github.com/AliSoftware/OHHTTPStubs/tree/1.2.0)
+
+* Added support for "HTTP Message Data" stubs generated with `curl -is <someurl>` to replay them easily (#27). See the `README.md` for more info
+* Added redirect support for 3xx response codes (#23)
+* Dropped non-ARC support. Now `OHHTTPStubs` is to be compiled using ARC. _(This should not change anything as it is intended to be integrated using CocoaPods or compiled in a separate xcodeproj anyway)_
+
+## [1.1.2](https://github.com/AliSoftware/OHHTTPStubs/tree/1.1.2)
+
+Easier integration process:
+
+* Use `#import <OHHTTPStubs/OHHTTPStubs.h>` again
+* But adding the path to the library headers in your application project's `HEADER_SEARCH_PATH` is no longer needed!
+
+## [1.1.1](https://github.com/AliSoftware/OHHTTPStubs/tree/1.1.1)
+
+* Fixed crash when calling "setEnabled:" / "registerClass:" multiple times
+* New integration process: we don't use the `PortableLibrary.xcconfig` anymore (as it generated problems for people using configuration with names other than "Debug" and "Release"). _(1)_
+
+_You will now have to indicate the folder containing headers for `OHHTTPStubs` in your `HEADER_SEARCH_PATH` Build Settings, and we are back to `#import "OHHTTPStubs.h"` until a better solution is found_
+
+> _(1) This modification for the integration process did only last for version 1.1.1. Version 1.1.2 restored `#import <OHHTTPStubs/OHHTTPStubs.h>` (but using a much better solution than the previous xcconfig used) and filling `HEADER_SEARCH_PATH` is no longer needed in further versions. See changelog for 1.1.2 above._
+
+## [1.1.0](https://github.com/AliSoftware/OHHTTPStubs/tree/1.1.0)
+
+* Added new API `shouldStubRequest:withRequestHandler:` to avoid useless building of stubbed response like `addRequestHandler:` does
+
+## [1.0.6](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.6)
+
+* Adding support for cookies (Set-Cookie headers)
+
+## [1.0.5](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.5)
+
+* Added Unit Tests
+* Removed calls to the deprecated `dispatch_get_current_queue()` GCD function (was used with `dispatch_after` to add fake delay to stubbed responses)
+
+## [1.0.4](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.4)
+
+* Fixed #6 : "responseWithError:" released response object too soon
+
+## [1.0.3](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.3)
+
+* Fixed small compilation issues #4 (issue in sample code) & #5 (ARC invalid cast)
+
+## [1.0.2](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.2)
+
+* Embedded `OHHTTPStubs` in a neat static library for nicer integration in your Xcode4 workspaces.
+
+## [1.0.1](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.1)
+
+* Fix issue when used in a SenTestCase
+
+## [1.0.0](https://github.com/AliSoftware/OHHTTPStubs/tree/1.0.0)
+
+* Cleaning API, added `removeLastHandler` and `removeRequestHandler:` method.
+* Now first stable API in this version.
+* Example project now compatible with ARC and non-ARC environments
+
+## [0.2.0](https://github.com/AliSoftware/OHHTTPStubs/tree/0.2.0)
+
+* Added Example project
+* Added ARC support
+* Some fixes
+
+## [0.1.0](https://github.com/AliSoftware/OHHTTPStubs/tree/0.1.0)
+
+* Initial version
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.h b/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.h
new file mode 100644
index 0000000000..bf1a8f5fce
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.h
@@ -0,0 +1,13 @@
+//
+// MainViewController.h
+// OHHTTPStubsDemo
+//
+// Created by Olivier Halligon on 11/08/12.
+// Copyright (c) 2012 AliSoftware. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface MainViewController : UIViewController
+
+@end
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.m b/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.m
new file mode 100644
index 0000000000..327a4d2d20
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.m
@@ -0,0 +1,169 @@
+//
+// MainViewController.m
+// OHHTTPStubsDemo
+//
+// Created by Olivier Halligon on 11/08/12.
+// Copyright (c) 2012 AliSoftware. All rights reserved.
+//
+
+#import "MainViewController.h"
+#import <OHHTTPStubs/OHHTTPStubs.h>
+
+
+@interface MainViewController ()
+// IBOutlets
+@property (retain, nonatomic) IBOutlet UISwitch *delaySwitch;
+@property (retain, nonatomic) IBOutlet UITextView *textView;
+@property (retain, nonatomic) IBOutlet UISwitch *installTextStubSwitch;
+@property (retain, nonatomic) IBOutlet UIImageView *imageView;
+@property (retain, nonatomic) IBOutlet UISwitch *installImageStubSwitch;
+@end
+
+@implementation MainViewController
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Init & Dealloc
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ [self installTextStub:self.installTextStubSwitch];
+ [self installImageStub:self.installImageStubSwitch];
+ [OHHTTPStubs onStubActivation:^(NSURLRequest *request, id<OHHTTPStubsDescriptor> stub) {
+ NSLog(@"[OHHTTPStubs] Request to %@ has been stubbed with %@", request.URL, stub.name);
+ }];
+}
+- (void)viewDidUnload
+{
+ [self setTextView:nil];
+ [self setImageView:nil];
+ [self setDelaySwitch:nil];
+ [super viewDidUnload];
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Global stubs activation
+
+- (IBAction)toggleStubs:(UISwitch *)sender
+{
+ [OHHTTPStubs setEnabled:sender.on];
+ self.delaySwitch.enabled = sender.on;
+ self.installTextStubSwitch.enabled = sender.on;
+ self.installImageStubSwitch.enabled = sender.on;
+
+ NSLog(@"Installed (%@) stubs: %@", (sender.on?@"and enabled":@"but disabled"), OHHTTPStubs.allStubs);
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Text Download and Stub
+
+
+- (IBAction)downloadText:(UIButton*)sender
+{
+ sender.enabled = NO;
+ self.textView.text = nil;
+
+ NSString* urlString = @"http://www.opensource.apple.com/source/Git/Git-26/src/git-htmldocs/git-commit.txt?txt";
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
+
+ // This is a very handy way to send an asynchronous method, but only available in iOS5+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ sender.enabled = YES;
+ NSString* receivedText = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
+ self.textView.text = receivedText;
+ }];
+}
+
+
+
+
+- (IBAction)installTextStub:(UISwitch *)sender
+{
+ static id<OHHTTPStubsDescriptor> textStub = nil; // Note: no need to retain this value, it is retained by the OHHTTPStubs itself already
+ if (sender.on)
+ {
+ // Install
+ textStub = [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ // This stub will only configure stub requests for "*.txt" files
+ return [request.URL.pathExtension isEqualToString:@"txt"];
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ // Stub txt files with this
+ return [[OHHTTPStubsResponse responseWithFileAtPath:OHPathForFile(@"stub.txt", self.class)
+ statusCode:200
+ headers:@{@"Content-Type":@"text/plain"}]
+ requestTime:self.delaySwitch.on ? 2.f: 0.f
+ responseTime:OHHTTPStubsDownloadSpeedWifi];
+ }];
+ textStub.name = @"Text stub";
+ }
+ else
+ {
+ // Uninstall
+ [OHHTTPStubs removeStub:textStub];
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Image Download and Stub
+
+- (IBAction)downloadImage:(UIButton*)sender
+{
+ sender.enabled = NO;
+
+ NSString* urlString = @"http://images.apple.com/support/assets/images/products/iphone/hero_iphone4-5_wide.png";
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
+
+ // This is a very handy way to send an asynchronous method, but only available in iOS5+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ sender.enabled = YES;
+ self.imageView.image = [UIImage imageWithData:data];
+ }];
+}
+
+- (IBAction)installImageStub:(UISwitch *)sender
+{
+ static id<OHHTTPStubsDescriptor> imageStub = nil; // Note: no need to retain this value, it is retained by the OHHTTPStubs itself already :)
+ if (sender.on)
+ {
+ // Install
+ imageStub = [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ // This stub will only configure stub requests for "*.png" files
+ return [request.URL.pathExtension isEqualToString:@"png"];
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ // Stub jpg files with this
+ return [[OHHTTPStubsResponse responseWithFileAtPath:OHPathForFile(@"stub.jpg", self.class)
+ statusCode:200
+ headers:@{@"Content-Type":@"image/jpeg"}]
+ requestTime:self.delaySwitch.on ? 2.f: 0.f
+ responseTime:OHHTTPStubsDownloadSpeedWifi];
+ }];
+ imageStub.name = @"Image stub";
+ }
+ else
+ {
+ // Uninstall
+ [OHHTTPStubs removeStub:imageStub];
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Cleaning
+
+- (IBAction)clearResults
+{
+ self.textView.text = @"";
+ self.imageView.image = nil;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.xib b/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.xib
new file mode 100644
index 0000000000..bab95b860c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/MainViewController.xib
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12E55" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
+ <dependencies>
+ <deployment defaultVersion="1072" identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
+ </dependencies>
+ <objects>
+ <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIApplication"/>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+ <window opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" visibleAtLaunch="YES" id="20">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
+ <connections>
+ <outlet property="rootViewController" destination="21" id="22"/>
+ </connections>
+ </window>
+ <viewController id="21" customClass="MainViewController">
+ <view key="view" contentMode="scaleToFill" id="1">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="560"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Activate Stubs Globally" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="7">
+ <rect key="frame" x="20" y="40" width="177" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="5">
+ <rect key="frame" x="246" y="37" width="51" height="31"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <connections>
+ <action selector="toggleStubs:" destination="21" eventType="valueChanged" id="23"/>
+ </connections>
+ </switch>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Fake 2s Delay" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="15">
+ <rect key="frame" x="20" y="75" width="109" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="17">
+ <rect key="frame" x="144" y="72" width="51" height="31"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ </switch>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="29">
+ <rect key="frame" x="231" y="69" width="69" height="35"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <state key="normal" title="Clear">
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="clearResults" destination="21" eventType="touchUpInside" id="31"/>
+ </connections>
+ </button>
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" id="6">
+ <rect key="frame" x="20" y="170" width="280" height="188"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="12"/>
+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+ </textView>
+ <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" id="9">
+ <rect key="frame" x="20" y="425" width="280" height="115"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+ <color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
+ </imageView>
+ <view contentMode="scaleToFill" id="56B-Sg-JRy">
+ <rect key="frame" x="20" y="366" width="280" height="55"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+ <subviews>
+ <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="Llz-IP-qMB">
+ <rect key="frame" x="224" y="20" width="51" height="31"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <connections>
+ <action selector="installImageStub:" destination="21" eventType="valueChanged" id="l07-IE-Bbh"/>
+ </connections>
+ </switch>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" id="44">
+ <rect key="frame" x="201" y="0.0" width="79" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="9"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="8">
+ <rect key="frame" x="0.0" y="9" width="176" height="37"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <state key="normal" title="Download image">
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="disabled" title="Downloading…">
+ <color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="downloadImage:" destination="21" eventType="touchUpInside" id="33"/>
+ </connections>
+ </button>
+ </subviews>
+ <color key="backgroundColor" white="0.94548357664233584" alpha="1" colorSpace="calibratedWhite"/>
+ </view>
+ <view contentMode="scaleToFill" id="P7g-mD-orR">
+ <rect key="frame" x="20" y="111" width="280" height="55"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="4">
+ <rect key="frame" x="0.0" y="9" width="176" height="37"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <state key="normal" title="Download some text">
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="disabled" title="Downloading…">
+ <color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="downloadText:" destination="21" eventType="touchUpInside" id="32"/>
+ </connections>
+ </button>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" id="43">
+ <rect key="frame" x="201" y="0.0" width="79" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="9"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="41">
+ <rect key="frame" x="224" y="20" width="51" height="31"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+ <connections>
+ <action selector="installTextStub:" destination="21" eventType="valueChanged" id="45"/>
+ </connections>
+ </switch>
+ </subviews>
+ <color key="backgroundColor" white="0.94548357664233584" alpha="1" colorSpace="calibratedWhite"/>
+ </view>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
+ </view>
+ <extendedEdge key="edgesForExtendedLayout"/>
+ <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
+ <nil key="simulatedTopBarMetrics"/>
+ <nil key="simulatedBottomBarMetrics"/>
+ <simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
+ <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+ <connections>
+ <outlet property="delaySwitch" destination="17" id="26"/>
+ <outlet property="imageView" destination="9" id="25"/>
+ <outlet property="installImageStubSwitch" destination="Llz-IP-qMB" id="BDS-xd-SzF"/>
+ <outlet property="installTextStubSwitch" destination="41" id="47"/>
+ <outlet property="textView" destination="6" id="24"/>
+ </connections>
+ </viewController>
+ </objects>
+</document> \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..a342a5ec98
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj
@@ -0,0 +1,382 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 0984831517805426002A99FF /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0984831417805426002A99FF /* CFNetwork.framework */; };
+ 098FBDD415D704E800623941 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 098FBDD315D704E800623941 /* UIKit.framework */; };
+ 098FBDD615D704E800623941 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 098FBDD515D704E800623941 /* Foundation.framework */; };
+ 098FBDD815D704E800623941 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 098FBDD715D704E800623941 /* CoreGraphics.framework */; };
+ 098FBDE015D704E800623941 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 098FBDDF15D704E800623941 /* main.m */; };
+ 098FBDED15D7056200623941 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 098FBDEB15D7056200623941 /* MainViewController.m */; };
+ 098FBDEE15D7056200623941 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDEC15D7056200623941 /* MainViewController.xib */; };
+ 098FBDF815D70E2600623941 /* stub.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDF615D70E2600623941 /* stub.jpg */; };
+ 098FBDF915D70E2600623941 /* stub.txt in Resources */ = {isa = PBXBuildFile; fileRef = 098FBDF715D70E2600623941 /* stub.txt */; };
+ 099C7343169016D800239880 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 099C7342169016D800239880 /* Default-568h@2x.png */; };
+ 76C30541E2A1B24B6848F032 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B8BA1C0EA8F8EC24B9024E1 /* libPods.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 0984831417805426002A99FF /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ 098FBDCF15D704E800623941 /* OHHTTPStubsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OHHTTPStubsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 098FBDD315D704E800623941 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 098FBDD515D704E800623941 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 098FBDD715D704E800623941 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 098FBDDB15D704E800623941 /* OHHTTPStubsDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OHHTTPStubsDemo-Info.plist"; sourceTree = "<group>"; };
+ 098FBDDF15D704E800623941 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 098FBDE115D704E800623941 /* OHHTTPStubsDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsDemo-Prefix.pch"; sourceTree = "<group>"; };
+ 098FBDEA15D7056200623941 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
+ 098FBDEB15D7056200623941 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
+ 098FBDEC15D7056200623941 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; };
+ 098FBDF615D70E2600623941 /* stub.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stub.jpg; sourceTree = "<group>"; };
+ 098FBDF715D70E2600623941 /* stub.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stub.txt; sourceTree = "<group>"; };
+ 099C7342169016D800239880 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
+ 0EE81E095FF3A8AF6D3C4E77 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
+ 1B8BA1C0EA8F8EC24B9024E1 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 48556A011AA6E9FD0074B154 /* libPods-OHHTTPStubs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-OHHTTPStubs.a"; path = "Pods/../build/Debug-iphoneos/libPods-OHHTTPStubs.a"; sourceTree = "<group>"; };
+ B5AD292FAB98FC9C7637896A /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 098FBDCC15D704E800623941 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0984831517805426002A99FF /* CFNetwork.framework in Frameworks */,
+ 098FBDD415D704E800623941 /* UIKit.framework in Frameworks */,
+ 098FBDD615D704E800623941 /* Foundation.framework in Frameworks */,
+ 098FBDD815D704E800623941 /* CoreGraphics.framework in Frameworks */,
+ 76C30541E2A1B24B6848F032 /* libPods.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 098FBDC415D704E800623941 = {
+ isa = PBXGroup;
+ children = (
+ 098FBDD915D704E800623941 /* OHHTTPStubsDemo */,
+ 098FBDD215D704E800623941 /* Frameworks */,
+ 098FBDD015D704E800623941 /* Products */,
+ DBC538A23E8B9FD8D58D30B1 /* Pods */,
+ );
+ sourceTree = "<group>";
+ };
+ 098FBDD015D704E800623941 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 098FBDCF15D704E800623941 /* OHHTTPStubsDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 098FBDD215D704E800623941 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 48556A011AA6E9FD0074B154 /* libPods-OHHTTPStubs.a */,
+ 0984831417805426002A99FF /* CFNetwork.framework */,
+ 098FBDD315D704E800623941 /* UIKit.framework */,
+ 098FBDD515D704E800623941 /* Foundation.framework */,
+ 098FBDD715D704E800623941 /* CoreGraphics.framework */,
+ 1B8BA1C0EA8F8EC24B9024E1 /* libPods.a */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 098FBDD915D704E800623941 /* OHHTTPStubsDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 098FBDEA15D7056200623941 /* MainViewController.h */,
+ 098FBDEB15D7056200623941 /* MainViewController.m */,
+ 098FBDEC15D7056200623941 /* MainViewController.xib */,
+ 098FBDFA15D70E2F00623941 /* Stubs */,
+ 098FBDDA15D704E800623941 /* Supporting Files */,
+ );
+ name = OHHTTPStubsDemo;
+ sourceTree = "<group>";
+ };
+ 098FBDDA15D704E800623941 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 099C7342169016D800239880 /* Default-568h@2x.png */,
+ 098FBDDB15D704E800623941 /* OHHTTPStubsDemo-Info.plist */,
+ 098FBDDF15D704E800623941 /* main.m */,
+ 098FBDE115D704E800623941 /* OHHTTPStubsDemo-Prefix.pch */,
+ );
+ path = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 098FBDFA15D70E2F00623941 /* Stubs */ = {
+ isa = PBXGroup;
+ children = (
+ 098FBDF615D70E2600623941 /* stub.jpg */,
+ 098FBDF715D70E2600623941 /* stub.txt */,
+ );
+ path = Stubs;
+ sourceTree = "<group>";
+ };
+ DBC538A23E8B9FD8D58D30B1 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ B5AD292FAB98FC9C7637896A /* Pods.debug.xcconfig */,
+ 0EE81E095FF3A8AF6D3C4E77 /* Pods.release.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 098FBDCE15D704E800623941 /* OHHTTPStubsDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 098FBDE715D704E800623941 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */;
+ buildPhases = (
+ 5BF07CD1F1DEB3893534CA6D /* Check Pods Manifest.lock */,
+ 098FBDCB15D704E800623941 /* Sources */,
+ 098FBDCC15D704E800623941 /* Frameworks */,
+ 098FBDCD15D704E800623941 /* Resources */,
+ D61C918AA467A72C9C508B4E /* Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = OHHTTPStubsDemo;
+ productName = OHHTTPStubsDemo;
+ productReference = 098FBDCF15D704E800623941 /* OHHTTPStubsDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 098FBDC615D704E800623941 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0630;
+ ORGANIZATIONNAME = AliSoftware;
+ };
+ buildConfigurationList = 098FBDC915D704E800623941 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 098FBDC415D704E800623941;
+ productRefGroup = 098FBDD015D704E800623941 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 098FBDCE15D704E800623941 /* OHHTTPStubsDemo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 098FBDCD15D704E800623941 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 098FBDEE15D7056200623941 /* MainViewController.xib in Resources */,
+ 098FBDF815D70E2600623941 /* stub.jpg in Resources */,
+ 098FBDF915D70E2600623941 /* stub.txt in Resources */,
+ 099C7343169016D800239880 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 5BF07CD1F1DEB3893534CA6D /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ D61C918AA467A72C9C508B4E /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 098FBDCB15D704E800623941 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 098FBDE015D704E800623941 /* main.m in Sources */,
+ 098FBDED15D7056200623941 /* MainViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 098FBDE515D704E800623941 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_SHADOW = YES;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 098FBDE615D704E800623941 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_SHADOW = YES;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ OTHER_LDFLAGS = "-ObjC";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 098FBDE815D704E800623941 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = B5AD292FAB98FC9C7637896A /* Pods.debug.xcconfig */;
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "Supporting Files/OHHTTPStubsDemo-Prefix.pch";
+ INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/OHHTTPStubsDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 098FBDE915D704E800623941 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 0EE81E095FF3A8AF6D3C4E77 /* Pods.release.xcconfig */;
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "Supporting Files/OHHTTPStubsDemo-Prefix.pch";
+ INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/OHHTTPStubsDemo-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 098FBDC915D704E800623941 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 098FBDE515D704E800623941 /* Debug */,
+ 098FBDE615D704E800623941 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 098FBDE715D704E800623941 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 098FBDE815D704E800623941 /* Debug */,
+ 098FBDE915D704E800623941 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 098FBDC615D704E800623941 /* Project object */;
+}
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000000..68ace104de
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:OHHTTPStubsDemo.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Demo.xcscheme b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Demo.xcscheme
new file mode 100644
index 0000000000..41f5f1bbc6
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Demo.xcscheme
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0630"
+ version = "2.0">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "NO"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "098FBDCE15D704E800623941"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "NO"
+ buildForProfiling = "NO"
+ buildForArchiving = "NO"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "09110A5019805F4800D175E4"
+ BuildableName = "OHHTTPStubs iOS Tests.xctest"
+ BlueprintName = "OHHTTPStubs iOS Tests"
+ ReferencedContainer = "container:../OHHTTPStubs/OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "09110A5019805F4800D175E4"
+ BuildableName = "OHHTTPStubs iOS Tests.xctest"
+ BlueprintName = "OHHTTPStubs iOS Tests"
+ ReferencedContainer = "container:../OHHTTPStubs/OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "098FBDCE15D704E800623941"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugXPCServices = "NO"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "098FBDCE15D704E800623941"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "098FBDCE15D704E800623941"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000000..cfc0e73f1c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "group:OHHTTPStubsDemo.xcodeproj">
+ </FileRef>
+ <FileRef
+ location = "group:Pods/Pods.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Podfile b/test/ios/OHHTTPStubs/Examples/ObjC/Podfile
new file mode 100644
index 0000000000..30504595e8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Podfile
@@ -0,0 +1,6 @@
+source 'https://github.com/CocoaPods/Specs.git'
+
+xcodeproj 'OHHTTPStubsDemo.xcodeproj'
+platform :ios, '6.0'
+
+pod 'OHHTTPStubs', :path => '../..'
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Podfile.lock b/test/ios/OHHTTPStubs/Examples/ObjC/Podfile.lock
new file mode 100644
index 0000000000..8192540ce7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Podfile.lock
@@ -0,0 +1,14 @@
+PODS:
+ - OHHTTPStubs (4.0.1)
+
+DEPENDENCIES:
+ - OHHTTPStubs (from `../..`)
+
+EXTERNAL SOURCES:
+ OHHTTPStubs:
+ :path: "../.."
+
+SPEC CHECKSUMS:
+ OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
+
+COCOAPODS: 0.37.0
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h
new file mode 120000
index 0000000000..e466a30930
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
new file mode 120000
index 0000000000..55a0a6a468
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
new file mode 120000
index 0000000000..247257b1d8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h
new file mode 120000
index 0000000000..773f3f322e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h
new file mode 120000
index 0000000000..6a6273c69c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h
new file mode 120000
index 0000000000..e466a30930
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
new file mode 120000
index 0000000000..55a0a6a468
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
new file mode 120000
index 0000000000..247257b1d8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h
new file mode 120000
index 0000000000..773f3f322e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h
new file mode 120000
index 0000000000..6a6273c69c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json
new file mode 100644
index 0000000000..3be5f2250f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json
@@ -0,0 +1,26 @@
+{
+ "name": "OHHTTPStubs",
+ "version": "4.0.1",
+ "summary": "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest.",
+ "description": "A class to stub network requests easily:\n\n * Test your apps with fake network data (stubbed from file)\n * You can also customize your response headers and status code\n * Use customized stubs depending on the requests\n * Use custom response time to simulate slow network.\n * This works with any request (HTTP, HTTPS, or any protocol) sent using\n the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …)\n * This is really useful in unit testing, when you need to test network features\n but don't want to hit the real network and fake some response data instead.\n * Has useful convenience methods to stub JSON content or fixture from a file\n * Compatible with Swift\n",
+ "homepage": "https://github.com/AliSoftware/OHHTTPStubs",
+ "license": "MIT",
+ "authors": {
+ "Olivier Halligon": "olivier.halligon+ae@gmail.com"
+ },
+ "source": {
+ "git": "https://github.com/AliSoftware/OHHTTPStubs.git",
+ "tag": "4.0.1"
+ },
+ "source_files": "OHHTTPStubs/Sources/*.{h,m}",
+ "public_header_files": "OHHTTPStubs/Sources/*.h",
+ "frameworks": [
+ "Foundation",
+ "CFNetwork"
+ ],
+ "requires_arc": true,
+ "platforms": {
+ "ios": "5.0",
+ "osx": "10.7"
+ }
+}
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Manifest.lock b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Manifest.lock
new file mode 100644
index 0000000000..8192540ce7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Manifest.lock
@@ -0,0 +1,14 @@
+PODS:
+ - OHHTTPStubs (4.0.1)
+
+DEPENDENCIES:
+ - OHHTTPStubs (from `../..`)
+
+EXTERNAL SOURCES:
+ OHHTTPStubs:
+ :path: "../.."
+
+SPEC CHECKSUMS:
+ OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
+
+COCOAPODS: 0.37.0
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Pods.xcodeproj/project.pbxproj b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Pods.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..9ac1e19738
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Pods.xcodeproj/project.pbxproj
@@ -0,0 +1,488 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 0287B0995D3956A77FE8245B /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F22C8E5911B3A17469606575 /* Pods-dummy.m */; };
+ 05AF8AC740672A49F1DB86F8 /* OHPathHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB4DCEA3E6E205F6150BB9B /* OHPathHelpers.h */; };
+ 37E8EFCB93409F59A3519709 /* OHHTTPStubsResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 64DE90B81CB54898D8031417 /* OHHTTPStubsResponse.h */; };
+ 3C4E450E5248FA162C4836BB /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DA39110509B5D077268FC8 /* OHHTTPStubsResponse+JSON.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ 4C169F633246281BE747CBC7 /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = BB8B9FD03923F20EA8A5A11A /* OHHTTPStubsResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ 5FAAE71C0DC019D177F03852 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B2C23953AEE92A8924B57BD /* Foundation.framework */; };
+ 91AC7870E73F1D4AFD355954 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = CD10D9BE097DF051073D1136 /* OHHTTPStubsResponse+HTTPMessage.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ 91F20FAEB508489E6E82A37E /* Pods-OHHTTPStubs-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C9D0A204842A77405B1B4826 /* Pods-OHHTTPStubs-dummy.m */; };
+ B1DBEB199B89B0F2534AB372 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3F78A40A045AD979FC32D66 /* CFNetwork.framework */; };
+ B3F948D4C6FEA3E3414304E3 /* OHHTTPStubsResponse+JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1C78DC9C9ED126B2DD803F /* OHHTTPStubsResponse+JSON.h */; };
+ B5A13025620A2BC7F9523B3E /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 91CB751631C441AC78BFFF91 /* OHPathHelpers.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ B88B2F8C9696F7AFF1219FA6 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 90C538A641602D6CA84175EA /* OHHTTPStubs+NSURLSessionConfiguration.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ C73743AF5192A2BCAD0BA639 /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 757741D337827989EA9CFB35 /* OHHTTPStubs.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ D6D12CC401BBCC3846765533 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B2C23953AEE92A8924B57BD /* Foundation.framework */; };
+ DDE78ABCE16D42E4E3347D57 /* OHHTTPStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = F59CD3981590122479A99319 /* OHHTTPStubs.h */; };
+ E93E7222A109F4DE8DEE1C8A /* OHHTTPStubsResponse+HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BD78083C121EBF426395FC /* OHHTTPStubsResponse+HTTPMessage.h */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 70209F8E12151BE9099A0906 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 4E43A3978191CB163B56150F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 9BFA25996D607CC8407D9667;
+ remoteInfo = "Pods-OHHTTPStubs";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 1F1C78DC9C9ED126B2DD803F /* OHHTTPStubsResponse+JSON.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+JSON.h"; sourceTree = "<group>"; };
+ 26BD78083C121EBF426395FC /* OHHTTPStubsResponse+HTTPMessage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+HTTPMessage.h"; sourceTree = "<group>"; };
+ 43DA39110509B5D077268FC8 /* OHHTTPStubsResponse+JSON.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+JSON.m"; sourceTree = "<group>"; };
+ 51D2E996FA1B199219C88105 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 540BE0121862CF47DF5EAC7E /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = "<group>"; };
+ 5CAE31F1B62C6CE71BC12572 /* Pods-OHHTTPStubs-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs-prefix.pch"; sourceTree = "<group>"; };
+ 64DE90B81CB54898D8031417 /* OHHTTPStubsResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubsResponse.h; sourceTree = "<group>"; };
+ 757741D337827989EA9CFB35 /* OHHTTPStubs.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubs.m; sourceTree = "<group>"; };
+ 7A817F08BCB2651ACDF06BAF /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = "<group>"; };
+ 7B2C23953AEE92A8924B57BD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
+ 7F0BAB562664206098AE3E43 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = "<group>"; };
+ 85434260BFFB3C7A7BC04F99 /* Pods-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-environment.h"; sourceTree = "<group>"; };
+ 8AB4DCEA3E6E205F6150BB9B /* OHPathHelpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHPathHelpers.h; sourceTree = "<group>"; };
+ 90C538A641602D6CA84175EA /* OHHTTPStubs+NSURLSessionConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubs+NSURLSessionConfiguration.m"; sourceTree = "<group>"; };
+ 91CB751631C441AC78BFFF91 /* OHPathHelpers.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHPathHelpers.m; sourceTree = "<group>"; };
+ 925D0F1AA2487470D449CE49 /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = "<group>"; };
+ 95AC8CA1C533FBB6BD437ACB /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
+ A1BA020EDD8BB7AE11152ACC /* Pods-OHHTTPStubs.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs.xcconfig"; sourceTree = "<group>"; };
+ A976A0F9BBC8019FB5DD5B7F /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = "<group>"; };
+ BB8B9FD03923F20EA8A5A11A /* OHHTTPStubsResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubsResponse.m; sourceTree = "<group>"; };
+ C9D0A204842A77405B1B4826 /* Pods-OHHTTPStubs-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-OHHTTPStubs-dummy.m"; sourceTree = "<group>"; };
+ CD10D9BE097DF051073D1136 /* OHHTTPStubsResponse+HTTPMessage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+HTTPMessage.m"; sourceTree = "<group>"; };
+ DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs-Private.xcconfig"; sourceTree = "<group>"; };
+ DD8EC89EDDE25D7B79665F29 /* libPods-OHHTTPStubs.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ E3F78A40A045AD979FC32D66 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
+ F22C8E5911B3A17469606575 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = "<group>"; };
+ F59CD3981590122479A99319 /* OHHTTPStubs.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubs.h; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 370CE9976B2CE6DC38C7AD35 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B1DBEB199B89B0F2534AB372 /* CFNetwork.framework in Frameworks */,
+ D6D12CC401BBCC3846765533 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8F733C40CCF846B63AED7A63 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5FAAE71C0DC019D177F03852 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 262D783B60DE608266D6A656 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 51D2E996FA1B199219C88105 /* libPods.a */,
+ DD8EC89EDDE25D7B79665F29 /* libPods-OHHTTPStubs.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 2D13680F87CE7E9F973E18D6 /* Targets Support Files */ = {
+ isa = PBXGroup;
+ children = (
+ D8918EE34F24A086FB93B162 /* Pods */,
+ );
+ name = "Targets Support Files";
+ sourceTree = "<group>";
+ };
+ 3EB198ABE93CBAE1C25569ED /* OHHTTPStubs */ = {
+ isa = PBXGroup;
+ children = (
+ C4B29A11FCEF09243EA85BD4 /* OHHTTPStubs */,
+ D882BE8B7A1CD1ACAD41FC23 /* Support Files */,
+ );
+ name = OHHTTPStubs;
+ path = ../../..;
+ sourceTree = "<group>";
+ };
+ 4CCC5CCCC482E8248CF90F91 = {
+ isa = PBXGroup;
+ children = (
+ 95AC8CA1C533FBB6BD437ACB /* Podfile */,
+ A6534AD5BD03EA29AB460479 /* Development Pods */,
+ 90091CD0A828ED346DE8663C /* Frameworks */,
+ 262D783B60DE608266D6A656 /* Products */,
+ 2D13680F87CE7E9F973E18D6 /* Targets Support Files */,
+ );
+ sourceTree = "<group>";
+ };
+ 6B5292DC8591159D72E93366 /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ F59CD3981590122479A99319 /* OHHTTPStubs.h */,
+ 757741D337827989EA9CFB35 /* OHHTTPStubs.m */,
+ 90C538A641602D6CA84175EA /* OHHTTPStubs+NSURLSessionConfiguration.m */,
+ 64DE90B81CB54898D8031417 /* OHHTTPStubsResponse.h */,
+ BB8B9FD03923F20EA8A5A11A /* OHHTTPStubsResponse.m */,
+ 26BD78083C121EBF426395FC /* OHHTTPStubsResponse+HTTPMessage.h */,
+ CD10D9BE097DF051073D1136 /* OHHTTPStubsResponse+HTTPMessage.m */,
+ 1F1C78DC9C9ED126B2DD803F /* OHHTTPStubsResponse+JSON.h */,
+ 43DA39110509B5D077268FC8 /* OHHTTPStubsResponse+JSON.m */,
+ 8AB4DCEA3E6E205F6150BB9B /* OHPathHelpers.h */,
+ 91CB751631C441AC78BFFF91 /* OHPathHelpers.m */,
+ );
+ path = Sources;
+ sourceTree = "<group>";
+ };
+ 90091CD0A828ED346DE8663C /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D39958F9C841183DE3C7A500 /* iOS */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ A6534AD5BD03EA29AB460479 /* Development Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 3EB198ABE93CBAE1C25569ED /* OHHTTPStubs */,
+ );
+ name = "Development Pods";
+ sourceTree = "<group>";
+ };
+ C4B29A11FCEF09243EA85BD4 /* OHHTTPStubs */ = {
+ isa = PBXGroup;
+ children = (
+ 6B5292DC8591159D72E93366 /* Sources */,
+ );
+ path = OHHTTPStubs;
+ sourceTree = "<group>";
+ };
+ D39958F9C841183DE3C7A500 /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ E3F78A40A045AD979FC32D66 /* CFNetwork.framework */,
+ 7B2C23953AEE92A8924B57BD /* Foundation.framework */,
+ );
+ name = iOS;
+ sourceTree = "<group>";
+ };
+ D882BE8B7A1CD1ACAD41FC23 /* Support Files */ = {
+ isa = PBXGroup;
+ children = (
+ A1BA020EDD8BB7AE11152ACC /* Pods-OHHTTPStubs.xcconfig */,
+ DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */,
+ C9D0A204842A77405B1B4826 /* Pods-OHHTTPStubs-dummy.m */,
+ 5CAE31F1B62C6CE71BC12572 /* Pods-OHHTTPStubs-prefix.pch */,
+ );
+ name = "Support Files";
+ path = "Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs";
+ sourceTree = "<group>";
+ };
+ D8918EE34F24A086FB93B162 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 925D0F1AA2487470D449CE49 /* Pods-acknowledgements.markdown */,
+ 540BE0121862CF47DF5EAC7E /* Pods-acknowledgements.plist */,
+ F22C8E5911B3A17469606575 /* Pods-dummy.m */,
+ 85434260BFFB3C7A7BC04F99 /* Pods-environment.h */,
+ 7A817F08BCB2651ACDF06BAF /* Pods-resources.sh */,
+ 7F0BAB562664206098AE3E43 /* Pods.debug.xcconfig */,
+ A976A0F9BBC8019FB5DD5B7F /* Pods.release.xcconfig */,
+ );
+ name = Pods;
+ path = "Target Support Files/Pods";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ F9ECAC25D98304B8B72AF50A /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DDE78ABCE16D42E4E3347D57 /* OHHTTPStubs.h in Headers */,
+ E93E7222A109F4DE8DEE1C8A /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
+ B3F948D4C6FEA3E3414304E3 /* OHHTTPStubsResponse+JSON.h in Headers */,
+ 37E8EFCB93409F59A3519709 /* OHHTTPStubsResponse.h in Headers */,
+ 05AF8AC740672A49F1DB86F8 /* OHPathHelpers.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 9BFA25996D607CC8407D9667 /* Pods-OHHTTPStubs */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 99C679F5F4E67D87EC4BDF5A /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs" */;
+ buildPhases = (
+ BE02003453F6728BF5A57B70 /* Sources */,
+ 370CE9976B2CE6DC38C7AD35 /* Frameworks */,
+ F9ECAC25D98304B8B72AF50A /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "Pods-OHHTTPStubs";
+ productName = "Pods-OHHTTPStubs";
+ productReference = DD8EC89EDDE25D7B79665F29 /* libPods-OHHTTPStubs.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ ED0986E9CFBAA34FCF4971C9 /* Pods */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 40030A743EB9FB86643D5978 /* Build configuration list for PBXNativeTarget "Pods" */;
+ buildPhases = (
+ 222D0A79B1499A9F0B3FDA4B /* Sources */,
+ 8F733C40CCF846B63AED7A63 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 76788543FE7378BD74B08A8D /* PBXTargetDependency */,
+ );
+ name = Pods;
+ productName = Pods;
+ productReference = 51D2E996FA1B199219C88105 /* libPods.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 4E43A3978191CB163B56150F /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0640;
+ };
+ buildConfigurationList = A6F781DF7CB4BC20838676BB /* Build configuration list for PBXProject "Pods" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 4CCC5CCCC482E8248CF90F91;
+ productRefGroup = 262D783B60DE608266D6A656 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ ED0986E9CFBAA34FCF4971C9 /* Pods */,
+ 9BFA25996D607CC8407D9667 /* Pods-OHHTTPStubs */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 222D0A79B1499A9F0B3FDA4B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0287B0995D3956A77FE8245B /* Pods-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BE02003453F6728BF5A57B70 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B88B2F8C9696F7AFF1219FA6 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
+ C73743AF5192A2BCAD0BA639 /* OHHTTPStubs.m in Sources */,
+ 91AC7870E73F1D4AFD355954 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
+ 3C4E450E5248FA162C4836BB /* OHHTTPStubsResponse+JSON.m in Sources */,
+ 4C169F633246281BE747CBC7 /* OHHTTPStubsResponse.m in Sources */,
+ B5A13025620A2BC7F9523B3E /* OHPathHelpers.m in Sources */,
+ 91F20FAEB508489E6E82A37E /* Pods-OHHTTPStubs-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 76788543FE7378BD74B08A8D /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "Pods-OHHTTPStubs";
+ target = 9BFA25996D607CC8407D9667 /* Pods-OHHTTPStubs */;
+ targetProxy = 70209F8E12151BE9099A0906 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 337E89F82BC61A2DD3C2E883 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = A976A0F9BBC8019FB5DD5B7F /* Pods.release.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ 63360606759F06BB75622084 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ 68471B2F01E99F601F6F8AC3 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ ONLY_ACTIVE_ARCH = YES;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = "${SRCROOT}/../build";
+ };
+ name = Debug;
+ };
+ 6B84606278B52C10D43487F2 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = DBFCAD5C4AF069800133DA37 /* Pods-OHHTTPStubs-Private.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 7DBF91DE1049E44BD8E62530 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7F0BAB562664206098AE3E43 /* Pods.debug.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ F0A06905E42C5AED58002639 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = "${SRCROOT}/../build";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 40030A743EB9FB86643D5978 /* Build configuration list for PBXNativeTarget "Pods" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7DBF91DE1049E44BD8E62530 /* Debug */,
+ 337E89F82BC61A2DD3C2E883 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 99C679F5F4E67D87EC4BDF5A /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 6B84606278B52C10D43487F2 /* Debug */,
+ 63360606759F06BB75622084 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ A6F781DF7CB4BC20838676BB /* Build configuration list for PBXProject "Pods" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 68471B2F01E99F601F6F8AC3 /* Debug */,
+ F0A06905E42C5AED58002639 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 4E43A3978191CB163B56150F /* Project object */;
+}
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig
new file mode 100644
index 0000000000..8fb40d2e94
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig
@@ -0,0 +1,6 @@
+#include "Pods-OHHTTPStubs.xcconfig"
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OHHTTPStubs" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
+OTHER_LDFLAGS = ${PODS_OHHTTPSTUBS_OTHER_LDFLAGS} -ObjC
+PODS_ROOT = ${SRCROOT}
+SKIP_INSTALL = YES \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m
new file mode 100644
index 0000000000..6e93a65cc8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods_OHHTTPStubs : NSObject
+@end
+@implementation PodsDummy_Pods_OHHTTPStubs
+@end
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch
new file mode 100644
index 0000000000..95cf11d9fb
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch
@@ -0,0 +1,5 @@
+#ifdef __OBJC__
+#import <UIKit/UIKit.h>
+#endif
+
+#import "Pods-environment.h"
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig
new file mode 100644
index 0000000000..de1d241adc
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig
@@ -0,0 +1 @@
+PODS_OHHTTPSTUBS_OTHER_LDFLAGS = -framework "CFNetwork" -framework "Foundation" \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown
new file mode 100644
index 0000000000..79d3603ad7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown
@@ -0,0 +1,15 @@
+# Acknowledgements
+This application makes use of the following third party libraries:
+
+## OHHTTPStubs
+
+- MIT LICENSE -
+
+Copyright (c) 2012 Olivier Halligon
+
+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.
+Generated by CocoaPods - http://cocoapods.org
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.plist
new file mode 100644
index 0000000000..756aa4392a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-acknowledgements.plist
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PreferenceSpecifiers</key>
+ <array>
+ <dict>
+ <key>FooterText</key>
+ <string>This application makes use of the following third party libraries:</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>- MIT LICENSE -
+
+Copyright (c) 2012 Olivier Halligon
+
+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.</string>
+ <key>Title</key>
+ <string>OHHTTPStubs</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>Generated by CocoaPods - http://cocoapods.org</string>
+ <key>Title</key>
+ <string></string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ </array>
+ <key>StringsTable</key>
+ <string>Acknowledgements</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-dummy.m b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-dummy.m
new file mode 100644
index 0000000000..ade64bd1a9
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods : NSObject
+@end
+@implementation PodsDummy_Pods
+@end
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-environment.h b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-environment.h
new file mode 100644
index 0000000000..5918510c4e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-environment.h
@@ -0,0 +1,14 @@
+
+// To check if a library is compiled with CocoaPods you
+// can use the `COCOAPODS` macro definition which is
+// defined in the xcconfigs so it is available in
+// headers also when they are imported in the client
+// project.
+
+
+// OHHTTPStubs
+#define COCOAPODS_POD_AVAILABLE_OHHTTPStubs
+#define COCOAPODS_VERSION_MAJOR_OHHTTPStubs 4
+#define COCOAPODS_VERSION_MINOR_OHHTTPStubs 0
+#define COCOAPODS_VERSION_PATCH_OHHTTPStubs 1
+
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-resources.sh b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-resources.sh
new file mode 100755
index 0000000000..43f08523e1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods-resources.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+set -e
+
+mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+
+RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
+> "$RESOURCES_TO_COPY"
+
+XCASSET_FILES=()
+
+realpath() {
+ DIRECTORY=$(cd "${1%/*}" && pwd)
+ FILENAME="${1##*/}"
+ echo "$DIRECTORY/$FILENAME"
+}
+
+install_resource()
+{
+ case $1 in
+ *.storyboard)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.xib)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.framework)
+ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ ;;
+ *.xcdatamodel)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
+ ;;
+ *.xcdatamodeld)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
+ ;;
+ *.xcmappingmodel)
+ echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
+ xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
+ ;;
+ *.xcassets)
+ ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
+ XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
+ ;;
+ /*)
+ echo "$1"
+ echo "$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ *)
+ echo "${PODS_ROOT}/$1"
+ echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ esac
+}
+
+rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+if [[ "${ACTION}" == "install" ]]; then
+ rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
+rm -f "$RESOURCES_TO_COPY"
+
+if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
+then
+ case "${TARGETED_DEVICE_FAMILY}" in
+ 1,2)
+ TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
+ ;;
+ 1)
+ TARGET_DEVICE_ARGS="--target-device iphone"
+ ;;
+ 2)
+ TARGET_DEVICE_ARGS="--target-device ipad"
+ ;;
+ *)
+ TARGET_DEVICE_ARGS="--target-device mac"
+ ;;
+ esac
+
+ # Find all other xcassets (this unfortunately includes those of path pods and other targets).
+ OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
+ while read line; do
+ if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
+ XCASSET_FILES+=("$line")
+ fi
+ done <<<"$OTHER_XCASSETS"
+
+ printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.debug.xcconfig
new file mode 100644
index 0000000000..806e7917f9
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.debug.xcconfig
@@ -0,0 +1,6 @@
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs" -framework "CFNetwork" -framework "Foundation"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.release.xcconfig b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.release.xcconfig
new file mode 100644
index 0000000000..806e7917f9
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Pods/Target Support Files/Pods/Pods.release.xcconfig
@@ -0,0 +1,6 @@
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs" -framework "CFNetwork" -framework "Foundation"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.jpg b/test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.jpg
new file mode 100644
index 0000000000..c42a21cd74
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.jpg
Binary files differ
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.txt b/test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.txt
new file mode 100644
index 0000000000..e662f91b23
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Stubs/stub.txt
@@ -0,0 +1,3 @@
+This is the text from your stub.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullam corper suscipit lobortis nisi ut aliquip ex ea commodo consequat. Duis te feugi facilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit au gue duis dolore te feugat nulla facilisi.
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/Default-568h@2x.png b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/Default-568h@2x.png
new file mode 100644
index 0000000000..0891b7aabf
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/Default-568h@2x.png
Binary files differ
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Info.plist b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Info.plist
new file mode 100644
index 0000000000..5dc7a4773b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Info.plist
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.alisoftware.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainViewController</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Prefix.pch b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Prefix.pch
new file mode 100644
index 0000000000..20ef719789
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/OHHTTPStubsDemo-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'OHHTTPStubsDemo' target in the 'OHHTTPStubsDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
diff --git a/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/main.m b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/main.m
new file mode 100644
index 0000000000..478bfb3959
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/ObjC/Supporting Files/main.m
@@ -0,0 +1,17 @@
+//
+// main.m
+// OHHTTPStubsDemo
+//
+// Created by Olivier Halligon on 11/08/12.
+// Copyright (c) 2012 AliSoftware. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, nil);
+ }
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/AppDelegate.swift b/test/ios/OHHTTPStubs/Examples/Swift/AppDelegate.swift
new file mode 100644
index 0000000000..58f489a7d7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/AppDelegate.swift
@@ -0,0 +1,21 @@
+//
+// AppDelegate.swift
+// OHHTTPStubsDemo
+//
+// Created by Olivier Halligon on 18/04/2015.
+// Copyright (c) 2015 AliSoftware. All rights reserved.
+//
+
+import UIKit
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+ var window: UIWindow?
+
+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
+ // Override point for customization after application launch.
+ return true
+ }
+}
+
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Main.storyboard b/test/ios/OHHTTPStubs/Examples/Swift/Main.storyboard
new file mode 100644
index 0000000000..438521ca5c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Main.storyboard
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
+ <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+ </dependencies>
+ <scenes>
+ <!--Main View Controller-->
+ <scene sceneID="tne-QT-ifu">
+ <objects>
+ <viewController id="BYZ-38-t0r" customClass="MainViewController" customModule="OHHTTPStubsDemo" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+ <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Activate Stubs Globally" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="i3Q-pZ-OFi">
+ <rect key="frame" x="73" y="33" width="511" height="21"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" horizontalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="l60-ZM-CS7">
+ <rect key="frame" x="16" y="28" width="51" height="31"/>
+ <connections>
+ <action selector="toggleStubs:" destination="BYZ-38-t0r" eventType="valueChanged" id="Ab8-ba-nES"/>
+ </connections>
+ </switch>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Fake 2s Delay" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="BVp-fP-EX3">
+ <rect key="frame" x="73" y="72" width="434" height="21"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" horizontalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Ots-uz-HBP">
+ <rect key="frame" x="16" y="67" width="51" height="31"/>
+ </switch>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bd2-S0-6oU">
+ <rect key="frame" x="515" y="68" width="69" height="30"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="69" id="05U-TI-0b3"/>
+ </constraints>
+ <state key="normal" title="Clear">
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="clearResults" destination="BYZ-38-t0r" eventType="touchUpInside" id="aLh-6y-PPp"/>
+ </connections>
+ </button>
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="q0d-yd-8pd">
+ <rect key="frame" x="16" y="106" width="568" height="55"/>
+ <subviews>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cHe-gS-w8n">
+ <rect key="frame" x="13" y="5" width="481" height="45"/>
+ <state key="normal" title="Download some text">
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="disabled" title="Downloading…">
+ <color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="downloadText:" destination="BYZ-38-t0r" eventType="touchUpInside" id="HfU-ap-tEC"/>
+ </connections>
+ </button>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="750" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CZL-1L-SlS">
+ <rect key="frame" x="485" y="2" width="63" height="20"/>
+ <fontDescription key="fontDescription" type="system" pointSize="9"/>
+ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eja-cQ-oUU">
+ <rect key="frame" x="499" y="22" width="51" height="31"/>
+ <connections>
+ <action selector="installTextStub:" destination="BYZ-38-t0r" eventType="valueChanged" id="2pl-wJ-iCQ"/>
+ </connections>
+ </switch>
+ </subviews>
+ <color key="backgroundColor" white="0.94548357660000004" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstAttribute="bottom" secondItem="eja-cQ-oUU" secondAttribute="bottom" constant="2" id="29H-MG-Fxf"/>
+ <constraint firstItem="eja-cQ-oUU" firstAttribute="top" secondItem="CZL-1L-SlS" secondAttribute="bottom" id="3wI-sk-26n"/>
+ <constraint firstItem="cHe-gS-w8n" firstAttribute="leading" secondItem="q0d-yd-8pd" secondAttribute="leadingMargin" constant="5" id="Hwa-qe-ZOQ"/>
+ <constraint firstAttribute="trailing" secondItem="eja-cQ-oUU" secondAttribute="trailing" constant="20" symbolic="YES" id="Khb-si-DNH"/>
+ <constraint firstAttribute="bottom" secondItem="cHe-gS-w8n" secondAttribute="bottom" constant="5" id="S92-MO-7X2"/>
+ <constraint firstItem="cHe-gS-w8n" firstAttribute="top" secondItem="q0d-yd-8pd" secondAttribute="top" constant="5" id="bbu-UH-GkB"/>
+ <constraint firstItem="eja-cQ-oUU" firstAttribute="leading" secondItem="cHe-gS-w8n" secondAttribute="trailing" constant="5" id="gjH-jS-L0Y"/>
+ <constraint firstItem="CZL-1L-SlS" firstAttribute="trailing" secondItem="eja-cQ-oUU" secondAttribute="trailing" id="p7j-wp-ICC"/>
+ <constraint firstAttribute="height" constant="55" id="qXE-il-74X"/>
+ <constraint firstAttribute="trailing" secondItem="CZL-1L-SlS" secondAttribute="trailing" constant="8" id="rgi-Il-D0e"/>
+ <constraint firstItem="CZL-1L-SlS" firstAttribute="top" secondItem="q0d-yd-8pd" secondAttribute="top" constant="2" id="wN6-Rr-Qrd"/>
+ </constraints>
+ <variation key="default">
+ <mask key="constraints">
+ <exclude reference="rgi-Il-D0e"/>
+ </mask>
+ </variation>
+ </view>
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ruy-AH-zcs">
+ <rect key="frame" x="16" y="169" width="568" height="176"/>
+ <color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
+ <fontDescription key="fontDescription" name="Menlo-Regular" family="Menlo" pointSize="12"/>
+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+ </textView>
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GvE-e2-Eos">
+ <rect key="frame" x="16" y="353" width="568" height="55"/>
+ <subviews>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="c9w-hC-ZIo">
+ <rect key="frame" x="13" y="5" width="478" height="45"/>
+ <state key="normal" title="Download image">
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="disabled" title="Downloading…">
+ <color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="downloadImage:" destination="BYZ-38-t0r" eventType="touchUpInside" id="UM4-Du-Bbb"/>
+ </connections>
+ </button>
+ <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ji5-SF-Rck">
+ <rect key="frame" x="499" y="22" width="51" height="31"/>
+ <connections>
+ <action selector="installImageStub:" destination="BYZ-38-t0r" eventType="valueChanged" id="B56-KR-Iwy"/>
+ </connections>
+ </switch>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Stub installed?" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WaM-eo-B4Y">
+ <rect key="frame" x="485" y="2" width="63" height="20"/>
+ <fontDescription key="fontDescription" type="system" pointSize="9"/>
+ <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="0.94548357660000004" alpha="1" colorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="ji5-SF-Rck" firstAttribute="top" secondItem="WaM-eo-B4Y" secondAttribute="bottom" id="4ga-4o-xtr"/>
+ <constraint firstItem="c9w-hC-ZIo" firstAttribute="top" secondItem="GvE-e2-Eos" secondAttribute="top" constant="5" id="62E-jh-E4B"/>
+ <constraint firstItem="ji5-SF-Rck" firstAttribute="leading" secondItem="c9w-hC-ZIo" secondAttribute="trailing" constant="8" symbolic="YES" id="8lX-bA-JCe"/>
+ <constraint firstItem="c9w-hC-ZIo" firstAttribute="leading" secondItem="GvE-e2-Eos" secondAttribute="leadingMargin" constant="5" id="Dyb-rO-JJU"/>
+ <constraint firstAttribute="trailing" secondItem="ji5-SF-Rck" secondAttribute="trailing" constant="20" symbolic="YES" id="Fkp-ob-fLN"/>
+ <constraint firstAttribute="bottom" secondItem="ji5-SF-Rck" secondAttribute="bottom" constant="2" id="R9M-DJ-mIm"/>
+ <constraint firstAttribute="height" constant="55" id="Ro0-sY-nDW"/>
+ <constraint firstItem="WaM-eo-B4Y" firstAttribute="trailing" secondItem="ji5-SF-Rck" secondAttribute="trailing" id="ZxJ-2X-ePH"/>
+ <constraint firstAttribute="bottom" secondItem="c9w-hC-ZIo" secondAttribute="bottom" constant="5" id="jdz-li-ys1"/>
+ <constraint firstItem="WaM-eo-B4Y" firstAttribute="top" secondItem="GvE-e2-Eos" secondAttribute="top" constant="2" id="zDu-Go-F4N"/>
+ </constraints>
+ </view>
+ <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="5bj-Tq-WCZ">
+ <rect key="frame" x="16" y="416" width="568" height="176"/>
+ <color key="backgroundColor" white="0.89892221719999998" alpha="1" colorSpace="calibratedWhite"/>
+ </imageView>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="l60-ZM-CS7" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="0j5-Kr-Bap"/>
+ <constraint firstItem="GvE-e2-Eos" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="7BB-yF-NDN"/>
+ <constraint firstItem="5bj-Tq-WCZ" firstAttribute="height" secondItem="ruy-AH-zcs" secondAttribute="height" id="9CM-a2-1St"/>
+ <constraint firstItem="Ots-uz-HBP" firstAttribute="top" secondItem="l60-ZM-CS7" secondAttribute="bottom" constant="8" symbolic="YES" id="9fP-Fh-cY6"/>
+ <constraint firstItem="Ots-uz-HBP" firstAttribute="centerY" secondItem="BVp-fP-EX3" secondAttribute="centerY" id="CuV-xq-bsL"/>
+ <constraint firstItem="ruy-AH-zcs" firstAttribute="top" secondItem="q0d-yd-8pd" secondAttribute="bottom" constant="8" symbolic="YES" id="FAU-LK-lwH"/>
+ <constraint firstAttribute="trailingMargin" secondItem="i3Q-pZ-OFi" secondAttribute="trailing" id="Gf3-KX-gvo"/>
+ <constraint firstItem="ruy-AH-zcs" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="GwN-Yl-Oe9"/>
+ <constraint firstItem="q0d-yd-8pd" firstAttribute="top" secondItem="Ots-uz-HBP" secondAttribute="bottom" constant="8" symbolic="YES" id="Hte-At-iUc"/>
+ <constraint firstItem="5bj-Tq-WCZ" firstAttribute="top" secondItem="GvE-e2-Eos" secondAttribute="bottom" constant="8" symbolic="YES" id="JgY-aI-yDT"/>
+ <constraint firstItem="GvE-e2-Eos" firstAttribute="top" secondItem="ruy-AH-zcs" secondAttribute="bottom" constant="8" symbolic="YES" id="Ote-kU-oyl"/>
+ <constraint firstItem="l60-ZM-CS7" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="8" symbolic="YES" id="QcO-T9-cgv"/>
+ <constraint firstItem="Bd2-S0-6oU" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="SC7-du-hgz"/>
+ <constraint firstItem="Bd2-S0-6oU" firstAttribute="leading" secondItem="BVp-fP-EX3" secondAttribute="trailing" constant="8" symbolic="YES" id="UId-jY-PGT"/>
+ <constraint firstItem="BVp-fP-EX3" firstAttribute="leading" secondItem="Ots-uz-HBP" secondAttribute="trailing" constant="8" symbolic="YES" id="YtW-MD-2HS"/>
+ <constraint firstItem="Ots-uz-HBP" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="YzH-tR-2EL"/>
+ <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="5bj-Tq-WCZ" secondAttribute="bottom" constant="8" symbolic="YES" id="bkX-5L-yHb"/>
+ <constraint firstItem="GvE-e2-Eos" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="e3m-dD-QHe"/>
+ <constraint firstItem="q0d-yd-8pd" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="gf8-4V-OtZ"/>
+ <constraint firstItem="i3Q-pZ-OFi" firstAttribute="centerY" secondItem="l60-ZM-CS7" secondAttribute="centerY" id="i7p-Mu-Z5w"/>
+ <constraint firstItem="Bd2-S0-6oU" firstAttribute="centerY" secondItem="BVp-fP-EX3" secondAttribute="centerY" id="lBr-er-U9M"/>
+ <constraint firstItem="5bj-Tq-WCZ" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="n85-Qw-ILn"/>
+ <constraint firstItem="ruy-AH-zcs" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="t7w-mv-dbP"/>
+ <constraint firstItem="i3Q-pZ-OFi" firstAttribute="leading" secondItem="l60-ZM-CS7" secondAttribute="trailing" constant="8" symbolic="YES" id="ud7-J3-llm"/>
+ <constraint firstItem="q0d-yd-8pd" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="vd3-vh-cO6"/>
+ <constraint firstItem="5bj-Tq-WCZ" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="zf9-6C-GJh"/>
+ </constraints>
+ </view>
+ <connections>
+ <outlet property="delaySwitch" destination="Ots-uz-HBP" id="bye-pT-jxJ"/>
+ <outlet property="imageView" destination="5bj-Tq-WCZ" id="u02-Ml-Ob8"/>
+ <outlet property="installImageStubSwitch" destination="ji5-SF-Rck" id="7u3-ya-Crs"/>
+ <outlet property="installTextStubSwitch" destination="eja-cQ-oUU" id="Xsi-sG-ivV"/>
+ <outlet property="textView" destination="ruy-AH-zcs" id="Gbh-p5-mVt"/>
+ </connections>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+ </objects>
+ </scene>
+ </scenes>
+</document>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/MainViewController.swift b/test/ios/OHHTTPStubs/Examples/Swift/MainViewController.swift
new file mode 100644
index 0000000000..e983f11f39
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/MainViewController.swift
@@ -0,0 +1,145 @@
+//
+// ViewController.swift
+// OHHTTPStubsDemo
+//
+// Created by Olivier Halligon on 18/04/2015.
+// Copyright (c) 2015 AliSoftware. All rights reserved.
+//
+
+import UIKit
+import OHHTTPStubs
+
+class MainViewController: UIViewController {
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // MARK: - Outlets
+
+ @IBOutlet var delaySwitch: UISwitch!
+ @IBOutlet var textView: UITextView!
+ @IBOutlet var installTextStubSwitch: UISwitch!
+ @IBOutlet var imageView: UIImageView!
+ @IBOutlet var installImageStubSwitch: UISwitch!
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // MARK: - Init & Dealloc
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ installTextStub(self.installTextStubSwitch)
+ installImageStub(self.installImageStubSwitch)
+ OHHTTPStubs.onStubActivation { (request: NSURLRequest!, stub: OHHTTPStubsDescriptor!) in
+ println("[OHHTTPStubs] Request to \(request.URL!) has been stubbed with \(stub.name)")
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // MARK: - Global stubs activation
+
+ @IBAction func toggleStubs(sender: UISwitch) {
+ OHHTTPStubs.setEnabled(sender.on)
+ self.delaySwitch.enabled = sender.on
+ self.installTextStubSwitch.enabled = sender.on
+ self.installImageStubSwitch.enabled = sender.on
+
+ let state = sender.on ? "and enabled" : "but disabled"
+ println("Installed (\(state)) stubs: \(OHHTTPStubs.allStubs)")
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // MARK: - Text Download and Stub
+
+
+ @IBAction func downloadText(sender: UIButton) {
+ sender.enabled = false
+ self.textView.text = nil
+
+ let urlString = "http://www.opensource.apple.com/source/Git/Git-26/src/git-htmldocs/git-commit.txt?txt"
+ let req = NSURLRequest(URL: NSURL(string: urlString)!)
+
+ NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { (_, data, _) in
+ sender.enabled = true
+ let receivedText = NSString(data: data, encoding: NSASCIIStringEncoding)
+ self.textView.text = receivedText! as String
+ }
+ }
+
+ weak var textStub: OHHTTPStubsDescriptor?
+ @IBAction func installTextStub(sender: UISwitch) {
+ if sender.on {
+ // Install
+
+ // - we use an inline closure for the test predicate with shorthand argument names
+ // - we also use the "trailing closure" syntax of Swift for convenience
+ // - we don't care about the 'request' parameter in the trailing closure so we use '_'
+ textStub = OHHTTPStubs.stubRequestsPassingTest({$0.URL!.pathExtension == "txt"}) { _ in
+ let stubPath = OHPathForFile("stub.txt", self.dynamicType)
+ return OHHTTPStubsResponse(
+ fileAtPath: stubPath!,
+ statusCode: 200,
+ headers: ["Content-Type":"text/plain"]
+ )
+ .requestTime(self.delaySwitch.on ? 2.0 : 0.0, responseTime:OHHTTPStubsDownloadSpeedWifi)
+ }
+ textStub?.name = "Text stub"
+ } else {
+ // Uninstall
+ OHHTTPStubs.removeStub(textStub!)
+ }
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // MARK: - Image Download and Stub
+
+ @IBAction func downloadImage(sender: UIButton) {
+ sender.enabled = false
+ self.imageView.image = nil
+
+ let urlString = "http://images.apple.com/support/assets/images/products/iphone/hero_iphone4-5_wide.png"
+ let req = NSURLRequest(URL: NSURL(string: urlString)!)
+
+ NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { (_, data, _) in
+ sender.enabled = true
+ self.imageView.image = UIImage(data: data)
+ }
+ }
+
+ weak var imageStub: OHHTTPStubsDescriptor?
+ @IBAction func installImageStub(sender: UISwitch) {
+ if sender.on {
+ // Install
+
+ let isImage = { (request: NSURLRequest!) -> Bool in
+ contains(["png","jpg","jpeg","gif"], request.URL?.pathExtension ?? "")
+ }
+ // - we use a separate block 'isImage' for the 'test' predicate for code readability
+ // - we use the "trailing closure" syntax of Swift for convenience
+ // - we don't care about the 'request' parameter in the trailing closure so we use '_'
+ imageStub = OHHTTPStubs.stubRequestsPassingTest(isImage) { _ in
+ let stubPath = OHPathForFile("stub.jpg", self.dynamicType)
+ return OHHTTPStubsResponse(
+ fileAtPath: stubPath!,
+ statusCode: 200,
+ headers: ["Content-Type":"image/jpeg"]
+ )
+ .requestTime(self.delaySwitch.on ? 2.0 : 0.0, responseTime: OHHTTPStubsDownloadSpeedWifi)
+ }
+ imageStub?.name = "Image stub"
+ } else {
+ // Uninstall
+ OHHTTPStubs.removeStub(imageStub!)
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // MARK: - Cleaning
+
+ @IBAction func clearResults() {
+ self.textView.text = ""
+ self.imageView.image = nil
+ }
+
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.pbxproj b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..49d0a3d76c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.pbxproj
@@ -0,0 +1,378 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 099F74141AE2D049001108A5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 099F74131AE2D049001108A5 /* Images.xcassets */; };
+ 099F742F1AE2D572001108A5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 099F742D1AE2D572001108A5 /* Main.storyboard */; };
+ 099F74351AE2D5EB001108A5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 099F74341AE2D5EB001108A5 /* LaunchScreen.xib */; };
+ 099F74391AE2D5FF001108A5 /* stub.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 099F74371AE2D5FF001108A5 /* stub.jpg */; };
+ 099F743A1AE2D5FF001108A5 /* stub.txt in Resources */ = {isa = PBXBuildFile; fileRef = 099F74381AE2D5FF001108A5 /* stub.txt */; };
+ 099F743C1AE2D632001108A5 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 099F743B1AE2D632001108A5 /* Default-568h@2x.png */; };
+ 099F74401AE2D703001108A5 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099F740E1AE2D049001108A5 /* MainViewController.swift */; };
+ 099F74421AE2D7E0001108A5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099F74411AE2D7E0001108A5 /* AppDelegate.swift */; };
+ 33ABB39721D2012BFC1F5077 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6C6334E088CD830EF8D38DB /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 099F74071AE2D049001108A5 /* OHHTTPStubsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OHHTTPStubsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 099F740B1AE2D049001108A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 099F740E1AE2D049001108A5 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
+ 099F74131AE2D049001108A5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
+ 099F742D1AE2D572001108A5 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
+ 099F74341AE2D5EB001108A5 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = "<group>"; };
+ 099F74371AE2D5FF001108A5 /* stub.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = stub.jpg; sourceTree = "<group>"; };
+ 099F74381AE2D5FF001108A5 /* stub.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stub.txt; sourceTree = "<group>"; };
+ 099F743B1AE2D632001108A5 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Supporting Files/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
+ 099F74411AE2D7E0001108A5 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+ D1819A3B2BCA81021164F097 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
+ DC1FF3E7FE2F711D9C9AD066 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
+ F6C6334E088CD830EF8D38DB /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 099F74041AE2D049001108A5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 33ABB39721D2012BFC1F5077 /* Pods.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 099F73FE1AE2D049001108A5 = {
+ isa = PBXGroup;
+ children = (
+ 099F74091AE2D049001108A5 /* OHHTTPStubsDemo */,
+ 099F74081AE2D049001108A5 /* Products */,
+ 11944CD1D5FC771F513B1E27 /* Pods */,
+ 3116686BFC89EEC0587776C7 /* Frameworks */,
+ );
+ sourceTree = "<group>";
+ };
+ 099F74081AE2D049001108A5 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 099F74071AE2D049001108A5 /* OHHTTPStubsDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 099F74091AE2D049001108A5 /* OHHTTPStubsDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 099F74411AE2D7E0001108A5 /* AppDelegate.swift */,
+ 099F740E1AE2D049001108A5 /* MainViewController.swift */,
+ 099F742D1AE2D572001108A5 /* Main.storyboard */,
+ 099F74361AE2D5FF001108A5 /* Stubs */,
+ 099F740A1AE2D049001108A5 /* Supporting Files */,
+ );
+ name = OHHTTPStubsDemo;
+ sourceTree = "<group>";
+ };
+ 099F740A1AE2D049001108A5 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 099F743B1AE2D632001108A5 /* Default-568h@2x.png */,
+ 099F74341AE2D5EB001108A5 /* LaunchScreen.xib */,
+ 099F74131AE2D049001108A5 /* Images.xcassets */,
+ 099F740B1AE2D049001108A5 /* Info.plist */,
+ );
+ path = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 099F74361AE2D5FF001108A5 /* Stubs */ = {
+ isa = PBXGroup;
+ children = (
+ 099F74371AE2D5FF001108A5 /* stub.jpg */,
+ 099F74381AE2D5FF001108A5 /* stub.txt */,
+ );
+ path = Stubs;
+ sourceTree = "<group>";
+ };
+ 11944CD1D5FC771F513B1E27 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ D1819A3B2BCA81021164F097 /* Pods.debug.xcconfig */,
+ DC1FF3E7FE2F711D9C9AD066 /* Pods.release.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+ 3116686BFC89EEC0587776C7 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ F6C6334E088CD830EF8D38DB /* Pods.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 099F74061AE2D049001108A5 /* OHHTTPStubsDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 099F74261AE2D049001108A5 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */;
+ buildPhases = (
+ BC9F93D044C7E42A3DAD6455 /* Check Pods Manifest.lock */,
+ 099F74031AE2D049001108A5 /* Sources */,
+ 099F74041AE2D049001108A5 /* Frameworks */,
+ 099F74051AE2D049001108A5 /* Resources */,
+ D95367D5DC075A18A3D27355 /* Embed Pods Frameworks */,
+ 5D1017B32E55D59BD180A034 /* Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = OHHTTPStubsDemo;
+ productName = OHHTTPStubsDemo;
+ productReference = 099F74071AE2D049001108A5 /* OHHTTPStubsDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 099F73FF1AE2D049001108A5 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0630;
+ ORGANIZATIONNAME = AliSoftware;
+ TargetAttributes = {
+ 099F74061AE2D049001108A5 = {
+ CreatedOnToolsVersion = 6.3;
+ };
+ };
+ };
+ buildConfigurationList = 099F74021AE2D049001108A5 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 099F73FE1AE2D049001108A5;
+ productRefGroup = 099F74081AE2D049001108A5 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 099F74061AE2D049001108A5 /* OHHTTPStubsDemo */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 099F74051AE2D049001108A5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 099F74351AE2D5EB001108A5 /* LaunchScreen.xib in Resources */,
+ 099F74391AE2D5FF001108A5 /* stub.jpg in Resources */,
+ 099F742F1AE2D572001108A5 /* Main.storyboard in Resources */,
+ 099F74141AE2D049001108A5 /* Images.xcassets in Resources */,
+ 099F743A1AE2D5FF001108A5 /* stub.txt in Resources */,
+ 099F743C1AE2D632001108A5 /* Default-568h@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 5D1017B32E55D59BD180A034 /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ BC9F93D044C7E42A3DAD6455 /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ D95367D5DC075A18A3D27355 /* Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Embed Pods Frameworks";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 099F74031AE2D049001108A5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 099F74421AE2D7E0001108A5 /* AppDelegate.swift in Sources */,
+ 099F74401AE2D703001108A5 /* MainViewController.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 099F74241AE2D049001108A5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.3;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 099F74251AE2D049001108A5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.3;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 099F74271AE2D049001108A5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = D1819A3B2BCA81021164F097 /* Pods.debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 099F74281AE2D049001108A5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = DC1FF3E7FE2F711D9C9AD066 /* Pods.release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 099F74021AE2D049001108A5 /* Build configuration list for PBXProject "OHHTTPStubsDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 099F74241AE2D049001108A5 /* Debug */,
+ 099F74251AE2D049001108A5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 099F74261AE2D049001108A5 /* Build configuration list for PBXNativeTarget "OHHTTPStubsDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 099F74271AE2D049001108A5 /* Debug */,
+ 099F74281AE2D049001108A5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 099F73FF1AE2D049001108A5 /* Project object */;
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000000..919434a625
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:">
+ </FileRef>
+</Workspace>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme
new file mode 100644
index 0000000000..a3b4ac68e2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0630"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "099F74061AE2D049001108A5"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "NO"
+ buildForArchiving = "NO"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "099F741B1AE2D049001108A5"
+ BuildableName = "OHHTTPStubsDemoTests.xctest"
+ BlueprintName = "OHHTTPStubsDemoTests"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "099F741B1AE2D049001108A5"
+ BuildableName = "OHHTTPStubsDemoTests.xctest"
+ BlueprintName = "OHHTTPStubsDemoTests"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "099F74061AE2D049001108A5"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "099F74061AE2D049001108A5"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "099F74061AE2D049001108A5"
+ BuildableName = "OHHTTPStubsDemo.app"
+ BlueprintName = "OHHTTPStubsDemo"
+ ReferencedContainer = "container:OHHTTPStubsDemo.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000000..cfc0e73f1c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/OHHTTPStubsDemo.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "group:OHHTTPStubsDemo.xcodeproj">
+ </FileRef>
+ <FileRef
+ location = "group:Pods/Pods.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Podfile b/test/ios/OHHTTPStubs/Examples/Swift/Podfile
new file mode 100644
index 0000000000..a0112f4b24
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Podfile
@@ -0,0 +1,7 @@
+source 'https://github.com/CocoaPods/Specs.git'
+
+xcodeproj 'OHHTTPStubsDemo.xcodeproj'
+platform :ios, '8.0'
+use_frameworks!
+
+pod 'OHHTTPStubs', :path => '../..'
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Podfile.lock b/test/ios/OHHTTPStubs/Examples/Swift/Podfile.lock
new file mode 100644
index 0000000000..8192540ce7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Podfile.lock
@@ -0,0 +1,14 @@
+PODS:
+ - OHHTTPStubs (4.0.1)
+
+DEPENDENCIES:
+ - OHHTTPStubs (from `../..`)
+
+EXTERNAL SOURCES:
+ OHHTTPStubs:
+ :path: "../.."
+
+SPEC CHECKSUMS:
+ OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
+
+COCOAPODS: 0.37.0
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h
new file mode 120000
index 0000000000..e466a30930
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubs.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
new file mode 120000
index 0000000000..55a0a6a468
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
new file mode 120000
index 0000000000..247257b1d8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h
new file mode 120000
index 0000000000..773f3f322e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHHTTPStubsResponse.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h
new file mode 120000
index 0000000000..6a6273c69c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Private/OHHTTPStubs/OHPathHelpers.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h
new file mode 120000
index 0000000000..e466a30930
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubs.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubs.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
new file mode 120000
index 0000000000..55a0a6a468
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+HTTPMessage.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
new file mode 120000
index 0000000000..247257b1d8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse+JSON.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h
new file mode 120000
index 0000000000..773f3f322e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHHTTPStubsResponse.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHHTTPStubsResponse.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h
new file mode 120000
index 0000000000..6a6273c69c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Headers/Public/OHHTTPStubs/OHPathHelpers.h
@@ -0,0 +1 @@
+../../../../../../OHHTTPStubs/Sources/OHPathHelpers.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json
new file mode 100644
index 0000000000..3be5f2250f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json
@@ -0,0 +1,26 @@
+{
+ "name": "OHHTTPStubs",
+ "version": "4.0.1",
+ "summary": "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest.",
+ "description": "A class to stub network requests easily:\n\n * Test your apps with fake network data (stubbed from file)\n * You can also customize your response headers and status code\n * Use customized stubs depending on the requests\n * Use custom response time to simulate slow network.\n * This works with any request (HTTP, HTTPS, or any protocol) sent using\n the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …)\n * This is really useful in unit testing, when you need to test network features\n but don't want to hit the real network and fake some response data instead.\n * Has useful convenience methods to stub JSON content or fixture from a file\n * Compatible with Swift\n",
+ "homepage": "https://github.com/AliSoftware/OHHTTPStubs",
+ "license": "MIT",
+ "authors": {
+ "Olivier Halligon": "olivier.halligon+ae@gmail.com"
+ },
+ "source": {
+ "git": "https://github.com/AliSoftware/OHHTTPStubs.git",
+ "tag": "4.0.1"
+ },
+ "source_files": "OHHTTPStubs/Sources/*.{h,m}",
+ "public_header_files": "OHHTTPStubs/Sources/*.h",
+ "frameworks": [
+ "Foundation",
+ "CFNetwork"
+ ],
+ "requires_arc": true,
+ "platforms": {
+ "ios": "5.0",
+ "osx": "10.7"
+ }
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Manifest.lock b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Manifest.lock
new file mode 100644
index 0000000000..8192540ce7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Manifest.lock
@@ -0,0 +1,14 @@
+PODS:
+ - OHHTTPStubs (4.0.1)
+
+DEPENDENCIES:
+ - OHHTTPStubs (from `../..`)
+
+EXTERNAL SOURCES:
+ OHHTTPStubs:
+ :path: "../.."
+
+SPEC CHECKSUMS:
+ OHHTTPStubs: 69b1d48b7dfe838a355fdf48d8592d1042e3d85f
+
+COCOAPODS: 0.37.0
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Pods.xcodeproj/project.pbxproj b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Pods.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..5c218cc64d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Pods.xcodeproj/project.pbxproj
@@ -0,0 +1,562 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 025EDA37E7DE8225A36E9533 /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A6726A194863F5663B3675B /* OHHTTPStubs.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ 04A739CC8DD477CF2DD1049A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCC1018CD76A5124E04BCF56 /* Foundation.framework */; };
+ 075B64EB9838CF1EC0D30922 /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = B78D37976D52B166349E5E6F /* OHHTTPStubsResponse+JSON.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ 14483D9A6C49CA7A40EFE534 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCC1018CD76A5124E04BCF56 /* Foundation.framework */; };
+ 166C7DCBA88C67DD08E2213F /* Pods-OHHTTPStubs-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D519BA859D6F5C634D553D4 /* Pods-OHHTTPStubs-dummy.m */; };
+ 2838C1C53AE2A4B7A0CB6B2D /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DEBA4FE0386495BD23333C /* OHPathHelpers.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ 2A5F193F83B7231858F7168E /* OHHTTPStubsResponse+HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C4EA7ED7B1527D723F8E532 /* OHHTTPStubsResponse+HTTPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 476FA37EB9E1E2550A09B791 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5E38002A9F6264D56C1B71 /* Pods-dummy.m */; };
+ 88E7C5F2FEE4A3B2BB0F62AC /* OHHTTPStubsResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F20EE5AC3F660475C1B1C0 /* OHHTTPStubsResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ B9C7CAB43CDB46B8F62A9BEE /* OHHTTPStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = E0D231B2CD70092197143783 /* OHHTTPStubs.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ BF155DE6DF34A3513FD4E824 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BCF165693C58B3CF965CBD9 /* OHHTTPStubsResponse+HTTPMessage.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ D6E4E9277A6BE0092AB01AB6 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AEB564388B3581B65467A32 /* CFNetwork.framework */; };
+ DD462307456DA68D48B3DD09 /* Pods-OHHTTPStubs-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F9BE2226EACE897333DC5A85 /* Pods-OHHTTPStubs-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ EBF36E9C2568E24826C031B5 /* OHPathHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A996F9D34EDC707D02187F0 /* OHPathHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ F0720B4AF2F6D426ED586B80 /* Pods-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DF781F1D5A3BD5192A49E9 /* Pods-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ FA49795CDB854B8AF5215EA9 /* OHHTTPStubsResponse+JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F033017DBD2D340A327913A /* OHHTTPStubsResponse+JSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ FD0D1769D5FA62B3B81F4A7B /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 657749B5FFBC67FB429EF8C8 /* OHHTTPStubs+NSURLSessionConfiguration.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+ FECF1D77B5EA6D3A14324E0E /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 90935C1FB6D11C0CF2A1C0D0 /* OHHTTPStubsResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ C797270235A90C615B678C99 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = C2CBDA3936450283A6DE5391 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = D30DD3818F4A6F62029AA2A7;
+ remoteInfo = "Pods-OHHTTPStubs";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 0A6726A194863F5663B3675B /* OHHTTPStubs.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubs.m; sourceTree = "<group>"; };
+ 0C4EA7ED7B1527D723F8E532 /* OHHTTPStubsResponse+HTTPMessage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+HTTPMessage.h"; sourceTree = "<group>"; };
+ 0D519BA859D6F5C634D553D4 /* Pods-OHHTTPStubs-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-OHHTTPStubs-dummy.m"; sourceTree = "<group>"; };
+ 0E1F5577F3CB2A1A816F4766 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = "<group>"; };
+ 18547927D8BAD627CE1F2767 /* Pods-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-environment.h"; sourceTree = "<group>"; };
+ 1BCF165693C58B3CF965CBD9 /* OHHTTPStubsResponse+HTTPMessage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+HTTPMessage.m"; sourceTree = "<group>"; };
+ 3133227F412A22268B8AF43A /* Pods.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Pods.modulemap; sourceTree = "<group>"; };
+ 3C4E18BA425FF99FB4BC94B2 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 41DF781F1D5A3BD5192A49E9 /* Pods-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-umbrella.h"; sourceTree = "<group>"; };
+ 50D1B3B17AC91BE94D7AC1C3 /* Pods-OHHTTPStubs.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-OHHTTPStubs.modulemap"; sourceTree = "<group>"; };
+ 5A996F9D34EDC707D02187F0 /* OHPathHelpers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHPathHelpers.h; sourceTree = "<group>"; };
+ 5C62297C51CB5C28BA2B8A3D /* Pods-OHHTTPStubs-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs-Private.xcconfig"; sourceTree = "<group>"; };
+ 5F033017DBD2D340A327913A /* OHHTTPStubsResponse+JSON.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+JSON.h"; sourceTree = "<group>"; };
+ 657749B5FFBC67FB429EF8C8 /* OHHTTPStubs+NSURLSessionConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubs+NSURLSessionConfiguration.m"; sourceTree = "<group>"; };
+ 68E4D04F52C1DCB5E40CC71F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
+ 776DB99A4E43C19DCEDA35EE /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 78DEBA4FE0386495BD23333C /* OHPathHelpers.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHPathHelpers.m; sourceTree = "<group>"; };
+ 7AEB564388B3581B65467A32 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; };
+ 7CC91F06E268AD95D8E87E07 /* Pods-OHHTTPStubs-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs-prefix.pch"; sourceTree = "<group>"; };
+ 86F20EE5AC3F660475C1B1C0 /* OHHTTPStubsResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubsResponse.h; sourceTree = "<group>"; };
+ 90935C1FB6D11C0CF2A1C0D0 /* OHHTTPStubsResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubsResponse.m; sourceTree = "<group>"; };
+ B421722C71E69397A2EF865C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ B78D37976D52B166349E5E6F /* OHHTTPStubsResponse+JSON.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+JSON.m"; sourceTree = "<group>"; };
+ BE72840BBC26E4AACDC7A559 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = "<group>"; };
+ C9E457A0D563C1AA75CE83B1 /* Pods-OHHTTPStubs.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs.xcconfig"; sourceTree = "<group>"; };
+ CB7B8D454F792A091232FCE4 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = "<group>"; };
+ DF8436795410709AD8A59E65 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = "<group>"; };
+ E0D231B2CD70092197143783 /* OHHTTPStubs.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubs.h; sourceTree = "<group>"; };
+ E2B7684424038D4C151FBB37 /* Pods-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-frameworks.sh"; sourceTree = "<group>"; };
+ E9DC5D74566513AD12B939E0 /* OHHTTPStubs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OHHTTPStubs.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ EC618A869241D8D41FCA5D66 /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = "<group>"; };
+ EF5E38002A9F6264D56C1B71 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = "<group>"; };
+ F9BE2226EACE897333DC5A85 /* Pods-OHHTTPStubs-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs-umbrella.h"; sourceTree = "<group>"; };
+ FCC1018CD76A5124E04BCF56 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ BB29665972FBB8C2BDF6B926 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 04A739CC8DD477CF2DD1049A /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C668BD504E49E41CBCEF977A /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D6E4E9277A6BE0092AB01AB6 /* CFNetwork.framework in Frameworks */,
+ 14483D9A6C49CA7A40EFE534 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 06A88E21739F55C66513EA3C /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1FD2921CB92E9A0D66A7B44F /* iOS */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 1FD2921CB92E9A0D66A7B44F /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ 7AEB564388B3581B65467A32 /* CFNetwork.framework */,
+ FCC1018CD76A5124E04BCF56 /* Foundation.framework */,
+ );
+ name = iOS;
+ sourceTree = "<group>";
+ };
+ 50BB6BBA29675CDD0CA50ED6 /* Targets Support Files */ = {
+ isa = PBXGroup;
+ children = (
+ CE249CD186D7B774C5BED5DA /* Pods */,
+ );
+ name = "Targets Support Files";
+ sourceTree = "<group>";
+ };
+ 5F05422CA8CFAC32170B6ED8 /* Development Pods */ = {
+ isa = PBXGroup;
+ children = (
+ DE8EEB58B39A5A1D181D097D /* OHHTTPStubs */,
+ );
+ name = "Development Pods";
+ sourceTree = "<group>";
+ };
+ 77B40E05B7BF4D0C1E0E9964 /* Support Files */ = {
+ isa = PBXGroup;
+ children = (
+ B421722C71E69397A2EF865C /* Info.plist */,
+ 50D1B3B17AC91BE94D7AC1C3 /* Pods-OHHTTPStubs.modulemap */,
+ C9E457A0D563C1AA75CE83B1 /* Pods-OHHTTPStubs.xcconfig */,
+ 5C62297C51CB5C28BA2B8A3D /* Pods-OHHTTPStubs-Private.xcconfig */,
+ 0D519BA859D6F5C634D553D4 /* Pods-OHHTTPStubs-dummy.m */,
+ 7CC91F06E268AD95D8E87E07 /* Pods-OHHTTPStubs-prefix.pch */,
+ F9BE2226EACE897333DC5A85 /* Pods-OHHTTPStubs-umbrella.h */,
+ );
+ name = "Support Files";
+ path = "Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs";
+ sourceTree = "<group>";
+ };
+ CE249CD186D7B774C5BED5DA /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 776DB99A4E43C19DCEDA35EE /* Info.plist */,
+ 3133227F412A22268B8AF43A /* Pods.modulemap */,
+ EC618A869241D8D41FCA5D66 /* Pods-acknowledgements.markdown */,
+ CB7B8D454F792A091232FCE4 /* Pods-acknowledgements.plist */,
+ EF5E38002A9F6264D56C1B71 /* Pods-dummy.m */,
+ 18547927D8BAD627CE1F2767 /* Pods-environment.h */,
+ E2B7684424038D4C151FBB37 /* Pods-frameworks.sh */,
+ DF8436795410709AD8A59E65 /* Pods-resources.sh */,
+ 41DF781F1D5A3BD5192A49E9 /* Pods-umbrella.h */,
+ BE72840BBC26E4AACDC7A559 /* Pods.debug.xcconfig */,
+ 0E1F5577F3CB2A1A816F4766 /* Pods.release.xcconfig */,
+ );
+ name = Pods;
+ path = "Target Support Files/Pods";
+ sourceTree = "<group>";
+ };
+ D2A210717D0CD3840C8071EA /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ E0D231B2CD70092197143783 /* OHHTTPStubs.h */,
+ 0A6726A194863F5663B3675B /* OHHTTPStubs.m */,
+ 657749B5FFBC67FB429EF8C8 /* OHHTTPStubs+NSURLSessionConfiguration.m */,
+ 86F20EE5AC3F660475C1B1C0 /* OHHTTPStubsResponse.h */,
+ 90935C1FB6D11C0CF2A1C0D0 /* OHHTTPStubsResponse.m */,
+ 0C4EA7ED7B1527D723F8E532 /* OHHTTPStubsResponse+HTTPMessage.h */,
+ 1BCF165693C58B3CF965CBD9 /* OHHTTPStubsResponse+HTTPMessage.m */,
+ 5F033017DBD2D340A327913A /* OHHTTPStubsResponse+JSON.h */,
+ B78D37976D52B166349E5E6F /* OHHTTPStubsResponse+JSON.m */,
+ 5A996F9D34EDC707D02187F0 /* OHPathHelpers.h */,
+ 78DEBA4FE0386495BD23333C /* OHPathHelpers.m */,
+ );
+ path = Sources;
+ sourceTree = "<group>";
+ };
+ DB5D8EF15D472590591893B1 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ E9DC5D74566513AD12B939E0 /* OHHTTPStubs.framework */,
+ 3C4E18BA425FF99FB4BC94B2 /* Pods.framework */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ DE8EEB58B39A5A1D181D097D /* OHHTTPStubs */ = {
+ isa = PBXGroup;
+ children = (
+ E4D8AAB427BAAC84F3957D3F /* OHHTTPStubs */,
+ 77B40E05B7BF4D0C1E0E9964 /* Support Files */,
+ );
+ name = OHHTTPStubs;
+ path = ../../..;
+ sourceTree = "<group>";
+ };
+ E4D8AAB427BAAC84F3957D3F /* OHHTTPStubs */ = {
+ isa = PBXGroup;
+ children = (
+ D2A210717D0CD3840C8071EA /* Sources */,
+ );
+ path = OHHTTPStubs;
+ sourceTree = "<group>";
+ };
+ F83DE1D494882E34A62D48B1 = {
+ isa = PBXGroup;
+ children = (
+ 68E4D04F52C1DCB5E40CC71F /* Podfile */,
+ 5F05422CA8CFAC32170B6ED8 /* Development Pods */,
+ 06A88E21739F55C66513EA3C /* Frameworks */,
+ DB5D8EF15D472590591893B1 /* Products */,
+ 50BB6BBA29675CDD0CA50ED6 /* Targets Support Files */,
+ );
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 6109CBCD7C1C4DD48A864FB1 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ B9C7CAB43CDB46B8F62A9BEE /* OHHTTPStubs.h in Headers */,
+ 2A5F193F83B7231858F7168E /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
+ FA49795CDB854B8AF5215EA9 /* OHHTTPStubsResponse+JSON.h in Headers */,
+ 88E7C5F2FEE4A3B2BB0F62AC /* OHHTTPStubsResponse.h in Headers */,
+ EBF36E9C2568E24826C031B5 /* OHPathHelpers.h in Headers */,
+ DD462307456DA68D48B3DD09 /* Pods-OHHTTPStubs-umbrella.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6B304C1E935C3B6D384BFC1A /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F0720B4AF2F6D426ED586B80 /* Pods-umbrella.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 520A8502FB55654F3D44663F /* Pods */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 35920CD46DC6721D6B943E13 /* Build configuration list for PBXNativeTarget "Pods" */;
+ buildPhases = (
+ 87574F723CF88872A3710C10 /* Sources */,
+ BB29665972FBB8C2BDF6B926 /* Frameworks */,
+ 6B304C1E935C3B6D384BFC1A /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 3E902AAFC88492FC4CC25BCC /* PBXTargetDependency */,
+ );
+ name = Pods;
+ productName = Pods;
+ productReference = 3C4E18BA425FF99FB4BC94B2 /* Pods.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+ D30DD3818F4A6F62029AA2A7 /* Pods-OHHTTPStubs */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 9E320C31BC20443632AE890E /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs" */;
+ buildPhases = (
+ 70302128C9E296DA5A01A392 /* Sources */,
+ C668BD504E49E41CBCEF977A /* Frameworks */,
+ 6109CBCD7C1C4DD48A864FB1 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "Pods-OHHTTPStubs";
+ productName = "Pods-OHHTTPStubs";
+ productReference = E9DC5D74566513AD12B939E0 /* OHHTTPStubs.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ C2CBDA3936450283A6DE5391 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0640;
+ };
+ buildConfigurationList = 5DAD56263AD60CAD28B28D71 /* Build configuration list for PBXProject "Pods" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = F83DE1D494882E34A62D48B1;
+ productRefGroup = DB5D8EF15D472590591893B1 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 520A8502FB55654F3D44663F /* Pods */,
+ D30DD3818F4A6F62029AA2A7 /* Pods-OHHTTPStubs */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 70302128C9E296DA5A01A392 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FD0D1769D5FA62B3B81F4A7B /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
+ 025EDA37E7DE8225A36E9533 /* OHHTTPStubs.m in Sources */,
+ BF155DE6DF34A3513FD4E824 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
+ 075B64EB9838CF1EC0D30922 /* OHHTTPStubsResponse+JSON.m in Sources */,
+ FECF1D77B5EA6D3A14324E0E /* OHHTTPStubsResponse.m in Sources */,
+ 2838C1C53AE2A4B7A0CB6B2D /* OHPathHelpers.m in Sources */,
+ 166C7DCBA88C67DD08E2213F /* Pods-OHHTTPStubs-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 87574F723CF88872A3710C10 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 476FA37EB9E1E2550A09B791 /* Pods-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 3E902AAFC88492FC4CC25BCC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "Pods-OHHTTPStubs";
+ target = D30DD3818F4A6F62029AA2A7 /* Pods-OHHTTPStubs */;
+ targetProxy = C797270235A90C615B678C99 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 204E7D31CAF5A4F252A4D622 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 5C62297C51CB5C28BA2B8A3D /* Pods-OHHTTPStubs-Private.xcconfig */;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch";
+ INFOPLIST_FILE = "Target Support Files/Pods-OHHTTPStubs/Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MODULEMAP_FILE = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.modulemap";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ PRODUCT_NAME = OHHTTPStubs;
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Debug;
+ };
+ 2AE519C01027BBCA761BBBAC /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 5C62297C51CB5C28BA2B8A3D /* Pods-OHHTTPStubs-Private.xcconfig */;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch";
+ INFOPLIST_FILE = "Target Support Files/Pods-OHHTTPStubs/Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MODULEMAP_FILE = "Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.modulemap";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_NAME = OHHTTPStubs;
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Release;
+ };
+ 4C97FCFEC9543CEEE63EBFA1 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BE72840BBC26E4AACDC7A559 /* Pods.debug.xcconfig */;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ INFOPLIST_FILE = "Target Support Files/Pods/Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = Pods;
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Debug;
+ };
+ 4E419842EB75B63AB6EB7CD9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 0E1F5577F3CB2A1A816F4766 /* Pods.release.xcconfig */;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ CURRENT_PROJECT_VERSION = 1;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ INFOPLIST_FILE = "Target Support Files/Pods/Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = Pods;
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Release;
+ };
+ 8B7B96657207941542B8A42E /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = "${SRCROOT}/../build";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ F3155A251F8FB27D033C80B7 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ ONLY_ACTIVE_ARCH = YES;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = "${SRCROOT}/../build";
+ };
+ name = Debug;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 35920CD46DC6721D6B943E13 /* Build configuration list for PBXNativeTarget "Pods" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 4C97FCFEC9543CEEE63EBFA1 /* Debug */,
+ 4E419842EB75B63AB6EB7CD9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5DAD56263AD60CAD28B28D71 /* Build configuration list for PBXProject "Pods" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F3155A251F8FB27D033C80B7 /* Debug */,
+ 8B7B96657207941542B8A42E /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 9E320C31BC20443632AE890E /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 204E7D31CAF5A4F252A4D622 /* Debug */,
+ 2AE519C01027BBCA761BBBAC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = C2CBDA3936450283A6DE5391 /* Project object */;
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Info.plist b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Info.plist
new file mode 100644
index 0000000000..c10e7eab4f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>4.0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>${CURRENT_PROJECT_VERSION}</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig
new file mode 100644
index 0000000000..56b72965aa
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-Private.xcconfig
@@ -0,0 +1,9 @@
+#include "Pods-OHHTTPStubs.xcconfig"
+CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
+FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH"
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/OHHTTPStubs" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/OHHTTPStubs"
+OTHER_LDFLAGS = ${PODS_OHHTTPSTUBS_OTHER_LDFLAGS} -ObjC
+PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods
+PODS_ROOT = ${SRCROOT}
+SKIP_INSTALL = YES \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m
new file mode 100644
index 0000000000..6e93a65cc8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods_OHHTTPStubs : NSObject
+@end
+@implementation PodsDummy_Pods_OHHTTPStubs
+@end
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch
new file mode 100644
index 0000000000..95cf11d9fb
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-prefix.pch
@@ -0,0 +1,5 @@
+#ifdef __OBJC__
+#import <UIKit/UIKit.h>
+#endif
+
+#import "Pods-environment.h"
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-umbrella.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-umbrella.h
new file mode 100644
index 0000000000..28cfb1c4c0
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs-umbrella.h
@@ -0,0 +1,11 @@
+#import <UIKit/UIKit.h>
+
+#import "OHHTTPStubs.h"
+#import "OHHTTPStubsResponse+HTTPMessage.h"
+#import "OHHTTPStubsResponse+JSON.h"
+#import "OHHTTPStubsResponse.h"
+#import "OHPathHelpers.h"
+
+FOUNDATION_EXPORT double OHHTTPStubsVersionNumber;
+FOUNDATION_EXPORT const unsigned char OHHTTPStubsVersionString[];
+
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.modulemap b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.modulemap
new file mode 100644
index 0000000000..efe706e390
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.modulemap
@@ -0,0 +1,6 @@
+framework module OHHTTPStubs {
+ umbrella header "Pods-OHHTTPStubs-umbrella.h"
+
+ export *
+ module * { export * }
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig
new file mode 100644
index 0000000000..de1d241adc
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubs/Pods-OHHTTPStubs.xcconfig
@@ -0,0 +1 @@
+PODS_OHHTTPSTUBS_OTHER_LDFLAGS = -framework "CFNetwork" -framework "Foundation" \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Info.plist b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Info.plist
new file mode 100644
index 0000000000..6974542586
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>${CURRENT_PROJECT_VERSION}</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown
new file mode 100644
index 0000000000..79d3603ad7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown
@@ -0,0 +1,15 @@
+# Acknowledgements
+This application makes use of the following third party libraries:
+
+## OHHTTPStubs
+
+- MIT LICENSE -
+
+Copyright (c) 2012 Olivier Halligon
+
+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.
+Generated by CocoaPods - http://cocoapods.org
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.plist
new file mode 100644
index 0000000000..756aa4392a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-acknowledgements.plist
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PreferenceSpecifiers</key>
+ <array>
+ <dict>
+ <key>FooterText</key>
+ <string>This application makes use of the following third party libraries:</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>- MIT LICENSE -
+
+Copyright (c) 2012 Olivier Halligon
+
+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.</string>
+ <key>Title</key>
+ <string>OHHTTPStubs</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>Generated by CocoaPods - http://cocoapods.org</string>
+ <key>Title</key>
+ <string></string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ </array>
+ <key>StringsTable</key>
+ <string>Acknowledgements</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-dummy.m b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-dummy.m
new file mode 100644
index 0000000000..ade64bd1a9
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods : NSObject
+@end
+@implementation PodsDummy_Pods
+@end
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-environment.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-environment.h
new file mode 100644
index 0000000000..5918510c4e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-environment.h
@@ -0,0 +1,14 @@
+
+// To check if a library is compiled with CocoaPods you
+// can use the `COCOAPODS` macro definition which is
+// defined in the xcconfigs so it is available in
+// headers also when they are imported in the client
+// project.
+
+
+// OHHTTPStubs
+#define COCOAPODS_POD_AVAILABLE_OHHTTPStubs
+#define COCOAPODS_VERSION_MAJOR_OHHTTPStubs 4
+#define COCOAPODS_VERSION_MINOR_OHHTTPStubs 0
+#define COCOAPODS_VERSION_PATCH_OHHTTPStubs 1
+
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-frameworks.sh b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-frameworks.sh
new file mode 100755
index 0000000000..5b176d2615
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-frameworks.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+set -e
+
+echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+
+SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
+
+install_framework()
+{
+ local source="${BUILT_PRODUCTS_DIR}/Pods/$1"
+ local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+
+ if [ -L "${source}" ]; then
+ echo "Symlinked..."
+ source=$(readlink "${source}")
+ fi
+
+ # use filter instead of exclude so missing patterns dont' throw errors
+ echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}"
+ rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}"
+ # Resign the code if required by the build settings to avoid unstable apps
+ if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
+ code_sign "${destination}/$1"
+ fi
+
+ # Embed linked Swift runtime libraries
+ local basename
+ basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]})
+ local swift_runtime_libs
+ swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
+ for lib in $swift_runtime_libs; do
+ echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
+ rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
+ if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
+ code_sign "${destination}/${lib}"
+ fi
+ done
+}
+
+# Signs a framework with the provided identity
+code_sign() {
+ # Use the current code_sign_identitiy
+ echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
+ echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
+ /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
+}
+
+
+if [[ "$CONFIGURATION" == "Debug" ]]; then
+ install_framework 'OHHTTPStubs.framework'
+fi
+if [[ "$CONFIGURATION" == "Release" ]]; then
+ install_framework 'OHHTTPStubs.framework'
+fi
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-resources.sh b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-resources.sh
new file mode 100755
index 0000000000..43f08523e1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-resources.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+set -e
+
+mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+
+RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
+> "$RESOURCES_TO_COPY"
+
+XCASSET_FILES=()
+
+realpath() {
+ DIRECTORY=$(cd "${1%/*}" && pwd)
+ FILENAME="${1##*/}"
+ echo "$DIRECTORY/$FILENAME"
+}
+
+install_resource()
+{
+ case $1 in
+ *.storyboard)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.xib)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.framework)
+ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ ;;
+ *.xcdatamodel)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
+ ;;
+ *.xcdatamodeld)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
+ ;;
+ *.xcmappingmodel)
+ echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
+ xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
+ ;;
+ *.xcassets)
+ ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
+ XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
+ ;;
+ /*)
+ echo "$1"
+ echo "$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ *)
+ echo "${PODS_ROOT}/$1"
+ echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ esac
+}
+
+rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+if [[ "${ACTION}" == "install" ]]; then
+ rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
+rm -f "$RESOURCES_TO_COPY"
+
+if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
+then
+ case "${TARGETED_DEVICE_FAMILY}" in
+ 1,2)
+ TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
+ ;;
+ 1)
+ TARGET_DEVICE_ARGS="--target-device iphone"
+ ;;
+ 2)
+ TARGET_DEVICE_ARGS="--target-device ipad"
+ ;;
+ *)
+ TARGET_DEVICE_ARGS="--target-device mac"
+ ;;
+ esac
+
+ # Find all other xcassets (this unfortunately includes those of path pods and other targets).
+ OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
+ while read line; do
+ if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
+ XCASSET_FILES+=("$line")
+ fi
+ done <<<"$OTHER_XCASSETS"
+
+ printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-umbrella.h b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-umbrella.h
new file mode 100644
index 0000000000..21dcfd2c21
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods-umbrella.h
@@ -0,0 +1,6 @@
+#import <UIKit/UIKit.h>
+
+
+FOUNDATION_EXPORT double PodsVersionNumber;
+FOUNDATION_EXPORT const unsigned char PodsVersionString[];
+
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.debug.xcconfig
new file mode 100644
index 0000000000..c7ebebe606
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.debug.xcconfig
@@ -0,0 +1,8 @@
+FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
+OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/OHHTTPStubs.framework/Headers"
+OTHER_LDFLAGS = $(inherited) -ObjC -framework "OHHTTPStubs"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.modulemap b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.modulemap
new file mode 100644
index 0000000000..8413413077
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.modulemap
@@ -0,0 +1,6 @@
+framework module Pods {
+ umbrella header "Pods-umbrella.h"
+
+ export *
+ module * { export * }
+}
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.release.xcconfig b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.release.xcconfig
new file mode 100644
index 0000000000..c7ebebe606
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Pods/Target Support Files/Pods/Pods.release.xcconfig
@@ -0,0 +1,8 @@
+FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
+OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/OHHTTPStubs.framework/Headers"
+OTHER_LDFLAGS = $(inherited) -ObjC -framework "OHHTTPStubs"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.jpg b/test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.jpg
new file mode 100644
index 0000000000..c42a21cd74
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.jpg
Binary files differ
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.txt b/test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.txt
new file mode 100644
index 0000000000..e662f91b23
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Stubs/stub.txt
@@ -0,0 +1,3 @@
+This is the text from your stub.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullam corper suscipit lobortis nisi ut aliquip ex ea commodo consequat. Duis te feugi facilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit au gue duis dolore te feugat nulla facilisi.
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Default-568h@2x.png b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Default-568h@2x.png
new file mode 100644
index 0000000000..0891b7aabf
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Default-568h@2x.png
Binary files differ
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Images.xcassets/AppIcon.appiconset/Contents.json b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Images.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000000..36d2c80d88
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,68 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Info.plist b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Info.plist
new file mode 100644
index 0000000000..29b20c32a7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/Info.plist
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.alisoftware.$(PRODUCT_NAME:rfc1034identifier)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+ <key>UIMainStoryboardFile</key>
+ <string>Main</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/LaunchScreen.xib b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/LaunchScreen.xib
new file mode 100644
index 0000000000..a9be7a994c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Examples/Swift/Supporting Files/LaunchScreen.xib
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
+ <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
+ </dependencies>
+ <objects>
+ <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+ <view contentMode="scaleToFill" id="iN0-l3-epB">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 AliSoftware. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
+ <rect key="frame" x="20" y="439" width="441" height="21"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="OHHTTPStubsDemo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
+ <rect key="frame" x="20" y="140" width="441" height="43"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
+ <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
+ <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
+ <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
+ <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
+ <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
+ </constraints>
+ <nil key="simulatedStatusBarMetrics"/>
+ <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+ <point key="canvasLocation" x="548" y="455"/>
+ </view>
+ </objects>
+</document>
diff --git a/test/ios/OHHTTPStubs/LICENSE b/test/ios/OHHTTPStubs/LICENSE
new file mode 100644
index 0000000000..a83928dd2e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/LICENSE
@@ -0,0 +1,9 @@
+- MIT LICENSE -
+
+Copyright (c) 2012 Olivier Halligon
+
+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. \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs.podspec b/test/ios/OHHTTPStubs/OHHTTPStubs.podspec
new file mode 100644
index 0000000000..ffa5e93abc
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs.podspec
@@ -0,0 +1,37 @@
+Pod::Spec.new do |s|
+
+ s.name = "OHHTTPStubs"
+ s.version = "4.0.1"
+
+ s.summary = "Framework to stub your network requests like HTTP and help you write network unit tests with XCTest."
+ s.description = <<-DESC.gsub(/^ +\|/,'')
+ |A class to stub network requests easily:
+ |
+ | * Test your apps with fake network data (stubbed from file)
+ | * You can also customize your response headers and status code
+ | * Use customized stubs depending on the requests
+ | * Use custom response time to simulate slow network.
+ | * This works with any request (HTTP, HTTPS, or any protocol) sent using
+ | the iOS URL Loading System (NSURLConnection, NSURLSession, AFNetworking, …)
+ | * This is really useful in unit testing, when you need to test network features
+ | but don't want to hit the real network and fake some response data instead.
+ | * Has useful convenience methods to stub JSON content or fixture from a file
+ | * Compatible with Swift
+ DESC
+
+ s.homepage = "https://github.com/AliSoftware/OHHTTPStubs"
+ s.license = "MIT"
+ s.authors = { 'Olivier Halligon' => 'olivier.halligon+ae@gmail.com' }
+
+ s.source = { :git => "https://github.com/AliSoftware/OHHTTPStubs.git", :tag => s.version.to_s }
+
+ s.source_files = "OHHTTPStubs/Sources/*.{h,m}"
+ s.public_header_files = "OHHTTPStubs/Sources/*.h"
+
+ s.frameworks = 'Foundation', 'CFNetwork'
+
+ s.requires_arc = true
+ s.ios.deployment_target = '5.0'
+ s.osx.deployment_target = '10.7'
+
+end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..39f1c86074
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj
@@ -0,0 +1,1021 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 09110A4519805F4800D175E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09110A4419805F4800D175E4 /* Foundation.framework */; };
+ 09110A5319805F4800D175E4 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09110A5219805F4800D175E4 /* XCTest.framework */; };
+ 09110A5419805F4800D175E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09110A4419805F4800D175E4 /* Foundation.framework */; };
+ 09110A5919805F4800D175E4 /* libOHHTTPStubs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 09110A4119805F4800D175E4 /* libOHHTTPStubs.a */; };
+ 09110A6C1980605A00D175E4 /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A6B1980605A00D175E4 /* OHHTTPStubs.m */; };
+ 09110A741980606A00D175E4 /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A6F1980606A00D175E4 /* OHHTTPStubsResponse.m */; };
+ 09110A751980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A711980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m */; };
+ 09110A761980606A00D175E4 /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A731980606A00D175E4 /* OHHTTPStubsResponse+JSON.m */; };
+ 09110A791980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A781980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m */; };
+ 095981881980682800807DBE /* AFNetworkingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 095981481980668E00807DBE /* AFNetworkingTests.m */; };
+ 095981891980682E00807DBE /* NilValuesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 095981491980668E00807DBE /* NilValuesTests.m */; };
+ 0959818A1980682E00807DBE /* NSURLConnectionDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814A1980668E00807DBE /* NSURLConnectionDelegateTests.m */; };
+ 0959818B1980682E00807DBE /* NSURLConnectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814B1980668E00807DBE /* NSURLConnectionTests.m */; };
+ 0959818C1980682E00807DBE /* NSURLSessionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814C1980668E00807DBE /* NSURLSessionTests.m */; };
+ 0959818D1980682E00807DBE /* TimingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814D1980668E00807DBE /* TimingTests.m */; };
+ 0959818E1980682E00807DBE /* WithContentsOfURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814E1980668E00807DBE /* WithContentsOfURLTests.m */; };
+ 095981D319806A7900807DBE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09110A5219805F4800D175E4 /* XCTest.framework */; };
+ 095981D719806A7900807DBE /* OHHTTPStubs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 095981C219806A7900807DBE /* OHHTTPStubs.framework */; };
+ 095981EF19806AA200807DBE /* NilValuesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 095981491980668E00807DBE /* NilValuesTests.m */; };
+ 095981F019806AA200807DBE /* NSURLConnectionDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814A1980668E00807DBE /* NSURLConnectionDelegateTests.m */; };
+ 095981F119806AA200807DBE /* NSURLConnectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814B1980668E00807DBE /* NSURLConnectionTests.m */; };
+ 095981F219806AA200807DBE /* NSURLSessionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814C1980668E00807DBE /* NSURLSessionTests.m */; };
+ 095981F319806AA200807DBE /* TimingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814D1980668E00807DBE /* TimingTests.m */; };
+ 095981F419806AA200807DBE /* WithContentsOfURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0959814E1980668E00807DBE /* WithContentsOfURLTests.m */; };
+ 095981F619806AAC00807DBE /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A6B1980605A00D175E4 /* OHHTTPStubs.m */; };
+ 095981F719806AAC00807DBE /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A6F1980606A00D175E4 /* OHHTTPStubsResponse.m */; };
+ 095981F819806AAC00807DBE /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A711980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m */; };
+ 095981F919806AAC00807DBE /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A731980606A00D175E4 /* OHHTTPStubsResponse+JSON.m */; };
+ 095981FA19806AAC00807DBE /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A781980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m */; };
+ 095981FB19806AB700807DBE /* OHHTTPStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A6A1980605A00D175E4 /* OHHTTPStubs.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 095981FC19806AF300807DBE /* OHHTTPStubs.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 09110A6A1980605A00D175E4 /* OHHTTPStubs.h */; };
+ 095981FD19806AF300807DBE /* OHHTTPStubsResponse.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 09110A6E1980606A00D175E4 /* OHHTTPStubsResponse.h */; };
+ 095981FE19806AF300807DBE /* OHHTTPStubsResponse+HTTPMessage.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 09110A701980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.h */; };
+ 095981FF19806AF300807DBE /* OHHTTPStubsResponse+JSON.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 09110A721980606A00D175E4 /* OHHTTPStubsResponse+JSON.h */; };
+ 0959820019806B1700807DBE /* OHHTTPStubsResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A6E1980606A00D175E4 /* OHHTTPStubsResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 0959820119806B1E00807DBE /* OHHTTPStubsResponse+HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A701980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 0959820219806B2200807DBE /* OHHTTPStubsResponse+JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A721980606A00D175E4 /* OHHTTPStubsResponse+JSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 095B1AD51AE30BA7009D1B56 /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 095B1AD41AE30BA7009D1B56 /* OHPathHelpers.m */; };
+ 095B1AD61AE3138C009D1B56 /* OHPathHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 095B1AD31AE30BA7009D1B56 /* OHPathHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 095B1AD71AE3138C009D1B56 /* OHPathHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 095B1AD31AE30BA7009D1B56 /* OHPathHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 095B1AD81AE31395009D1B56 /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 095B1AD41AE30BA7009D1B56 /* OHPathHelpers.m */; };
+ 095B1AD91AE31396009D1B56 /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 095B1AD41AE30BA7009D1B56 /* OHPathHelpers.m */; };
+ 095B1ADA1AE313E0009D1B56 /* OHPathHelpers.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 095B1AD31AE30BA7009D1B56 /* OHPathHelpers.h */; };
+ 0DB397E35DDB6808A5496D53 /* libPods-OHHTTPStubs Mac Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F49690D948DE88BBB4A36B11 /* libPods-OHHTTPStubs Mac Tests.a */; };
+ 47AF337B1A3775B600158C9F /* emptyfile.json in Resources */ = {isa = PBXBuildFile; fileRef = 47AF337A1A37757B00158C9F /* emptyfile.json */; };
+ 47AF337C1A3775B600158C9F /* emptyfile.json in Resources */ = {isa = PBXBuildFile; fileRef = 47AF337A1A37757B00158C9F /* emptyfile.json */; };
+ 4DD13AB8422F0151AF227209 /* libPods-OHHTTPStubs iOS Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 446DA13BA37A8466FF4F9D35 /* libPods-OHHTTPStubs iOS Tests.a */; };
+ 725CD9B41A9EB6F600F84C8B /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A6B1980605A00D175E4 /* OHHTTPStubs.m */; };
+ 725CD9B51A9EB6F800F84C8B /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A6F1980606A00D175E4 /* OHHTTPStubsResponse.m */; };
+ 725CD9B61A9EB6FA00F84C8B /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A711980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m */; };
+ 725CD9B71A9EB6FD00F84C8B /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A731980606A00D175E4 /* OHHTTPStubsResponse+JSON.m */; };
+ 725CD9B81A9EB70000F84C8B /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 09110A781980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m */; };
+ 725CD9B91A9EB71000F84C8B /* OHHTTPStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A6A1980605A00D175E4 /* OHHTTPStubs.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 725CD9BA1A9EB71500F84C8B /* OHHTTPStubsResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A6E1980606A00D175E4 /* OHHTTPStubsResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 725CD9BB1A9EB71A00F84C8B /* OHHTTPStubsResponse+JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A721980606A00D175E4 /* OHHTTPStubsResponse+JSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 725CD9BC1A9EB71D00F84C8B /* OHHTTPStubsResponse+HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 09110A701980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 09110A5719805F4800D175E4 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 09110A3919805F4800D175E4 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 09110A4019805F4800D175E4;
+ remoteInfo = "OHHTTPStubs iOS";
+ };
+ 095981D519806A7900807DBE /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 09110A3919805F4800D175E4 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 095981C119806A7900807DBE;
+ remoteInfo = "OHHTTPStubs Mac";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 09110A3F19805F4800D175E4 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "include/$(PRODUCT_NAME)";
+ dstSubfolderSpec = 16;
+ files = (
+ 095B1ADA1AE313E0009D1B56 /* OHPathHelpers.h in CopyFiles */,
+ 095981FC19806AF300807DBE /* OHHTTPStubs.h in CopyFiles */,
+ 095981FD19806AF300807DBE /* OHHTTPStubsResponse.h in CopyFiles */,
+ 095981FE19806AF300807DBE /* OHHTTPStubsResponse+HTTPMessage.h in CopyFiles */,
+ 095981FF19806AF300807DBE /* OHHTTPStubsResponse+JSON.h in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 09110A4119805F4800D175E4 /* libOHHTTPStubs.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOHHTTPStubs.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 09110A4419805F4800D175E4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 09110A5119805F4800D175E4 /* OHHTTPStubs iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OHHTTPStubs iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 09110A5219805F4800D175E4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+ 09110A6A1980605A00D175E4 /* OHHTTPStubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubs.h; sourceTree = "<group>"; };
+ 09110A6B1980605A00D175E4 /* OHHTTPStubs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubs.m; sourceTree = "<group>"; };
+ 09110A6E1980606A00D175E4 /* OHHTTPStubsResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OHHTTPStubsResponse.h; sourceTree = "<group>"; };
+ 09110A6F1980606A00D175E4 /* OHHTTPStubsResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OHHTTPStubsResponse.m; sourceTree = "<group>"; };
+ 09110A701980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+HTTPMessage.h"; sourceTree = "<group>"; };
+ 09110A711980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+HTTPMessage.m"; sourceTree = "<group>"; };
+ 09110A721980606A00D175E4 /* OHHTTPStubsResponse+JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OHHTTPStubsResponse+JSON.h"; sourceTree = "<group>"; };
+ 09110A731980606A00D175E4 /* OHHTTPStubsResponse+JSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubsResponse+JSON.m"; sourceTree = "<group>"; };
+ 09110A781980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OHHTTPStubs+NSURLSessionConfiguration.m"; sourceTree = "<group>"; };
+ 095981451980657C00807DBE /* UnitTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "UnitTests-Info.plist"; sourceTree = "<group>"; };
+ 095981471980665400807DBE /* UnitTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UnitTests-Prefix.pch"; sourceTree = "<group>"; };
+ 095981481980668E00807DBE /* AFNetworkingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFNetworkingTests.m; path = "Test Suites/AFNetworkingTests.m"; sourceTree = "<group>"; };
+ 095981491980668E00807DBE /* NilValuesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NilValuesTests.m; path = "Test Suites/NilValuesTests.m"; sourceTree = "<group>"; };
+ 0959814A1980668E00807DBE /* NSURLConnectionDelegateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSURLConnectionDelegateTests.m; path = "Test Suites/NSURLConnectionDelegateTests.m"; sourceTree = "<group>"; };
+ 0959814B1980668E00807DBE /* NSURLConnectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSURLConnectionTests.m; path = "Test Suites/NSURLConnectionTests.m"; sourceTree = "<group>"; };
+ 0959814C1980668E00807DBE /* NSURLSessionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSURLSessionTests.m; path = "Test Suites/NSURLSessionTests.m"; sourceTree = "<group>"; };
+ 0959814D1980668E00807DBE /* TimingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TimingTests.m; path = "Test Suites/TimingTests.m"; sourceTree = "<group>"; };
+ 0959814E1980668E00807DBE /* WithContentsOfURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WithContentsOfURLTests.m; path = "Test Suites/WithContentsOfURLTests.m"; sourceTree = "<group>"; };
+ 0959819819806A4200807DBE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 0959819919806A4200807DBE /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ 0959819A19806A4200807DBE /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 095981C219806A7900807DBE /* OHHTTPStubs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OHHTTPStubs.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 095981C619806A7900807DBE /* OHHTTPStubs Mac-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OHHTTPStubs Mac-Info.plist"; sourceTree = "<group>"; };
+ 095981D219806A7900807DBE /* OHHTTPStubs Mac Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OHHTTPStubs Mac Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 095B1AD31AE30BA7009D1B56 /* OHPathHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OHPathHelpers.h; sourceTree = "<group>"; };
+ 095B1AD41AE30BA7009D1B56 /* OHPathHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OHPathHelpers.m; sourceTree = "<group>"; };
+ 0F72EA0B0A785AE724116B35 /* Pods-OHHTTPStubs iOS Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs iOS Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.debug.xcconfig"; sourceTree = "<group>"; };
+ 446DA13BA37A8466FF4F9D35 /* libPods-OHHTTPStubs iOS Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs iOS Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 47AF337A1A37757B00158C9F /* emptyfile.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = emptyfile.json; sourceTree = "<group>"; };
+ 725CD99B1A9EB65100F84C8B /* OHHTTPStubs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OHHTTPStubs.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 8DB8134EA435816E00804074 /* Pods-OHHTTPStubs iOS Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs iOS Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.release.xcconfig"; sourceTree = "<group>"; };
+ B11995FF7A5A81D0A322D6FA /* Pods-OHHTTPStubs Mac Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs Mac Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.debug.xcconfig"; sourceTree = "<group>"; };
+ E2483255B84CAC7897D6E98C /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs Mac Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.release.xcconfig"; sourceTree = "<group>"; };
+ F49690D948DE88BBB4A36B11 /* libPods-OHHTTPStubs Mac Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs Mac Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 09110A3E19805F4800D175E4 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 09110A4519805F4800D175E4 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 09110A4E19805F4800D175E4 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 09110A5319805F4800D175E4 /* XCTest.framework in Frameworks */,
+ 09110A5919805F4800D175E4 /* libOHHTTPStubs.a in Frameworks */,
+ 09110A5419805F4800D175E4 /* Foundation.framework in Frameworks */,
+ 4DD13AB8422F0151AF227209 /* libPods-OHHTTPStubs iOS Tests.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 095981BE19806A7900807DBE /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 095981CF19806A7900807DBE /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 095981D719806A7900807DBE /* OHHTTPStubs.framework in Frameworks */,
+ 095981D319806A7900807DBE /* XCTest.framework in Frameworks */,
+ 0DB397E35DDB6808A5496D53 /* libPods-OHHTTPStubs Mac Tests.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 725CD9971A9EB65100F84C8B /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 09110A3819805F4800D175E4 = {
+ isa = PBXGroup;
+ children = (
+ 09110A4619805F4800D175E4 /* OHHTTPStubs */,
+ 095981C519806A7900807DBE /* Supporting Files */,
+ 09110A5A19805F4800D175E4 /* UnitTests */,
+ 09110A4319805F4800D175E4 /* Frameworks */,
+ 09110A4219805F4800D175E4 /* Products */,
+ 69EB7ED77E3A41F78D65093A /* Pods */,
+ );
+ sourceTree = "<group>";
+ };
+ 09110A4219805F4800D175E4 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 09110A4119805F4800D175E4 /* libOHHTTPStubs.a */,
+ 09110A5119805F4800D175E4 /* OHHTTPStubs iOS Tests.xctest */,
+ 095981C219806A7900807DBE /* OHHTTPStubs.framework */,
+ 095981D219806A7900807DBE /* OHHTTPStubs Mac Tests.xctest */,
+ 725CD99B1A9EB65100F84C8B /* OHHTTPStubs.framework */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 09110A4319805F4800D175E4 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 09110A4419805F4800D175E4 /* Foundation.framework */,
+ 09110A5219805F4800D175E4 /* XCTest.framework */,
+ 0959819719806A4200807DBE /* Other Frameworks */,
+ F49690D948DE88BBB4A36B11 /* libPods-OHHTTPStubs Mac Tests.a */,
+ 446DA13BA37A8466FF4F9D35 /* libPods-OHHTTPStubs iOS Tests.a */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 09110A4619805F4800D175E4 /* OHHTTPStubs */ = {
+ isa = PBXGroup;
+ children = (
+ 09110A6A1980605A00D175E4 /* OHHTTPStubs.h */,
+ 09110A6B1980605A00D175E4 /* OHHTTPStubs.m */,
+ 09110A6D1980605D00D175E4 /* OHHTTPStubsResponse */,
+ 09110A771980607200D175E4 /* NSURLSession Support */,
+ 095B1AD31AE30BA7009D1B56 /* OHPathHelpers.h */,
+ 095B1AD41AE30BA7009D1B56 /* OHPathHelpers.m */,
+ );
+ name = OHHTTPStubs;
+ path = Sources;
+ sourceTree = "<group>";
+ };
+ 09110A5A19805F4800D175E4 /* UnitTests */ = {
+ isa = PBXGroup;
+ children = (
+ 47AF33791A37755E00158C9F /* Fixtures */,
+ 095981461980663000807DBE /* Test Suites */,
+ 09110A5B19805F4800D175E4 /* Supporting Files */,
+ );
+ path = UnitTests;
+ sourceTree = "<group>";
+ };
+ 09110A5B19805F4800D175E4 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 095981471980665400807DBE /* UnitTests-Prefix.pch */,
+ 095981451980657C00807DBE /* UnitTests-Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 09110A6D1980605D00D175E4 /* OHHTTPStubsResponse */ = {
+ isa = PBXGroup;
+ children = (
+ 09110A6E1980606A00D175E4 /* OHHTTPStubsResponse.h */,
+ 09110A6F1980606A00D175E4 /* OHHTTPStubsResponse.m */,
+ 09110A701980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.h */,
+ 09110A711980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m */,
+ 09110A721980606A00D175E4 /* OHHTTPStubsResponse+JSON.h */,
+ 09110A731980606A00D175E4 /* OHHTTPStubsResponse+JSON.m */,
+ );
+ name = OHHTTPStubsResponse;
+ sourceTree = "<group>";
+ };
+ 09110A771980607200D175E4 /* NSURLSession Support */ = {
+ isa = PBXGroup;
+ children = (
+ 09110A781980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m */,
+ );
+ name = "NSURLSession Support";
+ sourceTree = "<group>";
+ };
+ 095981461980663000807DBE /* Test Suites */ = {
+ isa = PBXGroup;
+ children = (
+ 095981481980668E00807DBE /* AFNetworkingTests.m */,
+ 095981491980668E00807DBE /* NilValuesTests.m */,
+ 0959814A1980668E00807DBE /* NSURLConnectionDelegateTests.m */,
+ 0959814B1980668E00807DBE /* NSURLConnectionTests.m */,
+ 0959814C1980668E00807DBE /* NSURLSessionTests.m */,
+ 0959814D1980668E00807DBE /* TimingTests.m */,
+ 0959814E1980668E00807DBE /* WithContentsOfURLTests.m */,
+ );
+ name = "Test Suites";
+ sourceTree = "<group>";
+ };
+ 0959819719806A4200807DBE /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 0959819819806A4200807DBE /* Foundation.framework */,
+ 0959819919806A4200807DBE /* CoreData.framework */,
+ 0959819A19806A4200807DBE /* AppKit.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 095981C519806A7900807DBE /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 095981C619806A7900807DBE /* OHHTTPStubs Mac-Info.plist */,
+ );
+ path = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 47AF33791A37755E00158C9F /* Fixtures */ = {
+ isa = PBXGroup;
+ children = (
+ 47AF337A1A37757B00158C9F /* emptyfile.json */,
+ );
+ path = Fixtures;
+ sourceTree = "<group>";
+ };
+ 69EB7ED77E3A41F78D65093A /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ B11995FF7A5A81D0A322D6FA /* Pods-OHHTTPStubs Mac Tests.debug.xcconfig */,
+ E2483255B84CAC7897D6E98C /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */,
+ 0F72EA0B0A785AE724116B35 /* Pods-OHHTTPStubs iOS Tests.debug.xcconfig */,
+ 8DB8134EA435816E00804074 /* Pods-OHHTTPStubs iOS Tests.release.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 095981BF19806A7900807DBE /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0959820219806B2200807DBE /* OHHTTPStubsResponse+JSON.h in Headers */,
+ 0959820119806B1E00807DBE /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
+ 0959820019806B1700807DBE /* OHHTTPStubsResponse.h in Headers */,
+ 095B1AD71AE3138C009D1B56 /* OHPathHelpers.h in Headers */,
+ 095981FB19806AB700807DBE /* OHHTTPStubs.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 725CD9981A9EB65100F84C8B /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 725CD9B91A9EB71000F84C8B /* OHHTTPStubs.h in Headers */,
+ 725CD9BA1A9EB71500F84C8B /* OHHTTPStubsResponse.h in Headers */,
+ 725CD9BB1A9EB71A00F84C8B /* OHHTTPStubsResponse+JSON.h in Headers */,
+ 725CD9BC1A9EB71D00F84C8B /* OHHTTPStubsResponse+HTTPMessage.h in Headers */,
+ 095B1AD61AE3138C009D1B56 /* OHPathHelpers.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 09110A4019805F4800D175E4 /* OHHTTPStubs iOS StaticLib */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 09110A6419805F4800D175E4 /* Build configuration list for PBXNativeTarget "OHHTTPStubs iOS StaticLib" */;
+ buildPhases = (
+ 09110A3D19805F4800D175E4 /* Sources */,
+ 09110A3E19805F4800D175E4 /* Frameworks */,
+ 09110A3F19805F4800D175E4 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "OHHTTPStubs iOS StaticLib";
+ productName = OHHTTPStubs;
+ productReference = 09110A4119805F4800D175E4 /* libOHHTTPStubs.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 09110A5019805F4800D175E4 /* OHHTTPStubs iOS Tests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 09110A6719805F4800D175E4 /* Build configuration list for PBXNativeTarget "OHHTTPStubs iOS Tests" */;
+ buildPhases = (
+ 7F432602D77FABAF29E05AA8 /* Check Pods Manifest.lock */,
+ 09110A4D19805F4800D175E4 /* Sources */,
+ 09110A4E19805F4800D175E4 /* Frameworks */,
+ 09110A4F19805F4800D175E4 /* Resources */,
+ 2E71B8D8A7ECD8287E0E81D5 /* Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 09110A5819805F4800D175E4 /* PBXTargetDependency */,
+ );
+ name = "OHHTTPStubs iOS Tests";
+ productName = OHHTTPStubsTests;
+ productReference = 09110A5119805F4800D175E4 /* OHHTTPStubs iOS Tests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 095981C119806A7900807DBE /* OHHTTPStubs Mac Framework */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 095981E019806A7900807DBE /* Build configuration list for PBXNativeTarget "OHHTTPStubs Mac Framework" */;
+ buildPhases = (
+ 095981BD19806A7900807DBE /* Sources */,
+ 095981BE19806A7900807DBE /* Frameworks */,
+ 095981BF19806A7900807DBE /* Headers */,
+ 095981C019806A7900807DBE /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "OHHTTPStubs Mac Framework";
+ productName = "OHHTTPStubs Mac";
+ productReference = 095981C219806A7900807DBE /* OHHTTPStubs.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+ 095981D119806A7900807DBE /* OHHTTPStubs Mac Tests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 095981E319806A7900807DBE /* Build configuration list for PBXNativeTarget "OHHTTPStubs Mac Tests" */;
+ buildPhases = (
+ 752F2AD343353136781BDAB2 /* Check Pods Manifest.lock */,
+ 095981CE19806A7900807DBE /* Sources */,
+ 095981CF19806A7900807DBE /* Frameworks */,
+ 095981D019806A7900807DBE /* Resources */,
+ BF1C89AB0FF2DD0E338DD44E /* Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 095981D619806A7900807DBE /* PBXTargetDependency */,
+ );
+ name = "OHHTTPStubs Mac Tests";
+ productName = "OHHTTPStubs Mac Tests";
+ productReference = 095981D219806A7900807DBE /* OHHTTPStubs Mac Tests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 725CD99A1A9EB65100F84C8B /* OHHTTPStubs iOS Framework */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 725CD9B21A9EB65200F84C8B /* Build configuration list for PBXNativeTarget "OHHTTPStubs iOS Framework" */;
+ buildPhases = (
+ 725CD9961A9EB65100F84C8B /* Sources */,
+ 725CD9971A9EB65100F84C8B /* Frameworks */,
+ 725CD9981A9EB65100F84C8B /* Headers */,
+ 725CD9991A9EB65100F84C8B /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "OHHTTPStubs iOS Framework";
+ productName = "OHHTTPStubs iOS Framework";
+ productReference = 725CD99B1A9EB65100F84C8B /* OHHTTPStubs.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 09110A3919805F4800D175E4 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0510;
+ ORGANIZATIONNAME = AliSoftware;
+ TargetAttributes = {
+ 09110A5019805F4800D175E4 = {
+ TestTargetID = 09110A4019805F4800D175E4;
+ };
+ 095981D119806A7900807DBE = {
+ TestTargetID = 095981C119806A7900807DBE;
+ };
+ 725CD99A1A9EB65100F84C8B = {
+ CreatedOnToolsVersion = 6.1.1;
+ };
+ };
+ };
+ buildConfigurationList = 09110A3C19805F4800D175E4 /* Build configuration list for PBXProject "OHHTTPStubs" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 09110A3819805F4800D175E4;
+ productRefGroup = 09110A4219805F4800D175E4 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 09110A4019805F4800D175E4 /* OHHTTPStubs iOS StaticLib */,
+ 09110A5019805F4800D175E4 /* OHHTTPStubs iOS Tests */,
+ 725CD99A1A9EB65100F84C8B /* OHHTTPStubs iOS Framework */,
+ 095981C119806A7900807DBE /* OHHTTPStubs Mac Framework */,
+ 095981D119806A7900807DBE /* OHHTTPStubs Mac Tests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 09110A4F19805F4800D175E4 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 47AF337B1A3775B600158C9F /* emptyfile.json in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 095981C019806A7900807DBE /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 095981D019806A7900807DBE /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 47AF337C1A3775B600158C9F /* emptyfile.json in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 725CD9991A9EB65100F84C8B /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 2E71B8D8A7ECD8287E0E81D5 /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 752F2AD343353136781BDAB2 /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ 7F432602D77FABAF29E05AA8 /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ BF1C89AB0FF2DD0E338DD44E /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 09110A3D19805F4800D175E4 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 09110A751980606A00D175E4 /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
+ 09110A761980606A00D175E4 /* OHHTTPStubsResponse+JSON.m in Sources */,
+ 09110A791980608600D175E4 /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
+ 09110A6C1980605A00D175E4 /* OHHTTPStubs.m in Sources */,
+ 09110A741980606A00D175E4 /* OHHTTPStubsResponse.m in Sources */,
+ 095B1AD51AE30BA7009D1B56 /* OHPathHelpers.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 09110A4D19805F4800D175E4 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0959818D1980682E00807DBE /* TimingTests.m in Sources */,
+ 0959818A1980682E00807DBE /* NSURLConnectionDelegateTests.m in Sources */,
+ 0959818E1980682E00807DBE /* WithContentsOfURLTests.m in Sources */,
+ 095981881980682800807DBE /* AFNetworkingTests.m in Sources */,
+ 0959818C1980682E00807DBE /* NSURLSessionTests.m in Sources */,
+ 0959818B1980682E00807DBE /* NSURLConnectionTests.m in Sources */,
+ 095981891980682E00807DBE /* NilValuesTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 095981BD19806A7900807DBE /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 095981F719806AAC00807DBE /* OHHTTPStubsResponse.m in Sources */,
+ 095981F819806AAC00807DBE /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
+ 095981F619806AAC00807DBE /* OHHTTPStubs.m in Sources */,
+ 095981F919806AAC00807DBE /* OHHTTPStubsResponse+JSON.m in Sources */,
+ 095981FA19806AAC00807DBE /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
+ 095B1AD91AE31396009D1B56 /* OHPathHelpers.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 095981CE19806A7900807DBE /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 095981F119806AA200807DBE /* NSURLConnectionTests.m in Sources */,
+ 095981F319806AA200807DBE /* TimingTests.m in Sources */,
+ 095981F419806AA200807DBE /* WithContentsOfURLTests.m in Sources */,
+ 095981EF19806AA200807DBE /* NilValuesTests.m in Sources */,
+ 095981F219806AA200807DBE /* NSURLSessionTests.m in Sources */,
+ 095981F019806AA200807DBE /* NSURLConnectionDelegateTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 725CD9961A9EB65100F84C8B /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 725CD9B41A9EB6F600F84C8B /* OHHTTPStubs.m in Sources */,
+ 725CD9B81A9EB70000F84C8B /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
+ 725CD9B51A9EB6F800F84C8B /* OHHTTPStubsResponse.m in Sources */,
+ 725CD9B71A9EB6FD00F84C8B /* OHHTTPStubsResponse+JSON.m in Sources */,
+ 725CD9B61A9EB6FA00F84C8B /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
+ 095B1AD81AE31395009D1B56 /* OHPathHelpers.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 09110A5819805F4800D175E4 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 09110A4019805F4800D175E4 /* OHHTTPStubs iOS StaticLib */;
+ targetProxy = 09110A5719805F4800D175E4 /* PBXContainerItemProxy */;
+ };
+ 095981D619806A7900807DBE /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 095981C119806A7900807DBE /* OHHTTPStubs Mac Framework */;
+ targetProxy = 095981D519806A7900807DBE /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 09110A6219805F4800D175E4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "XCODE_VERSION=$(XCODE_VERSION_MAJOR)",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 09110A6319805F4800D175E4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "XCODE_VERSION=$(XCODE_VERSION_MAJOR)",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 09110A6519805F4800D175E4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DSTROOT = /tmp/OHHTTPStubs.dst;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = OHHTTPStubs;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 09110A6619805F4800D175E4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DSTROOT = /tmp/OHHTTPStubs.dst;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = OHHTTPStubs;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ 09110A6819805F4800D175E4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 0F72EA0B0A785AE724116B35 /* Pods-OHHTTPStubs iOS Tests.debug.xcconfig */;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "UnitTests/UnitTests-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "UnitTests/UnitTests-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Debug;
+ };
+ 09110A6919805F4800D175E4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 8DB8134EA435816E00804074 /* Pods-OHHTTPStubs iOS Tests.release.xcconfig */;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "UnitTests/UnitTests-Prefix.pch";
+ INFOPLIST_FILE = "UnitTests/UnitTests-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Release;
+ };
+ 095981E119806A7900807DBE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ );
+ FRAMEWORK_VERSION = A;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "Supporting Files/OHHTTPStubs Mac-Info.plist";
+ INSTALL_PATH = "@rpath";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = OHHTTPStubs;
+ SDKROOT = macosx;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 095981E219806A7900807DBE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ );
+ FRAMEWORK_VERSION = A;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ INFOPLIST_FILE = "Supporting Files/OHHTTPStubs Mac-Info.plist";
+ INSTALL_PATH = "@rpath";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = OHHTTPStubs;
+ SDKROOT = macosx;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ 095981E419806A7900807DBE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = B11995FF7A5A81D0A322D6FA /* Pods-OHHTTPStubs Mac Tests.debug.xcconfig */;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "UnitTests/UnitTests-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Debug;
+ };
+ 095981E519806A7900807DBE /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = E2483255B84CAC7897D6E98C /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "UnitTests/UnitTests-Prefix.pch";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Release;
+ };
+ 725CD9AE1A9EB65200F84C8B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "Supporting Files/OHHTTPStubs iOS-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ PRODUCT_NAME = OHHTTPStubs;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 725CD9AF1A9EB65200F84C8B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ INFOPLIST_FILE = "Supporting Files/OHHTTPStubs iOS-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_NAME = OHHTTPStubs;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 09110A3C19805F4800D175E4 /* Build configuration list for PBXProject "OHHTTPStubs" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 09110A6219805F4800D175E4 /* Debug */,
+ 09110A6319805F4800D175E4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 09110A6419805F4800D175E4 /* Build configuration list for PBXNativeTarget "OHHTTPStubs iOS StaticLib" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 09110A6519805F4800D175E4 /* Debug */,
+ 09110A6619805F4800D175E4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 09110A6719805F4800D175E4 /* Build configuration list for PBXNativeTarget "OHHTTPStubs iOS Tests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 09110A6819805F4800D175E4 /* Debug */,
+ 09110A6919805F4800D175E4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 095981E019806A7900807DBE /* Build configuration list for PBXNativeTarget "OHHTTPStubs Mac Framework" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 095981E119806A7900807DBE /* Debug */,
+ 095981E219806A7900807DBE /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 095981E319806A7900807DBE /* Build configuration list for PBXNativeTarget "OHHTTPStubs Mac Tests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 095981E419806A7900807DBE /* Debug */,
+ 095981E519806A7900807DBE /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 725CD9B21A9EB65200F84C8B /* Build configuration list for PBXNativeTarget "OHHTTPStubs iOS Framework" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 725CD9AE1A9EB65200F84C8B /* Debug */,
+ 725CD9AF1A9EB65200F84C8B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 09110A3919805F4800D175E4 /* Project object */;
+}
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000000..25fccc6ba4
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:OHHTTPStubs.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme
new file mode 100644
index 0000000000..d9a07a32f3
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0630"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "095981C119806A7900807DBE"
+ BuildableName = "OHHTTPStubs.framework"
+ BlueprintName = "OHHTTPStubs Mac Framework"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "NO"
+ buildForProfiling = "NO"
+ buildForArchiving = "NO"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "095981D119806A7900807DBE"
+ BuildableName = "OHHTTPStubs Mac Tests.xctest"
+ BlueprintName = "OHHTTPStubs Mac Tests"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "095981D119806A7900807DBE"
+ BuildableName = "OHHTTPStubs Mac Tests.xctest"
+ BlueprintName = "OHHTTPStubs Mac Tests"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "095981C119806A7900807DBE"
+ BuildableName = "OHHTTPStubs.framework"
+ BlueprintName = "OHHTTPStubs Mac Framework"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Framework.xcscheme b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Framework.xcscheme
new file mode 100644
index 0000000000..92fa016742
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Framework.xcscheme
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0630"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "725CD99A1A9EB65100F84C8B"
+ BuildableName = "OHHTTPStubs.framework"
+ BlueprintName = "OHHTTPStubs iOS Framework"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "725CD99A1A9EB65100F84C8B"
+ BuildableName = "OHHTTPStubs.framework"
+ BlueprintName = "OHHTTPStubs iOS Framework"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "725CD99A1A9EB65100F84C8B"
+ BuildableName = "OHHTTPStubs.framework"
+ BlueprintName = "OHHTTPStubs iOS Framework"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "725CD99A1A9EB65100F84C8B"
+ BuildableName = "OHHTTPStubs.framework"
+ BlueprintName = "OHHTTPStubs iOS Framework"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme
new file mode 100644
index 0000000000..ae7c69efd4
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0630"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "09110A4019805F4800D175E4"
+ BuildableName = "libOHHTTPStubs.a"
+ BlueprintName = "OHHTTPStubs iOS StaticLib"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "NO"
+ buildForProfiling = "NO"
+ buildForArchiving = "NO"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "09110A5019805F4800D175E4"
+ BuildableName = "OHHTTPStubs iOS Tests.xctest"
+ BlueprintName = "OHHTTPStubs iOS Tests"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "09110A5019805F4800D175E4"
+ BuildableName = "OHHTTPStubs iOS Tests.xctest"
+ BlueprintName = "OHHTTPStubs iOS Tests"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "09110A4019805F4800D175E4"
+ BuildableName = "libOHHTTPStubs.a"
+ BlueprintName = "OHHTTPStubs iOS StaticLib"
+ ReferencedContainer = "container:OHHTTPStubs.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcworkspace/contents.xcworkspacedata b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000000..06ceb62b61
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/OHHTTPStubs.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "group:OHHTTPStubs.xcodeproj">
+ </FileRef>
+ <FileRef
+ location = "group:Pods/Pods.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Podfile b/test/ios/OHHTTPStubs/OHHTTPStubs/Podfile
new file mode 100644
index 0000000000..5e37ca8720
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Podfile
@@ -0,0 +1,14 @@
+source 'https://github.com/CocoaPods/Specs.git'
+
+xcodeproj 'OHHTTPStubs.xcodeproj'
+inhibit_all_warnings!
+
+target 'OHHTTPStubs iOS Tests' do
+ platform :ios, '6.0'
+ pod 'AFNetworking', '2.5.0'
+end
+
+target 'OHHTTPStubs Mac Tests' do
+ platform :osx, '10.8'
+ pod 'AFNetworking', '2.5.0'
+end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Podfile.lock b/test/ios/OHHTTPStubs/OHHTTPStubs/Podfile.lock
new file mode 100644
index 0000000000..c3fbbd33b4
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Podfile.lock
@@ -0,0 +1,30 @@
+PODS:
+ - AFNetworking (2.5.0):
+ - AFNetworking/NSURLConnection (= 2.5.0)
+ - AFNetworking/NSURLSession (= 2.5.0)
+ - AFNetworking/Reachability (= 2.5.0)
+ - AFNetworking/Security (= 2.5.0)
+ - AFNetworking/Serialization (= 2.5.0)
+ - AFNetworking/UIKit (= 2.5.0)
+ - AFNetworking/NSURLConnection (2.5.0):
+ - AFNetworking/Reachability
+ - AFNetworking/Security
+ - AFNetworking/Serialization
+ - AFNetworking/NSURLSession (2.5.0):
+ - AFNetworking/Reachability
+ - AFNetworking/Security
+ - AFNetworking/Serialization
+ - AFNetworking/Reachability (2.5.0)
+ - AFNetworking/Security (2.5.0)
+ - AFNetworking/Serialization (2.5.0)
+ - AFNetworking/UIKit (2.5.0):
+ - AFNetworking/NSURLConnection
+ - AFNetworking/NSURLSession
+
+DEPENDENCIES:
+ - AFNetworking (= 2.5.0)
+
+SPEC CHECKSUMS:
+ AFNetworking: 96ac9bf3eda33582701cb1fcc5b896aa1e20311e
+
+COCOAPODS: 0.37.0
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h
new file mode 100644
index 0000000000..dfa82f6691
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h
@@ -0,0 +1,67 @@
+// AFHTTPRequestOperation.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#import "AFURLConnectionOperation.h"
+
+/**
+ `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request.
+ */
+@interface AFHTTPRequestOperation : AFURLConnectionOperation
+
+///------------------------------------------------
+/// @name Getting HTTP URL Connection Information
+///------------------------------------------------
+
+/**
+ The last HTTP response received by the operation's connection.
+ */
+@property (readonly, nonatomic, strong) NSHTTPURLResponse *response;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed.
+
+ @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+/**
+ An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error.
+ */
+@property (readonly, nonatomic, strong) id responseObject;
+
+///-----------------------------------------------------------
+/// @name Setting Completion Block Success / Failure Callbacks
+///-----------------------------------------------------------
+
+/**
+ Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed.
+
+ This method should be overridden in subclasses in order to specify the response object passed into the success block.
+
+ @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request.
+ @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request.
+ */
+- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m
new file mode 100644
index 0000000000..1de5812ca1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m
@@ -0,0 +1,206 @@
+// AFHTTPRequestOperation.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFHTTPRequestOperation.h"
+
+static dispatch_queue_t http_request_operation_processing_queue() {
+ static dispatch_queue_t af_http_request_operation_processing_queue;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_http_request_operation_processing_queue = dispatch_queue_create("com.alamofire.networking.http-request.processing", DISPATCH_QUEUE_CONCURRENT);
+ });
+
+ return af_http_request_operation_processing_queue;
+}
+
+static dispatch_group_t http_request_operation_completion_group() {
+ static dispatch_group_t af_http_request_operation_completion_group;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_http_request_operation_completion_group = dispatch_group_create();
+ });
+
+ return af_http_request_operation_completion_group;
+}
+
+#pragma mark -
+
+@interface AFURLConnectionOperation ()
+@property (readwrite, nonatomic, strong) NSURLRequest *request;
+@property (readwrite, nonatomic, strong) NSURLResponse *response;
+@end
+
+@interface AFHTTPRequestOperation ()
+@property (readwrite, nonatomic, strong) NSHTTPURLResponse *response;
+@property (readwrite, nonatomic, strong) id responseObject;
+@property (readwrite, nonatomic, strong) NSError *responseSerializationError;
+@property (readwrite, nonatomic, strong) NSRecursiveLock *lock;
+@end
+
+@implementation AFHTTPRequestOperation
+@dynamic lock;
+
+- (instancetype)initWithRequest:(NSURLRequest *)urlRequest {
+ self = [super initWithRequest:urlRequest];
+ if (!self) {
+ return nil;
+ }
+
+ self.responseSerializer = [AFHTTPResponseSerializer serializer];
+
+ return self;
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+ NSParameterAssert(responseSerializer);
+
+ [self.lock lock];
+ _responseSerializer = responseSerializer;
+ self.responseObject = nil;
+ self.responseSerializationError = nil;
+ [self.lock unlock];
+}
+
+- (id)responseObject {
+ [self.lock lock];
+ if (!_responseObject && [self isFinished] && !self.error) {
+ NSError *error = nil;
+ self.responseObject = [self.responseSerializer responseObjectForResponse:self.response data:self.responseData error:&error];
+ if (error) {
+ self.responseSerializationError = error;
+ }
+ }
+ [self.lock unlock];
+
+ return _responseObject;
+}
+
+- (NSError *)error {
+ if (_responseSerializationError) {
+ return _responseSerializationError;
+ } else {
+ return [super error];
+ }
+}
+
+#pragma mark - AFHTTPRequestOperation
+
+- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-retain-cycles"
+#pragma clang diagnostic ignored "-Wgnu"
+ self.completionBlock = ^{
+ if (self.completionGroup) {
+ dispatch_group_enter(self.completionGroup);
+ }
+
+ dispatch_async(http_request_operation_processing_queue(), ^{
+ if (self.error) {
+ if (failure) {
+ dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{
+ failure(self, self.error);
+ });
+ }
+ } else {
+ id responseObject = self.responseObject;
+ if (self.error) {
+ if (failure) {
+ dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{
+ failure(self, self.error);
+ });
+ }
+ } else {
+ if (success) {
+ dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{
+ success(self, responseObject);
+ });
+ }
+ }
+ }
+
+ if (self.completionGroup) {
+ dispatch_group_leave(self.completionGroup);
+ }
+ });
+ };
+#pragma clang diagnostic pop
+}
+
+#pragma mark - AFURLRequestOperation
+
+- (void)pause {
+ [super pause];
+
+ u_int64_t offset = 0;
+ if ([self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey]) {
+ offset = [(NSNumber *)[self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedLongLongValue];
+ } else {
+ offset = [(NSData *)[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length];
+ }
+
+ NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy];
+ if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) {
+ [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"];
+ }
+ [mutableURLRequest setValue:[NSString stringWithFormat:@"bytes=%llu-", offset] forHTTPHeaderField:@"Range"];
+ self.request = mutableURLRequest;
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFHTTPRequestOperation *operation = [super copyWithZone:zone];
+
+ operation.responseSerializer = [self.responseSerializer copyWithZone:zone];
+ operation.completionQueue = self.completionQueue;
+ operation.completionGroup = self.completionGroup;
+
+ return operation;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h
new file mode 100644
index 0000000000..9f390294e2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h
@@ -0,0 +1,308 @@
+// AFHTTPRequestOperationManager.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+#import <Availability.h>
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+#import <MobileCoreServices/MobileCoreServices.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
+#import "AFHTTPRequestOperation.h"
+#import "AFURLResponseSerialization.h"
+#import "AFURLRequestSerialization.h"
+#import "AFSecurityPolicy.h"
+#import "AFNetworkReachabilityManager.h"
+
+/**
+ `AFHTTPRequestOperationManager` encapsulates the common patterns of communicating with a web application over HTTP, including request creation, response serialization, network reachability monitoring, and security, as well as request operation management.
+
+ ## Subclassing Notes
+
+ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
+
+ For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect.
+
+ ## Methods to Override
+
+ To change the behavior of all request operation construction for an `AFHTTPRequestOperationManager` subclass, override `HTTPRequestOperationWithRequest:success:failure`.
+
+ ## Serialization
+
+ Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`.
+
+ Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
+
+ ## URL Construction Using Relative Paths
+
+ For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`.
+
+ Below are a few examples of how `baseURL` and relative paths interact:
+
+ NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"];
+ [NSURL URLWithString:@"foo" relativeToURL:baseURL]; // http://example.com/v1/foo
+ [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL]; // http://example.com/v1/foo?bar=baz
+ [NSURL URLWithString:@"/foo" relativeToURL:baseURL]; // http://example.com/foo
+ [NSURL URLWithString:@"foo/" relativeToURL:baseURL]; // http://example.com/v1/foo
+ [NSURL URLWithString:@"/foo/" relativeToURL:baseURL]; // http://example.com/foo/
+ [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/
+
+ Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash.
+
+ ## Network Reachability Monitoring
+
+ Network reachability status and change monitoring is available through the `reachabilityManager` property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See `AFNetworkReachabilityManager` for more details.
+
+ ## NSSecureCoding & NSCopying Caveats
+
+ `AFHTTPRequestOperationManager` conforms to the `NSSecureCoding` and `NSCopying` protocols, allowing operations to be archived to disk, and copied in memory, respectively. There are a few minor caveats to keep in mind, however:
+
+ - Archives and copies of HTTP clients will be initialized with an empty operation queue.
+ - NSSecureCoding cannot serialize / deserialize block properties, so an archive of an HTTP client will not include any reachability callback block that may be set.
+ */
+@interface AFHTTPRequestOperationManager : NSObject <NSSecureCoding, NSCopying>
+
+/**
+ The URL used to monitor reachability, and construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
+ */
+@property (readonly, nonatomic, strong) NSURL *baseURL;
+
+/**
+ Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
+
+ @warning `requestSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to a JSON serializer, which serializes data from responses with a `application/json` MIME type, and falls back to the raw data object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed.
+
+ @warning `responseSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+/**
+ The operation queue on which request operations are scheduled and run.
+ */
+@property (nonatomic, strong) NSOperationQueue *operationQueue;
+
+///-------------------------------
+/// @name Managing URL Credentials
+///-------------------------------
+
+/**
+ Whether request operations should consult the credential storage for authenticating the connection. `YES` by default.
+
+ @see AFURLConnectionOperation -shouldUseCredentialStorage
+ */
+@property (nonatomic, assign) BOOL shouldUseCredentialStorage;
+
+/**
+ The credential used by request operations for authentication challenges.
+
+ @see AFURLConnectionOperation -credential
+ */
+@property (nonatomic, strong) NSURLCredential *credential;
+
+///-------------------------------
+/// @name Managing Security Policy
+///-------------------------------
+
+/**
+ The security policy used by created request operations to evaluate server trust for secure connections. `AFHTTPRequestOperationManager` uses the `defaultPolicy` unless otherwise specified.
+ */
+@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
+
+///------------------------------------
+/// @name Managing Network Reachability
+///------------------------------------
+
+/**
+ The network reachability manager. `AFHTTPRequestOperationManager` uses the `sharedManager` by default.
+ */
+@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager;
+
+///-------------------------------
+/// @name Managing Callback Queues
+///-------------------------------
+
+/**
+ The dispatch queue for the `completionBlock` of request operations. If `NULL` (default), the main queue is used.
+ */
+@property (nonatomic, strong) dispatch_queue_t completionQueue;
+
+/**
+ The dispatch group for the `completionBlock` of request operations. If `NULL` (default), a private dispatch group is used.
+ */
+@property (nonatomic, strong) dispatch_group_t completionGroup;
+
+///---------------------------------------------
+/// @name Creating and Initializing HTTP Clients
+///---------------------------------------------
+
+/**
+ Creates and returns an `AFHTTPRequestOperationManager` object.
+ */
++ (instancetype)manager;
+
+/**
+ Initializes an `AFHTTPRequestOperationManager` object with the specified base URL.
+
+ This is the designated initializer.
+
+ @param url The base URL for the HTTP client.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(NSURL *)url;
+
+///---------------------------------------
+/// @name Managing HTTP Request Operations
+///---------------------------------------
+
+/**
+ Creates an `AFHTTPRequestOperation`, and sets the response serializers to that of the HTTP client.
+
+ @param request The request object to be loaded asynchronously during execution of the operation.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the object created from the response data of request.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes two arguments:, the created request operation and the `NSError` object describing the network or parsing error that occurred.
+ */
+- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)request
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+///---------------------------
+/// @name Making HTTP Requests
+///---------------------------
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a `GET` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)GET:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a `HEAD` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single arguments: the request operation.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)HEAD:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a multipart `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a `PUT` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)PUT:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a `PATCH` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)PATCH:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+/**
+ Creates and runs an `AFHTTPRequestOperation` with a `DELETE` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the request operation, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
+
+ @see -HTTPRequestOperationWithRequest:success:failure:
+ */
+- (AFHTTPRequestOperation *)DELETE:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
+
+@end
+
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m
new file mode 100644
index 0000000000..4ae7275480
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m
@@ -0,0 +1,253 @@
+// AFHTTPRequestOperationManager.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import "AFHTTPRequestOperationManager.h"
+#import "AFHTTPRequestOperation.h"
+
+#import <Availability.h>
+#import <Security/Security.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#import <UIKit/UIKit.h>
+#endif
+
+@interface AFHTTPRequestOperationManager ()
+@property (readwrite, nonatomic, strong) NSURL *baseURL;
+@end
+
+@implementation AFHTTPRequestOperationManager
+
++ (instancetype)manager {
+ return [[self alloc] initWithBaseURL:nil];
+}
+
+- (instancetype)init {
+ return [self initWithBaseURL:nil];
+}
+
+- (instancetype)initWithBaseURL:(NSURL *)url {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected
+ if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) {
+ url = [url URLByAppendingPathComponent:@""];
+ }
+
+ self.baseURL = url;
+
+ self.requestSerializer = [AFHTTPRequestSerializer serializer];
+ self.responseSerializer = [AFJSONResponseSerializer serializer];
+
+ self.securityPolicy = [AFSecurityPolicy defaultPolicy];
+
+ self.reachabilityManager = [AFNetworkReachabilityManager sharedManager];
+
+ self.operationQueue = [[NSOperationQueue alloc] init];
+
+ self.shouldUseCredentialStorage = YES;
+
+ return self;
+}
+
+#pragma mark -
+
+#ifdef _SYSTEMCONFIGURATION_H
+#endif
+
+- (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
+ NSParameterAssert(requestSerializer);
+
+ _requestSerializer = requestSerializer;
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+ NSParameterAssert(responseSerializer);
+
+ _responseSerializer = responseSerializer;
+}
+
+#pragma mark -
+
+- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)request
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
+ operation.responseSerializer = self.responseSerializer;
+ operation.shouldUseCredentialStorage = self.shouldUseCredentialStorage;
+ operation.credential = self.credential;
+ operation.securityPolicy = self.securityPolicy;
+
+ [operation setCompletionBlockWithSuccess:success failure:failure];
+ operation.completionQueue = self.completionQueue;
+ operation.completionGroup = self.completionGroup;
+
+ return operation;
+}
+
+#pragma mark -
+
+- (AFHTTPRequestOperation *)GET:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"GET" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+- (AFHTTPRequestOperation *)HEAD:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"HEAD" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *requestOperation, __unused id responseObject) {
+ if (success) {
+ success(requestOperation);
+ }
+ } failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+- (AFHTTPRequestOperation *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+- (AFHTTPRequestOperation *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+- (AFHTTPRequestOperation *)PUT:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"PUT" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+- (AFHTTPRequestOperation *)PATCH:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"PATCH" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+- (AFHTTPRequestOperation *)DELETE:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
+ failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
+{
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"DELETE" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
+ AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
+
+ [self.operationQueue addOperation:operation];
+
+ return operation;
+}
+
+#pragma mark - NSObject
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.operationQueue];
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ NSURL *baseURL = [decoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))];
+
+ self = [self initWithBaseURL:baseURL];
+ if (!self) {
+ return nil;
+ }
+
+ self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))];
+ self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
+ [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
+ [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFHTTPRequestOperationManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL];
+
+ HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
+ HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
+
+ return HTTPClient;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h
new file mode 100644
index 0000000000..8fed5a6891
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h
@@ -0,0 +1,240 @@
+// AFHTTPSessionManager.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+#import <Availability.h>
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+#import <MobileCoreServices/MobileCoreServices.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
+#import "AFURLSessionManager.h"
+
+/**
+ `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths.
+
+ ## Subclassing Notes
+
+ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
+
+ For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect.
+
+ ## Methods to Override
+
+ To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:completionHandler:`.
+
+ ## Serialization
+
+ Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`.
+
+ Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
+
+ ## URL Construction Using Relative Paths
+
+ For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`.
+
+ Below are a few examples of how `baseURL` and relative paths interact:
+
+ NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"];
+ [NSURL URLWithString:@"foo" relativeToURL:baseURL]; // http://example.com/v1/foo
+ [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL]; // http://example.com/v1/foo?bar=baz
+ [NSURL URLWithString:@"/foo" relativeToURL:baseURL]; // http://example.com/foo
+ [NSURL URLWithString:@"foo/" relativeToURL:baseURL]; // http://example.com/v1/foo
+ [NSURL URLWithString:@"/foo/" relativeToURL:baseURL]; // http://example.com/foo/
+ [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/
+
+ Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash.
+
+ @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance.
+ */
+
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
+
+@interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying>
+
+/**
+ The URL used to monitor reachability, and construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
+ */
+@property (readonly, nonatomic, strong) NSURL *baseURL;
+
+/**
+ Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
+
+ @warning `requestSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`.
+
+ @warning `responseSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns an `AFHTTPSessionManager` object.
+ */
++ (instancetype)manager;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ @param url The base URL for the HTTP client.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(NSURL *)url;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ This is the designated initializer.
+
+ @param url The base URL for the HTTP client.
+ @param configuration The configuration used to create the managed session.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(NSURL *)url
+ sessionConfiguration:(NSURLSessionConfiguration *)configuration;
+
+///---------------------------
+/// @name Making HTTP Requests
+///---------------------------
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `GET` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)GET:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)HEAD:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)PUT:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)PATCH:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (NSURLSessionDataTask *)DELETE:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m
new file mode 100644
index 0000000000..6413297d72
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m
@@ -0,0 +1,321 @@
+// AFHTTPSessionManager.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFHTTPSessionManager.h"
+
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
+
+#import "AFURLRequestSerialization.h"
+#import "AFURLResponseSerialization.h"
+
+#import <Availability.h>
+#import <Security/Security.h>
+
+#ifdef _SYSTEMCONFIGURATION_H
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+#endif
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#import <UIKit/UIKit.h>
+#endif
+
+@interface AFHTTPSessionManager ()
+@property (readwrite, nonatomic, strong) NSURL *baseURL;
+@end
+
+@implementation AFHTTPSessionManager
+
++ (instancetype)manager {
+ return [[[self class] alloc] initWithBaseURL:nil];
+}
+
+- (instancetype)init {
+ return [self initWithBaseURL:nil];
+}
+
+- (instancetype)initWithBaseURL:(NSURL *)url {
+ return [self initWithBaseURL:url sessionConfiguration:nil];
+}
+
+- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration {
+ return [self initWithBaseURL:nil sessionConfiguration:configuration];
+}
+
+- (instancetype)initWithBaseURL:(NSURL *)url
+ sessionConfiguration:(NSURLSessionConfiguration *)configuration
+{
+ self = [super initWithSessionConfiguration:configuration];
+ if (!self) {
+ return nil;
+ }
+
+ // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected
+ if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) {
+ url = [url URLByAppendingPathComponent:@""];
+ }
+
+ self.baseURL = url;
+
+ self.requestSerializer = [AFHTTPRequestSerializer serializer];
+ self.responseSerializer = [AFJSONResponseSerializer serializer];
+
+ return self;
+}
+
+#pragma mark -
+
+#ifdef _SYSTEMCONFIGURATION_H
+#endif
+
+- (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
+ NSParameterAssert(requestSerializer);
+
+ _requestSerializer = requestSerializer;
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+ NSParameterAssert(responseSerializer);
+
+ [super setResponseSerializer:responseSerializer];
+}
+
+#pragma mark -
+
+- (NSURLSessionDataTask *)GET:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:success failure:failure];
+
+ [dataTask resume];
+
+ return dataTask;
+}
+
+- (NSURLSessionDataTask *)HEAD:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters success:^(NSURLSessionDataTask *task, __unused id responseObject) {
+ if (success) {
+ success(task);
+ }
+ } failure:failure];
+
+ [dataTask resume];
+
+ return dataTask;
+}
+
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters success:success failure:failure];
+
+ [dataTask resume];
+
+ return dataTask;
+}
+
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+ parameters:(id)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSError *serializationError = nil;
+ NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError];
+ if (serializationError) {
+ if (failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
+ failure(nil, serializationError);
+ });
+#pragma clang diagnostic pop
+ }
+
+ return nil;
+ }
+
+ __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:nil completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
+ if (error) {
+ if (failure) {
+ failure(task, error);
+ }
+ } else {
+ if (success) {
+ success(task, responseObject);
+ }
+ }
+ }];
+
+ [task resume];
+
+ return task;
+}
+
+- (NSURLSessionDataTask *)PUT:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters success:success failure:failure];
+
+ [dataTask resume];
+
+ return dataTask;
+}
+
+- (NSURLSessionDataTask *)PATCH:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters success:success failure:failure];
+
+ [dataTask resume];
+
+ return dataTask;
+}
+
+- (NSURLSessionDataTask *)DELETE:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+ failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+ NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters success:success failure:failure];
+
+ [dataTask resume];
+
+ return dataTask;
+}
+
+- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(id)parameters
+ success:(void (^)(NSURLSessionDataTask *, id))success
+ failure:(void (^)(NSURLSessionDataTask *, NSError *))failure
+{
+ NSError *serializationError = nil;
+ NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError];
+ if (serializationError) {
+ if (failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
+ failure(nil, serializationError);
+ });
+#pragma clang diagnostic pop
+ }
+
+ return nil;
+ }
+
+ __block NSURLSessionDataTask *dataTask = nil;
+ dataTask = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
+ if (error) {
+ if (failure) {
+ failure(dataTask, error);
+ }
+ } else {
+ if (success) {
+ success(dataTask, responseObject);
+ }
+ }
+ }];
+
+ return dataTask;
+}
+
+#pragma mark - NSObject
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.session, self.operationQueue];
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))];
+ NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
+ if (!configuration) {
+ NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"];
+ if (configurationIdentifier) {
+#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100)
+ configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier];
+#else
+ configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier];
+#endif
+ }
+ }
+
+ self = [self initWithBaseURL:baseURL sessionConfiguration:configuration];
+ if (!self) {
+ return nil;
+ }
+
+ self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))];
+ self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
+ if ([self.session.configuration conformsToProtocol:@protocol(NSCoding)]) {
+ [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
+ } else {
+ [coder encodeObject:self.session.configuration.identifier forKey:@"identifier"];
+ }
+ [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
+ [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration];
+
+ HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
+ HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
+
+ return HTTPClient;
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h
new file mode 100644
index 0000000000..5e610d887f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h
@@ -0,0 +1,193 @@
+// AFNetworkReachabilityManager.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+
+typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
+ AFNetworkReachabilityStatusUnknown = -1,
+ AFNetworkReachabilityStatusNotReachable = 0,
+ AFNetworkReachabilityStatusReachableViaWWAN = 1,
+ AFNetworkReachabilityStatusReachableViaWiFi = 2,
+};
+
+/**
+ `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
+
+ Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
+
+ See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/)
+
+ @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
+ */
+@interface AFNetworkReachabilityManager : NSObject
+
+/**
+ The current network reachability status.
+ */
+@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
+
+/**
+ Whether or not the network is currently reachable.
+ */
+@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable;
+
+/**
+ Whether or not the network is currently reachable via WWAN.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN;
+
+/**
+ Whether or not the network is currently reachable via WiFi.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Returns the shared network reachability manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Creates and returns a network reachability manager for the specified domain.
+
+ @param domain The domain used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified domain.
+ */
++ (instancetype)managerForDomain:(NSString *)domain;
+
+/**
+ Creates and returns a network reachability manager for the socket address.
+
+ @param address The socket address (`sockaddr_in`) used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified socket address.
+ */
++ (instancetype)managerForAddress:(const void *)address;
+
+/**
+ Initializes an instance of a network reachability manager from the specified reachability object.
+
+ @param reachability The reachability object to monitor.
+
+ @return An initialized network reachability manager, actively monitoring the specified reachability.
+ */
+- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability;
+
+///--------------------------------------------------
+/// @name Starting & Stopping Reachability Monitoring
+///--------------------------------------------------
+
+/**
+ Starts monitoring for changes in network reachability status.
+ */
+- (void)startMonitoring;
+
+/**
+ Stops monitoring for changes in network reachability status.
+ */
+- (void)stopMonitoring;
+
+///-------------------------------------------------
+/// @name Getting Localized Reachability Description
+///-------------------------------------------------
+
+/**
+ Returns a localized string representation of the current network reachability status.
+ */
+- (NSString *)localizedNetworkReachabilityStatusString;
+
+///---------------------------------------------------
+/// @name Setting Network Reachability Change Callback
+///---------------------------------------------------
+
+/**
+ Sets a callback to be executed when the network availability of the `baseURL` host changes.
+
+ @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`.
+ */
+- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Network Reachability
+
+ The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses.
+
+ enum {
+ AFNetworkReachabilityStatusUnknown,
+ AFNetworkReachabilityStatusNotReachable,
+ AFNetworkReachabilityStatusReachableViaWWAN,
+ AFNetworkReachabilityStatusReachableViaWiFi,
+ }
+
+ `AFNetworkReachabilityStatusUnknown`
+ The `baseURL` host reachability is not known.
+
+ `AFNetworkReachabilityStatusNotReachable`
+ The `baseURL` host cannot be reached.
+
+ `AFNetworkReachabilityStatusReachableViaWWAN`
+ The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS.
+
+ `AFNetworkReachabilityStatusReachableViaWiFi`
+ The `baseURL` host can be reached via a Wi-Fi connection.
+
+ ### Keys for Notification UserInfo Dictionary
+
+ Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification.
+
+ `AFNetworkingReachabilityNotificationStatusItem`
+ A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification.
+ The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status.
+ */
+
+///--------------------
+/// @name Notifications
+///--------------------
+
+/**
+ Posted when network reachability changes.
+ This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability.
+
+ @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import <SystemConfiguration/SystemConfiguration.h>` to the header prefix of the project (`Prefix.pch`).
+ */
+extern NSString * const AFNetworkingReachabilityDidChangeNotification;
+extern NSString * const AFNetworkingReachabilityNotificationStatusItem;
+
+///--------------------
+/// @name Functions
+///--------------------
+
+/**
+ Returns a localized string representation of an `AFNetworkReachabilityStatus` value.
+ */
+extern NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m
new file mode 100644
index 0000000000..1da148282d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m
@@ -0,0 +1,259 @@
+// AFNetworkReachabilityManager.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFNetworkReachabilityManager.h"
+
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+
+NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire.networking.reachability.change";
+NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem";
+
+typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);
+
+typedef NS_ENUM(NSUInteger, AFNetworkReachabilityAssociation) {
+ AFNetworkReachabilityForAddress = 1,
+ AFNetworkReachabilityForAddressPair = 2,
+ AFNetworkReachabilityForName = 3,
+};
+
+NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) {
+ switch (status) {
+ case AFNetworkReachabilityStatusNotReachable:
+ return NSLocalizedStringFromTable(@"Not Reachable", @"AFNetworking", nil);
+ case AFNetworkReachabilityStatusReachableViaWWAN:
+ return NSLocalizedStringFromTable(@"Reachable via WWAN", @"AFNetworking", nil);
+ case AFNetworkReachabilityStatusReachableViaWiFi:
+ return NSLocalizedStringFromTable(@"Reachable via WiFi", @"AFNetworking", nil);
+ case AFNetworkReachabilityStatusUnknown:
+ default:
+ return NSLocalizedStringFromTable(@"Unknown", @"AFNetworking", nil);
+ }
+}
+
+static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetworkReachabilityFlags flags) {
+ BOOL isReachable = ((flags & kSCNetworkReachabilityFlagsReachable) != 0);
+ BOOL needsConnection = ((flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0);
+ BOOL canConnectionAutomatically = (((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0));
+ BOOL canConnectWithoutUserInteraction = (canConnectionAutomatically && (flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0);
+ BOOL isNetworkReachable = (isReachable && (!needsConnection || canConnectWithoutUserInteraction));
+
+ AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusUnknown;
+ if (isNetworkReachable == NO) {
+ status = AFNetworkReachabilityStatusNotReachable;
+ }
+#if TARGET_OS_IPHONE
+ else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) {
+ status = AFNetworkReachabilityStatusReachableViaWWAN;
+ }
+#endif
+ else {
+ status = AFNetworkReachabilityStatusReachableViaWiFi;
+ }
+
+ return status;
+}
+
+static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
+ AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
+ AFNetworkReachabilityStatusBlock block = (__bridge AFNetworkReachabilityStatusBlock)info;
+ if (block) {
+ block(status);
+ }
+
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
+ });
+
+}
+
+static const void * AFNetworkReachabilityRetainCallback(const void *info) {
+ return Block_copy(info);
+}
+
+static void AFNetworkReachabilityReleaseCallback(const void *info) {
+ if (info) {
+ Block_release(info);
+ }
+}
+
+@interface AFNetworkReachabilityManager ()
+@property (readwrite, nonatomic, assign) SCNetworkReachabilityRef networkReachability;
+@property (readwrite, nonatomic, assign) AFNetworkReachabilityAssociation networkReachabilityAssociation;
+@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
+@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock;
+@end
+
+@implementation AFNetworkReachabilityManager
+
++ (instancetype)sharedManager {
+ static AFNetworkReachabilityManager *_sharedManager = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ struct sockaddr_in address;
+ bzero(&address, sizeof(address));
+ address.sin_len = sizeof(address);
+ address.sin_family = AF_INET;
+
+ _sharedManager = [self managerForAddress:&address];
+ });
+
+ return _sharedManager;
+}
+
++ (instancetype)managerForDomain:(NSString *)domain {
+ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]);
+
+ AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
+ manager.networkReachabilityAssociation = AFNetworkReachabilityForName;
+
+ return manager;
+}
+
++ (instancetype)managerForAddress:(const void *)address {
+ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address);
+
+ AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
+ manager.networkReachabilityAssociation = AFNetworkReachabilityForAddress;
+
+ return manager;
+}
+
+- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.networkReachability = reachability;
+ self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
+
+ return self;
+}
+
+- (void)dealloc {
+ [self stopMonitoring];
+
+ if (_networkReachability) {
+ CFRelease(_networkReachability);
+ _networkReachability = NULL;
+ }
+}
+
+#pragma mark -
+
+- (BOOL)isReachable {
+ return [self isReachableViaWWAN] || [self isReachableViaWiFi];
+}
+
+- (BOOL)isReachableViaWWAN {
+ return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN;
+}
+
+- (BOOL)isReachableViaWiFi {
+ return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi;
+}
+
+#pragma mark -
+
+- (void)startMonitoring {
+ [self stopMonitoring];
+
+ if (!self.networkReachability) {
+ return;
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+
+ strongSelf.networkReachabilityStatus = status;
+ if (strongSelf.networkReachabilityStatusBlock) {
+ strongSelf.networkReachabilityStatusBlock(status);
+ }
+
+ };
+
+ SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
+ SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
+ SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
+
+ switch (self.networkReachabilityAssociation) {
+ case AFNetworkReachabilityForName:
+ break;
+ case AFNetworkReachabilityForAddress:
+ case AFNetworkReachabilityForAddressPair:
+ default: {
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{
+ SCNetworkReachabilityFlags flags;
+ SCNetworkReachabilityGetFlags(self.networkReachability, &flags);
+ AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
+ dispatch_async(dispatch_get_main_queue(), ^{
+ callback(status);
+
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
+
+
+ });
+ });
+ }
+ break;
+ }
+}
+
+- (void)stopMonitoring {
+ if (!self.networkReachability) {
+ return;
+ }
+
+ SCNetworkReachabilityUnscheduleFromRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
+}
+
+#pragma mark -
+
+- (NSString *)localizedNetworkReachabilityStatusString {
+ return AFStringFromNetworkReachabilityStatus(self.networkReachabilityStatus);
+}
+
+#pragma mark -
+
+- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block {
+ self.networkReachabilityStatusBlock = block;
+}
+
+#pragma mark - NSKeyValueObserving
+
++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ if ([key isEqualToString:@"reachable"] || [key isEqualToString:@"reachableViaWWAN"] || [key isEqualToString:@"reachableViaWiFi"]) {
+ return [NSSet setWithObject:@"networkReachabilityStatus"];
+ }
+
+ return [super keyPathsForValuesAffectingValueForKey:key];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworking.h
new file mode 100644
index 0000000000..68273da58e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFNetworking.h
@@ -0,0 +1,44 @@
+// AFNetworking.h
+//
+// Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
+//
+// 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/Foundation.h>
+#import <Availability.h>
+
+#ifndef _AFNETWORKING_
+ #define _AFNETWORKING_
+
+ #import "AFURLRequestSerialization.h"
+ #import "AFURLResponseSerialization.h"
+ #import "AFSecurityPolicy.h"
+ #import "AFNetworkReachabilityManager.h"
+
+ #import "AFURLConnectionOperation.h"
+ #import "AFHTTPRequestOperation.h"
+ #import "AFHTTPRequestOperationManager.h"
+
+#if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \
+ ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) )
+ #import "AFURLSessionManager.h"
+ #import "AFHTTPSessionManager.h"
+#endif
+
+#endif /* _AFNETWORKING_ */
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h
new file mode 100644
index 0000000000..a880d75191
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h
@@ -0,0 +1,143 @@
+// AFSecurity.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#import <Security/Security.h>
+
+typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
+ AFSSLPinningModeNone,
+ AFSSLPinningModePublicKey,
+ AFSSLPinningModeCertificate,
+};
+
+/**
+ `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
+
+ Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
+ */
+@interface AFSecurityPolicy : NSObject
+
+/**
+ The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
+ */
+@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
+
+/**
+ Whether to evaluate an entire SSL certificate chain, or just the leaf certificate. Defaults to `YES`.
+ */
+@property (nonatomic, assign) BOOL validatesCertificateChain;
+
+/**
+ The certificates used to evaluate server trust according to the SSL pinning mode. By default, this property is set to any (`.cer`) certificates included in the app bundle.
+ */
+@property (nonatomic, strong) NSArray *pinnedCertificates;
+
+/**
+ Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL allowInvalidCertificates;
+
+/**
+ Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES` for `AFSSLPinningModePublicKey` or `AFSSLPinningModeCertificate`, otherwise `NO`.
+ */
+@property (nonatomic, assign) BOOL validatesDomainName;
+
+///-----------------------------------------
+/// @name Getting Specific Security Policies
+///-----------------------------------------
+
+/**
+ Returns the shared default security policy, which does not allow invalid certificates, does not validate domain name, and does not validate against pinned certificates or public keys.
+
+ @return The default security policy.
+ */
++ (instancetype)defaultPolicy;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+
+ @param pinningMode The SSL pinning mode.
+
+ @return A new security policy.
+ */
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
+
+///------------------------------
+/// @name Evaluating Server Trust
+///------------------------------
+
+/**
+ Whether or not the specified server trust should be accepted, based on the security policy.
+
+ This method should be used when responding to an authentication challenge from a server.
+
+ @param serverTrust The X.509 certificate trust of the server.
+
+ @return Whether or not to trust the server.
+
+ @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`.
+ */
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE;
+
+/**
+ Whether or not the specified server trust should be accepted, based on the security policy.
+
+ This method should be used when responding to an authentication challenge from a server.
+
+ @param serverTrust The X.509 certificate trust of the server.
+ @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
+
+ @return Whether or not to trust the server.
+ */
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
+ forDomain:(NSString *)domain;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## SSL Pinning Modes
+
+ The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
+
+ enum {
+ AFSSLPinningModeNone,
+ AFSSLPinningModePublicKey,
+ AFSSLPinningModeCertificate,
+ }
+
+ `AFSSLPinningModeNone`
+ Do not used pinned certificates to validate servers.
+
+ `AFSSLPinningModePublicKey`
+ Validate host certificates against public keys of pinned certificates.
+
+ `AFSSLPinningModeCertificate`
+ Validate host certificates against pinned certificates.
+*/
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m
new file mode 100644
index 0000000000..1f97f914f3
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m
@@ -0,0 +1,335 @@
+// AFSecurity.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFSecurityPolicy.h"
+
+// Equivalent of macro in <AssertMacros.h>, without causing compiler warning:
+// "'DebugAssert' is deprecated: first deprecated in OS X 10.8"
+#ifndef AF_Require
+ #define AF_Require(assertion, exceptionLabel) \
+ do { \
+ if (__builtin_expect(!(assertion), 0)) { \
+ goto exceptionLabel; \
+ } \
+ } while (0)
+#endif
+
+#ifndef AF_Require_noErr
+ #define AF_Require_noErr(errorCode, exceptionLabel) \
+ do { \
+ if (__builtin_expect(0 != (errorCode), 0)) { \
+ goto exceptionLabel; \
+ } \
+ } while (0)
+#endif
+
+#if !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+static NSData * AFSecKeyGetData(SecKeyRef key) {
+ CFDataRef data = NULL;
+
+ AF_Require_noErr(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out);
+
+ return (__bridge_transfer NSData *)data;
+
+_out:
+ if (data) {
+ CFRelease(data);
+ }
+
+ return nil;
+}
+#endif
+
+static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ return [(__bridge id)key1 isEqual:(__bridge id)key2];
+#else
+ return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)];
+#endif
+}
+
+static id AFPublicKeyForCertificate(NSData *certificate) {
+ id allowedPublicKey = nil;
+ SecCertificateRef allowedCertificate;
+ SecCertificateRef allowedCertificates[1];
+ CFArrayRef tempCertificates = nil;
+ SecPolicyRef policy = nil;
+ SecTrustRef allowedTrust = nil;
+ SecTrustResultType result;
+
+ allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate);
+ AF_Require(allowedCertificate != NULL, _out);
+
+ allowedCertificates[0] = allowedCertificate;
+ tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
+
+ policy = SecPolicyCreateBasicX509();
+ AF_Require_noErr(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out);
+ AF_Require_noErr(SecTrustEvaluate(allowedTrust, &result), _out);
+
+ allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
+
+_out:
+ if (allowedTrust) {
+ CFRelease(allowedTrust);
+ }
+
+ if (policy) {
+ CFRelease(policy);
+ }
+
+ if (tempCertificates) {
+ CFRelease(tempCertificates);
+ }
+
+ if (allowedCertificate) {
+ CFRelease(allowedCertificate);
+ }
+
+ return allowedPublicKey;
+}
+
+static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) {
+ BOOL isValid = NO;
+ SecTrustResultType result;
+ AF_Require_noErr(SecTrustEvaluate(serverTrust, &result), _out);
+
+ isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed);
+
+_out:
+ return isValid;
+}
+
+static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) {
+ CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
+ NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
+
+ for (CFIndex i = 0; i < certificateCount; i++) {
+ SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
+ [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)];
+ }
+
+ return [NSArray arrayWithArray:trustChain];
+}
+
+static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
+ SecPolicyRef policy = SecPolicyCreateBasicX509();
+ CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
+ NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
+ for (CFIndex i = 0; i < certificateCount; i++) {
+ SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
+
+ SecCertificateRef someCertificates[] = {certificate};
+ CFArrayRef certificates = CFArrayCreate(NULL, (const void **)someCertificates, 1, NULL);
+
+ SecTrustRef trust;
+ AF_Require_noErr(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
+
+ SecTrustResultType result;
+ AF_Require_noErr(SecTrustEvaluate(trust, &result), _out);
+
+ [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)];
+
+ _out:
+ if (trust) {
+ CFRelease(trust);
+ }
+
+ if (certificates) {
+ CFRelease(certificates);
+ }
+
+ continue;
+ }
+ CFRelease(policy);
+
+ return [NSArray arrayWithArray:trustChain];
+}
+
+#pragma mark -
+
+@interface AFSecurityPolicy()
+@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
+@property (readwrite, nonatomic, strong) NSArray *pinnedPublicKeys;
+@end
+
+@implementation AFSecurityPolicy
+
++ (NSArray *)defaultPinnedCertificates {
+ static NSArray *_defaultPinnedCertificates = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSBundle *bundle = [NSBundle bundleForClass:[self class]];
+ NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];
+
+ NSMutableArray *certificates = [NSMutableArray arrayWithCapacity:[paths count]];
+ for (NSString *path in paths) {
+ NSData *certificateData = [NSData dataWithContentsOfFile:path];
+ [certificates addObject:certificateData];
+ }
+
+ _defaultPinnedCertificates = [[NSArray alloc] initWithArray:certificates];
+ });
+
+ return _defaultPinnedCertificates;
+}
+
++ (instancetype)defaultPolicy {
+ AFSecurityPolicy *securityPolicy = [[self alloc] init];
+ securityPolicy.SSLPinningMode = AFSSLPinningModeNone;
+
+ return securityPolicy;
+}
+
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
+ AFSecurityPolicy *securityPolicy = [[self alloc] init];
+ securityPolicy.SSLPinningMode = pinningMode;
+
+ [securityPolicy setPinnedCertificates:[self defaultPinnedCertificates]];
+
+ return securityPolicy;
+}
+
+- (id)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.validatesCertificateChain = YES;
+
+ return self;
+}
+
+#pragma mark -
+
+- (void)setSSLPinningMode:(AFSSLPinningMode)SSLPinningMode {
+ _SSLPinningMode = SSLPinningMode;
+
+ switch (self.SSLPinningMode) {
+ case AFSSLPinningModePublicKey:
+ case AFSSLPinningModeCertificate:
+ self.validatesDomainName = YES;
+ break;
+ default:
+ self.validatesDomainName = NO;
+ break;
+ }
+}
+
+- (void)setPinnedCertificates:(NSArray *)pinnedCertificates {
+ _pinnedCertificates = pinnedCertificates;
+
+ if (self.pinnedCertificates) {
+ NSMutableArray *mutablePinnedPublicKeys = [NSMutableArray arrayWithCapacity:[self.pinnedCertificates count]];
+ for (NSData *certificate in self.pinnedCertificates) {
+ id publicKey = AFPublicKeyForCertificate(certificate);
+ if (!publicKey) {
+ continue;
+ }
+ [mutablePinnedPublicKeys addObject:publicKey];
+ }
+ self.pinnedPublicKeys = [NSArray arrayWithArray:mutablePinnedPublicKeys];
+ } else {
+ self.pinnedPublicKeys = nil;
+ }
+}
+
+#pragma mark -
+
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust {
+ return [self evaluateServerTrust:serverTrust forDomain:nil];
+}
+
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
+ forDomain:(NSString *)domain
+{
+ NSMutableArray *policies = [NSMutableArray array];
+ if (self.validatesDomainName) {
+ [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)];
+ } else {
+ [policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()];
+ }
+
+ SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies);
+
+ if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) {
+ return NO;
+ }
+
+ NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);
+ switch (self.SSLPinningMode) {
+ case AFSSLPinningModeNone:
+ return YES;
+ case AFSSLPinningModeCertificate: {
+ NSMutableArray *pinnedCertificates = [NSMutableArray array];
+ for (NSData *certificateData in self.pinnedCertificates) {
+ [pinnedCertificates addObject:(__bridge_transfer id)SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData)];
+ }
+ SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)pinnedCertificates);
+
+ if (!AFServerTrustIsValid(serverTrust)) {
+ return NO;
+ }
+
+ if (!self.validatesCertificateChain) {
+ return YES;
+ }
+
+ NSUInteger trustedCertificateCount = 0;
+ for (NSData *trustChainCertificate in serverCertificates) {
+ if ([self.pinnedCertificates containsObject:trustChainCertificate]) {
+ trustedCertificateCount++;
+ }
+ }
+
+ return trustedCertificateCount == [serverCertificates count];
+ }
+ case AFSSLPinningModePublicKey: {
+ NSUInteger trustedPublicKeyCount = 0;
+ NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust);
+ if (!self.validatesCertificateChain && [publicKeys count] > 0) {
+ publicKeys = @[[publicKeys firstObject]];
+ }
+
+ for (id trustChainPublicKey in publicKeys) {
+ for (id pinnedPublicKey in self.pinnedPublicKeys) {
+ if (AFSecKeyIsEqualToKey((__bridge SecKeyRef)trustChainPublicKey, (__bridge SecKeyRef)pinnedPublicKey)) {
+ trustedPublicKeyCount += 1;
+ }
+ }
+ }
+
+ return trustedPublicKeyCount > 0 && ((self.validatesCertificateChain && trustedPublicKeyCount == [serverCertificates count]) || (!self.validatesCertificateChain && trustedPublicKeyCount >= 1));
+ }
+ }
+
+ return NO;
+}
+
+#pragma mark - NSKeyValueObserving
+
++ (NSSet *)keyPathsForValuesAffectingPinnedPublicKeys {
+ return [NSSet setWithObject:@"pinnedCertificates"];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h
new file mode 100644
index 0000000000..85435564c3
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h
@@ -0,0 +1,328 @@
+// AFURLConnectionOperation.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+#import "AFURLRequestSerialization.h"
+#import "AFURLResponseSerialization.h"
+#import "AFSecurityPolicy.h"
+
+/**
+ `AFURLConnectionOperation` is a subclass of `NSOperation` that implements `NSURLConnection` delegate methods.
+
+ ## Subclassing Notes
+
+ This is the base class of all network request operations. You may wish to create your own subclass in order to implement additional `NSURLConnection` delegate methods (see "`NSURLConnection` Delegate Methods" below), or to provide additional properties and/or class constructors.
+
+ If you are creating a subclass that communicates over the HTTP or HTTPS protocols, you may want to consider subclassing `AFHTTPRequestOperation` instead, as it supports specifying acceptable content types or status codes.
+
+ ## NSURLConnection Delegate Methods
+
+ `AFURLConnectionOperation` implements the following `NSURLConnection` delegate methods:
+
+ - `connection:didReceiveResponse:`
+ - `connection:didReceiveData:`
+ - `connectionDidFinishLoading:`
+ - `connection:didFailWithError:`
+ - `connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:`
+ - `connection:willCacheResponse:`
+ - `connectionShouldUseCredentialStorage:`
+ - `connection:needNewBodyStream:`
+ - `connection:willSendRequestForAuthenticationChallenge:`
+
+ If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first.
+
+ ## Callbacks and Completion Blocks
+
+ The built-in `completionBlock` provided by `NSOperation` allows for custom behavior to be executed after the request finishes. It is a common pattern for class constructors in subclasses to take callback block parameters, and execute them conditionally in the body of its `completionBlock`. Make sure to handle cancelled operations appropriately when setting a `completionBlock` (i.e. returning early before parsing response data). See the implementation of any of the `AFHTTPRequestOperation` subclasses for an example of this.
+
+ Subclasses are strongly discouraged from overriding `setCompletionBlock:`, as `AFURLConnectionOperation`'s implementation includes a workaround to mitigate retain cycles, and what Apple rather ominously refers to as ["The Deallocation Problem"](http://developer.apple.com/library/ios/#technotes/tn2109/).
+
+ ## SSL Pinning
+
+ Relying on the CA trust model to validate SSL certificates exposes your app to security vulnerabilities, such as man-in-the-middle attacks. For applications that connect to known servers, SSL certificate pinning provides an increased level of security, by checking server certificate validity against those specified in the app bundle.
+
+ SSL with certificate pinning is strongly recommended for any application that transmits sensitive information to an external webservice.
+
+ Connections will be validated on all matching certificates with a `.cer` extension in the bundle root.
+
+ ## App Extensions
+
+ When using AFNetworking in an App Extension, `#define AF_APP_EXTENSIONS` to avoid using unavailable APIs.
+
+ ## NSCoding & NSCopying Conformance
+
+ `AFURLConnectionOperation` conforms to the `NSCoding` and `NSCopying` protocols, allowing operations to be archived to disk, and copied in memory, respectively. However, because of the intrinsic limitations of capturing the exact state of an operation at a particular moment, there are some important caveats to keep in mind:
+
+ ### NSCoding Caveats
+
+ - Encoded operations do not include any block or stream properties. Be sure to set `completionBlock`, `outputStream`, and any callback blocks as necessary when using `-initWithCoder:` or `NSKeyedUnarchiver`.
+ - Operations are paused on `encodeWithCoder:`. If the operation was encoded while paused or still executing, its archived state will return `YES` for `isReady`. Otherwise, the state of an operation when encoding will remain unchanged.
+
+ ### NSCopying Caveats
+
+ - `-copy` and `-copyWithZone:` return a new operation with the `NSURLRequest` of the original. So rather than an exact copy of the operation at that particular instant, the copying mechanism returns a completely new instance, which can be useful for retrying operations.
+ - A copy of an operation will not include the `outputStream` of the original.
+ - Operation copies do not include `completionBlock`, as it often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ operation when copied.
+ */
+
+@interface AFURLConnectionOperation : NSOperation <NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSSecureCoding, NSCopying>
+
+///-------------------------------
+/// @name Accessing Run Loop Modes
+///-------------------------------
+
+/**
+ The run loop modes in which the operation will run on the network thread. By default, this is a single-member set containing `NSRunLoopCommonModes`.
+ */
+@property (nonatomic, strong) NSSet *runLoopModes;
+
+///-----------------------------------------
+/// @name Getting URL Connection Information
+///-----------------------------------------
+
+/**
+ The request used by the operation's connection.
+ */
+@property (readonly, nonatomic, strong) NSURLRequest *request;
+
+/**
+ The last response received by the operation's connection.
+ */
+@property (readonly, nonatomic, strong) NSURLResponse *response;
+
+/**
+ The error, if any, that occurred in the lifecycle of the request.
+ */
+@property (readonly, nonatomic, strong) NSError *error;
+
+///----------------------------
+/// @name Getting Response Data
+///----------------------------
+
+/**
+ The data received during the request.
+ */
+@property (readonly, nonatomic, strong) NSData *responseData;
+
+/**
+ The string representation of the response data.
+ */
+@property (readonly, nonatomic, copy) NSString *responseString;
+
+/**
+ The string encoding of the response.
+
+ If the response does not specify a valid string encoding, `responseStringEncoding` will return `NSUTF8StringEncoding`.
+ */
+@property (readonly, nonatomic, assign) NSStringEncoding responseStringEncoding;
+
+///-------------------------------
+/// @name Managing URL Credentials
+///-------------------------------
+
+/**
+ Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default.
+
+ This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`.
+ */
+@property (nonatomic, assign) BOOL shouldUseCredentialStorage;
+
+/**
+ The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
+
+ This will be overridden by any shared credentials that exist for the username or password of the request URL, if present.
+ */
+@property (nonatomic, strong) NSURLCredential *credential;
+
+///-------------------------------
+/// @name Managing Security Policy
+///-------------------------------
+
+/**
+ The security policy used to evaluate server trust for secure connections.
+ */
+@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
+
+///------------------------
+/// @name Accessing Streams
+///------------------------
+
+/**
+ The input stream used to read data to be sent during the request.
+
+ This property acts as a proxy to the `HTTPBodyStream` property of `request`.
+ */
+@property (nonatomic, strong) NSInputStream *inputStream;
+
+/**
+ The output stream that is used to write data received until the request is finished.
+
+ By default, data is accumulated into a buffer that is stored into `responseData` upon completion of the request, with the intermediary `outputStream` property set to `nil`. When `outputStream` is set, the data will not be accumulated into an internal buffer, and as a result, the `responseData` property of the completed request will be `nil`. The output stream will be scheduled in the network thread runloop upon being set.
+ */
+@property (nonatomic, strong) NSOutputStream *outputStream;
+
+///---------------------------------
+/// @name Managing Callback Queues
+///---------------------------------
+
+/**
+ The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used.
+ */
+@property (nonatomic, strong) dispatch_queue_t completionQueue;
+
+/**
+ The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used.
+ */
+@property (nonatomic, strong) dispatch_group_t completionGroup;
+
+///---------------------------------------------
+/// @name Managing Request Operation Information
+///---------------------------------------------
+
+/**
+ The user info dictionary for the receiver.
+ */
+@property (nonatomic, strong) NSDictionary *userInfo;
+
+///------------------------------------------------------
+/// @name Initializing an AFURLConnectionOperation Object
+///------------------------------------------------------
+
+/**
+ Initializes and returns a newly allocated operation object with a url connection configured with the specified url request.
+
+ This is the designated initializer.
+
+ @param urlRequest The request object to be used by the operation connection.
+ */
+- (instancetype)initWithRequest:(NSURLRequest *)urlRequest;
+
+///----------------------------------
+/// @name Pausing / Resuming Requests
+///----------------------------------
+
+/**
+ Pauses the execution of the request operation.
+
+ A paused operation returns `NO` for `-isReady`, `-isExecuting`, and `-isFinished`. As such, it will remain in an `NSOperationQueue` until it is either cancelled or resumed. Pausing a finished, cancelled, or paused operation has no effect.
+ */
+- (void)pause;
+
+/**
+ Whether the request operation is currently paused.
+
+ @return `YES` if the operation is currently paused, otherwise `NO`.
+ */
+- (BOOL)isPaused;
+
+/**
+ Resumes the execution of the paused request operation.
+
+ Pause/Resume behavior varies depending on the underlying implementation for the operation class. In its base implementation, resuming a paused requests restarts the original request. However, since HTTP defines a specification for how to request a specific content range, `AFHTTPRequestOperation` will resume downloading the request from where it left off, instead of restarting the original request.
+ */
+- (void)resume;
+
+///----------------------------------------------
+/// @name Configuring Backgrounding Task Behavior
+///----------------------------------------------
+
+/**
+ Specifies that the operation should continue execution after the app has entered the background, and the expiration handler for that background task.
+
+ @param handler A handler to be called shortly before the application’s remaining background time reaches 0. The handler is wrapped in a block that cancels the operation, and cleans up and marks the end of execution, unlike the `handler` parameter in `UIApplication -beginBackgroundTaskWithExpirationHandler:`, which expects this to be done in the handler itself. The handler is called synchronously on the main thread, thus blocking the application’s suspension momentarily while the application is notified.
+ */
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS)
+- (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler;
+#endif
+
+///---------------------------------
+/// @name Setting Progress Callbacks
+///---------------------------------
+
+/**
+ Sets a callback to be called when an undetermined number of bytes have been uploaded to the server.
+
+ @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes three arguments: the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread.
+ */
+- (void)setUploadProgressBlock:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block;
+
+/**
+ Sets a callback to be called when an undetermined number of bytes have been downloaded from the server.
+
+ @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
+ */
+- (void)setDownloadProgressBlock:(void (^)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead))block;
+
+///-------------------------------------------------
+/// @name Setting NSURLConnection Delegate Callbacks
+///-------------------------------------------------
+
+/**
+ Sets a block to be executed when the connection will authenticate a challenge in order to download its request, as handled by the `NSURLConnectionDelegate` method `connection:willSendRequestForAuthenticationChallenge:`.
+
+ @param block A block object to be executed when the connection will authenticate a challenge in order to download its request. The block has no return type and takes two arguments: the URL connection object, and the challenge that must be authenticated. This block must invoke one of the challenge-responder methods (NSURLAuthenticationChallengeSender protocol).
+
+ If `allowsInvalidSSLCertificate` is set to YES, `connection:willSendRequestForAuthenticationChallenge:` will attempt to have the challenge sender use credentials with invalid SSL certificates.
+ */
+- (void)setWillSendRequestForAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block;
+
+/**
+ Sets a block to be executed when the server redirects the request from one URL to another URL, or when the request URL changed by the `NSURLProtocol` subclass handling the request in order to standardize its format, as handled by the `NSURLConnectionDataDelegate` method `connection:willSendRequest:redirectResponse:`.
+
+ @param block A block object to be executed when the request URL was changed. The block returns an `NSURLRequest` object, the URL request to redirect, and takes three arguments: the URL connection object, the the proposed redirected request, and the URL response that caused the redirect.
+ */
+- (void)setRedirectResponseBlock:(NSURLRequest * (^)(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse))block;
+
+
+/**
+ Sets a block to be executed to modify the response a connection will cache, if any, as handled by the `NSURLConnectionDelegate` method `connection:willCacheResponse:`.
+
+ @param block A block object to be executed to determine what response a connection will cache, if any. The block returns an `NSCachedURLResponse` object, the cached response to store in memory or `nil` to prevent the response from being cached, and takes two arguments: the URL connection object, and the cached response provided for the request.
+ */
+- (void)setCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLConnection *connection, NSCachedURLResponse *cachedResponse))block;
+
+///
+
+/**
+
+ */
++ (NSArray *)batchOfRequestOperations:(NSArray *)operations
+ progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
+ completionBlock:(void (^)(NSArray *operations))completionBlock;
+
+@end
+
+///--------------------
+/// @name Notifications
+///--------------------
+
+/**
+ Posted when an operation begins executing.
+ */
+extern NSString * const AFNetworkingOperationDidStartNotification;
+
+/**
+ Posted when an operation finishes.
+ */
+extern NSString * const AFNetworkingOperationDidFinishNotification;
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m
new file mode 100644
index 0000000000..cfe609a2de
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m
@@ -0,0 +1,789 @@
+// AFURLConnectionOperation.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFURLConnectionOperation.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#import <UIKit/UIKit.h>
+#endif
+
+#if !__has_feature(objc_arc)
+#error AFNetworking must be built with ARC.
+// You can turn on ARC for only AFNetworking files by adding -fobjc-arc to the build phase for each of its files.
+#endif
+
+typedef NS_ENUM(NSInteger, AFOperationState) {
+ AFOperationPausedState = -1,
+ AFOperationReadyState = 1,
+ AFOperationExecutingState = 2,
+ AFOperationFinishedState = 3,
+};
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS)
+typedef UIBackgroundTaskIdentifier AFBackgroundTaskIdentifier;
+#else
+typedef id AFBackgroundTaskIdentifier;
+#endif
+
+static dispatch_group_t url_request_operation_completion_group() {
+ static dispatch_group_t af_url_request_operation_completion_group;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_url_request_operation_completion_group = dispatch_group_create();
+ });
+
+ return af_url_request_operation_completion_group;
+}
+
+static dispatch_queue_t url_request_operation_completion_queue() {
+ static dispatch_queue_t af_url_request_operation_completion_queue;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_url_request_operation_completion_queue = dispatch_queue_create("com.alamofire.networking.operation.queue", DISPATCH_QUEUE_CONCURRENT );
+ });
+
+ return af_url_request_operation_completion_queue;
+}
+
+static NSString * const kAFNetworkingLockName = @"com.alamofire.networking.operation.lock";
+
+NSString * const AFNetworkingOperationDidStartNotification = @"com.alamofire.networking.operation.start";
+NSString * const AFNetworkingOperationDidFinishNotification = @"com.alamofire.networking.operation.finish";
+
+typedef void (^AFURLConnectionOperationProgressBlock)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
+typedef void (^AFURLConnectionOperationAuthenticationChallengeBlock)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge);
+typedef NSCachedURLResponse * (^AFURLConnectionOperationCacheResponseBlock)(NSURLConnection *connection, NSCachedURLResponse *cachedResponse);
+typedef NSURLRequest * (^AFURLConnectionOperationRedirectResponseBlock)(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse);
+
+static inline NSString * AFKeyPathFromOperationState(AFOperationState state) {
+ switch (state) {
+ case AFOperationReadyState:
+ return @"isReady";
+ case AFOperationExecutingState:
+ return @"isExecuting";
+ case AFOperationFinishedState:
+ return @"isFinished";
+ case AFOperationPausedState:
+ return @"isPaused";
+ default: {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
+ return @"state";
+#pragma clang diagnostic pop
+ }
+ }
+}
+
+static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperationState toState, BOOL isCancelled) {
+ switch (fromState) {
+ case AFOperationReadyState:
+ switch (toState) {
+ case AFOperationPausedState:
+ case AFOperationExecutingState:
+ return YES;
+ case AFOperationFinishedState:
+ return isCancelled;
+ default:
+ return NO;
+ }
+ case AFOperationExecutingState:
+ switch (toState) {
+ case AFOperationPausedState:
+ case AFOperationFinishedState:
+ return YES;
+ default:
+ return NO;
+ }
+ case AFOperationFinishedState:
+ return NO;
+ case AFOperationPausedState:
+ return toState == AFOperationReadyState;
+ default: {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
+ switch (toState) {
+ case AFOperationPausedState:
+ case AFOperationReadyState:
+ case AFOperationExecutingState:
+ case AFOperationFinishedState:
+ return YES;
+ default:
+ return NO;
+ }
+ }
+#pragma clang diagnostic pop
+ }
+}
+
+@interface AFURLConnectionOperation ()
+@property (readwrite, nonatomic, assign) AFOperationState state;
+@property (readwrite, nonatomic, strong) NSRecursiveLock *lock;
+@property (readwrite, nonatomic, strong) NSURLConnection *connection;
+@property (readwrite, nonatomic, strong) NSURLRequest *request;
+@property (readwrite, nonatomic, strong) NSURLResponse *response;
+@property (readwrite, nonatomic, strong) NSError *error;
+@property (readwrite, nonatomic, strong) NSData *responseData;
+@property (readwrite, nonatomic, copy) NSString *responseString;
+@property (readwrite, nonatomic, assign) NSStringEncoding responseStringEncoding;
+@property (readwrite, nonatomic, assign) long long totalBytesRead;
+@property (readwrite, nonatomic, assign) AFBackgroundTaskIdentifier backgroundTaskIdentifier;
+@property (readwrite, nonatomic, copy) AFURLConnectionOperationProgressBlock uploadProgress;
+@property (readwrite, nonatomic, copy) AFURLConnectionOperationProgressBlock downloadProgress;
+@property (readwrite, nonatomic, copy) AFURLConnectionOperationAuthenticationChallengeBlock authenticationChallenge;
+@property (readwrite, nonatomic, copy) AFURLConnectionOperationCacheResponseBlock cacheResponse;
+@property (readwrite, nonatomic, copy) AFURLConnectionOperationRedirectResponseBlock redirectResponse;
+
+- (void)operationDidStart;
+- (void)finish;
+- (void)cancelConnection;
+@end
+
+@implementation AFURLConnectionOperation
+@synthesize outputStream = _outputStream;
+
++ (void)networkRequestThreadEntryPoint:(id)__unused object {
+ @autoreleasepool {
+ [[NSThread currentThread] setName:@"AFNetworking"];
+
+ NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+ [runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
+ [runLoop run];
+ }
+}
+
++ (NSThread *)networkRequestThread {
+ static NSThread *_networkRequestThread = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _networkRequestThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkRequestThreadEntryPoint:) object:nil];
+ [_networkRequestThread start];
+ });
+
+ return _networkRequestThread;
+}
+
+- (instancetype)initWithRequest:(NSURLRequest *)urlRequest {
+ NSParameterAssert(urlRequest);
+
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ _state = AFOperationReadyState;
+
+ self.lock = [[NSRecursiveLock alloc] init];
+ self.lock.name = kAFNetworkingLockName;
+
+ self.runLoopModes = [NSSet setWithObject:NSRunLoopCommonModes];
+
+ self.request = urlRequest;
+
+ self.shouldUseCredentialStorage = YES;
+
+ self.securityPolicy = [AFSecurityPolicy defaultPolicy];
+
+ return self;
+}
+
+- (void)dealloc {
+ if (_outputStream) {
+ [_outputStream close];
+ _outputStream = nil;
+ }
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS)
+ if (_backgroundTaskIdentifier) {
+ [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
+ _backgroundTaskIdentifier = UIBackgroundTaskInvalid;
+ }
+#endif
+}
+
+#pragma mark -
+
+- (void)setResponseData:(NSData *)responseData {
+ [self.lock lock];
+ if (!responseData) {
+ _responseData = nil;
+ } else {
+ _responseData = [NSData dataWithBytes:responseData.bytes length:responseData.length];
+ }
+ [self.lock unlock];
+}
+
+- (NSString *)responseString {
+ [self.lock lock];
+ if (!_responseString && self.response && self.responseData) {
+ self.responseString = [[NSString alloc] initWithData:self.responseData encoding:self.responseStringEncoding];
+ }
+ [self.lock unlock];
+
+ return _responseString;
+}
+
+- (NSStringEncoding)responseStringEncoding {
+ [self.lock lock];
+ if (!_responseStringEncoding && self.response) {
+ NSStringEncoding stringEncoding = NSUTF8StringEncoding;
+ if (self.response.textEncodingName) {
+ CFStringEncoding IANAEncoding = CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef)self.response.textEncodingName);
+ if (IANAEncoding != kCFStringEncodingInvalidId) {
+ stringEncoding = CFStringConvertEncodingToNSStringEncoding(IANAEncoding);
+ }
+ }
+
+ self.responseStringEncoding = stringEncoding;
+ }
+ [self.lock unlock];
+
+ return _responseStringEncoding;
+}
+
+- (NSInputStream *)inputStream {
+ return self.request.HTTPBodyStream;
+}
+
+- (void)setInputStream:(NSInputStream *)inputStream {
+ NSMutableURLRequest *mutableRequest = [self.request mutableCopy];
+ mutableRequest.HTTPBodyStream = inputStream;
+ self.request = mutableRequest;
+}
+
+- (NSOutputStream *)outputStream {
+ if (!_outputStream) {
+ self.outputStream = [NSOutputStream outputStreamToMemory];
+ }
+
+ return _outputStream;
+}
+
+- (void)setOutputStream:(NSOutputStream *)outputStream {
+ [self.lock lock];
+ if (outputStream != _outputStream) {
+ if (_outputStream) {
+ [_outputStream close];
+ }
+
+ _outputStream = outputStream;
+ }
+ [self.lock unlock];
+}
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS)
+- (void)setShouldExecuteAsBackgroundTaskWithExpirationHandler:(void (^)(void))handler {
+ [self.lock lock];
+ if (!self.backgroundTaskIdentifier) {
+ UIApplication *application = [UIApplication sharedApplication];
+ __weak __typeof(self)weakSelf = self;
+ self.backgroundTaskIdentifier = [application beginBackgroundTaskWithExpirationHandler:^{
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+
+ if (handler) {
+ handler();
+ }
+
+ if (strongSelf) {
+ [strongSelf cancel];
+
+ [application endBackgroundTask:strongSelf.backgroundTaskIdentifier];
+ strongSelf.backgroundTaskIdentifier = UIBackgroundTaskInvalid;
+ }
+ }];
+ }
+ [self.lock unlock];
+}
+#endif
+
+#pragma mark -
+
+- (void)setState:(AFOperationState)state {
+ if (!AFStateTransitionIsValid(self.state, state, [self isCancelled])) {
+ return;
+ }
+
+ [self.lock lock];
+ NSString *oldStateKey = AFKeyPathFromOperationState(self.state);
+ NSString *newStateKey = AFKeyPathFromOperationState(state);
+
+ [self willChangeValueForKey:newStateKey];
+ [self willChangeValueForKey:oldStateKey];
+ _state = state;
+ [self didChangeValueForKey:oldStateKey];
+ [self didChangeValueForKey:newStateKey];
+ [self.lock unlock];
+}
+
+- (void)pause {
+ if ([self isPaused] || [self isFinished] || [self isCancelled]) {
+ return;
+ }
+
+ [self.lock lock];
+ if ([self isExecuting]) {
+ [self performSelector:@selector(operationDidPause) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+ [notificationCenter postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
+ });
+ }
+
+ self.state = AFOperationPausedState;
+ [self.lock unlock];
+}
+
+- (void)operationDidPause {
+ [self.lock lock];
+ [self.connection cancel];
+ [self.lock unlock];
+}
+
+- (BOOL)isPaused {
+ return self.state == AFOperationPausedState;
+}
+
+- (void)resume {
+ if (![self isPaused]) {
+ return;
+ }
+
+ [self.lock lock];
+ self.state = AFOperationReadyState;
+
+ [self start];
+ [self.lock unlock];
+}
+
+#pragma mark -
+
+- (void)setUploadProgressBlock:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block {
+ self.uploadProgress = block;
+}
+
+- (void)setDownloadProgressBlock:(void (^)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead))block {
+ self.downloadProgress = block;
+}
+
+- (void)setWillSendRequestForAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block {
+ self.authenticationChallenge = block;
+}
+
+- (void)setCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLConnection *connection, NSCachedURLResponse *cachedResponse))block {
+ self.cacheResponse = block;
+}
+
+- (void)setRedirectResponseBlock:(NSURLRequest * (^)(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse))block {
+ self.redirectResponse = block;
+}
+
+#pragma mark - NSOperation
+
+- (void)setCompletionBlock:(void (^)(void))block {
+ [self.lock lock];
+ if (!block) {
+ [super setCompletionBlock:nil];
+ } else {
+ __weak __typeof(self)weakSelf = self;
+ [super setCompletionBlock:^ {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ dispatch_group_t group = strongSelf.completionGroup ?: url_request_operation_completion_group();
+ dispatch_queue_t queue = strongSelf.completionQueue ?: dispatch_get_main_queue();
+#pragma clang diagnostic pop
+
+ dispatch_group_async(group, queue, ^{
+ block();
+ });
+
+ dispatch_group_notify(group, url_request_operation_completion_queue(), ^{
+ [strongSelf setCompletionBlock:nil];
+ });
+ }];
+ }
+ [self.lock unlock];
+}
+
+- (BOOL)isReady {
+ return self.state == AFOperationReadyState && [super isReady];
+}
+
+- (BOOL)isExecuting {
+ return self.state == AFOperationExecutingState;
+}
+
+- (BOOL)isFinished {
+ return self.state == AFOperationFinishedState;
+}
+
+- (BOOL)isConcurrent {
+ return YES;
+}
+
+- (void)start {
+ [self.lock lock];
+ if ([self isCancelled]) {
+ [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
+ } else if ([self isReady]) {
+ self.state = AFOperationExecutingState;
+
+ [self performSelector:@selector(operationDidStart) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
+ }
+ [self.lock unlock];
+}
+
+- (void)operationDidStart {
+ [self.lock lock];
+ if (![self isCancelled]) {
+ self.connection = [[NSURLConnection alloc] initWithRequest:self.request delegate:self startImmediately:NO];
+
+ NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+ for (NSString *runLoopMode in self.runLoopModes) {
+ [self.connection scheduleInRunLoop:runLoop forMode:runLoopMode];
+ [self.outputStream scheduleInRunLoop:runLoop forMode:runLoopMode];
+ }
+
+ [self.outputStream open];
+ [self.connection start];
+ }
+ [self.lock unlock];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self];
+ });
+}
+
+- (void)finish {
+ [self.lock lock];
+ self.state = AFOperationFinishedState;
+ [self.lock unlock];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
+ });
+}
+
+- (void)cancel {
+ [self.lock lock];
+ if (![self isFinished] && ![self isCancelled]) {
+ [super cancel];
+
+ if ([self isExecuting]) {
+ [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]];
+ }
+ }
+ [self.lock unlock];
+}
+
+- (void)cancelConnection {
+ NSDictionary *userInfo = nil;
+ if ([self.request URL]) {
+ userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
+ }
+ NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo];
+
+ if (![self isFinished]) {
+ if (self.connection) {
+ [self.connection cancel];
+ [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:error];
+ } else {
+ // Accomodate race condition where `self.connection` has not yet been set before cancellation
+ self.error = error;
+ [self finish];
+ }
+ }
+}
+
+#pragma mark -
+
++ (NSArray *)batchOfRequestOperations:(NSArray *)operations
+ progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
+ completionBlock:(void (^)(NSArray *operations))completionBlock
+{
+ if (!operations || [operations count] == 0) {
+ return @[[NSBlockOperation blockOperationWithBlock:^{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (completionBlock) {
+ completionBlock(@[]);
+ }
+ });
+ }]];
+ }
+
+ __block dispatch_group_t group = dispatch_group_create();
+ NSBlockOperation *batchedOperation = [NSBlockOperation blockOperationWithBlock:^{
+ dispatch_group_notify(group, dispatch_get_main_queue(), ^{
+ if (completionBlock) {
+ completionBlock(operations);
+ }
+ });
+ }];
+
+ for (AFURLConnectionOperation *operation in operations) {
+ operation.completionGroup = group;
+ void (^originalCompletionBlock)(void) = [operation.completionBlock copy];
+ __weak __typeof(operation)weakOperation = operation;
+ operation.completionBlock = ^{
+ __strong __typeof(weakOperation)strongOperation = weakOperation;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ dispatch_queue_t queue = strongOperation.completionQueue ?: dispatch_get_main_queue();
+#pragma clang diagnostic pop
+ dispatch_group_async(group, queue, ^{
+ if (originalCompletionBlock) {
+ originalCompletionBlock();
+ }
+
+ NSUInteger numberOfFinishedOperations = [[operations indexesOfObjectsPassingTest:^BOOL(id op, NSUInteger __unused idx, BOOL __unused *stop) {
+ return [op isFinished];
+ }] count];
+
+ if (progressBlock) {
+ progressBlock(numberOfFinishedOperations, [operations count]);
+ }
+
+ dispatch_group_leave(group);
+ });
+ };
+
+ dispatch_group_enter(group);
+ [batchedOperation addDependency:operation];
+ }
+
+ return [operations arrayByAddingObject:batchedOperation];
+}
+
+#pragma mark - NSObject
+
+- (NSString *)description {
+ [self.lock lock];
+ NSString *description = [NSString stringWithFormat:@"<%@: %p, state: %@, cancelled: %@ request: %@, response: %@>", NSStringFromClass([self class]), self, AFKeyPathFromOperationState(self.state), ([self isCancelled] ? @"YES" : @"NO"), self.request, self.response];
+ [self.lock unlock];
+ return description;
+}
+
+#pragma mark - NSURLConnectionDelegate
+
+- (void)connection:(NSURLConnection *)connection
+willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ if (self.authenticationChallenge) {
+ self.authenticationChallenge(connection, challenge);
+ return;
+ }
+
+ if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
+ if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) {
+ NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
+ [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
+ } else {
+ [[challenge sender] cancelAuthenticationChallenge:challenge];
+ }
+ } else {
+ if ([challenge previousFailureCount] == 0) {
+ if (self.credential) {
+ [[challenge sender] useCredential:self.credential forAuthenticationChallenge:challenge];
+ } else {
+ [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
+ }
+ } else {
+ [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
+ }
+ }
+}
+
+- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connection {
+ return self.shouldUseCredentialStorage;
+}
+
+- (NSURLRequest *)connection:(NSURLConnection *)connection
+ willSendRequest:(NSURLRequest *)request
+ redirectResponse:(NSURLResponse *)redirectResponse
+{
+ if (self.redirectResponse) {
+ return self.redirectResponse(connection, request, redirectResponse);
+ } else {
+ return request;
+ }
+}
+
+- (void)connection:(NSURLConnection __unused *)connection
+ didSendBodyData:(NSInteger)bytesWritten
+ totalBytesWritten:(NSInteger)totalBytesWritten
+totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
+{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (self.uploadProgress) {
+ self.uploadProgress((NSUInteger)bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
+ }
+ });
+}
+
+- (void)connection:(NSURLConnection __unused *)connection
+didReceiveResponse:(NSURLResponse *)response
+{
+ self.response = response;
+}
+
+- (void)connection:(NSURLConnection __unused *)connection
+ didReceiveData:(NSData *)data
+{
+ NSUInteger length = [data length];
+ while (YES) {
+ NSInteger totalNumberOfBytesWritten = 0;
+ if ([self.outputStream hasSpaceAvailable]) {
+ const uint8_t *dataBuffer = (uint8_t *)[data bytes];
+
+ NSInteger numberOfBytesWritten = 0;
+ while (totalNumberOfBytesWritten < (NSInteger)length) {
+ numberOfBytesWritten = [self.outputStream write:&dataBuffer[(NSUInteger)totalNumberOfBytesWritten] maxLength:(length - (NSUInteger)totalNumberOfBytesWritten)];
+ if (numberOfBytesWritten == -1) {
+ break;
+ }
+
+ totalNumberOfBytesWritten += numberOfBytesWritten;
+ }
+
+ break;
+ }
+
+ if (self.outputStream.streamError) {
+ [self.connection cancel];
+ [self performSelector:@selector(connection:didFailWithError:) withObject:self.connection withObject:self.outputStream.streamError];
+ return;
+ }
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ self.totalBytesRead += (long long)length;
+
+ if (self.downloadProgress) {
+ self.downloadProgress(length, self.totalBytesRead, self.response.expectedContentLength);
+ }
+ });
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection __unused *)connection {
+ self.responseData = [self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey];
+
+ [self.outputStream close];
+ if (self.responseData) {
+ self.outputStream = nil;
+ }
+
+ self.connection = nil;
+
+ [self finish];
+}
+
+- (void)connection:(NSURLConnection __unused *)connection
+ didFailWithError:(NSError *)error
+{
+ self.error = error;
+
+ [self.outputStream close];
+ if (self.responseData) {
+ self.outputStream = nil;
+ }
+
+ self.connection = nil;
+
+ [self finish];
+}
+
+- (NSCachedURLResponse *)connection:(NSURLConnection *)connection
+ willCacheResponse:(NSCachedURLResponse *)cachedResponse
+{
+ if (self.cacheResponse) {
+ return self.cacheResponse(connection, cachedResponse);
+ } else {
+ if ([self isCancelled]) {
+ return nil;
+ }
+
+ return cachedResponse;
+ }
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ NSURLRequest *request = [decoder decodeObjectOfClass:[NSURLRequest class] forKey:NSStringFromSelector(@selector(request))];
+
+ self = [self initWithRequest:request];
+ if (!self) {
+ return nil;
+ }
+
+ self.state = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(state))] integerValue];
+ self.response = [decoder decodeObjectOfClass:[NSHTTPURLResponse class] forKey:NSStringFromSelector(@selector(response))];
+ self.error = [decoder decodeObjectOfClass:[NSError class] forKey:NSStringFromSelector(@selector(error))];
+ self.responseData = [decoder decodeObjectOfClass:[NSData class] forKey:NSStringFromSelector(@selector(responseData))];
+ self.totalBytesRead = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(totalBytesRead))] longLongValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [self pause];
+
+ [coder encodeObject:self.request forKey:NSStringFromSelector(@selector(request))];
+
+ switch (self.state) {
+ case AFOperationExecutingState:
+ case AFOperationPausedState:
+ [coder encodeInteger:AFOperationReadyState forKey:NSStringFromSelector(@selector(state))];
+ break;
+ default:
+ [coder encodeInteger:self.state forKey:NSStringFromSelector(@selector(state))];
+ break;
+ }
+
+ [coder encodeObject:self.response forKey:NSStringFromSelector(@selector(response))];
+ [coder encodeObject:self.error forKey:NSStringFromSelector(@selector(error))];
+ [coder encodeObject:self.responseData forKey:NSStringFromSelector(@selector(responseData))];
+ [coder encodeInt64:self.totalBytesRead forKey:NSStringFromSelector(@selector(totalBytesRead))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFURLConnectionOperation *operation = [(AFURLConnectionOperation *)[[self class] allocWithZone:zone] initWithRequest:self.request];
+
+ operation.uploadProgress = self.uploadProgress;
+ operation.downloadProgress = self.downloadProgress;
+ operation.authenticationChallenge = self.authenticationChallenge;
+ operation.cacheResponse = self.cacheResponse;
+ operation.redirectResponse = self.redirectResponse;
+ operation.completionQueue = self.completionQueue;
+ operation.completionGroup = self.completionGroup;
+
+ return operation;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h
new file mode 100644
index 0000000000..aed4549815
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h
@@ -0,0 +1,463 @@
+// AFSerialization.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#import <UIKit/UIKit.h>
+#endif
+
+/**
+ The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary.
+
+ For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the `Content-Type` HTTP header field value to `application/json`.
+ */
+@protocol AFURLRequestSerialization <NSObject, NSSecureCoding, NSCopying>
+
+/**
+ Returns a request with the specified parameters encoded into a copy of the original request.
+
+ @param request The original request.
+ @param parameters The parameters to be encoded.
+ @param error The error that occurred while attempting to encode the request parameters.
+
+ @return A serialized request.
+ */
+- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
+ withParameters:(id)parameters
+ error:(NSError * __autoreleasing *)error;
+
+@end
+
+#pragma mark -
+
+/**
+
+ */
+typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) {
+ AFHTTPRequestQueryStringDefaultStyle = 0,
+};
+
+@protocol AFMultipartFormData;
+
+/**
+ `AFHTTPRequestSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation.
+
+ Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPRequestSerializer` in order to ensure consistent default behavior.
+ */
+@interface AFHTTPRequestSerializer : NSObject <AFURLRequestSerialization>
+
+/**
+ The string encoding used to serialize parameters. `NSUTF8StringEncoding` by default.
+ */
+@property (nonatomic, assign) NSStringEncoding stringEncoding;
+
+/**
+ Whether created requests can use the device’s cellular radio (if present). `YES` by default.
+
+ @see NSMutableURLRequest -setAllowsCellularAccess:
+ */
+@property (nonatomic, assign) BOOL allowsCellularAccess;
+
+/**
+ The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default.
+
+ @see NSMutableURLRequest -setCachePolicy:
+ */
+@property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy;
+
+/**
+ Whether created requests should use the default cookie handling. `YES` by default.
+
+ @see NSMutableURLRequest -setHTTPShouldHandleCookies:
+ */
+@property (nonatomic, assign) BOOL HTTPShouldHandleCookies;
+
+/**
+ Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default
+
+ @see NSMutableURLRequest -setHTTPShouldUsePipelining:
+ */
+@property (nonatomic, assign) BOOL HTTPShouldUsePipelining;
+
+/**
+ The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default.
+
+ @see NSMutableURLRequest -setNetworkServiceType:
+ */
+@property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType;
+
+/**
+ The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds.
+
+ @see NSMutableURLRequest -setTimeoutInterval:
+ */
+@property (nonatomic, assign) NSTimeInterval timeoutInterval;
+
+///---------------------------------------
+/// @name Configuring HTTP Request Headers
+///---------------------------------------
+
+/**
+ Default HTTP header field values to be applied to serialized requests.
+ */
+@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders;
+
+/**
+ Creates and returns a serializer with default configuration.
+ */
++ (instancetype)serializer;
+
+/**
+ Sets the value for the HTTP headers set in request objects made by the HTTP client. If `nil`, removes the existing value for that header.
+
+ @param field The HTTP header to set a default value for
+ @param value The value set as default for the specified header, or `nil`
+ */
+- (void)setValue:(NSString *)value
+forHTTPHeaderField:(NSString *)field;
+
+/**
+ Returns the value for the HTTP headers set in the request serializer.
+
+ @param field The HTTP header to retrieve the default value for
+
+ @return The value set as default for the specified header, or `nil`
+ */
+- (NSString *)valueForHTTPHeaderField:(NSString *)field;
+
+/**
+ Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header.
+
+ @param username The HTTP basic auth username
+ @param password The HTTP basic auth password
+ */
+- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username
+ password:(NSString *)password;
+
+/**
+ @deprecated This method has been deprecated. Use -setValue:forHTTPHeaderField: instead.
+ */
+- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token DEPRECATED_ATTRIBUTE;
+
+
+/**
+ Clears any existing value for the "Authorization" HTTP header.
+ */
+- (void)clearAuthorizationHeader;
+
+///-------------------------------------------------------
+/// @name Configuring Query String Parameter Serialization
+///-------------------------------------------------------
+
+/**
+ HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default.
+ */
+@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI;
+
+/**
+ Set the method of query string serialization according to one of the pre-defined styles.
+
+ @param style The serialization style.
+
+ @see AFHTTPRequestQueryStringSerializationStyle
+ */
+- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style;
+
+/**
+ Set the a custom method of query string serialization according to the specified block.
+
+ @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request.
+ */
+- (void)setQueryStringSerializationWithBlock:(NSString * (^)(NSURLRequest *request, NSDictionary *parameters, NSError * __autoreleasing *error))block;
+
+///-------------------------------
+/// @name Creating Request Objects
+///-------------------------------
+
+/**
+ @deprecated This method has been deprecated. Use -requestWithMethod:URLString:parameters:error: instead.
+ */
+- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(id)parameters DEPRECATED_ATTRIBUTE;
+
+/**
+ Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string.
+
+ If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body.
+
+ @param method The HTTP method for the request, such as `GET`, `POST`, `PUT`, or `DELETE`. This parameter must not be `nil`.
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be either set as a query string for `GET` requests, or the request HTTP body.
+ @param error The error that occured while constructing the request.
+
+ @return An `NSMutableURLRequest` object.
+ */
+- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(id)parameters
+ error:(NSError * __autoreleasing *)error;
+
+/**
+ @deprecated This method has been deprecated. Use -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error: instead.
+ */
+- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(NSDictionary *)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block DEPRECATED_ATTRIBUTE;
+
+/**
+ Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2
+
+ Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream.
+
+ @param method The HTTP method for the request. This parameter must not be `GET` or `HEAD`, or `nil`.
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded and set in the request HTTP body.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param error The error that occured while constructing the request.
+
+ @return An `NSMutableURLRequest` object
+ */
+- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(NSDictionary *)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+ error:(NSError * __autoreleasing *)error;
+
+/**
+ Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished.
+
+ @param request The multipart form request.
+ @param fileURL The file URL to write multipart form contents to.
+ @param handler A handler block to execute.
+
+ @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request.
+
+ @see https://github.com/AFNetworking/AFNetworking/issues/1398
+ */
+- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request
+ writingStreamContentsToFile:(NSURL *)fileURL
+ completionHandler:(void (^)(NSError *error))handler;
+
+@end
+
+#pragma mark -
+
+/**
+ The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:`.
+ */
+@protocol AFMultipartFormData
+
+/**
+ Appends the HTTP header `Content-Disposition: file; filename=#{generated filename}; name=#{name}"` and `Content-Type: #{generated mimeType}`, followed by the encoded file data and the multipart form boundary.
+
+ The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively.
+
+ @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`.
+ @param name The name to be associated with the specified data. This parameter must not be `nil`.
+ @param error If an error occurs, upon return contains an `NSError` object that describes the problem.
+
+ @return `YES` if the file data was successfully appended, otherwise `NO`.
+ */
+- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
+ name:(NSString *)name
+ error:(NSError * __autoreleasing *)error;
+
+/**
+ Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary.
+
+ @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`.
+ @param name The name to be associated with the specified data. This parameter must not be `nil`.
+ @param fileName The file name to be used in the `Content-Disposition` header. This parameter must not be `nil`.
+ @param mimeType The declared MIME type of the file data. This parameter must not be `nil`.
+ @param error If an error occurs, upon return contains an `NSError` object that describes the problem.
+
+ @return `YES` if the file data was successfully appended otherwise `NO`.
+ */
+- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ mimeType:(NSString *)mimeType
+ error:(NSError * __autoreleasing *)error;
+
+/**
+ Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary.
+
+ @param inputStream The input stream to be appended to the form data
+ @param name The name to be associated with the specified input stream. This parameter must not be `nil`.
+ @param fileName The filename to be associated with the specified input stream. This parameter must not be `nil`.
+ @param length The length of the specified input stream in bytes.
+ @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`.
+ */
+- (void)appendPartWithInputStream:(NSInputStream *)inputStream
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ length:(int64_t)length
+ mimeType:(NSString *)mimeType;
+
+/**
+ Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary.
+
+ @param data The data to be encoded and appended to the form data.
+ @param name The name to be associated with the specified data. This parameter must not be `nil`.
+ @param fileName The filename to be associated with the specified data. This parameter must not be `nil`.
+ @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`.
+ */
+- (void)appendPartWithFileData:(NSData *)data
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ mimeType:(NSString *)mimeType;
+
+/**
+ Appends the HTTP headers `Content-Disposition: form-data; name=#{name}"`, followed by the encoded data and the multipart form boundary.
+
+ @param data The data to be encoded and appended to the form data.
+ @param name The name to be associated with the specified data. This parameter must not be `nil`.
+ */
+
+- (void)appendPartWithFormData:(NSData *)data
+ name:(NSString *)name;
+
+
+/**
+ Appends HTTP headers, followed by the encoded data and the multipart form boundary.
+
+ @param headers The HTTP headers to be appended to the form data.
+ @param body The data to be encoded and appended to the form data. This parameter must not be `nil`.
+ */
+- (void)appendPartWithHeaders:(NSDictionary *)headers
+ body:(NSData *)body;
+
+/**
+ Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream.
+
+ When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, there is no definite way to distinguish between a 3G, EDGE, or LTE connection over `NSURLConnection`. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth.
+
+ @param numberOfBytes Maximum packet size, in number of bytes. The default packet size for an input stream is 16kb.
+ @param delay Duration of delay each time a packet is read. By default, no delay is set.
+ */
+- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes
+ delay:(NSTimeInterval)delay;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFJSONRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSJSONSerialization`, setting the `Content-Type` of the encoded request to `application/json`.
+ */
+@interface AFJSONRequestSerializer : AFHTTPRequestSerializer
+
+/**
+ Options for writing the request JSON data from Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONWritingOptions". `0` by default.
+ */
+@property (nonatomic, assign) NSJSONWritingOptions writingOptions;
+
+/**
+ Creates and returns a JSON serializer with specified reading and writing options.
+
+ @param writingOptions The specified JSON writing options.
+ */
++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFPropertyListRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSPropertyListSerializer`, setting the `Content-Type` of the encoded request to `application/x-plist`.
+ */
+@interface AFPropertyListRequestSerializer : AFHTTPRequestSerializer
+
+/**
+ The property list format. Possible values are described in "NSPropertyListFormat".
+ */
+@property (nonatomic, assign) NSPropertyListFormat format;
+
+/**
+ @warning The `writeOptions` property is currently unused.
+ */
+@property (nonatomic, assign) NSPropertyListWriteOptions writeOptions;
+
+/**
+ Creates and returns a property list serializer with a specified format, read options, and write options.
+
+ @param format The property list format.
+ @param writeOptions The property list write options.
+
+ @warning The `writeOptions` property is currently unused.
+ */
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+ writeOptions:(NSPropertyListWriteOptions)writeOptions;
+
+@end
+
+#pragma mark -
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Error Domains
+
+ The following error domain is predefined.
+
+ - `NSString * const AFURLRequestSerializationErrorDomain`
+
+ ### Constants
+
+ `AFURLRequestSerializationErrorDomain`
+ AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`.
+ */
+extern NSString * const AFURLRequestSerializationErrorDomain;
+
+/**
+ ## User info dictionary keys
+
+ These keys may exist in the user info dictionary, in addition to those defined for NSError.
+
+ - `NSString * const AFNetworkingOperationFailingURLRequestErrorKey`
+
+ ### Constants
+
+ `AFNetworkingOperationFailingURLRequestErrorKey`
+ The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`.
+ */
+extern NSString * const AFNetworkingOperationFailingURLRequestErrorKey;
+
+/**
+ ## Throttling Bandwidth for HTTP Request Input Streams
+
+ @see -throttleBandwidthWithPacketSize:delay:
+
+ ### Constants
+
+ `kAFUploadStream3GSuggestedPacketSize`
+ Maximum packet size, in number of bytes. Equal to 16kb.
+
+ `kAFUploadStream3GSuggestedDelay`
+ Duration of delay each time a packet is read. Equal to 0.2 seconds.
+ */
+extern NSUInteger const kAFUploadStream3GSuggestedPacketSize;
+extern NSTimeInterval const kAFUploadStream3GSuggestedDelay;
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m
new file mode 100644
index 0000000000..a56e8542e1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m
@@ -0,0 +1,1339 @@
+// AFSerialization.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFURLRequestSerialization.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+#import <MobileCoreServices/MobileCoreServices.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
+NSString * const AFURLRequestSerializationErrorDomain = @"com.alamofire.error.serialization.request";
+NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @"com.alamofire.serialization.request.error.response";
+
+typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, NSDictionary *parameters, NSError *__autoreleasing *error);
+
+static NSString * AFBase64EncodedStringFromString(NSString *string) {
+ NSData *data = [NSData dataWithBytes:[string UTF8String] length:[string lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
+ NSUInteger length = [data length];
+ NSMutableData *mutableData = [NSMutableData dataWithLength:((length + 2) / 3) * 4];
+
+ uint8_t *input = (uint8_t *)[data bytes];
+ uint8_t *output = (uint8_t *)[mutableData mutableBytes];
+
+ for (NSUInteger i = 0; i < length; i += 3) {
+ NSUInteger value = 0;
+ for (NSUInteger j = i; j < (i + 3); j++) {
+ value <<= 8;
+ if (j < length) {
+ value |= (0xFF & input[j]);
+ }
+ }
+
+ static uint8_t const kAFBase64EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+ NSUInteger idx = (i / 3) * 4;
+ output[idx + 0] = kAFBase64EncodingTable[(value >> 18) & 0x3F];
+ output[idx + 1] = kAFBase64EncodingTable[(value >> 12) & 0x3F];
+ output[idx + 2] = (i + 1) < length ? kAFBase64EncodingTable[(value >> 6) & 0x3F] : '=';
+ output[idx + 3] = (i + 2) < length ? kAFBase64EncodingTable[(value >> 0) & 0x3F] : '=';
+ }
+
+ return [[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding];
+}
+
+static NSString * const kAFCharactersToBeEscapedInQueryString = @":/?&=;+!@#$()',*";
+
+static NSString * AFPercentEscapedQueryStringKeyFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
+ static NSString * const kAFCharactersToLeaveUnescapedInQueryStringPairKey = @"[].";
+
+ return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, (__bridge CFStringRef)kAFCharactersToLeaveUnescapedInQueryStringPairKey, (__bridge CFStringRef)kAFCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(encoding));
+}
+
+static NSString * AFPercentEscapedQueryStringValueFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
+ return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)kAFCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(encoding));
+}
+
+#pragma mark -
+
+@interface AFQueryStringPair : NSObject
+@property (readwrite, nonatomic, strong) id field;
+@property (readwrite, nonatomic, strong) id value;
+
+- (id)initWithField:(id)field value:(id)value;
+
+- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding;
+@end
+
+@implementation AFQueryStringPair
+
+- (id)initWithField:(id)field value:(id)value {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.field = field;
+ self.value = value;
+
+ return self;
+}
+
+- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding {
+ if (!self.value || [self.value isEqual:[NSNull null]]) {
+ return AFPercentEscapedQueryStringKeyFromStringWithEncoding([self.field description], stringEncoding);
+ } else {
+ return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedQueryStringKeyFromStringWithEncoding([self.field description], stringEncoding), AFPercentEscapedQueryStringValueFromStringWithEncoding([self.value description], stringEncoding)];
+ }
+}
+
+@end
+
+#pragma mark -
+
+extern NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary);
+extern NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value);
+
+static NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *parameters, NSStringEncoding stringEncoding) {
+ NSMutableArray *mutablePairs = [NSMutableArray array];
+ for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) {
+ [mutablePairs addObject:[pair URLEncodedStringValueWithEncoding:stringEncoding]];
+ }
+
+ return [mutablePairs componentsJoinedByString:@"&"];
+}
+
+NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary) {
+ return AFQueryStringPairsFromKeyAndValue(nil, dictionary);
+}
+
+NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
+ NSMutableArray *mutableQueryStringComponents = [NSMutableArray array];
+
+ NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"description" ascending:YES selector:@selector(compare:)];
+
+ if ([value isKindOfClass:[NSDictionary class]]) {
+ NSDictionary *dictionary = value;
+ // Sort dictionary keys to ensure consistent ordering in query string, which is important when deserializing potentially ambiguous sequences, such as an array of dictionaries
+ for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[ sortDescriptor ]]) {
+ id nestedValue = [dictionary objectForKey:nestedKey];
+ if (nestedValue) {
+ [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)];
+ }
+ }
+ } else if ([value isKindOfClass:[NSArray class]]) {
+ NSArray *array = value;
+ for (id nestedValue in array) {
+ [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)];
+ }
+ } else if ([value isKindOfClass:[NSSet class]]) {
+ NSSet *set = value;
+ for (id obj in [set sortedArrayUsingDescriptors:@[ sortDescriptor ]]) {
+ [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue(key, obj)];
+ }
+ } else {
+ [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]];
+ }
+
+ return mutableQueryStringComponents;
+}
+
+#pragma mark -
+
+@interface AFStreamingMultipartFormData : NSObject <AFMultipartFormData>
+- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest
+ stringEncoding:(NSStringEncoding)encoding;
+
+- (NSMutableURLRequest *)requestByFinalizingMultipartFormData;
+@end
+
+#pragma mark -
+
+static NSArray * AFHTTPRequestSerializerObservedKeyPaths() {
+ static NSArray *_AFHTTPRequestSerializerObservedKeyPaths = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _AFHTTPRequestSerializerObservedKeyPaths = @[NSStringFromSelector(@selector(allowsCellularAccess)), NSStringFromSelector(@selector(cachePolicy)), NSStringFromSelector(@selector(HTTPShouldHandleCookies)), NSStringFromSelector(@selector(HTTPShouldUsePipelining)), NSStringFromSelector(@selector(networkServiceType)), NSStringFromSelector(@selector(timeoutInterval))];
+ });
+
+ return _AFHTTPRequestSerializerObservedKeyPaths;
+}
+
+static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerObserverContext;
+
+@interface AFHTTPRequestSerializer ()
+@property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths;
+@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders;
+@property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle;
+@property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization;
+@end
+
+@implementation AFHTTPRequestSerializer
+
++ (instancetype)serializer {
+ return [[self alloc] init];
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.stringEncoding = NSUTF8StringEncoding;
+
+ self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary];
+
+ // Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
+ NSMutableArray *acceptLanguagesComponents = [NSMutableArray array];
+ [[NSLocale preferredLanguages] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ float q = 1.0f - (idx * 0.1f);
+ [acceptLanguagesComponents addObject:[NSString stringWithFormat:@"%@;q=%0.1g", obj, q]];
+ *stop = q <= 0.5f;
+ }];
+ [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"];
+
+ NSString *userAgent = nil;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
+ userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
+#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+ userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]];
+#endif
+#pragma clang diagnostic pop
+ if (userAgent) {
+ if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) {
+ NSMutableString *mutableUserAgent = [userAgent mutableCopy];
+ if (CFStringTransform((__bridge CFMutableStringRef)(mutableUserAgent), NULL, (__bridge CFStringRef)@"Any-Latin; Latin-ASCII; [:^ASCII:] Remove", false)) {
+ userAgent = mutableUserAgent;
+ }
+ }
+ [self setValue:userAgent forHTTPHeaderField:@"User-Agent"];
+ }
+
+ // HTTP Method Definitions; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
+ self.HTTPMethodsEncodingParametersInURI = [NSSet setWithObjects:@"GET", @"HEAD", @"DELETE", nil];
+
+ self.mutableObservedChangedKeyPaths = [NSMutableSet set];
+ for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) {
+ if ([self respondsToSelector:NSSelectorFromString(keyPath)]) {
+ [self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:AFHTTPRequestSerializerObserverContext];
+ }
+ }
+
+ return self;
+}
+
+- (void)dealloc {
+ for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) {
+ if ([self respondsToSelector:NSSelectorFromString(keyPath)]) {
+ [self removeObserver:self forKeyPath:keyPath context:AFHTTPRequestSerializerObserverContext];
+ }
+ }
+}
+
+#pragma mark -
+
+- (NSDictionary *)HTTPRequestHeaders {
+ return [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders];
+}
+
+- (void)setValue:(NSString *)value
+forHTTPHeaderField:(NSString *)field
+{
+ [self.mutableHTTPRequestHeaders setValue:value forKey:field];
+}
+
+- (NSString *)valueForHTTPHeaderField:(NSString *)field {
+ return [self.mutableHTTPRequestHeaders valueForKey:field];
+}
+
+- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username
+ password:(NSString *)password
+{
+ NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password];
+ [self setValue:[NSString stringWithFormat:@"Basic %@", AFBase64EncodedStringFromString(basicAuthCredentials)] forHTTPHeaderField:@"Authorization"];
+}
+
+- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token {
+ [self setValue:[NSString stringWithFormat:@"Token token=\"%@\"", token] forHTTPHeaderField:@"Authorization"];
+}
+
+- (void)clearAuthorizationHeader {
+ [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];
+}
+
+#pragma mark -
+
+- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style {
+ self.queryStringSerializationStyle = style;
+ self.queryStringSerialization = nil;
+}
+
+- (void)setQueryStringSerializationWithBlock:(NSString *(^)(NSURLRequest *, NSDictionary *, NSError *__autoreleasing *))block {
+ self.queryStringSerialization = block;
+}
+
+#pragma mark -
+
+- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(id)parameters
+{
+ return [self requestWithMethod:method URLString:URLString parameters:parameters error:nil];
+}
+
+- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(id)parameters
+ error:(NSError *__autoreleasing *)error
+{
+ NSParameterAssert(method);
+ NSParameterAssert(URLString);
+
+ NSURL *url = [NSURL URLWithString:URLString];
+
+ NSParameterAssert(url);
+
+ NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url];
+ mutableRequest.HTTPMethod = method;
+
+ for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) {
+ if ([self.mutableObservedChangedKeyPaths containsObject:keyPath]) {
+ [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath];
+ }
+ }
+
+ mutableRequest = [[self requestBySerializingRequest:mutableRequest withParameters:parameters error:error] mutableCopy];
+
+ return mutableRequest;
+}
+
+- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(NSDictionary *)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+{
+ return [self multipartFormRequestWithMethod:method URLString:URLString parameters:parameters constructingBodyWithBlock:block error:nil];
+}
+
+- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
+ URLString:(NSString *)URLString
+ parameters:(NSDictionary *)parameters
+ constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+ error:(NSError *__autoreleasing *)error
+{
+ NSParameterAssert(method);
+ NSParameterAssert(![method isEqualToString:@"GET"] && ![method isEqualToString:@"HEAD"]);
+
+ NSMutableURLRequest *mutableRequest = [self requestWithMethod:method URLString:URLString parameters:nil error:error];
+
+ __block AFStreamingMultipartFormData *formData = [[AFStreamingMultipartFormData alloc] initWithURLRequest:mutableRequest stringEncoding:NSUTF8StringEncoding];
+
+ if (parameters) {
+ for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) {
+ NSData *data = nil;
+ if ([pair.value isKindOfClass:[NSData class]]) {
+ data = pair.value;
+ } else if ([pair.value isEqual:[NSNull null]]) {
+ data = [NSData data];
+ } else {
+ data = [[pair.value description] dataUsingEncoding:self.stringEncoding];
+ }
+
+ if (data) {
+ [formData appendPartWithFormData:data name:[pair.field description]];
+ }
+ }
+ }
+
+ if (block) {
+ block(formData);
+ }
+
+ return [formData requestByFinalizingMultipartFormData];
+}
+
+- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request
+ writingStreamContentsToFile:(NSURL *)fileURL
+ completionHandler:(void (^)(NSError *error))handler
+{
+ if (!request.HTTPBodyStream) {
+ return [request mutableCopy];
+ }
+
+ NSParameterAssert([fileURL isFileURL]);
+
+ NSInputStream *inputStream = request.HTTPBodyStream;
+ NSOutputStream *outputStream = [[NSOutputStream alloc] initWithURL:fileURL append:NO];
+ __block NSError *error = nil;
+
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+ [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+
+ [inputStream open];
+ [outputStream open];
+
+ while ([inputStream hasBytesAvailable] && [outputStream hasSpaceAvailable]) {
+ uint8_t buffer[1024];
+
+ NSInteger bytesRead = [inputStream read:buffer maxLength:1024];
+ if (inputStream.streamError || bytesRead < 0) {
+ error = inputStream.streamError;
+ break;
+ }
+
+ NSInteger bytesWritten = [outputStream write:buffer maxLength:(NSUInteger)bytesRead];
+ if (outputStream.streamError || bytesWritten < 0) {
+ error = outputStream.streamError;
+ break;
+ }
+
+ if (bytesRead == 0 && bytesWritten == 0) {
+ break;
+ }
+ }
+
+ [outputStream close];
+ [inputStream close];
+
+ if (handler) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ handler(error);
+ });
+ }
+ });
+
+ NSMutableURLRequest *mutableRequest = [request mutableCopy];
+ mutableRequest.HTTPBodyStream = nil;
+
+ return mutableRequest;
+}
+
+#pragma mark - AFURLRequestSerialization
+
+- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
+ withParameters:(id)parameters
+ error:(NSError *__autoreleasing *)error
+{
+ NSParameterAssert(request);
+
+ NSMutableURLRequest *mutableRequest = [request mutableCopy];
+
+ [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) {
+ if (![request valueForHTTPHeaderField:field]) {
+ [mutableRequest setValue:value forHTTPHeaderField:field];
+ }
+ }];
+
+ if (parameters) {
+ NSString *query = nil;
+ if (self.queryStringSerialization) {
+ NSError *serializationError;
+ query = self.queryStringSerialization(request, parameters, &serializationError);
+
+ if (serializationError) {
+ if (error) {
+ *error = serializationError;
+ }
+
+ return nil;
+ }
+ } else {
+ switch (self.queryStringSerializationStyle) {
+ case AFHTTPRequestQueryStringDefaultStyle:
+ query = AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding);
+ break;
+ }
+ }
+
+ if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) {
+ mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]];
+ } else {
+ if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
+ [mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
+ }
+ [mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]];
+ }
+ }
+
+ return mutableRequest;
+}
+
+#pragma mark - NSKeyValueObserving
+
+- (void)observeValueForKeyPath:(NSString *)keyPath
+ ofObject:(__unused id)object
+ change:(NSDictionary *)change
+ context:(void *)context
+{
+ if (context == AFHTTPRequestSerializerObserverContext) {
+ if ([change[NSKeyValueChangeNewKey] isEqual:[NSNull null]]) {
+ [self.mutableObservedChangedKeyPaths removeObject:keyPath];
+ } else {
+ [self.mutableObservedChangedKeyPaths addObject:keyPath];
+ }
+ }
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+
+ self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy];
+ self.queryStringSerializationStyle = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
+ [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init];
+ serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
+ serializer.queryStringSerializationStyle = self.queryStringSerializationStyle;
+ serializer.queryStringSerialization = self.queryStringSerialization;
+
+ return serializer;
+}
+
+@end
+
+#pragma mark -
+
+static NSString * AFCreateMultipartFormBoundary() {
+ return [NSString stringWithFormat:@"Boundary+%08X%08X", arc4random(), arc4random()];
+}
+
+static NSString * const kAFMultipartFormCRLF = @"\r\n";
+
+static inline NSString * AFMultipartFormInitialBoundary(NSString *boundary) {
+ return [NSString stringWithFormat:@"--%@%@", boundary, kAFMultipartFormCRLF];
+}
+
+static inline NSString * AFMultipartFormEncapsulationBoundary(NSString *boundary) {
+ return [NSString stringWithFormat:@"%@--%@%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF];
+}
+
+static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) {
+ return [NSString stringWithFormat:@"%@--%@--%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF];
+}
+
+static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
+#ifdef __UTTYPE__
+ NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL);
+ NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
+ if (!contentType) {
+ return @"application/octet-stream";
+ } else {
+ return contentType;
+ }
+#else
+#pragma unused (extension)
+ return @"application/octet-stream";
+#endif
+}
+
+NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16;
+NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
+
+@interface AFHTTPBodyPart : NSObject
+@property (nonatomic, assign) NSStringEncoding stringEncoding;
+@property (nonatomic, strong) NSDictionary *headers;
+@property (nonatomic, copy) NSString *boundary;
+@property (nonatomic, strong) id body;
+@property (nonatomic, assign) unsigned long long bodyContentLength;
+@property (nonatomic, strong) NSInputStream *inputStream;
+
+@property (nonatomic, assign) BOOL hasInitialBoundary;
+@property (nonatomic, assign) BOOL hasFinalBoundary;
+
+@property (readonly, nonatomic, assign, getter = hasBytesAvailable) BOOL bytesAvailable;
+@property (readonly, nonatomic, assign) unsigned long long contentLength;
+
+- (NSInteger)read:(uint8_t *)buffer
+ maxLength:(NSUInteger)length;
+@end
+
+@interface AFMultipartBodyStream : NSInputStream <NSStreamDelegate>
+@property (nonatomic, assign) NSUInteger numberOfBytesInPacket;
+@property (nonatomic, assign) NSTimeInterval delay;
+@property (nonatomic, strong) NSInputStream *inputStream;
+@property (readonly, nonatomic, assign) unsigned long long contentLength;
+@property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty;
+
+- (id)initWithStringEncoding:(NSStringEncoding)encoding;
+- (void)setInitialAndFinalBoundaries;
+- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart;
+@end
+
+#pragma mark -
+
+@interface AFStreamingMultipartFormData ()
+@property (readwrite, nonatomic, copy) NSMutableURLRequest *request;
+@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding;
+@property (readwrite, nonatomic, copy) NSString *boundary;
+@property (readwrite, nonatomic, strong) AFMultipartBodyStream *bodyStream;
+@end
+
+@implementation AFStreamingMultipartFormData
+
+- (id)initWithURLRequest:(NSMutableURLRequest *)urlRequest
+ stringEncoding:(NSStringEncoding)encoding
+{
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.request = urlRequest;
+ self.stringEncoding = encoding;
+ self.boundary = AFCreateMultipartFormBoundary();
+ self.bodyStream = [[AFMultipartBodyStream alloc] initWithStringEncoding:encoding];
+
+ return self;
+}
+
+- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
+ name:(NSString *)name
+ error:(NSError * __autoreleasing *)error
+{
+ NSParameterAssert(fileURL);
+ NSParameterAssert(name);
+
+ NSString *fileName = [fileURL lastPathComponent];
+ NSString *mimeType = AFContentTypeForPathExtension([fileURL pathExtension]);
+
+ return [self appendPartWithFileURL:fileURL name:name fileName:fileName mimeType:mimeType error:error];
+}
+
+- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ mimeType:(NSString *)mimeType
+ error:(NSError * __autoreleasing *)error
+{
+ NSParameterAssert(fileURL);
+ NSParameterAssert(name);
+ NSParameterAssert(fileName);
+ NSParameterAssert(mimeType);
+
+ if (![fileURL isFileURL]) {
+ NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"Expected URL to be a file URL", @"AFNetworking", nil)};
+ if (error) {
+ *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo];
+ }
+
+ return NO;
+ } else if ([fileURL checkResourceIsReachableAndReturnError:error] == NO) {
+ NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"File URL not reachable.", @"AFNetworking", nil)};
+ if (error) {
+ *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo];
+ }
+
+ return NO;
+ }
+
+ NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileURL path] error:error];
+ if (!fileAttributes) {
+ return NO;
+ }
+
+ NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
+ [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
+ [mutableHeaders setValue:mimeType forKey:@"Content-Type"];
+
+ AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init];
+ bodyPart.stringEncoding = self.stringEncoding;
+ bodyPart.headers = mutableHeaders;
+ bodyPart.boundary = self.boundary;
+ bodyPart.body = fileURL;
+ bodyPart.bodyContentLength = [[fileAttributes objectForKey:NSFileSize] unsignedLongLongValue];
+ [self.bodyStream appendHTTPBodyPart:bodyPart];
+
+ return YES;
+}
+
+- (void)appendPartWithInputStream:(NSInputStream *)inputStream
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ length:(int64_t)length
+ mimeType:(NSString *)mimeType
+{
+ NSParameterAssert(name);
+ NSParameterAssert(fileName);
+ NSParameterAssert(mimeType);
+
+ NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
+ [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
+ [mutableHeaders setValue:mimeType forKey:@"Content-Type"];
+
+ AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init];
+ bodyPart.stringEncoding = self.stringEncoding;
+ bodyPart.headers = mutableHeaders;
+ bodyPart.boundary = self.boundary;
+ bodyPart.body = inputStream;
+
+ bodyPart.bodyContentLength = (unsigned long long)length;
+
+ [self.bodyStream appendHTTPBodyPart:bodyPart];
+}
+
+- (void)appendPartWithFileData:(NSData *)data
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ mimeType:(NSString *)mimeType
+{
+ NSParameterAssert(name);
+ NSParameterAssert(fileName);
+ NSParameterAssert(mimeType);
+
+ NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
+ [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
+ [mutableHeaders setValue:mimeType forKey:@"Content-Type"];
+
+ [self appendPartWithHeaders:mutableHeaders body:data];
+}
+
+- (void)appendPartWithFormData:(NSData *)data
+ name:(NSString *)name
+{
+ NSParameterAssert(name);
+
+ NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
+ [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"];
+
+ [self appendPartWithHeaders:mutableHeaders body:data];
+}
+
+- (void)appendPartWithHeaders:(NSDictionary *)headers
+ body:(NSData *)body
+{
+ NSParameterAssert(body);
+
+ AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init];
+ bodyPart.stringEncoding = self.stringEncoding;
+ bodyPart.headers = headers;
+ bodyPart.boundary = self.boundary;
+ bodyPart.bodyContentLength = [body length];
+ bodyPart.body = body;
+
+ [self.bodyStream appendHTTPBodyPart:bodyPart];
+}
+
+- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes
+ delay:(NSTimeInterval)delay
+{
+ self.bodyStream.numberOfBytesInPacket = numberOfBytes;
+ self.bodyStream.delay = delay;
+}
+
+- (NSMutableURLRequest *)requestByFinalizingMultipartFormData {
+ if ([self.bodyStream isEmpty]) {
+ return self.request;
+ }
+
+ // Reset the initial and final boundaries to ensure correct Content-Length
+ [self.bodyStream setInitialAndFinalBoundaries];
+ [self.request setHTTPBodyStream:self.bodyStream];
+
+ [self.request setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", self.boundary] forHTTPHeaderField:@"Content-Type"];
+ [self.request setValue:[NSString stringWithFormat:@"%llu", [self.bodyStream contentLength]] forHTTPHeaderField:@"Content-Length"];
+
+ return self.request;
+}
+
+@end
+
+#pragma mark -
+
+@interface NSStream ()
+@property (readwrite) NSStreamStatus streamStatus;
+@property (readwrite, copy) NSError *streamError;
+@end
+
+@interface AFMultipartBodyStream () <NSCopying>
+@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding;
+@property (readwrite, nonatomic, strong) NSMutableArray *HTTPBodyParts;
+@property (readwrite, nonatomic, strong) NSEnumerator *HTTPBodyPartEnumerator;
+@property (readwrite, nonatomic, strong) AFHTTPBodyPart *currentHTTPBodyPart;
+@property (readwrite, nonatomic, strong) NSOutputStream *outputStream;
+@property (readwrite, nonatomic, strong) NSMutableData *buffer;
+@end
+
+@implementation AFMultipartBodyStream
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wimplicit-atomic-properties"
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100)
+@synthesize delegate;
+#endif
+@synthesize streamStatus;
+@synthesize streamError;
+#pragma clang diagnostic pop
+
+- (id)initWithStringEncoding:(NSStringEncoding)encoding {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.stringEncoding = encoding;
+ self.HTTPBodyParts = [NSMutableArray array];
+ self.numberOfBytesInPacket = NSIntegerMax;
+
+ return self;
+}
+
+- (void)setInitialAndFinalBoundaries {
+ if ([self.HTTPBodyParts count] > 0) {
+ for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) {
+ bodyPart.hasInitialBoundary = NO;
+ bodyPart.hasFinalBoundary = NO;
+ }
+
+ [[self.HTTPBodyParts objectAtIndex:0] setHasInitialBoundary:YES];
+ [[self.HTTPBodyParts lastObject] setHasFinalBoundary:YES];
+ }
+}
+
+- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart {
+ [self.HTTPBodyParts addObject:bodyPart];
+}
+
+- (BOOL)isEmpty {
+ return [self.HTTPBodyParts count] == 0;
+}
+
+#pragma mark - NSInputStream
+
+- (NSInteger)read:(uint8_t *)buffer
+ maxLength:(NSUInteger)length
+{
+ if ([self streamStatus] == NSStreamStatusClosed) {
+ return 0;
+ }
+
+ NSInteger totalNumberOfBytesRead = 0;
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) {
+ if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) {
+ if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) {
+ break;
+ }
+ } else {
+ NSUInteger maxLength = length - (NSUInteger)totalNumberOfBytesRead;
+ NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength];
+ if (numberOfBytesRead == -1) {
+ self.streamError = self.currentHTTPBodyPart.inputStream.streamError;
+ break;
+ } else {
+ totalNumberOfBytesRead += numberOfBytesRead;
+
+ if (self.delay > 0.0f) {
+ [NSThread sleepForTimeInterval:self.delay];
+ }
+ }
+ }
+ }
+#pragma clang diagnostic pop
+
+ return totalNumberOfBytesRead;
+}
+
+- (BOOL)getBuffer:(__unused uint8_t **)buffer
+ length:(__unused NSUInteger *)len
+{
+ return NO;
+}
+
+- (BOOL)hasBytesAvailable {
+ return [self streamStatus] == NSStreamStatusOpen;
+}
+
+#pragma mark - NSStream
+
+- (void)open {
+ if (self.streamStatus == NSStreamStatusOpen) {
+ return;
+ }
+
+ self.streamStatus = NSStreamStatusOpen;
+
+ [self setInitialAndFinalBoundaries];
+ self.HTTPBodyPartEnumerator = [self.HTTPBodyParts objectEnumerator];
+}
+
+- (void)close {
+ self.streamStatus = NSStreamStatusClosed;
+}
+
+- (id)propertyForKey:(__unused NSString *)key {
+ return nil;
+}
+
+- (BOOL)setProperty:(__unused id)property
+ forKey:(__unused NSString *)key
+{
+ return NO;
+}
+
+- (void)scheduleInRunLoop:(__unused NSRunLoop *)aRunLoop
+ forMode:(__unused NSString *)mode
+{}
+
+- (void)removeFromRunLoop:(__unused NSRunLoop *)aRunLoop
+ forMode:(__unused NSString *)mode
+{}
+
+- (unsigned long long)contentLength {
+ unsigned long long length = 0;
+ for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) {
+ length += [bodyPart contentLength];
+ }
+
+ return length;
+}
+
+#pragma mark - Undocumented CFReadStream Bridged Methods
+
+- (void)_scheduleInCFRunLoop:(__unused CFRunLoopRef)aRunLoop
+ forMode:(__unused CFStringRef)aMode
+{}
+
+- (void)_unscheduleFromCFRunLoop:(__unused CFRunLoopRef)aRunLoop
+ forMode:(__unused CFStringRef)aMode
+{}
+
+- (BOOL)_setCFClientFlags:(__unused CFOptionFlags)inFlags
+ callback:(__unused CFReadStreamClientCallBack)inCallback
+ context:(__unused CFStreamClientContext *)inContext {
+ return NO;
+}
+
+#pragma mark - NSCopying
+
+-(id)copyWithZone:(NSZone *)zone {
+ AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding];
+
+ for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) {
+ [bodyStreamCopy appendHTTPBodyPart:[bodyPart copy]];
+ }
+
+ [bodyStreamCopy setInitialAndFinalBoundaries];
+
+ return bodyStreamCopy;
+}
+
+@end
+
+#pragma mark -
+
+typedef enum {
+ AFEncapsulationBoundaryPhase = 1,
+ AFHeaderPhase = 2,
+ AFBodyPhase = 3,
+ AFFinalBoundaryPhase = 4,
+} AFHTTPBodyPartReadPhase;
+
+@interface AFHTTPBodyPart () <NSCopying> {
+ AFHTTPBodyPartReadPhase _phase;
+ NSInputStream *_inputStream;
+ unsigned long long _phaseReadOffset;
+}
+
+- (BOOL)transitionToNextPhase;
+- (NSInteger)readData:(NSData *)data
+ intoBuffer:(uint8_t *)buffer
+ maxLength:(NSUInteger)length;
+@end
+
+@implementation AFHTTPBodyPart
+
+- (id)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ [self transitionToNextPhase];
+
+ return self;
+}
+
+- (void)dealloc {
+ if (_inputStream) {
+ [_inputStream close];
+ _inputStream = nil;
+ }
+}
+
+- (NSInputStream *)inputStream {
+ if (!_inputStream) {
+ if ([self.body isKindOfClass:[NSData class]]) {
+ _inputStream = [NSInputStream inputStreamWithData:self.body];
+ } else if ([self.body isKindOfClass:[NSURL class]]) {
+ _inputStream = [NSInputStream inputStreamWithURL:self.body];
+ } else if ([self.body isKindOfClass:[NSInputStream class]]) {
+ _inputStream = self.body;
+ } else {
+ _inputStream = [NSInputStream inputStreamWithData:[NSData data]];
+ }
+ }
+
+ return _inputStream;
+}
+
+- (NSString *)stringForHeaders {
+ NSMutableString *headerString = [NSMutableString string];
+ for (NSString *field in [self.headers allKeys]) {
+ [headerString appendString:[NSString stringWithFormat:@"%@: %@%@", field, [self.headers valueForKey:field], kAFMultipartFormCRLF]];
+ }
+ [headerString appendString:kAFMultipartFormCRLF];
+
+ return [NSString stringWithString:headerString];
+}
+
+- (unsigned long long)contentLength {
+ unsigned long long length = 0;
+
+ NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding];
+ length += [encapsulationBoundaryData length];
+
+ NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding];
+ length += [headersData length];
+
+ length += _bodyContentLength;
+
+ NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]);
+ length += [closingBoundaryData length];
+
+ return length;
+}
+
+- (BOOL)hasBytesAvailable {
+ // Allows `read:maxLength:` to be called again if `AFMultipartFormFinalBoundary` doesn't fit into the available buffer
+ if (_phase == AFFinalBoundaryPhase) {
+ return YES;
+ }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcovered-switch-default"
+ switch (self.inputStream.streamStatus) {
+ case NSStreamStatusNotOpen:
+ case NSStreamStatusOpening:
+ case NSStreamStatusOpen:
+ case NSStreamStatusReading:
+ case NSStreamStatusWriting:
+ return YES;
+ case NSStreamStatusAtEnd:
+ case NSStreamStatusClosed:
+ case NSStreamStatusError:
+ default:
+ return NO;
+ }
+#pragma clang diagnostic pop
+}
+
+- (NSInteger)read:(uint8_t *)buffer
+ maxLength:(NSUInteger)length
+{
+ NSInteger totalNumberOfBytesRead = 0;
+
+ if (_phase == AFEncapsulationBoundaryPhase) {
+ NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding];
+ totalNumberOfBytesRead += [self readData:encapsulationBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
+ }
+
+ if (_phase == AFHeaderPhase) {
+ NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding];
+ totalNumberOfBytesRead += [self readData:headersData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
+ }
+
+ if (_phase == AFBodyPhase) {
+ NSInteger numberOfBytesRead = 0;
+
+ numberOfBytesRead = [self.inputStream read:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
+ if (numberOfBytesRead == -1) {
+ return -1;
+ } else {
+ totalNumberOfBytesRead += numberOfBytesRead;
+
+ if ([self.inputStream streamStatus] >= NSStreamStatusAtEnd) {
+ [self transitionToNextPhase];
+ }
+ }
+ }
+
+ if (_phase == AFFinalBoundaryPhase) {
+ NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]);
+ totalNumberOfBytesRead += [self readData:closingBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)];
+ }
+
+ return totalNumberOfBytesRead;
+}
+
+- (NSInteger)readData:(NSData *)data
+ intoBuffer:(uint8_t *)buffer
+ maxLength:(NSUInteger)length
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length));
+ [data getBytes:buffer range:range];
+#pragma clang diagnostic pop
+
+ _phaseReadOffset += range.length;
+
+ if (((NSUInteger)_phaseReadOffset) >= [data length]) {
+ [self transitionToNextPhase];
+ }
+
+ return (NSInteger)range.length;
+}
+
+- (BOOL)transitionToNextPhase {
+ if (![[NSThread currentThread] isMainThread]) {
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ [self transitionToNextPhase];
+ });
+ return YES;
+ }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcovered-switch-default"
+ switch (_phase) {
+ case AFEncapsulationBoundaryPhase:
+ _phase = AFHeaderPhase;
+ break;
+ case AFHeaderPhase:
+ [self.inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
+ [self.inputStream open];
+ _phase = AFBodyPhase;
+ break;
+ case AFBodyPhase:
+ [self.inputStream close];
+ _phase = AFFinalBoundaryPhase;
+ break;
+ case AFFinalBoundaryPhase:
+ default:
+ _phase = AFEncapsulationBoundaryPhase;
+ break;
+ }
+ _phaseReadOffset = 0;
+#pragma clang diagnostic pop
+
+ return YES;
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init];
+
+ bodyPart.stringEncoding = self.stringEncoding;
+ bodyPart.headers = self.headers;
+ bodyPart.bodyContentLength = self.bodyContentLength;
+ bodyPart.body = self.body;
+ bodyPart.boundary = self.boundary;
+
+ return bodyPart;
+}
+
+@end
+
+#pragma mark -
+
+@implementation AFJSONRequestSerializer
+
++ (instancetype)serializer {
+ return [self serializerWithWritingOptions:(NSJSONWritingOptions)0];
+}
+
++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions
+{
+ AFJSONRequestSerializer *serializer = [[self alloc] init];
+ serializer.writingOptions = writingOptions;
+
+ return serializer;
+}
+
+#pragma mark - AFURLRequestSerialization
+
+- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
+ withParameters:(id)parameters
+ error:(NSError *__autoreleasing *)error
+{
+ NSParameterAssert(request);
+
+ if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) {
+ return [super requestBySerializingRequest:request withParameters:parameters error:error];
+ }
+
+ NSMutableURLRequest *mutableRequest = [request mutableCopy];
+
+ [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) {
+ if (![request valueForHTTPHeaderField:field]) {
+ [mutableRequest setValue:value forHTTPHeaderField:field];
+ }
+ }];
+
+ if (parameters) {
+ if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
+ [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
+ }
+
+ [mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]];
+ }
+
+ return mutableRequest;
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.writingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writingOptions))] unsignedIntegerValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFJSONRequestSerializer *serializer = [super copyWithZone:zone];
+ serializer.writingOptions = self.writingOptions;
+
+ return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@implementation AFPropertyListRequestSerializer
+
++ (instancetype)serializer {
+ return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 writeOptions:0];
+}
+
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+ writeOptions:(NSPropertyListWriteOptions)writeOptions
+{
+ AFPropertyListRequestSerializer *serializer = [[self alloc] init];
+ serializer.format = format;
+ serializer.writeOptions = writeOptions;
+
+ return serializer;
+}
+
+#pragma mark - AFURLRequestSerializer
+
+- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
+ withParameters:(id)parameters
+ error:(NSError *__autoreleasing *)error
+{
+ NSParameterAssert(request);
+
+ if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) {
+ return [super requestBySerializingRequest:request withParameters:parameters error:error];
+ }
+
+ NSMutableURLRequest *mutableRequest = [request mutableCopy];
+
+ [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) {
+ if (![request valueForHTTPHeaderField:field]) {
+ [mutableRequest setValue:value forHTTPHeaderField:field];
+ }
+ }];
+
+ if (parameters) {
+ if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
+ [mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"];
+ }
+
+ [mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]];
+ }
+
+ return mutableRequest;
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.format = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
+ self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
+ [coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone];
+ serializer.format = self.format;
+ serializer.writeOptions = self.writeOptions;
+
+ return serializer;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h
new file mode 100644
index 0000000000..030e8faed7
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h
@@ -0,0 +1,310 @@
+// AFSerialization.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+#import <CoreGraphics/CoreGraphics.h>
+
+/**
+ The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
+
+ For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object.
+ */
+@protocol AFURLResponseSerialization <NSObject, NSSecureCoding, NSCopying>
+
+/**
+ The response object decoded from the data associated with a specified response.
+
+ @param response The response to be processed.
+ @param data The response data to be decoded.
+ @param error The error that occurred while attempting to decode the response data.
+
+ @return The object decoded from the specified response data.
+ */
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation.
+
+ Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior.
+ */
+@interface AFHTTPResponseSerializer : NSObject <AFURLResponseSerialization>
+
+- (instancetype) init;
+
+/**
+ The string encoding used to serialize parameters.
+ */
+@property (nonatomic, assign) NSStringEncoding stringEncoding;
+
+/**
+ Creates and returns a serializer with default configuration.
+ */
++ (instancetype)serializer;
+
+///-----------------------------------------
+/// @name Configuring Response Serialization
+///-----------------------------------------
+
+/**
+ The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation.
+
+ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+ */
+@property (nonatomic, copy) NSIndexSet *acceptableStatusCodes;
+
+/**
+ The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation.
+ */
+@property (nonatomic, copy) NSSet *acceptableContentTypes;
+
+/**
+ Validates the specified response and data.
+
+ In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks.
+
+ @param response The response to be validated.
+ @param data The data associated with the response.
+ @param error The error that occurred while attempting to validate the response.
+
+ @return `YES` if the response is valid, otherwise `NO`.
+ */
+- (BOOL)validateResponse:(NSHTTPURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error;
+
+@end
+
+#pragma mark -
+
+
+/**
+ `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses.
+
+ By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types:
+
+ - `application/json`
+ - `text/json`
+ - `text/javascript`
+ */
+@interface AFJSONResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype) init;
+
+/**
+ Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
+ */
+@property (nonatomic, assign) NSJSONReadingOptions readingOptions;
+
+/**
+ Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL removesKeysWithNullValues;
+
+/**
+ Creates and returns a JSON serializer with specified reading and writing options.
+
+ @param readingOptions The specified JSON reading options.
+ */
++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects.
+
+ By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types:
+
+ - `application/xml`
+ - `text/xml`
+ */
+@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer
+
+@end
+
+#pragma mark -
+
+#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+
+/**
+ `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects.
+
+ By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types:
+
+ - `application/xml`
+ - `text/xml`
+ */
+@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype) init;
+
+/**
+ Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
+ */
+@property (nonatomic, assign) NSUInteger options;
+
+/**
+ Creates and returns an XML document serializer with the specified options.
+
+ @param mask The XML document options.
+ */
++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask;
+
+@end
+
+#endif
+
+#pragma mark -
+
+/**
+ `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects.
+
+ By default, `AFPropertyListResponseSerializer` accepts the following MIME types:
+
+ - `application/x-plist`
+ */
+@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype) init;
+
+/**
+ The property list format. Possible values are described in "NSPropertyListFormat".
+ */
+@property (nonatomic, assign) NSPropertyListFormat format;
+
+/**
+ The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions."
+ */
+@property (nonatomic, assign) NSPropertyListReadOptions readOptions;
+
+/**
+ Creates and returns a property list serializer with a specified format, read options, and write options.
+
+ @param format The property list format.
+ @param readOptions The property list reading options.
+ */
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+ readOptions:(NSPropertyListReadOptions)readOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses.
+
+ By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage:
+
+ - `image/tiff`
+ - `image/jpeg`
+ - `image/gif`
+ - `image/png`
+ - `image/ico`
+ - `image/x-icon`
+ - `image/bmp`
+ - `image/x-bmp`
+ - `image/x-xbitmap`
+ - `image/x-win-bitmap`
+ */
+@interface AFImageResponseSerializer : AFHTTPResponseSerializer
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+/**
+ The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance.
+ */
+@property (nonatomic, assign) CGFloat imageScale;
+
+/**
+ Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default.
+ */
+@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage;
+#endif
+
+@end
+
+#pragma mark -
+
+/**
+ `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer.
+ */
+@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer
+
+/**
+ The component response serializers.
+ */
+@property (readonly, nonatomic, copy) NSArray *responseSerializers;
+
+/**
+ Creates and returns a compound serializer comprised of the specified response serializers.
+
+ @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`.
+ */
++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Error Domains
+
+ The following error domain is predefined.
+
+ - `NSString * const AFURLResponseSerializationErrorDomain`
+
+ ### Constants
+
+ `AFURLResponseSerializationErrorDomain`
+ AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`.
+ */
+extern NSString * const AFURLResponseSerializationErrorDomain;
+
+/**
+ ## User info dictionary keys
+
+ These keys may exist in the user info dictionary, in addition to those defined for NSError.
+
+ - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey`
+ - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey`
+
+ ### Constants
+
+ `AFNetworkingOperationFailingURLResponseErrorKey`
+ The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
+
+ `AFNetworkingOperationFailingURLResponseDataErrorKey`
+ The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
+ */
+extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
+
+extern NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey;
+
+
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m
new file mode 100644
index 0000000000..083d30c266
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m
@@ -0,0 +1,793 @@
+// AFSerialization.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFURLResponseSerialization.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#import <UIKit/UIKit.h>
+#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+#import <Cocoa/Cocoa.h>
+#endif
+
+NSString * const AFURLResponseSerializationErrorDomain = @"com.alamofire.error.serialization.response";
+NSString * const AFNetworkingOperationFailingURLResponseErrorKey = @"com.alamofire.serialization.response.error.response";
+NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey = @"com.alamofire.serialization.response.error.data";
+
+static NSError * AFErrorWithUnderlyingError(NSError *error, NSError *underlyingError) {
+ if (!error) {
+ return underlyingError;
+ }
+
+ if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) {
+ return error;
+ }
+
+ NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy];
+ mutableUserInfo[NSUnderlyingErrorKey] = underlyingError;
+
+ return [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:mutableUserInfo];
+}
+
+static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger code, NSString *domain) {
+ if ([error.domain isEqualToString:domain] && error.code == code) {
+ return YES;
+ } else if (error.userInfo[NSUnderlyingErrorKey]) {
+ return AFErrorOrUnderlyingErrorHasCodeInDomain(error.userInfo[NSUnderlyingErrorKey], code, domain);
+ }
+
+ return NO;
+}
+
+static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
+ if ([JSONObject isKindOfClass:[NSArray class]]) {
+ NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]];
+ for (id value in (NSArray *)JSONObject) {
+ [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
+ }
+
+ return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray];
+ } else if ([JSONObject isKindOfClass:[NSDictionary class]]) {
+ NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject];
+ for (id <NSCopying> key in [(NSDictionary *)JSONObject allKeys]) {
+ id value = [(NSDictionary *)JSONObject objectForKey:key];
+ if (!value || [value isEqual:[NSNull null]]) {
+ [mutableDictionary removeObjectForKey:key];
+ } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) {
+ [mutableDictionary setObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions) forKey:key];
+ }
+ }
+
+ return (readingOptions & NSJSONReadingMutableContainers) ? mutableDictionary : [NSDictionary dictionaryWithDictionary:mutableDictionary];
+ }
+
+ return JSONObject;
+}
+
+@implementation AFHTTPResponseSerializer
+
++ (instancetype)serializer {
+ return [[self alloc] init];
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.stringEncoding = NSUTF8StringEncoding;
+
+ self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)];
+ self.acceptableContentTypes = nil;
+
+ return self;
+}
+
+#pragma mark -
+
+- (BOOL)validateResponse:(NSHTTPURLResponse *)response
+ data:(NSData *)data
+ error:(NSError * __autoreleasing *)error
+{
+ BOOL responseIsValid = YES;
+ NSError *validationError = nil;
+
+ if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) {
+ if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]]) {
+ if ([data length] > 0 && [response URL]) {
+ NSMutableDictionary *mutableUserInfo = [@{
+ NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]],
+ NSURLErrorFailingURLErrorKey:[response URL],
+ AFNetworkingOperationFailingURLResponseErrorKey: response,
+ } mutableCopy];
+ if (data) {
+ mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data;
+ }
+
+ validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:mutableUserInfo], validationError);
+ }
+
+ responseIsValid = NO;
+ }
+
+ if (self.acceptableStatusCodes && ![self.acceptableStatusCodes containsIndex:(NSUInteger)response.statusCode] && [response URL]) {
+ NSMutableDictionary *mutableUserInfo = [@{
+ NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%ld)", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], (long)response.statusCode],
+ NSURLErrorFailingURLErrorKey:[response URL],
+ AFNetworkingOperationFailingURLResponseErrorKey: response,
+ } mutableCopy];
+
+ if (data) {
+ mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data;
+ }
+
+ validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorBadServerResponse userInfo:mutableUserInfo], validationError);
+
+ responseIsValid = NO;
+ }
+ }
+
+ if (error && !responseIsValid) {
+ *error = validationError;
+ }
+
+ return responseIsValid;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ [self validateResponse:(NSHTTPURLResponse *)response data:data error:error];
+
+ return data;
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+
+ self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
+ self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [coder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
+ [coder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+ serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone];
+ serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone];
+
+ return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@implementation AFJSONResponseSerializer
+
++ (instancetype)serializer {
+ return [self serializerWithReadingOptions:(NSJSONReadingOptions)0];
+}
+
++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions {
+ AFJSONResponseSerializer *serializer = [[self alloc] init];
+ serializer.readingOptions = readingOptions;
+
+ return serializer;
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];
+
+ return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+ if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+ return nil;
+ }
+ }
+
+ // Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization.
+ // See https://github.com/rails/rails/issues/1742
+ NSStringEncoding stringEncoding = self.stringEncoding;
+ if (response.textEncodingName) {
+ CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
+ if (encoding != kCFStringEncodingInvalidId) {
+ stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
+ }
+ }
+
+ id responseObject = nil;
+ NSError *serializationError = nil;
+ @autoreleasepool {
+ NSString *responseString = [[NSString alloc] initWithData:data encoding:stringEncoding];
+ if (responseString && ![responseString isEqualToString:@" "]) {
+ // Workaround for a bug in NSJSONSerialization when Unicode character escape codes are used instead of the actual character
+ // See http://stackoverflow.com/a/12843465/157142
+ data = [responseString dataUsingEncoding:NSUTF8StringEncoding];
+
+ if (data) {
+ if ([data length] > 0) {
+ responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
+ } else {
+ return nil;
+ }
+ } else {
+ NSDictionary *userInfo = @{
+ NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"Data failed decoding as a UTF-8 string", @"AFNetworking", nil),
+ NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Could not decode string: %@", @"AFNetworking", nil), responseString]
+ };
+
+ serializationError = [NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
+ }
+ }
+ }
+
+ if (self.removesKeysWithNullValues && responseObject) {
+ responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
+ }
+
+ if (error) {
+ *error = AFErrorWithUnderlyingError(serializationError, *error);
+ }
+
+ return responseObject;
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.readingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readingOptions))] unsignedIntegerValue];
+ self.removesKeysWithNullValues = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))] boolValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:@(self.readingOptions) forKey:NSStringFromSelector(@selector(readingOptions))];
+ [coder encodeObject:@(self.removesKeysWithNullValues) forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+ serializer.readingOptions = self.readingOptions;
+ serializer.removesKeysWithNullValues = self.removesKeysWithNullValues;
+
+ return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@implementation AFXMLParserResponseSerializer
+
++ (instancetype)serializer {
+ AFXMLParserResponseSerializer *serializer = [[self alloc] init];
+
+ return serializer;
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil];
+
+ return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSHTTPURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+ if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+ return nil;
+ }
+ }
+
+ return [[NSXMLParser alloc] initWithData:data];
+}
+
+@end
+
+#pragma mark -
+
+#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+
+@implementation AFXMLDocumentResponseSerializer
+
++ (instancetype)serializer {
+ return [self serializerWithXMLDocumentOptions:0];
+}
+
++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask {
+ AFXMLDocumentResponseSerializer *serializer = [[self alloc] init];
+ serializer.options = mask;
+
+ return serializer;
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil];
+
+ return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+ if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+ return nil;
+ }
+ }
+
+ NSError *serializationError = nil;
+ NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError];
+
+ if (error) {
+ *error = AFErrorWithUnderlyingError(serializationError, *error);
+ }
+
+ return document;
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.options = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(options))] unsignedIntegerValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:@(self.options) forKey:NSStringFromSelector(@selector(options))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+ serializer.options = self.options;
+
+ return serializer;
+}
+
+@end
+
+#endif
+
+#pragma mark -
+
+@implementation AFPropertyListResponseSerializer
+
++ (instancetype)serializer {
+ return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 readOptions:0];
+}
+
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+ readOptions:(NSPropertyListReadOptions)readOptions
+{
+ AFPropertyListResponseSerializer *serializer = [[self alloc] init];
+ serializer.format = format;
+ serializer.readOptions = readOptions;
+
+ return serializer;
+}
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/x-plist", nil];
+
+ return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+ if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+ return nil;
+ }
+ }
+
+ id responseObject;
+ NSError *serializationError = nil;
+
+ if (data) {
+ responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
+ }
+
+ if (error) {
+ *error = AFErrorWithUnderlyingError(serializationError, *error);
+ }
+
+ return responseObject;
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.format = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
+ self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))];
+ [coder encodeObject:@(self.readOptions) forKey:NSStringFromSelector(@selector(readOptions))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+ serializer.format = self.format;
+ serializer.readOptions = self.readOptions;
+
+ return serializer;
+}
+
+@end
+
+#pragma mark -
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#import <CoreGraphics/CoreGraphics.h>
+
+static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) {
+ UIImage *image = [[UIImage alloc] initWithData:data];
+
+ return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation];
+}
+
+static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *response, NSData *data, CGFloat scale) {
+ if (!data || [data length] == 0) {
+ return nil;
+ }
+
+ CGImageRef imageRef = NULL;
+ CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data);
+
+ if ([response.MIMEType isEqualToString:@"image/png"]) {
+ imageRef = CGImageCreateWithPNGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault);
+ } else if ([response.MIMEType isEqualToString:@"image/jpeg"]) {
+ imageRef = CGImageCreateWithJPEGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault);
+
+ // CGImageCreateWithJPEGDataProvider does not properly handle CMKY, so if so, fall back to AFImageWithDataAtScale
+ if (imageRef) {
+ CGColorSpaceRef imageColorSpace = CGImageGetColorSpace(imageRef);
+ CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(imageColorSpace);
+ if (imageColorSpaceModel == kCGColorSpaceModelCMYK) {
+ CGImageRelease(imageRef);
+ imageRef = NULL;
+ }
+ }
+ }
+
+ CGDataProviderRelease(dataProvider);
+
+ UIImage *image = AFImageWithDataAtScale(data, scale);
+ if (!imageRef) {
+ if (image.images || !image) {
+ return image;
+ }
+
+ imageRef = CGImageCreateCopy([image CGImage]);
+ if (!imageRef) {
+ return nil;
+ }
+ }
+
+ size_t width = CGImageGetWidth(imageRef);
+ size_t height = CGImageGetHeight(imageRef);
+ size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);
+
+ if (width * height > 1024 * 1024 || bitsPerComponent > 8) {
+ CGImageRelease(imageRef);
+
+ return image;
+ }
+
+ size_t bytesPerRow = 0; // CGImageGetBytesPerRow() calculates incorrectly in iOS 5.0, so defer to CGBitmapContextCreate
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace);
+ CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
+
+ if (colorSpaceModel == kCGColorSpaceModelRGB) {
+ uint32_t alpha = (bitmapInfo & kCGBitmapAlphaInfoMask);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wassign-enum"
+ if (alpha == kCGImageAlphaNone) {
+ bitmapInfo &= ~kCGBitmapAlphaInfoMask;
+ bitmapInfo |= kCGImageAlphaNoneSkipFirst;
+ } else if (!(alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast)) {
+ bitmapInfo &= ~kCGBitmapAlphaInfoMask;
+ bitmapInfo |= kCGImageAlphaPremultipliedFirst;
+ }
+#pragma clang diagnostic pop
+ }
+
+ CGContextRef context = CGBitmapContextCreate(NULL, width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo);
+
+ CGColorSpaceRelease(colorSpace);
+
+ if (!context) {
+ CGImageRelease(imageRef);
+
+ return image;
+ }
+
+ CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, width, height), imageRef);
+ CGImageRef inflatedImageRef = CGBitmapContextCreateImage(context);
+
+ CGContextRelease(context);
+
+ UIImage *inflatedImage = [[UIImage alloc] initWithCGImage:inflatedImageRef scale:scale orientation:image.imageOrientation];
+
+ CGImageRelease(inflatedImageRef);
+ CGImageRelease(imageRef);
+
+ return inflatedImage;
+}
+#endif
+
+
+@implementation AFImageResponseSerializer
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap", nil];
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ self.imageScale = [[UIScreen mainScreen] scale];
+ self.automaticallyInflatesResponseImage = YES;
+#endif
+
+ return self;
+}
+
+#pragma mark - AFURLResponseSerializer
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+ if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+ return nil;
+ }
+ }
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ if (self.automaticallyInflatesResponseImage) {
+ return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale);
+ } else {
+ return AFImageWithDataAtScale(data, self.imageScale);
+ }
+#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+ // Ensure that the image is set to it's correct pixel width and height
+ NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data];
+ NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])];
+ [image addRepresentation:bitimage];
+
+ return image;
+#endif
+
+ return nil;
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))];
+#if CGFLOAT_IS_DOUBLE
+ self.imageScale = [imageScale doubleValue];
+#else
+ self.imageScale = [imageScale floatValue];
+#endif
+
+ self.automaticallyInflatesResponseImage = [decoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
+#endif
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))];
+ [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
+#endif
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+ serializer.imageScale = self.imageScale;
+ serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage;
+#endif
+
+ return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@interface AFCompoundResponseSerializer ()
+@property (readwrite, nonatomic, copy) NSArray *responseSerializers;
+@end
+
+@implementation AFCompoundResponseSerializer
+
++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers {
+ AFCompoundResponseSerializer *serializer = [[self alloc] init];
+ serializer.responseSerializers = responseSerializers;
+
+ return serializer;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+ data:(NSData *)data
+ error:(NSError *__autoreleasing *)error
+{
+ for (id <AFURLResponseSerialization> serializer in self.responseSerializers) {
+ if (![serializer isKindOfClass:[AFHTTPResponseSerializer class]]) {
+ continue;
+ }
+
+ NSError *serializerError = nil;
+ id responseObject = [serializer responseObjectForResponse:response data:data error:&serializerError];
+ if (responseObject) {
+ if (error) {
+ *error = AFErrorWithUnderlyingError(serializerError, *error);
+ }
+
+ return responseObject;
+ }
+ }
+
+ return [super responseObjectForResponse:response data:data error:error];
+}
+
+#pragma mark - NSSecureCoding
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (!self) {
+ return nil;
+ }
+
+ self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+ serializer.responseSerializers = self.responseSerializers;
+
+ return serializer;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h
new file mode 100644
index 0000000000..f475773d02
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h
@@ -0,0 +1,531 @@
+// AFURLSessionManager.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import "AFURLResponseSerialization.h"
+#import "AFURLRequestSerialization.h"
+#import "AFSecurityPolicy.h"
+#import "AFNetworkReachabilityManager.h"
+
+/**
+ `AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to `<NSURLSessionTaskDelegate>`, `<NSURLSessionDataDelegate>`, `<NSURLSessionDownloadDelegate>`, and `<NSURLSessionDelegate>`.
+
+ ## Subclassing Notes
+
+ This is the base class for `AFHTTPSessionManager`, which adds functionality specific to making HTTP requests. If you are looking to extend `AFURLSessionManager` specifically for HTTP, consider subclassing `AFHTTPSessionManager` instead.
+
+ ## NSURLSession & NSURLSessionTask Delegate Methods
+
+ `AFURLSessionManager` implements the following delegate methods:
+
+ ### `NSURLSessionDelegate`
+
+ - `URLSession:didBecomeInvalidWithError:`
+ - `URLSession:didReceiveChallenge:completionHandler:`
+ - `URLSessionDidFinishEventsForBackgroundURLSession:`
+
+ ### `NSURLSessionTaskDelegate`
+
+ - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`
+ - `URLSession:task:didReceiveChallenge:completionHandler:`
+ - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`
+ - `URLSession:task:didCompleteWithError:`
+
+ ### `NSURLSessionDataDelegate`
+
+ - `URLSession:dataTask:didReceiveResponse:completionHandler:`
+ - `URLSession:dataTask:didBecomeDownloadTask:`
+ - `URLSession:dataTask:didReceiveData:`
+ - `URLSession:dataTask:willCacheResponse:completionHandler:`
+
+ ### `NSURLSessionDownloadDelegate`
+
+ - `URLSession:downloadTask:didFinishDownloadingToURL:`
+ - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`
+ - `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`
+
+ If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first.
+
+ ## Network Reachability Monitoring
+
+ Network reachability status and change monitoring is available through the `reachabilityManager` property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See `AFNetworkReachabilityManager` for more details.
+
+ ## NSCoding Caveats
+
+ - Encoded managers do not include any block properties. Be sure to set delegate callback blocks when using `-initWithCoder:` or `NSKeyedUnarchiver`.
+
+ ## NSCopying Caveats
+
+ - `-copy` and `-copyWithZone:` return a new manager with a new `NSURLSession` created from the configuration of the original.
+ - Operation copies do not include any delegate callback blocks, as they often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ session manager when copied.
+
+ @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance.
+ */
+
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
+
+@interface AFURLSessionManager : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSSecureCoding, NSCopying>
+
+/**
+ The managed session.
+ */
+@property (readonly, nonatomic, strong) NSURLSession *session;
+
+/**
+ The operation queue on which delegate callbacks are run.
+ */
+@property (readonly, nonatomic, strong) NSOperationQueue *operationQueue;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`.
+
+ @warning `responseSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) id <AFURLResponseSerialization> responseSerializer;
+
+///-------------------------------
+/// @name Managing Security Policy
+///-------------------------------
+
+/**
+ The security policy used by created request operations to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified.
+ */
+@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
+
+///--------------------------------------
+/// @name Monitoring Network Reachability
+///--------------------------------------
+
+/**
+ The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default.
+ */
+@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager;
+
+///----------------------------
+/// @name Getting Session Tasks
+///----------------------------
+
+/**
+ The data, upload, and download tasks currently run by the managed session.
+ */
+@property (readonly, nonatomic, strong) NSArray *tasks;
+
+/**
+ The data tasks currently run by the managed session.
+ */
+@property (readonly, nonatomic, strong) NSArray *dataTasks;
+
+/**
+ The upload tasks currently run by the managed session.
+ */
+@property (readonly, nonatomic, strong) NSArray *uploadTasks;
+
+/**
+ The download tasks currently run by the managed session.
+ */
+@property (readonly, nonatomic, strong) NSArray *downloadTasks;
+
+///-------------------------------
+/// @name Managing Callback Queues
+///-------------------------------
+
+/**
+ The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used.
+ */
+@property (nonatomic, strong) dispatch_queue_t completionQueue;
+
+/**
+ The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used.
+ */
+@property (nonatomic, strong) dispatch_group_t completionGroup;
+
+///---------------------------------
+/// @name Working Around System Bugs
+///---------------------------------
+
+/**
+ Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default.
+
+ @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again.
+
+ @see https://github.com/AFNetworking/AFNetworking/issues/1675
+ */
+@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns a manager for a session created with the specified configuration. This is the designated initializer.
+
+ @param configuration The configuration used to create the managed session.
+
+ @return A manager for a newly-created session.
+ */
+- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration;
+
+/**
+ Invalidates the managed session, optionally canceling pending tasks.
+
+ @param cancelPendingTasks Whether or not to cancel pending tasks.
+ */
+- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks;
+
+///-------------------------
+/// @name Running Data Tasks
+///-------------------------
+
+/**
+ Creates an `NSURLSessionDataTask` with the specified request.
+
+ @param request The HTTP request for the request.
+ @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
+ */
+- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
+
+///---------------------------
+/// @name Running Upload Tasks
+///---------------------------
+
+/**
+ Creates an `NSURLSessionUploadTask` with the specified request for a local file.
+
+ @param request The HTTP request for the request.
+ @param fileURL A URL to the local file to be uploaded.
+ @param progress A progress object monitoring the current upload progress.
+ @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
+
+ @see `attemptsToRecreateUploadTasksForBackgroundSessions`
+ */
+- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
+ fromFile:(NSURL *)fileURL
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
+
+/**
+ Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body.
+
+ @param request The HTTP request for the request.
+ @param bodyData A data object containing the HTTP body to be uploaded.
+ @param progress A progress object monitoring the current upload progress.
+ @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
+ */
+- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
+ fromData:(NSData *)bodyData
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
+
+/**
+ Creates an `NSURLSessionUploadTask` with the specified streaming request.
+
+ @param request The HTTP request for the request.
+ @param progress A progress object monitoring the current upload progress.
+ @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
+ */
+- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
+
+///-----------------------------
+/// @name Running Download Tasks
+///-----------------------------
+
+/**
+ Creates an `NSURLSessionDownloadTask` with the specified request.
+
+ @param request The HTTP request for the request.
+ @param progress A progress object monitoring the current download progress.
+ @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL.
+ @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
+
+ @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method.
+ */
+- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
+ progress:(NSProgress * __autoreleasing *)progress
+ destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
+ completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;
+
+/**
+ Creates an `NSURLSessionDownloadTask` with the specified resume data.
+
+ @param resumeData The data used to resume downloading.
+ @param progress A progress object monitoring the current download progress.
+ @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL.
+ @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
+ */
+- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
+ progress:(NSProgress * __autoreleasing *)progress
+ destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
+ completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;
+
+///---------------------------------
+/// @name Getting Progress for Tasks
+///---------------------------------
+
+/**
+ Returns the upload progress of the specified task.
+
+ @param uploadTask The session upload task. Must not be `nil`.
+
+ @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable.
+ */
+- (NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask;
+
+/**
+ Returns the download progress of the specified task.
+
+ @param downloadTask The session download task. Must not be `nil`.
+
+ @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable.
+ */
+- (NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask;
+
+///-----------------------------------------
+/// @name Setting Session Delegate Callbacks
+///-----------------------------------------
+
+/**
+ Sets a block to be executed when the managed session becomes invalid, as handled by the `NSURLSessionDelegate` method `URLSession:didBecomeInvalidWithError:`.
+
+ @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation.
+ */
+- (void)setSessionDidBecomeInvalidBlock:(void (^)(NSURLSession *session, NSError *error))block;
+
+/**
+ Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`.
+
+ @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge.
+ */
+- (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block;
+
+///--------------------------------------
+/// @name Setting Task Delegate Callbacks
+///--------------------------------------
+
+/**
+ Sets a block to be executed when a task requires a new request body stream to send to the remote server, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:needNewBodyStream:`.
+
+ @param block A block object to be executed when a task requires a new request body stream.
+ */
+- (void)setTaskNeedNewBodyStreamBlock:(NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block;
+
+/**
+ Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`.
+
+ @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response.
+ */
+- (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block;
+
+/**
+ Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`.
+
+ @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge.
+ */
+- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block;
+
+/**
+ Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`.
+
+ @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread.
+ */
+- (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block;
+
+/**
+ Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`.
+
+ @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task.
+ */
+- (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, NSError *error))block;
+
+///-------------------------------------------
+/// @name Setting Data Task Delegate Callbacks
+///-------------------------------------------
+
+/**
+ Sets a block to be executed when a data task has received a response, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveResponse:completionHandler:`.
+
+ @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response.
+ */
+- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block;
+
+/**
+ Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`.
+
+ @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become.
+ */
+- (void)setDataTaskDidBecomeDownloadTaskBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block;
+
+/**
+ Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`.
+
+ @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue.
+ */
+- (void)setDataTaskDidReceiveDataBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block;
+
+/**
+ Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`.
+
+ @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response.
+ */
+- (void)setDataTaskWillCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block;
+
+/**
+ Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`.
+
+ @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session.
+ */
+- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block;
+
+///-----------------------------------------------
+/// @name Setting Download Task Delegate Callbacks
+///-----------------------------------------------
+
+/**
+ Sets a block to be executed when a download task has completed a download, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didFinishDownloadingToURL:`.
+
+ @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error.
+ */
+- (void)setDownloadTaskDidFinishDownloadingBlock:(NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block;
+
+/**
+ Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`.
+
+ @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue.
+ */
+- (void)setDownloadTaskDidWriteDataBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block;
+
+/**
+ Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`.
+
+ @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded.
+ */
+- (void)setDownloadTaskDidResumeBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block;
+
+@end
+
+#endif
+
+///--------------------
+/// @name Notifications
+///--------------------
+
+/**
+ Posted when a task begins executing.
+
+ @deprecated Use `AFNetworkingTaskDidResumeNotification` instead.
+ */
+extern NSString * const AFNetworkingTaskDidStartNotification DEPRECATED_ATTRIBUTE;
+
+/**
+ Posted when a task resumes.
+ */
+extern NSString * const AFNetworkingTaskDidResumeNotification;
+
+/**
+ Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.
+
+ @deprecated Use `AFNetworkingTaskDidCompleteNotification` instead.
+ */
+extern NSString * const AFNetworkingTaskDidFinishNotification DEPRECATED_ATTRIBUTE;
+
+/**
+ Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.
+ */
+extern NSString * const AFNetworkingTaskDidCompleteNotification;
+
+/**
+ Posted when a task suspends its execution.
+ */
+extern NSString * const AFNetworkingTaskDidSuspendNotification;
+
+/**
+ Posted when a session is invalidated.
+ */
+extern NSString * const AFURLSessionDidInvalidateNotification;
+
+/**
+ Posted when a session download task encountered an error when moving the temporary download file to a specified destination.
+ */
+extern NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification;
+
+/**
+ The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if response data exists for the task.
+
+ @deprecated Use `AFNetworkingTaskDidCompleteResponseDataKey` instead.
+ */
+extern NSString * const AFNetworkingTaskDidFinishResponseDataKey DEPRECATED_ATTRIBUTE;
+
+/**
+ The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if response data exists for the task.
+ */
+extern NSString * const AFNetworkingTaskDidCompleteResponseDataKey;
+
+/**
+ The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the response was serialized.
+
+ @deprecated Use `AFNetworkingTaskDidCompleteSerializedResponseKey` instead.
+ */
+extern NSString * const AFNetworkingTaskDidFinishSerializedResponseKey DEPRECATED_ATTRIBUTE;
+
+/**
+ The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the response was serialized.
+ */
+extern NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey;
+
+/**
+ The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer.
+
+ @deprecated Use `AFNetworkingTaskDidCompleteResponseSerializerKey` instead.
+ */
+extern NSString * const AFNetworkingTaskDidFinishResponseSerializerKey DEPRECATED_ATTRIBUTE;
+
+/**
+ The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer.
+ */
+extern NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey;
+
+/**
+ The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk.
+
+ @deprecated Use `AFNetworkingTaskDidCompleteAssetPathKey` instead.
+ */
+extern NSString * const AFNetworkingTaskDidFinishAssetPathKey DEPRECATED_ATTRIBUTE;
+
+/**
+ The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk.
+ */
+extern NSString * const AFNetworkingTaskDidCompleteAssetPathKey;
+
+/**
+ Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists.
+
+ @deprecated Use `AFNetworkingTaskDidCompleteErrorKey` instead.
+ */
+extern NSString * const AFNetworkingTaskDidFinishErrorKey DEPRECATED_ATTRIBUTE;
+
+/**
+ Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists.
+ */
+extern NSString * const AFNetworkingTaskDidCompleteErrorKey;
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m
new file mode 100644
index 0000000000..d53e6ec2db
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m
@@ -0,0 +1,1079 @@
+// AFURLSessionManager.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFURLSessionManager.h"
+#import <objc/runtime.h>
+
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
+
+static dispatch_queue_t url_session_manager_creation_queue() {
+ static dispatch_queue_t af_url_session_manager_creation_queue;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_url_session_manager_creation_queue = dispatch_queue_create("com.alamofire.networking.session.manager.creation", DISPATCH_QUEUE_SERIAL);
+ });
+
+ return af_url_session_manager_creation_queue;
+}
+
+static dispatch_queue_t url_session_manager_processing_queue() {
+ static dispatch_queue_t af_url_session_manager_processing_queue;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_url_session_manager_processing_queue = dispatch_queue_create("com.alamofire.networking.session.manager.processing", DISPATCH_QUEUE_CONCURRENT);
+ });
+
+ return af_url_session_manager_processing_queue;
+}
+
+static dispatch_group_t url_session_manager_completion_group() {
+ static dispatch_group_t af_url_session_manager_completion_group;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_url_session_manager_completion_group = dispatch_group_create();
+ });
+
+ return af_url_session_manager_completion_group;
+}
+
+NSString * const AFNetworkingTaskDidResumeNotification = @"com.alamofire.networking.task.resume";
+NSString * const AFNetworkingTaskDidCompleteNotification = @"com.alamofire.networking.task.complete";
+NSString * const AFNetworkingTaskDidSuspendNotification = @"com.alamofire.networking.task.suspend";
+NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate";
+NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error";
+
+NSString * const AFNetworkingTaskDidStartNotification = @"com.alamofire.networking.task.resume"; // Deprecated
+NSString * const AFNetworkingTaskDidFinishNotification = @"com.alamofire.networking.task.complete"; // Deprecated
+
+NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse";
+NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer";
+NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata";
+NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error";
+NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath";
+
+NSString * const AFNetworkingTaskDidFinishSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; // Deprecated
+NSString * const AFNetworkingTaskDidFinishResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; // Deprecated
+NSString * const AFNetworkingTaskDidFinishResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; // Deprecated
+NSString * const AFNetworkingTaskDidFinishErrorKey = @"com.alamofire.networking.task.complete.error"; // Deprecated
+NSString * const AFNetworkingTaskDidFinishAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; // Deprecated
+
+static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock";
+
+static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3;
+
+static void * AFTaskStateChangedContext = &AFTaskStateChangedContext;
+
+typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error);
+typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential);
+
+typedef NSURLRequest * (^AFURLSessionTaskWillPerformHTTPRedirectionBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request);
+typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionTaskDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential);
+typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSession *session);
+
+typedef NSInputStream * (^AFURLSessionTaskNeedNewBodyStreamBlock)(NSURLSession *session, NSURLSessionTask *task);
+typedef void (^AFURLSessionTaskDidSendBodyDataBlock)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
+typedef void (^AFURLSessionTaskDidCompleteBlock)(NSURLSession *session, NSURLSessionTask *task, NSError *error);
+
+typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response);
+typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask);
+typedef void (^AFURLSessionDataTaskDidReceiveDataBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data);
+typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse);
+
+typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location);
+typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
+typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes);
+
+typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error);
+
+#pragma mark -
+
+@interface AFURLSessionManagerTaskDelegate : NSObject <NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate>
+@property (nonatomic, weak) AFURLSessionManager *manager;
+@property (nonatomic, strong) NSMutableData *mutableData;
+@property (nonatomic, strong) NSProgress *progress;
+@property (nonatomic, copy) NSURL *downloadFileURL;
+@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading;
+@property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler;
+@end
+
+@implementation AFURLSessionManagerTaskDelegate
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ self.mutableData = [NSMutableData data];
+
+ self.progress = [NSProgress progressWithTotalUnitCount:0];
+
+ return self;
+}
+
+#pragma mark - NSURLSessionTaskDelegate
+
+- (void)URLSession:(__unused NSURLSession *)session
+ task:(__unused NSURLSessionTask *)task
+ didSendBodyData:(__unused int64_t)bytesSent
+ totalBytesSent:(int64_t)totalBytesSent
+totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
+{
+ self.progress.totalUnitCount = totalBytesExpectedToSend;
+ self.progress.completedUnitCount = totalBytesSent;
+}
+
+- (void)URLSession:(__unused NSURLSession *)session
+ task:(NSURLSessionTask *)task
+didCompleteWithError:(NSError *)error
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ __strong AFURLSessionManager *manager = self.manager;
+
+ __block id responseObject = nil;
+
+ __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
+ userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer;
+
+ if (self.downloadFileURL) {
+ userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL;
+ } else if (self.mutableData) {
+ userInfo[AFNetworkingTaskDidCompleteResponseDataKey] = [NSData dataWithData:self.mutableData];
+ }
+
+ if (error) {
+ userInfo[AFNetworkingTaskDidCompleteErrorKey] = error;
+
+ dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{
+ if (self.completionHandler) {
+ self.completionHandler(task.response, responseObject, error);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo];
+ });
+ });
+ } else {
+ dispatch_async(url_session_manager_processing_queue(), ^{
+ NSError *serializationError = nil;
+ responseObject = [manager.responseSerializer responseObjectForResponse:task.response data:[NSData dataWithData:self.mutableData] error:&serializationError];
+
+ if (self.downloadFileURL) {
+ responseObject = self.downloadFileURL;
+ }
+
+ if (responseObject) {
+ userInfo[AFNetworkingTaskDidCompleteSerializedResponseKey] = responseObject;
+ }
+
+ if (serializationError) {
+ userInfo[AFNetworkingTaskDidCompleteErrorKey] = serializationError;
+ }
+
+ dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{
+ if (self.completionHandler) {
+ self.completionHandler(task.response, responseObject, serializationError);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo];
+ });
+ });
+ });
+ }
+#pragma clang diagnostic pop
+}
+
+#pragma mark - NSURLSessionDataTaskDelegate
+
+- (void)URLSession:(__unused NSURLSession *)session
+ dataTask:(__unused NSURLSessionDataTask *)dataTask
+ didReceiveData:(NSData *)data
+{
+ [self.mutableData appendData:data];
+}
+
+#pragma mark - NSURLSessionDownloadTaskDelegate
+
+- (void)URLSession:(NSURLSession *)session
+ downloadTask:(NSURLSessionDownloadTask *)downloadTask
+didFinishDownloadingToURL:(NSURL *)location
+{
+ NSError *fileManagerError = nil;
+ self.downloadFileURL = nil;
+
+ if (self.downloadTaskDidFinishDownloading) {
+ self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location);
+ if (self.downloadFileURL) {
+ [[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError];
+
+ if (fileManagerError) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo];
+ }
+ }
+ }
+}
+
+- (void)URLSession:(__unused NSURLSession *)session
+ downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
+ didWriteData:(__unused int64_t)bytesWritten
+ totalBytesWritten:(int64_t)totalBytesWritten
+totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
+{
+ self.progress.totalUnitCount = totalBytesExpectedToWrite;
+ self.progress.completedUnitCount = totalBytesWritten;
+}
+
+- (void)URLSession:(__unused NSURLSession *)session
+ downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
+ didResumeAtOffset:(int64_t)fileOffset
+expectedTotalBytes:(int64_t)expectedTotalBytes {
+ self.progress.totalUnitCount = expectedTotalBytes;
+ self.progress.completedUnitCount = fileOffset;
+}
+
+@end
+
+#pragma mark -
+
+/*
+ A workaround for issues related to key-value observing the `state` of an `NSURLSessionTask`.
+
+ See https://github.com/AFNetworking/AFNetworking/issues/1477
+ */
+
+static inline void af_swizzleSelector(Class class, SEL originalSelector, SEL swizzledSelector) {
+ Method originalMethod = class_getInstanceMethod(class, originalSelector);
+ Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
+ if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) {
+ class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
+ } else {
+ method_exchangeImplementations(originalMethod, swizzledMethod);
+ }
+}
+
+static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume";
+static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofire.networking.nsurlsessiontask.suspend";
+
+@interface NSURLSessionTask (_AFStateObserving)
+@end
+
+@implementation NSURLSessionTask (_AFStateObserving)
+
++ (void)load {
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ af_swizzleSelector([self class], @selector(resume), @selector(af_resume));
+ af_swizzleSelector([self class], @selector(suspend), @selector(af_suspend));
+ });
+}
+
+#pragma mark -
+
+- (void)af_resume {
+ NSURLSessionTaskState state = self.state;
+ [self af_resume];
+
+ if (state != NSURLSessionTaskStateRunning) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidResumeNotification object:self];
+ }
+}
+
+- (void)af_suspend {
+ NSURLSessionTaskState state = self.state;
+ [self af_suspend];
+
+ if (state != NSURLSessionTaskStateSuspended) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidSuspendNotification object:self];
+ }
+}
+
+@end
+
+#pragma mark -
+
+@interface AFURLSessionManager ()
+@property (readwrite, nonatomic, strong) NSURLSessionConfiguration *sessionConfiguration;
+@property (readwrite, nonatomic, strong) NSOperationQueue *operationQueue;
+@property (readwrite, nonatomic, strong) NSURLSession *session;
+@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableTaskDelegatesKeyedByTaskIdentifier;
+@property (readwrite, nonatomic, strong) NSLock *lock;
+@property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid;
+@property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge;
+@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession;
+@property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection;
+@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge;
+@property (readwrite, nonatomic, copy) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream;
+@property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData;
+@property (readwrite, nonatomic, copy) AFURLSessionTaskDidCompleteBlock taskDidComplete;
+@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse;
+@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask;
+@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData;
+@property (readwrite, nonatomic, copy) AFURLSessionDataTaskWillCacheResponseBlock dataTaskWillCacheResponse;
+@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading;
+@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidWriteDataBlock downloadTaskDidWriteData;
+@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidResumeBlock downloadTaskDidResume;
+@end
+
+@implementation AFURLSessionManager
+
+- (instancetype)init {
+ return [self initWithSessionConfiguration:nil];
+}
+
+- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ if (!configuration) {
+ configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+ }
+
+ self.sessionConfiguration = configuration;
+
+ self.operationQueue = [[NSOperationQueue alloc] init];
+ self.operationQueue.maxConcurrentOperationCount = 1;
+
+ self.session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue];
+
+ self.responseSerializer = [AFJSONResponseSerializer serializer];
+
+ self.securityPolicy = [AFSecurityPolicy defaultPolicy];
+
+ self.reachabilityManager = [AFNetworkReachabilityManager sharedManager];
+
+ self.mutableTaskDelegatesKeyedByTaskIdentifier = [[NSMutableDictionary alloc] init];
+
+ self.lock = [[NSLock alloc] init];
+ self.lock.name = AFURLSessionManagerLockName;
+
+ [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
+ for (NSURLSessionDataTask *task in dataTasks) {
+ [self addDelegateForDataTask:task completionHandler:nil];
+ }
+
+ for (NSURLSessionUploadTask *uploadTask in uploadTasks) {
+ [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil];
+ }
+
+ for (NSURLSessionDownloadTask *downloadTask in downloadTasks) {
+ [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil];
+ }
+ }];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:nil];
+
+ return self;
+}
+
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+- (void)taskDidResume:(NSNotification *)notification {
+ NSURLSessionTask *task = notification.object;
+ if ([task isKindOfClass:[NSURLSessionTask class]]) {
+ AFURLSessionManager *manager = [self delegateForTask:task].manager;
+ if ([manager isEqual:self]) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidResumeNotification object:task];
+ });
+ }
+ }
+}
+
+- (void)taskDidSuspend:(NSNotification *)notification {
+ NSURLSessionTask *task = notification.object;
+ if ([task isKindOfClass:[NSURLSessionTask class]]) {
+ AFURLSessionManager *manager = [self delegateForTask:task].manager;
+ if ([manager isEqual:self]) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidSuspendNotification object:task];
+ });
+ }
+ }
+}
+
+#pragma mark -
+
+- (AFURLSessionManagerTaskDelegate *)delegateForTask:(NSURLSessionTask *)task {
+ NSParameterAssert(task);
+
+ AFURLSessionManagerTaskDelegate *delegate = nil;
+ [self.lock lock];
+ delegate = self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)];
+ [self.lock unlock];
+
+ return delegate;
+}
+
+- (void)setDelegate:(AFURLSessionManagerTaskDelegate *)delegate
+ forTask:(NSURLSessionTask *)task
+{
+ NSParameterAssert(task);
+ NSParameterAssert(delegate);
+
+ [self.lock lock];
+ self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate;
+ [self.lock unlock];
+}
+
+- (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
+{
+ AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
+ delegate.manager = self;
+ delegate.completionHandler = completionHandler;
+
+ [self setDelegate:delegate forTask:dataTask];
+}
+
+- (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
+{
+ AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
+ delegate.manager = self;
+ delegate.completionHandler = completionHandler;
+
+ int64_t totalUnitCount = uploadTask.countOfBytesExpectedToSend;
+ if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
+ NSString *contentLength = [uploadTask.originalRequest valueForHTTPHeaderField:@"Content-Length"];
+ if(contentLength) {
+ totalUnitCount = (int64_t) [contentLength longLongValue];
+ }
+ }
+
+ delegate.progress = [NSProgress progressWithTotalUnitCount:totalUnitCount];
+ delegate.progress.pausingHandler = ^{
+ [uploadTask suspend];
+ };
+ delegate.progress.cancellationHandler = ^{
+ [uploadTask cancel];
+ };
+
+ if (progress) {
+ *progress = delegate.progress;
+ }
+
+ [self setDelegate:delegate forTask:uploadTask];
+}
+
+- (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask
+ progress:(NSProgress * __autoreleasing *)progress
+ destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
+ completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
+{
+ AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
+ delegate.manager = self;
+ delegate.completionHandler = completionHandler;
+
+ if (destination) {
+ delegate.downloadTaskDidFinishDownloading = ^NSURL * (NSURLSession * __unused session, NSURLSessionDownloadTask *task, NSURL *location) {
+ return destination(location, task.response);
+ };
+ }
+
+ if (progress) {
+ *progress = delegate.progress;
+ }
+
+ [self setDelegate:delegate forTask:downloadTask];
+}
+
+- (void)removeDelegateForTask:(NSURLSessionTask *)task {
+ NSParameterAssert(task);
+
+ [self.lock lock];
+ [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)];
+ [self.lock unlock];
+}
+
+- (void)removeAllDelegates {
+ [self.lock lock];
+ [self.mutableTaskDelegatesKeyedByTaskIdentifier removeAllObjects];
+ [self.lock unlock];
+}
+
+#pragma mark -
+
+- (NSArray *)tasksForKeyPath:(NSString *)keyPath {
+ __block NSArray *tasks = nil;
+ dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
+ [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(dataTasks))]) {
+ tasks = dataTasks;
+ } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(uploadTasks))]) {
+ tasks = uploadTasks;
+ } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(downloadTasks))]) {
+ tasks = downloadTasks;
+ } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(tasks))]) {
+ tasks = [@[dataTasks, uploadTasks, downloadTasks] valueForKeyPath:@"@unionOfArrays.self"];
+ }
+
+ dispatch_semaphore_signal(semaphore);
+ }];
+
+ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
+
+ return tasks;
+}
+
+- (NSArray *)tasks {
+ return [self tasksForKeyPath:NSStringFromSelector(_cmd)];
+}
+
+- (NSArray *)dataTasks {
+ return [self tasksForKeyPath:NSStringFromSelector(_cmd)];
+}
+
+- (NSArray *)uploadTasks {
+ return [self tasksForKeyPath:NSStringFromSelector(_cmd)];
+}
+
+- (NSArray *)downloadTasks {
+ return [self tasksForKeyPath:NSStringFromSelector(_cmd)];
+}
+
+#pragma mark -
+
+- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (cancelPendingTasks) {
+ [self.session invalidateAndCancel];
+ } else {
+ [self.session finishTasksAndInvalidate];
+ }
+ });
+}
+
+#pragma mark -
+
+- (void)setResponseSerializer:(id <AFURLResponseSerialization>)responseSerializer {
+ NSParameterAssert(responseSerializer);
+
+ _responseSerializer = responseSerializer;
+}
+
+#pragma mark -
+
+- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
+{
+ __block NSURLSessionDataTask *dataTask = nil;
+ dispatch_sync(url_session_manager_creation_queue(), ^{
+ dataTask = [self.session dataTaskWithRequest:request];
+ });
+
+ [self addDelegateForDataTask:dataTask completionHandler:completionHandler];
+
+ return dataTask;
+}
+
+#pragma mark -
+
+- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
+ fromFile:(NSURL *)fileURL
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
+{
+ __block NSURLSessionUploadTask *uploadTask = nil;
+ dispatch_sync(url_session_manager_creation_queue(), ^{
+ uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
+ });
+
+ if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) {
+ for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) {
+ uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
+ }
+ }
+
+ [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
+
+ return uploadTask;
+}
+
+- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
+ fromData:(NSData *)bodyData
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
+{
+ __block NSURLSessionUploadTask *uploadTask = nil;
+ dispatch_sync(url_session_manager_creation_queue(), ^{
+ uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData];
+ });
+
+ [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
+
+ return uploadTask;
+}
+
+- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
+ progress:(NSProgress * __autoreleasing *)progress
+ completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
+{
+ __block NSURLSessionUploadTask *uploadTask = nil;
+ dispatch_sync(url_session_manager_creation_queue(), ^{
+ uploadTask = [self.session uploadTaskWithStreamedRequest:request];
+ });
+
+ [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
+
+ return uploadTask;
+}
+
+#pragma mark -
+
+- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
+ progress:(NSProgress * __autoreleasing *)progress
+ destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
+ completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
+{
+ __block NSURLSessionDownloadTask *downloadTask = nil;
+ dispatch_sync(url_session_manager_creation_queue(), ^{
+ downloadTask = [self.session downloadTaskWithRequest:request];
+ });
+
+ [self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler];
+
+ return downloadTask;
+}
+
+- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
+ progress:(NSProgress * __autoreleasing *)progress
+ destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
+ completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
+{
+ __block NSURLSessionDownloadTask *downloadTask = nil;
+ dispatch_sync(url_session_manager_creation_queue(), ^{
+ downloadTask = [self.session downloadTaskWithResumeData:resumeData];
+ });
+
+ [self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler];
+
+ return downloadTask;
+}
+
+#pragma mark -
+
+- (NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask {
+ return [[self delegateForTask:uploadTask] progress];
+}
+
+- (NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask {
+ return [[self delegateForTask:downloadTask] progress];
+}
+
+#pragma mark -
+
+- (void)setSessionDidBecomeInvalidBlock:(void (^)(NSURLSession *session, NSError *error))block {
+ self.sessionDidBecomeInvalid = block;
+}
+
+- (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block {
+ self.sessionDidReceiveAuthenticationChallenge = block;
+}
+
+- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block {
+ self.didFinishEventsForBackgroundURLSession = block;
+}
+
+#pragma mark -
+
+- (void)setTaskNeedNewBodyStreamBlock:(NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block {
+ self.taskNeedNewBodyStream = block;
+}
+
+- (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block {
+ self.taskWillPerformHTTPRedirection = block;
+}
+
+- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block {
+ self.taskDidReceiveAuthenticationChallenge = block;
+}
+
+- (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block {
+ self.taskDidSendBodyData = block;
+}
+
+- (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, NSError *error))block {
+ self.taskDidComplete = block;
+}
+
+#pragma mark -
+
+- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block {
+ self.dataTaskDidReceiveResponse = block;
+}
+
+- (void)setDataTaskDidBecomeDownloadTaskBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block {
+ self.dataTaskDidBecomeDownloadTask = block;
+}
+
+- (void)setDataTaskDidReceiveDataBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block {
+ self.dataTaskDidReceiveData = block;
+}
+
+- (void)setDataTaskWillCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block {
+ self.dataTaskWillCacheResponse = block;
+}
+
+#pragma mark -
+
+- (void)setDownloadTaskDidFinishDownloadingBlock:(NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block {
+ self.downloadTaskDidFinishDownloading = block;
+}
+
+- (void)setDownloadTaskDidWriteDataBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block {
+ self.downloadTaskDidWriteData = block;
+}
+
+- (void)setDownloadTaskDidResumeBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block {
+ self.downloadTaskDidResume = block;
+}
+
+#pragma mark - NSObject
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@: %p, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, self.session, self.operationQueue];
+}
+
+- (BOOL)respondsToSelector:(SEL)selector {
+ if (selector == @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)) {
+ return self.taskWillPerformHTTPRedirection != nil;
+ } else if (selector == @selector(URLSession:dataTask:didReceiveResponse:completionHandler:)) {
+ return self.dataTaskDidReceiveResponse != nil;
+ } else if (selector == @selector(URLSession:dataTask:willCacheResponse:completionHandler:)) {
+ return self.dataTaskWillCacheResponse != nil;
+ } else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) {
+ return self.didFinishEventsForBackgroundURLSession != nil;
+ }
+
+ return [[self class] instancesRespondToSelector:selector];
+}
+
+#pragma mark - NSURLSessionDelegate
+
+- (void)URLSession:(NSURLSession *)session
+didBecomeInvalidWithError:(NSError *)error
+{
+ if (self.sessionDidBecomeInvalid) {
+ self.sessionDidBecomeInvalid(session, error);
+ }
+
+ [self removeAllDelegates];
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session];
+}
+
+- (void)URLSession:(NSURLSession *)session
+didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
+ completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
+{
+ NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling;
+ __block NSURLCredential *credential = nil;
+
+ if (self.sessionDidReceiveAuthenticationChallenge) {
+ disposition = self.sessionDidReceiveAuthenticationChallenge(session, challenge, &credential);
+ } else {
+ if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
+ if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) {
+ credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
+ if (credential) {
+ disposition = NSURLSessionAuthChallengeUseCredential;
+ } else {
+ disposition = NSURLSessionAuthChallengePerformDefaultHandling;
+ }
+ } else {
+ disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;
+ }
+ } else {
+ disposition = NSURLSessionAuthChallengePerformDefaultHandling;
+ }
+ }
+
+ if (completionHandler) {
+ completionHandler(disposition, credential);
+ }
+}
+
+#pragma mark - NSURLSessionTaskDelegate
+
+- (void)URLSession:(NSURLSession *)session
+ task:(NSURLSessionTask *)task
+willPerformHTTPRedirection:(NSHTTPURLResponse *)response
+ newRequest:(NSURLRequest *)request
+ completionHandler:(void (^)(NSURLRequest *))completionHandler
+{
+ NSURLRequest *redirectRequest = request;
+
+ if (self.taskWillPerformHTTPRedirection) {
+ redirectRequest = self.taskWillPerformHTTPRedirection(session, task, response, request);
+ }
+
+ if (completionHandler) {
+ completionHandler(redirectRequest);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ task:(NSURLSessionTask *)task
+didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
+ completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
+{
+ NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling;
+ __block NSURLCredential *credential = nil;
+
+ if (self.taskDidReceiveAuthenticationChallenge) {
+ disposition = self.taskDidReceiveAuthenticationChallenge(session, task, challenge, &credential);
+ } else {
+ if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
+ if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) {
+ disposition = NSURLSessionAuthChallengeUseCredential;
+ credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
+ } else {
+ disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge;
+ }
+ } else {
+ disposition = NSURLSessionAuthChallengePerformDefaultHandling;
+ }
+ }
+
+ if (completionHandler) {
+ completionHandler(disposition, credential);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ task:(NSURLSessionTask *)task
+ needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler
+{
+ NSInputStream *inputStream = nil;
+
+ if (self.taskNeedNewBodyStream) {
+ inputStream = self.taskNeedNewBodyStream(session, task);
+ } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) {
+ inputStream = [task.originalRequest.HTTPBodyStream copy];
+ }
+
+ if (completionHandler) {
+ completionHandler(inputStream);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ task:(NSURLSessionTask *)task
+ didSendBodyData:(int64_t)bytesSent
+ totalBytesSent:(int64_t)totalBytesSent
+totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
+{
+
+ int64_t totalUnitCount = totalBytesExpectedToSend;
+ if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
+ NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"];
+ if(contentLength) {
+ totalUnitCount = (int64_t) [contentLength longLongValue];
+ }
+ }
+
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
+ [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount];
+
+ if (self.taskDidSendBodyData) {
+ self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ task:(NSURLSessionTask *)task
+didCompleteWithError:(NSError *)error
+{
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
+
+ // delegate may be nil when completing a task in the background
+ if (delegate) {
+ [delegate URLSession:session task:task didCompleteWithError:error];
+
+ [self removeDelegateForTask:task];
+ }
+
+ if (self.taskDidComplete) {
+ self.taskDidComplete(session, task, error);
+ }
+
+}
+
+#pragma mark - NSURLSessionDataDelegate
+
+- (void)URLSession:(NSURLSession *)session
+ dataTask:(NSURLSessionDataTask *)dataTask
+didReceiveResponse:(NSURLResponse *)response
+ completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler
+{
+ NSURLSessionResponseDisposition disposition = NSURLSessionResponseAllow;
+
+ if (self.dataTaskDidReceiveResponse) {
+ disposition = self.dataTaskDidReceiveResponse(session, dataTask, response);
+ }
+
+ if (completionHandler) {
+ completionHandler(disposition);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ dataTask:(NSURLSessionDataTask *)dataTask
+didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
+{
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask];
+ if (delegate) {
+ [self removeDelegateForTask:dataTask];
+ [self setDelegate:delegate forTask:downloadTask];
+ }
+
+ if (self.dataTaskDidBecomeDownloadTask) {
+ self.dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ dataTask:(NSURLSessionDataTask *)dataTask
+ didReceiveData:(NSData *)data
+{
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask];
+ [delegate URLSession:session dataTask:dataTask didReceiveData:data];
+
+ if (self.dataTaskDidReceiveData) {
+ self.dataTaskDidReceiveData(session, dataTask, data);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ dataTask:(NSURLSessionDataTask *)dataTask
+ willCacheResponse:(NSCachedURLResponse *)proposedResponse
+ completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler
+{
+ NSCachedURLResponse *cachedResponse = proposedResponse;
+
+ if (self.dataTaskWillCacheResponse) {
+ cachedResponse = self.dataTaskWillCacheResponse(session, dataTask, proposedResponse);
+ }
+
+ if (completionHandler) {
+ completionHandler(cachedResponse);
+ }
+}
+
+- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session {
+ if (self.didFinishEventsForBackgroundURLSession) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ self.didFinishEventsForBackgroundURLSession(session);
+ });
+ }
+}
+
+#pragma mark - NSURLSessionDownloadDelegate
+
+- (void)URLSession:(NSURLSession *)session
+ downloadTask:(NSURLSessionDownloadTask *)downloadTask
+didFinishDownloadingToURL:(NSURL *)location
+{
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
+ if (self.downloadTaskDidFinishDownloading) {
+ NSURL *fileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location);
+ if (fileURL) {
+ delegate.downloadFileURL = fileURL;
+ NSError *error = nil;
+ [[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error];
+ if (error) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo];
+ }
+
+ return;
+ }
+ }
+
+ if (delegate) {
+ [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location];
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ downloadTask:(NSURLSessionDownloadTask *)downloadTask
+ didWriteData:(int64_t)bytesWritten
+ totalBytesWritten:(int64_t)totalBytesWritten
+totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
+{
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
+ [delegate URLSession:session downloadTask:downloadTask didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
+
+ if (self.downloadTaskDidWriteData) {
+ self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
+ }
+}
+
+- (void)URLSession:(NSURLSession *)session
+ downloadTask:(NSURLSessionDownloadTask *)downloadTask
+ didResumeAtOffset:(int64_t)fileOffset
+expectedTotalBytes:(int64_t)expectedTotalBytes
+{
+ AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
+ [delegate URLSession:session downloadTask:downloadTask didResumeAtOffset:fileOffset expectedTotalBytes:expectedTotalBytes];
+
+ if (self.downloadTaskDidResume) {
+ self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes);
+ }
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (id)initWithCoder:(NSCoder *)decoder {
+ NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
+
+ self = [self initWithSessionConfiguration:configuration];
+ if (!self) {
+ return nil;
+ }
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
+}
+
+#pragma mark - NSCopying
+
+- (id)copyWithZone:(NSZone *)zone {
+ return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration];
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/LICENSE b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/LICENSE
new file mode 100644
index 0000000000..0616192d00
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/)
+
+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.
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/README.md b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/README.md
new file mode 100644
index 0000000000..13e080c096
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/README.md
@@ -0,0 +1,383 @@
+<p align="center" >
+ <img src="https://raw.github.com/AFNetworking/AFNetworking/assets/afnetworking-logo.png" alt="AFNetworking" title="AFNetworking">
+</p>
+
+[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking)
+
+AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
+
+Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac.
+
+Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did!
+
+## How To Get Started
+
+- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps
+- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki)
+- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking
+- Read the [AFNetworking 2.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-2.0-Migration-Guide) for an overview of the architectural changes from 1.0.
+
+## Communication
+
+- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). (Tag 'afnetworking')
+- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking).
+- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue.
+- If you **have a feature request**, open an issue.
+- If you **want to contribute**, submit a pull request.
+
+### Installation with CocoaPods
+
+[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking).
+
+#### Podfile
+
+```ruby
+platform :ios, '7.0'
+pod "AFNetworking", "~> 2.0"
+```
+
+## Requirements
+
+| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Notes |
+|:--------------------:|:---------------------------:|:----------------------------:|:-------------------------------------------------------------------------:|
+| 2.x | iOS 6 | OS X 10.8 | Xcode 5 is required. `AFHTTPSessionManager` requires iOS 7 or OS X 10.9. |
+| [1.x](https://github.com/AFNetworking/AFNetworking/tree/1.x) | iOS 5 | Mac OS X 10.7 | |
+| [0.10.x](https://github.com/AFNetworking/AFNetworking/tree/0.10.x) | iOS 4 | Mac OS X 10.6 | |
+
+(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)).
+
+## Architecture
+
+### NSURLConnection
+
+- `AFURLConnectionOperation`
+- `AFHTTPRequestOperation`
+- `AFHTTPRequestOperationManager`
+
+### NSURLSession _(iOS 7 / Mac OS X 10.9)_
+
+- `AFURLSessionManager`
+- `AFHTTPSessionManager`
+
+### Serialization
+
+* `<AFURLRequestSerialization>`
+ - `AFHTTPRequestSerializer`
+ - `AFJSONRequestSerializer`
+ - `AFPropertyListRequestSerializer`
+* `<AFURLResponseSerialization>`
+ - `AFHTTPResponseSerializer`
+ - `AFJSONResponseSerializer`
+ - `AFXMLParserResponseSerializer`
+ - `AFXMLDocumentResponseSerializer` _(Mac OS X)_
+ - `AFPropertyListResponseSerializer`
+ - `AFImageResponseSerializer`
+ - `AFCompoundResponseSerializer`
+
+### Additional Functionality
+
+- `AFSecurityPolicy`
+- `AFNetworkReachabilityManager`
+
+## Usage
+
+### HTTP Request Operation Manager
+
+`AFHTTPRequestOperationManager` encapsulates the common patterns of communicating with a web application over HTTP, including request creation, response serialization, network reachability monitoring, and security, as well as request operation management.
+
+#### `GET` Request
+
+```objective-c
+AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
+[manager GET:@"http://example.com/resources.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
+ NSLog(@"JSON: %@", responseObject);
+} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ NSLog(@"Error: %@", error);
+}];
+```
+
+#### `POST` URL-Form-Encoded Request
+
+```objective-c
+AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
+NSDictionary *parameters = @{@"foo": @"bar"};
+[manager POST:@"http://example.com/resources.json" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
+ NSLog(@"JSON: %@", responseObject);
+} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ NSLog(@"Error: %@", error);
+}];
+```
+
+#### `POST` Multi-Part Request
+
+```objective-c
+AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
+NSDictionary *parameters = @{@"foo": @"bar"};
+NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"];
+[manager POST:@"http://example.com/resources.json" parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
+ [formData appendPartWithFileURL:filePath name:@"image" error:nil];
+} success:^(AFHTTPRequestOperation *operation, id responseObject) {
+ NSLog(@"Success: %@", responseObject);
+} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ NSLog(@"Error: %@", error);
+}];
+```
+
+---
+
+### AFURLSessionManager
+
+`AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to `<NSURLSessionTaskDelegate>`, `<NSURLSessionDataDelegate>`, `<NSURLSessionDownloadDelegate>`, and `<NSURLSessionDelegate>`.
+
+#### Creating a Download Task
+
+```objective-c
+NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
+
+NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"];
+NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) {
+ NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil];
+ return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]];
+} completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) {
+ NSLog(@"File downloaded to: %@", filePath);
+}];
+[downloadTask resume];
+```
+
+#### Creating an Upload Task
+
+```objective-c
+NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
+
+NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"];
+NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"];
+NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ } else {
+ NSLog(@"Success: %@ %@", response, responseObject);
+ }
+}];
+[uploadTask resume];
+```
+
+#### Creating an Upload Task for a Multi-Part Request, with Progress
+
+```objective-c
+NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
+ [formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil];
+ } error:nil];
+
+AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
+NSProgress *progress = nil;
+
+NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ } else {
+ NSLog(@"%@ %@", response, responseObject);
+ }
+}];
+
+[uploadTask resume];
+```
+
+#### Creating a Data Task
+
+```objective-c
+NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
+
+NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"];
+NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ } else {
+ NSLog(@"%@ %@", response, responseObject);
+ }
+}];
+[dataTask resume];
+```
+
+---
+
+### Request Serialization
+
+Request serializers create requests from URL strings, encoding parameters as either a query string or HTTP body.
+
+```objective-c
+NSString *URLString = @"http://example.com";
+NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]};
+```
+
+#### Query String Parameter Encoding
+
+```objective-c
+[[AFHTTPRequestSerializer serializer] requestWithMethod:@"GET" URLString:URLString parameters:parameters error:nil];
+```
+
+ GET http://example.com?foo=bar&baz[]=1&baz[]=2&baz[]=3
+
+#### URL Form Parameter Encoding
+
+```objective-c
+[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters];
+```
+
+ POST http://example.com/
+ Content-Type: application/x-www-form-urlencoded
+
+ foo=bar&baz[]=1&baz[]=2&baz[]=3
+
+#### JSON Parameter Encoding
+
+```objective-c
+[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters];
+```
+
+ POST http://example.com/
+ Content-Type: application/json
+
+ {"foo": "bar", "baz": [1,2,3]}
+
+---
+
+### Network Reachability Manager
+
+`AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
+
+#### Shared Network Reachability
+
+```objective-c
+[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
+ NSLog(@"Reachability: %@", AFStringFromNetworkReachabilityStatus(status));
+}];
+```
+
+#### HTTP Manager Reachability
+
+```objective-c
+NSURL *baseURL = [NSURL URLWithString:@"http://example.com/"];
+AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL];
+
+NSOperationQueue *operationQueue = manager.operationQueue;
+[manager.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
+ switch (status) {
+ case AFNetworkReachabilityStatusReachableViaWWAN:
+ case AFNetworkReachabilityStatusReachableViaWiFi:
+ [operationQueue setSuspended:NO];
+ break;
+ case AFNetworkReachabilityStatusNotReachable:
+ default:
+ [operationQueue setSuspended:YES];
+ break;
+ }
+}];
+
+[manager.reachabilityManager startMonitoring];
+```
+
+---
+
+### Security Policy
+
+`AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
+
+Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
+
+#### Allowing Invalid SSL Certificates
+
+```objective-c
+AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
+manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production
+```
+
+---
+
+### AFHTTPRequestOperation
+
+`AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request.
+
+Although `AFHTTPRequestOperationManager` is usually the best way to go about making requests, `AFHTTPRequestOperation` can be used by itself.
+
+#### `GET` with `AFHTTPRequestOperation`
+
+```objective-c
+NSURL *URL = [NSURL URLWithString:@"http://example.com/resources/123.json"];
+NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request];
+op.responseSerializer = [AFJSONResponseSerializer serializer];
+[op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ NSLog(@"JSON: %@", responseObject);
+} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ NSLog(@"Error: %@", error);
+}];
+[[NSOperationQueue mainQueue] addOperation:op];
+```
+
+#### Batch of Operations
+
+```objective-c
+NSMutableArray *mutableOperations = [NSMutableArray array];
+for (NSURL *fileURL in filesToUpload) {
+ NSURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
+ [formData appendPartWithFileURL:fileURL name:@"images[]" error:nil];
+ }];
+
+ AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
+
+ [mutableOperations addObject:operation];
+}
+
+NSArray *operations = [AFURLConnectionOperation batchOfRequestOperations:@[...] progressBlock:^(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations) {
+ NSLog(@"%lu of %lu complete", numberOfFinishedOperations, totalNumberOfOperations);
+} completionBlock:^(NSArray *operations) {
+ NSLog(@"All operations in batch complete");
+}];
+[[NSOperationQueue mainQueue] addOperations:operations waitUntilFinished:NO];
+```
+
+## Unit Tests
+
+AFNetworking includes a suite of unit tests within the Tests subdirectory. In order to run the unit tests, you must install the testing dependencies via [CocoaPods](http://cocoapods.org/):
+
+ $ cd Tests
+ $ pod install
+
+Once testing dependencies are installed, you can execute the test suite via the 'iOS Tests' and 'OS X Tests' schemes within Xcode.
+
+### Running Tests from the Command Line
+
+Tests can also be run from the command line or within a continuous integration environment. The [`xcpretty`](https://github.com/mneorr/xcpretty) utility needs to be installed before running the tests from the command line:
+
+ $ gem install xcpretty
+
+Once `xcpretty` is installed, you can execute the suite via `rake test`.
+
+## Credits
+
+AFNetworking was originally created by [Scott Raymond](https://github.com/sco/) and [Mattt Thompson](https://github.com/mattt/) in the development of [Gowalla for iPhone](http://en.wikipedia.org/wiki/Gowalla).
+
+AFNetworking's logo was designed by [Alan Defibaugh](http://www.alandefibaugh.com/).
+
+And most of all, thanks to AFNetworking's [growing list of contributors](https://github.com/AFNetworking/AFNetworking/contributors).
+
+## Contact
+
+Follow AFNetworking on Twitter ([@AFNetworking](https://twitter.com/AFNetworking))
+
+### Maintainers
+
+- [Mattt Thompson](http://github.com/mattt) ([@mattt](https://twitter.com/mattt))
+
+## License
+
+AFNetworking is available under the MIT license. See the LICENSE file for more info.
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
new file mode 100644
index 0000000000..312d680e0d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
@@ -0,0 +1,76 @@
+// AFNetworkActivityIndicatorManager.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+/**
+ `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero.
+
+ You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code:
+
+ [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
+
+ By setting `isNetworkActivityIndicatorVisible` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself.
+
+ See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information:
+ http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44
+ */
+@interface AFNetworkActivityIndicatorManager : NSObject
+
+/**
+ A Boolean value indicating whether the manager is enabled.
+
+ If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
+ */
+@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
+
+/**
+ A Boolean value indicating whether the network activity indicator is currently displayed in the status bar.
+ */
+@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible;
+
+/**
+ Returns the shared network activity indicator manager object for the system.
+
+ @return The systemwide network activity indicator manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator.
+ */
+- (void)incrementActivityCount;
+
+/**
+ Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator.
+ */
+- (void)decrementActivityCount;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
new file mode 100644
index 0000000000..c2d855a59c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
@@ -0,0 +1,171 @@
+// AFNetworkActivityIndicatorManager.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "AFNetworkActivityIndicatorManager.h"
+
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
+
+#import "AFHTTPRequestOperation.h"
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17;
+
+static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) {
+ if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) {
+ return [(AFURLConnectionOperation *)[notification object] request];
+ }
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+ if ([[notification object] respondsToSelector:@selector(originalRequest)]) {
+ return [(NSURLSessionTask *)[notification object] originalRequest];
+ }
+#endif
+
+ return nil;
+}
+
+@interface AFNetworkActivityIndicatorManager ()
+@property (readwrite, nonatomic, assign) NSInteger activityCount;
+@property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer;
+@property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
+
+- (void)updateNetworkActivityIndicatorVisibility;
+- (void)updateNetworkActivityIndicatorVisibilityDelayed;
+@end
+
+@implementation AFNetworkActivityIndicatorManager
+@dynamic networkActivityIndicatorVisible;
+
++ (instancetype)sharedManager {
+ static AFNetworkActivityIndicatorManager *_sharedManager = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedManager = [[self alloc] init];
+ });
+
+ return _sharedManager;
+}
+
++ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible {
+ return [NSSet setWithObject:@"activityCount"];
+}
+
+- (id)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingOperationDidStartNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingOperationDidFinishNotification object:nil];
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil];
+#endif
+
+ return self;
+}
+
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [_activityIndicatorVisibilityTimer invalidate];
+}
+
+- (void)updateNetworkActivityIndicatorVisibilityDelayed {
+ if (self.enabled) {
+ // Delay hiding of activity indicator for a short interval, to avoid flickering
+ if (![self isNetworkActivityIndicatorVisible]) {
+ [self.activityIndicatorVisibilityTimer invalidate];
+ self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kAFNetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO];
+ [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes];
+ } else {
+ [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]];
+ }
+ }
+}
+
+- (BOOL)isNetworkActivityIndicatorVisible {
+ return self.activityCount > 0;
+}
+
+- (void)updateNetworkActivityIndicatorVisibility {
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]];
+}
+
+- (void)setActivityCount:(NSInteger)activityCount {
+ @synchronized(self) {
+ _activityCount = activityCount;
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self updateNetworkActivityIndicatorVisibilityDelayed];
+ });
+}
+
+- (void)incrementActivityCount {
+ [self willChangeValueForKey:@"activityCount"];
+ @synchronized(self) {
+ _activityCount++;
+ }
+ [self didChangeValueForKey:@"activityCount"];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self updateNetworkActivityIndicatorVisibilityDelayed];
+ });
+}
+
+- (void)decrementActivityCount {
+ [self willChangeValueForKey:@"activityCount"];
+ @synchronized(self) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ _activityCount = MAX(_activityCount - 1, 0);
+#pragma clang diagnostic pop
+ }
+ [self didChangeValueForKey:@"activityCount"];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self updateNetworkActivityIndicatorVisibilityDelayed];
+ });
+}
+
+- (void)networkRequestDidStart:(NSNotification *)notification {
+ if ([AFNetworkRequestFromNotification(notification) URL]) {
+ [self incrementActivityCount];
+ }
+}
+
+- (void)networkRequestDidFinish:(NSNotification *)notification {
+ if ([AFNetworkRequestFromNotification(notification) URL]) {
+ [self decrementActivityCount];
+ }
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
new file mode 100644
index 0000000000..1c1f8dd6f8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
@@ -0,0 +1,64 @@
+// UIActivityIndicatorView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task.
+ */
+@interface UIActivityIndicatorView (AFNetworking)
+
+///----------------------------------
+/// @name Animating for Session Tasks
+///----------------------------------
+
+/**
+ Binds the animating state to the state of the specified task.
+
+ @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
+#endif
+
+///---------------------------------------
+/// @name Animating for Request Operations
+///---------------------------------------
+
+/**
+ Binds the animating state to the execution state of the specified operation.
+
+ @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
new file mode 100644
index 0000000000..6627dbb1b8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
@@ -0,0 +1,97 @@
+// UIActivityIndicatorView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIActivityIndicatorView+AFNetworking.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+@implementation UIActivityIndicatorView (AFNetworking)
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+
+ if (task) {
+ if (task.state != NSURLSessionTaskStateCompleted) {
+ if (task.state == NSURLSessionTaskStateRunning) {
+ [self startAnimating];
+ } else {
+ [self stopAnimating];
+ }
+
+ [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task];
+ }
+ }
+}
+#endif
+
+#pragma mark -
+
+- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
+
+ if (operation) {
+ if (![operation isFinished]) {
+ if ([operation isExecuting]) {
+ [self startAnimating];
+ } else {
+ [self stopAnimating];
+ }
+
+ [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingOperationDidStartNotification object:operation];
+ [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingOperationDidFinishNotification object:operation];
+ }
+ }
+}
+
+#pragma mark -
+
+- (void)af_startAnimating {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self startAnimating];
+ });
+}
+
+- (void)af_stopAnimating {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self stopAnimating];
+ });
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h
new file mode 100644
index 0000000000..b94f1cb8e0
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h
@@ -0,0 +1,96 @@
+// UIAlertView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error.
+ */
+@interface UIAlertView (AFNetworking)
+
+///-------------------------------------
+/// @name Showing Alert for Session Task
+///-------------------------------------
+
+/**
+ Shows an alert view with the error of the specified session task, if any.
+
+ @param task The session task.
+ @param delegate The alert view delegate.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate;
+#endif
+
+/**
+ Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles.
+
+ @param task The session task.
+ @param delegate The alert view delegate.
+ @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
+ @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
+#endif
+
+///------------------------------------------
+/// @name Showing Alert for Request Operation
+///------------------------------------------
+
+/**
+ Shows an alert view with the error of the specified request operation, if any.
+
+ @param operation The request operation.
+ @param delegate The alert view delegate.
+ */
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate;
+
+/**
+ Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles.
+
+ @param operation The request operation.
+ @param delegate The alert view delegate.
+ @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
+ @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`.
+ */
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m
new file mode 100644
index 0000000000..b7e2a26cb2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m
@@ -0,0 +1,111 @@
+// UIAlertView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIAlertView+AFNetworking.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFURLConnectionOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+static void AFGetAlertViewTitleAndMessageFromError(NSError *error, NSString * __autoreleasing *title, NSString * __autoreleasing *message) {
+ if (error.localizedDescription && (error.localizedRecoverySuggestion || error.localizedFailureReason)) {
+ *title = error.localizedDescription;
+
+ if (error.localizedRecoverySuggestion) {
+ *message = error.localizedRecoverySuggestion;
+ } else {
+ *message = error.localizedFailureReason;
+ }
+ } else if (error.localizedDescription) {
+ *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description");
+ *message = error.localizedDescription;
+ } else {
+ *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description");
+ *message = [NSString stringWithFormat:NSLocalizedStringFromTable(@"%@ Error: %ld", @"AFNetworking", @"Fallback Error Failure Reason Format"), error.domain, (long)error.code];
+ }
+}
+
+@implementation UIAlertView (AFNetworking)
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate
+{
+ [self showAlertViewForTaskWithErrorOnCompletion:task delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil];
+}
+
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION
+{
+ __block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingTaskDidCompleteNotification object:task queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
+
+ NSError *error = notification.userInfo[AFNetworkingTaskDidCompleteErrorKey];
+ if (error) {
+ NSString *title, *message;
+ AFGetAlertViewTitleAndMessageFromError(error, &title, &message);
+
+ [[[UIAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles, nil] show];
+ }
+
+ [[NSNotificationCenter defaultCenter] removeObserver:observer name:AFNetworkingTaskDidCompleteNotification object:notification.object];
+ }];
+}
+#endif
+
+#pragma mark -
+
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate
+{
+ [self showAlertViewForRequestOperationWithErrorOnCompletion:operation delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlert View Cancel Button Title") otherButtonTitles:nil, nil];
+}
+
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION
+{
+ __block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:operation queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
+
+ if (notification.object && [notification.object isKindOfClass:[AFURLConnectionOperation class]]) {
+ NSError *error = [(AFURLConnectionOperation *)notification.object error];
+ if (error) {
+ NSString *title, *message;
+ AFGetAlertViewTitleAndMessageFromError(error, &title, &message);
+
+ [[[UIAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles, nil] show];
+ }
+ }
+
+ [[NSNotificationCenter defaultCenter] removeObserver:observer name:AFNetworkingOperationDidFinishNotification object:notification.object];
+ }];
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h
new file mode 100644
index 0000000000..e6ed6de04c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h
@@ -0,0 +1,181 @@
+// UIButton+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@protocol AFURLResponseSerialization, AFImageCache;
+
+/**
+ This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL.
+
+ @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
+ */
+@interface UIButton (AFNetworking)
+
+///----------------------------
+/// @name Accessing Image Cache
+///----------------------------
+
+/**
+ The image cache used to improve image loadiing performance on scroll views. By default, `UIButton` will use the `sharedImageCache` of `UIImageView`.
+ */
++ (id <AFImageCache>)sharedImageCache;
+
+/**
+ Set the cache used for image loading.
+
+ @param imageCache The image cache.
+ */
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache;
+
+///------------------------------------
+/// @name Accessing Response Serializer
+///------------------------------------
+
+/**
+ The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
+
+ @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer
+ */
+@property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
+
+///--------------------
+/// @name Setting Image
+///--------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the image request.
+ */
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
+ */
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied.
+
+ @param state The control state.
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
+ @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the request and response parameters will be `nil`.
+ @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred.
+ */
+- (void)setImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure;
+
+
+///-------------------------------
+/// @name Setting Background Image
+///-------------------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled.
+
+ If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the background image request.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the background image request.
+ @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied.
+
+ @param state The control state.
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure;
+
+
+///------------------------------
+/// @name Canceling Image Loading
+///------------------------------
+
+/**
+ Cancels any executing image operation for the specified control state of the receiver, if one exists.
+
+ @param state The control state.
+ */
+- (void)cancelImageRequestOperationForState:(UIControlState)state;
+
+/**
+ Cancels any executing background image operation for the specified control state of the receiver, if one exists.
+
+ @param state The control state.
+ */
+- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m
new file mode 100644
index 0000000000..a225290a25
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m
@@ -0,0 +1,293 @@
+// UIButton+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIButton+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFURLResponseSerialization.h"
+#import "AFHTTPRequestOperation.h"
+
+#import "UIImageView+AFNetworking.h"
+
+@interface UIButton (_AFNetworking)
+@end
+
+@implementation UIButton (_AFNetworking)
+
++ (NSOperationQueue *)af_sharedImageRequestOperationQueue {
+ static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init];
+ _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;
+ });
+
+ return _af_sharedImageRequestOperationQueue;
+}
+
+#pragma mark -
+
+static char AFImageRequestOperationNormal;
+static char AFImageRequestOperationHighlighted;
+static char AFImageRequestOperationSelected;
+static char AFImageRequestOperationDisabled;
+
+static const char * af_imageRequestOperationKeyForState(UIControlState state) {
+ switch (state) {
+ case UIControlStateHighlighted:
+ return &AFImageRequestOperationHighlighted;
+ case UIControlStateSelected:
+ return &AFImageRequestOperationSelected;
+ case UIControlStateDisabled:
+ return &AFImageRequestOperationDisabled;
+ case UIControlStateNormal:
+ default:
+ return &AFImageRequestOperationNormal;
+ }
+}
+
+- (AFHTTPRequestOperation *)af_imageRequestOperationForState:(UIControlState)state {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_imageRequestOperationKeyForState(state));
+}
+
+- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation
+ forState:(UIControlState)state
+{
+ objc_setAssociatedObject(self, af_imageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+static char AFBackgroundImageRequestOperationNormal;
+static char AFBackgroundImageRequestOperationHighlighted;
+static char AFBackgroundImageRequestOperationSelected;
+static char AFBackgroundImageRequestOperationDisabled;
+
+static const char * af_backgroundImageRequestOperationKeyForState(UIControlState state) {
+ switch (state) {
+ case UIControlStateHighlighted:
+ return &AFBackgroundImageRequestOperationHighlighted;
+ case UIControlStateSelected:
+ return &AFBackgroundImageRequestOperationSelected;
+ case UIControlStateDisabled:
+ return &AFBackgroundImageRequestOperationDisabled;
+ case UIControlStateNormal:
+ default:
+ return &AFBackgroundImageRequestOperationNormal;
+ }
+}
+
+- (AFHTTPRequestOperation *)af_backgroundImageRequestOperationForState:(UIControlState)state {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state));
+}
+
+- (void)af_setBackgroundImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation
+ forState:(UIControlState)state
+{
+ objc_setAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIButton (AFNetworking)
+
++ (id <AFImageCache>)sharedImageCache {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: [UIImageView sharedImageCache];
+#pragma clang diagnostic pop
+}
+
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache {
+ objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (id <AFURLResponseSerialization>)imageResponseSerializer {
+ static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setImageResponseSerializer:(id <AFURLResponseSerialization>)serializer {
+ objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+{
+ [self setImageForState:state withURL:url placeholderImage:nil];
+}
+
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage
+{
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+ [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure
+{
+ [self cancelImageRequestOperationForState:state];
+
+ UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
+ if (cachedImage) {
+ if (success) {
+ success(nil, nil, cachedImage);
+ } else {
+ [self setImage:cachedImage forState:state];
+ }
+
+ [self af_setImageRequestOperation:nil forState:state];
+ } else {
+ if (placeholderImage) {
+ [self setImage:placeholderImage forState:state];
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ AFHTTPRequestOperation *imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
+ imageRequestOperation.responseSerializer = self.imageResponseSerializer;
+ [imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[operation.request URL]]) {
+ if (success) {
+ success(operation.request, operation.response, responseObject);
+ } else if (responseObject) {
+ [strongSelf setImage:responseObject forState:state];
+ }
+ }
+ [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ if ([[urlRequest URL] isEqual:[operation.response URL]]) {
+ if (failure) {
+ failure(error);
+ }
+ }
+ }];
+
+ [self af_setImageRequestOperation:imageRequestOperation forState:state];
+ [[[self class] af_sharedImageRequestOperationQueue] addOperation:imageRequestOperation];
+ }
+}
+
+#pragma mark -
+
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+{
+ [self setBackgroundImageForState:state withURL:url placeholderImage:nil];
+}
+
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage
+{
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+ [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure
+{
+ [self cancelBackgroundImageRequestOperationForState:state];
+
+ UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
+ if (cachedImage) {
+ if (success) {
+ success(nil, nil, cachedImage);
+ } else {
+ [self setBackgroundImage:cachedImage forState:state];
+ }
+
+ [self af_setBackgroundImageRequestOperation:nil forState:state];
+ } else {
+ if (placeholderImage) {
+ [self setBackgroundImage:placeholderImage forState:state];
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ AFHTTPRequestOperation *backgroundImageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
+ backgroundImageRequestOperation.responseSerializer = self.imageResponseSerializer;
+ [backgroundImageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[operation.request URL]]) {
+ if (success) {
+ success(operation.request, operation.response, responseObject);
+ } else if (responseObject) {
+ [strongSelf setBackgroundImage:responseObject forState:state];
+ }
+ }
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ if ([[urlRequest URL] isEqual:[operation.response URL]]) {
+ if (failure) {
+ failure(error);
+ }
+ }
+ }];
+
+ [self af_setBackgroundImageRequestOperation:backgroundImageRequestOperation forState:state];
+ [[[self class] af_sharedImageRequestOperationQueue] addOperation:backgroundImageRequestOperation];
+ }
+}
+
+#pragma mark -
+
+- (void)cancelImageRequestOperationForState:(UIControlState)state {
+ [[self af_imageRequestOperationForState:state] cancel];
+ [self af_setImageRequestOperation:nil forState:state];
+}
+
+- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state {
+ [[self af_backgroundImageRequestOperationForState:state] cancel];
+ [self af_setBackgroundImageRequestOperation:nil forState:state];
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h
new file mode 100644
index 0000000000..5d523636e8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h
@@ -0,0 +1,143 @@
+// UIImageView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@protocol AFURLResponseSerialization, AFImageCache;
+
+/**
+ This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL.
+ */
+@interface UIImageView (AFNetworking)
+
+///----------------------------
+/// @name Accessing Image Cache
+///----------------------------
+
+/**
+ The image cache used to improve image loadiing performance on scroll views. By default, this is an `NSCache` subclass conforming to the `AFImageCache` protocol, which listens for notification warnings and evicts objects accordingly.
+*/
++ (id <AFImageCache>)sharedImageCache;
+
+/**
+ Set the cache used for image loading.
+
+ @param imageCache The image cache.
+ */
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache;
+
+///------------------------------------
+/// @name Accessing Response Serializer
+///------------------------------------
+
+/**
+ The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
+
+ @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer
+ */
+@property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
+
+///--------------------
+/// @name Setting Image
+///--------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
+
+ @param url The URL used for the image request.
+ */
+- (void)setImageWithURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
+
+ @param url The URL used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
+ */
+- (void)setImageWithURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
+
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
+ @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the request and response parameters will be `nil`.
+ @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+ */
+- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure;
+
+/**
+ Cancels any executing image operation for the receiver, if one exists.
+ */
+- (void)cancelImageRequestOperation;
+
+@end
+
+#pragma mark -
+
+/**
+ The `AFImageCache` protocol is adopted by an object used to cache images loaded by the AFNetworking category on `UIImageView`.
+ */
+@protocol AFImageCache <NSObject>
+
+/**
+ Returns a cached image for the specififed request, if available.
+
+ @param request The image request.
+
+ @return The cached image.
+ */
+- (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
+
+/**
+ Caches a particular image for the specified request.
+
+ @param image The image to cache.
+ @param request The request to be used as a cache key.
+ */
+- (void)cacheImage:(UIImage *)image
+ forRequest:(NSURLRequest *)request;
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m
new file mode 100644
index 0000000000..c06aa9ca4c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m
@@ -0,0 +1,216 @@
+// UIImageView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIImageView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+
+@interface AFImageCache : NSCache <AFImageCache>
+@end
+
+#pragma mark -
+
+@interface UIImageView (_AFNetworking)
+@property (readwrite, nonatomic, strong, setter = af_setImageRequestOperation:) AFHTTPRequestOperation *af_imageRequestOperation;
+@end
+
+@implementation UIImageView (_AFNetworking)
+
++ (NSOperationQueue *)af_sharedImageRequestOperationQueue {
+ static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init];
+ _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;
+ });
+
+ return _af_sharedImageRequestOperationQueue;
+}
+
+- (AFHTTPRequestOperation *)af_imageRequestOperation {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_imageRequestOperation));
+}
+
+- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation {
+ objc_setAssociatedObject(self, @selector(af_imageRequestOperation), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIImageView (AFNetworking)
+@dynamic imageResponseSerializer;
+
++ (id <AFImageCache>)sharedImageCache {
+ static AFImageCache *_af_defaultImageCache = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _af_defaultImageCache = [[AFImageCache alloc] init];
+
+ [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) {
+ [_af_defaultImageCache removeAllObjects];
+ }];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: _af_defaultImageCache;
+#pragma clang diagnostic pop
+}
+
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache {
+ objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (id <AFURLResponseSerialization>)imageResponseSerializer {
+ static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setImageResponseSerializer:(id <AFURLResponseSerialization>)serializer {
+ objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setImageWithURL:(NSURL *)url {
+ [self setImageWithURL:url placeholderImage:nil];
+}
+
+- (void)setImageWithURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage
+{
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+ [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
+{
+ [self cancelImageRequestOperation];
+
+ UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
+ if (cachedImage) {
+ if (success) {
+ success(nil, nil, cachedImage);
+ } else {
+ self.image = cachedImage;
+ }
+
+ self.af_imageRequestOperation = nil;
+ } else {
+ if (placeholderImage) {
+ self.image = placeholderImage;
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
+ self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer;
+ [self.af_imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) {
+ if (success) {
+ success(urlRequest, operation.response, responseObject);
+ } else if (responseObject) {
+ strongSelf.image = responseObject;
+ }
+
+ if (operation == strongSelf.af_imageRequestOperation){
+ strongSelf.af_imageRequestOperation = nil;
+ }
+ }
+
+ [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) {
+ if (failure) {
+ failure(urlRequest, operation.response, error);
+ }
+
+ if (operation == strongSelf.af_imageRequestOperation){
+ strongSelf.af_imageRequestOperation = nil;
+ }
+ }
+ }];
+
+ [[[self class] af_sharedImageRequestOperationQueue] addOperation:self.af_imageRequestOperation];
+ }
+}
+
+- (void)cancelImageRequestOperation {
+ [self.af_imageRequestOperation cancel];
+ self.af_imageRequestOperation = nil;
+}
+
+@end
+
+#pragma mark -
+
+static inline NSString * AFImageCacheKeyFromURLRequest(NSURLRequest *request) {
+ return [[request URL] absoluteString];
+}
+
+@implementation AFImageCache
+
+- (UIImage *)cachedImageForRequest:(NSURLRequest *)request {
+ switch ([request cachePolicy]) {
+ case NSURLRequestReloadIgnoringCacheData:
+ case NSURLRequestReloadIgnoringLocalAndRemoteCacheData:
+ return nil;
+ default:
+ break;
+ }
+
+ return [self objectForKey:AFImageCacheKeyFromURLRequest(request)];
+}
+
+- (void)cacheImage:(UIImage *)image
+ forRequest:(NSURLRequest *)request
+{
+ if (image && request) {
+ [self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)];
+ }
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h
new file mode 100644
index 0000000000..94082f6cb5
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h
@@ -0,0 +1,38 @@
+// UIKit+AFNetworking.h
+//
+// Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
+//
+// 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 <UIKit/UIKit.h>
+
+#ifndef _UIKIT_AFNETWORKING_
+ #define _UIKIT_AFNETWORKING_
+
+ #import "AFNetworkActivityIndicatorManager.h"
+
+ #import "UIActivityIndicatorView+AFNetworking.h"
+ #import "UIAlertView+AFNetworking.h"
+ #import "UIButton+AFNetworking.h"
+ #import "UIImageView+AFNetworking.h"
+ #import "UIKit+AFNetworking.h"
+ #import "UIProgressView+AFNetworking.h"
+ #import "UIRefreshControl+AFNetworking.h"
+ #import "UIWebView+AFNetworking.h"
+#endif /* _UIKIT_AFNETWORKING_ */
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h
new file mode 100644
index 0000000000..3f1bc086f5
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h
@@ -0,0 +1,88 @@
+// UIProgressView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation.
+ */
+@interface UIProgressView (AFNetworking)
+
+///------------------------------------
+/// @name Setting Session Task Progress
+///------------------------------------
+
+/**
+ Binds the progress to the upload progress of the specified session task.
+
+ @param task The session task.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
+ animated:(BOOL)animated;
+#endif
+
+/**
+ Binds the progress to the download progress of the specified session task.
+
+ @param task The session task.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
+ animated:(BOOL)animated;
+#endif
+
+///------------------------------------
+/// @name Setting Session Task Progress
+///------------------------------------
+
+/**
+ Binds the progress to the upload progress of the specified request operation.
+
+ @param operation The request operation.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated;
+
+/**
+ Binds the progress to the download progress of the specified request operation.
+
+ @param operation The request operation.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m
new file mode 100644
index 0000000000..927f56d843
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m
@@ -0,0 +1,183 @@
+// UIProgressView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIProgressView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFURLConnectionOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext;
+static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext;
+
+@interface AFURLConnectionOperation (_UIProgressView)
+@property (readwrite, nonatomic, copy) void (^uploadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
+@property (readwrite, nonatomic, assign, setter = af_setUploadProgressAnimated:) BOOL af_uploadProgressAnimated;
+
+@property (readwrite, nonatomic, copy) void (^downloadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
+@property (readwrite, nonatomic, assign, setter = af_setDownloadProgressAnimated:) BOOL af_downloadProgressAnimated;
+@end
+
+@implementation AFURLConnectionOperation (_UIProgressView)
+@dynamic uploadProgress; // Implemented in AFURLConnectionOperation
+@dynamic af_uploadProgressAnimated;
+
+@dynamic downloadProgress; // Implemented in AFURLConnectionOperation
+@dynamic af_downloadProgressAnimated;
+@end
+
+#pragma mark -
+
+@implementation UIProgressView (AFNetworking)
+
+- (BOOL)af_uploadProgressAnimated {
+ return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue];
+}
+
+- (void)af_setUploadProgressAnimated:(BOOL)animated {
+ objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (BOOL)af_downloadProgressAnimated {
+ return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue];
+}
+
+- (void)af_setDownloadProgressAnimated:(BOOL)animated {
+ objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
+ animated:(BOOL)animated
+{
+ [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
+ [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
+
+ [self af_setUploadProgressAnimated:animated];
+}
+
+- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
+ animated:(BOOL)animated
+{
+ [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
+ [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
+
+ [self af_setDownloadProgressAnimated:animated];
+}
+#endif
+
+#pragma mark -
+
+- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated
+{
+ __weak __typeof(self)weakSelf = self;
+ void (^original)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) = [operation.uploadProgress copy];
+ [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
+ if (original) {
+ original(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (totalBytesExpectedToWrite > 0) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ [strongSelf setProgress:(totalBytesWritten / (totalBytesExpectedToWrite * 1.0f)) animated:animated];
+ }
+ });
+ }];
+}
+
+- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated
+{
+ __weak __typeof(self)weakSelf = self;
+ void (^original)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) = [operation.downloadProgress copy];
+ [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
+ if (original) {
+ original(bytesRead, totalBytesRead, totalBytesExpectedToRead);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (totalBytesExpectedToRead > 0) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ [strongSelf setProgress:(totalBytesRead / (totalBytesExpectedToRead * 1.0f)) animated:animated];
+ }
+ });
+ }];
+}
+
+#pragma mark - NSKeyValueObserving
+
+- (void)observeValueForKeyPath:(NSString *)keyPath
+ ofObject:(id)object
+ change:(__unused NSDictionary *)change
+ context:(void *)context
+{
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+ if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) {
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) {
+ if ([object countOfBytesExpectedToSend] > 0) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated];
+ });
+ }
+ }
+
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) {
+ if ([object countOfBytesExpectedToReceive] > 0) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated];
+ });
+ }
+ }
+
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) {
+ if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) {
+ @try {
+ [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))];
+
+ if (context == AFTaskCountOfBytesSentContext) {
+ [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))];
+ }
+
+ if (context == AFTaskCountOfBytesReceivedContext) {
+ [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))];
+ }
+ }
+ @catch (NSException * __unused exception) {}
+ }
+ }
+ }
+#endif
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h
new file mode 100644
index 0000000000..37ce772de0
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h
@@ -0,0 +1,64 @@
+// UIRefreshControl+AFNetworking.m
+//
+// Copyright (c) 2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically begining and ending refreshing depending on the loading state of a request operation or session task.
+ */
+@interface UIRefreshControl (AFNetworking)
+
+///-----------------------------------
+/// @name Refreshing for Session Tasks
+///-----------------------------------
+
+/**
+ Binds the refreshing state to the state of the specified task.
+
+ @param task The task. If `nil`, automatic updating from any previously specified operation will be diabled.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
+#endif
+
+///----------------------------------------
+/// @name Refreshing for Request Operations
+///----------------------------------------
+
+/**
+ Binds the refreshing state to the execution state of the specified operation.
+
+ @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m
new file mode 100644
index 0000000000..e266451fe5
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m
@@ -0,0 +1,93 @@
+// UIRefreshControl+AFNetworking.m
+//
+// Copyright (c) 2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIRefreshControl+AFNetworking.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+@implementation UIRefreshControl (AFNetworking)
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+
+ if (task) {
+ if (task.state == NSURLSessionTaskStateRunning) {
+ [self beginRefreshing];
+
+ [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task];
+ } else {
+ [self endRefreshing];
+ }
+ }
+}
+#endif
+
+- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
+
+ if (operation) {
+ if (![operation isFinished]) {
+ if ([operation isExecuting]) {
+ [self beginRefreshing];
+ } else {
+ [self endRefreshing];
+ }
+
+ [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingOperationDidStartNotification object:operation];
+ [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingOperationDidFinishNotification object:operation];
+ }
+ }
+}
+
+#pragma mark -
+
+- (void)af_beginRefreshing {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self beginRefreshing];
+ });
+}
+
+- (void)af_endRefreshing {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self endRefreshing];
+ });
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h
new file mode 100644
index 0000000000..202e8f4ea2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h
@@ -0,0 +1,83 @@
+// UIWebView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFHTTPRequestSerializer, AFHTTPResponseSerializer;
+@protocol AFURLRequestSerialization, AFURLResponseSerialization;
+
+/**
+ This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.
+
+ @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly.
+ */
+@interface UIWebView (AFNetworking)
+
+/**
+ The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+/**
+ Asynchronously loads the specified request.
+
+ @param request A URL request identifying the location of the content to load. This must not be `nil`.
+ @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
+ @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.
+ */
+- (void)loadRequest:(NSURLRequest *)request
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
+ failure:(void (^)(NSError *error))failure;
+
+/**
+ Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding.
+
+ @param request A URL request identifying the location of the content to load. This must not be `nil`.
+ @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified.
+ @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified.
+ @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
+ @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data.
+ @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.
+ */
+- (void)loadRequest:(NSURLRequest *)request
+ MIMEType:(NSString *)MIMEType
+ textEncodingName:(NSString *)textEncodingName
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
+ failure:(void (^)(NSError *error))failure;
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m
new file mode 100644
index 0000000000..525d02aead
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m
@@ -0,0 +1,151 @@
+// UIWebView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// 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 "UIWebView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+#import "AFURLResponseSerialization.h"
+#import "AFURLRequestSerialization.h"
+
+@interface UIWebView (_AFNetworking)
+@property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) AFHTTPRequestOperation *af_HTTPRequestOperation;
+@end
+
+@implementation UIWebView (_AFNetworking)
+
+- (AFHTTPRequestOperation *)af_HTTPRequestOperation {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation));
+}
+
+- (void)af_setHTTPRequestOperation:(AFHTTPRequestOperation *)operation {
+ objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIWebView (AFNetworking)
+
+- (AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
+ static AFHTTPRequestSerializer <AFURLRequestSerialization> *_af_defaultRequestSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultRequestSerializer = [AFHTTPRequestSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setRequestSerializer:(AFHTTPRequestSerializer<AFURLRequestSerialization> *)requestSerializer {
+ objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+ static AFHTTPResponseSerializer <AFURLResponseSerialization> *_af_defaultResponseSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer<AFURLResponseSerialization> *)responseSerializer {
+ objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)loadRequest:(NSURLRequest *)request
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
+ failure:(void (^)(NSError *error))failure
+{
+ [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) {
+ NSStringEncoding stringEncoding = NSUTF8StringEncoding;
+ if (response.textEncodingName) {
+ CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
+ if (encoding != kCFStringEncodingInvalidId) {
+ stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
+ }
+ }
+
+ NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding];
+ if (success) {
+ string = success(response, string);
+ }
+
+ return [string dataUsingEncoding:stringEncoding];
+ } failure:failure];
+}
+
+- (void)loadRequest:(NSURLRequest *)request
+ MIMEType:(NSString *)MIMEType
+ textEncodingName:(NSString *)textEncodingName
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
+ failure:(void (^)(NSError *error))failure
+{
+ NSParameterAssert(request);
+
+ if (self.af_HTTPRequestOperation) {
+ [self.af_HTTPRequestOperation cancel];
+ }
+
+ request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil];
+
+ self.af_HTTPRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
+ self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer;
+
+ __weak __typeof(self)weakSelf = self;
+ [self.af_HTTPRequestOperation setDownloadProgressBlock:progress];
+ [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id __unused responseObject) {
+ NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData;
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ __strong __typeof(weakSelf) strongSelf = weakSelf;
+ [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]];
+#pragma clang diagnostic pop
+ } failure:^(AFHTTPRequestOperation * __unused operation, NSError *error) {
+ if (failure) {
+ failure(error);
+ }
+ }];
+
+ [self.af_HTTPRequestOperation start];
+}
+
+@end
+
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h
new file mode 120000
index 0000000000..ac762c8238
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h
new file mode 120000
index 0000000000..9dcc623c63
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h
new file mode 120000
index 0000000000..56feb9fb85
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h
new file mode 120000
index 0000000000..67519d9848
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h
new file mode 120000
index 0000000000..68fc7744f2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworking.h
new file mode 120000
index 0000000000..a5a38da7dc
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h
new file mode 120000
index 0000000000..fd1322db9c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFSecurityPolicy.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h
new file mode 120000
index 0000000000..d9b35fb754
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h
new file mode 120000
index 0000000000..ca8209b81f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h
new file mode 120000
index 0000000000..e36a765d82
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h
new file mode 120000
index 0000000000..835101de7b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLSessionManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h
new file mode 120000
index 0000000000..c534ebfb02
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h
new file mode 120000
index 0000000000..f992813385
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h
new file mode 120000
index 0000000000..8f2e221939
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h
new file mode 120000
index 0000000000..a95d67380f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h
new file mode 120000
index 0000000000..95017cce57
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h
new file mode 120000
index 0000000000..730b167dcd
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h
new file mode 120000
index 0000000000..8efd826209
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h
new file mode 120000
index 0000000000..c8df6ef17b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h
new file mode 120000
index 0000000000..ac762c8238
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h
new file mode 120000
index 0000000000..9dcc623c63
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h
new file mode 120000
index 0000000000..56feb9fb85
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h
new file mode 120000
index 0000000000..67519d9848
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h
new file mode 120000
index 0000000000..68fc7744f2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworking.h
new file mode 120000
index 0000000000..a5a38da7dc
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h
new file mode 120000
index 0000000000..fd1322db9c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFSecurityPolicy.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h
new file mode 120000
index 0000000000..d9b35fb754
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h
new file mode 120000
index 0000000000..ca8209b81f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h
new file mode 120000
index 0000000000..e36a765d82
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h
new file mode 120000
index 0000000000..835101de7b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h
@@ -0,0 +1 @@
+../../../AFNetworking/AFNetworking/AFURLSessionManager.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h
new file mode 120000
index 0000000000..c534ebfb02
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h
new file mode 120000
index 0000000000..f992813385
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h
new file mode 120000
index 0000000000..8f2e221939
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h
new file mode 120000
index 0000000000..a95d67380f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h
new file mode 120000
index 0000000000..95017cce57
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h
new file mode 120000
index 0000000000..730b167dcd
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h
new file mode 120000
index 0000000000..8efd826209
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h
new file mode 120000
index 0000000000..c8df6ef17b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h
@@ -0,0 +1 @@
+../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Manifest.lock b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Manifest.lock
new file mode 100644
index 0000000000..c3fbbd33b4
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Manifest.lock
@@ -0,0 +1,30 @@
+PODS:
+ - AFNetworking (2.5.0):
+ - AFNetworking/NSURLConnection (= 2.5.0)
+ - AFNetworking/NSURLSession (= 2.5.0)
+ - AFNetworking/Reachability (= 2.5.0)
+ - AFNetworking/Security (= 2.5.0)
+ - AFNetworking/Serialization (= 2.5.0)
+ - AFNetworking/UIKit (= 2.5.0)
+ - AFNetworking/NSURLConnection (2.5.0):
+ - AFNetworking/Reachability
+ - AFNetworking/Security
+ - AFNetworking/Serialization
+ - AFNetworking/NSURLSession (2.5.0):
+ - AFNetworking/Reachability
+ - AFNetworking/Security
+ - AFNetworking/Serialization
+ - AFNetworking/Reachability (2.5.0)
+ - AFNetworking/Security (2.5.0)
+ - AFNetworking/Serialization (2.5.0)
+ - AFNetworking/UIKit (2.5.0):
+ - AFNetworking/NSURLConnection
+ - AFNetworking/NSURLSession
+
+DEPENDENCIES:
+ - AFNetworking (= 2.5.0)
+
+SPEC CHECKSUMS:
+ AFNetworking: 96ac9bf3eda33582701cb1fcc5b896aa1e20311e
+
+COCOAPODS: 0.37.0
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Pods.xcodeproj/project.pbxproj b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Pods.xcodeproj/project.pbxproj
new file mode 100644
index 0000000000..27db8eaffd
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Pods.xcodeproj/project.pbxproj
@@ -0,0 +1,906 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 05F10BA864A937B79CEF7AB7 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 5447FF01A06FD20A36A2E25D /* AFURLRequestSerialization.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 07109DEE2D3CCAC6E27FF610 /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BC80768F1ECB71168E4F0E /* AFNetworkReachabilityManager.h */; };
+ 07C1C70C97F4B12085CF9B54 /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = CEA9DC40500CC7C2D1322784 /* UIImageView+AFNetworking.h */; };
+ 09696F6B38AF4AA07130BDA5 /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 49BC80768F1ECB71168E4F0E /* AFNetworkReachabilityManager.h */; };
+ 0B0AC3DCF875ACE1AB25DB06 /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 497A151ED83BFF5C3E5B595D /* AFSecurityPolicy.h */; };
+ 0D8DD2899735197CB2EDFC53 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = BF517ABC8323C43878EE5182 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m */; };
+ 0ED74CA078B559E46733EB86 /* AFHTTPRequestOperationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F35D08450536F79059CA3B8F /* AFHTTPRequestOperationManager.h */; };
+ 111FA2DCCECDC450CCE86B79 /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D0F6E023E9623249382E1A8 /* UIProgressView+AFNetworking.h */; };
+ 12614473A129EE388A04B562 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F35939851ED38CB5738C6911 /* AFNetworkReachabilityManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 1A69E8016FF6786724EA2DA5 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 5447FF01A06FD20A36A2E25D /* AFURLRequestSerialization.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 1B0340808D17594E7E20416E /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E571E4A2307F50521384E71 /* AFURLResponseSerialization.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 20CD2FEFF175371C94C52D11 /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 093C199AD28717A653273DE0 /* AFHTTPSessionManager.h */; };
+ 25142432152E0D0FC54821E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88C39391AEC2A6F4CE298276 /* Foundation.framework */; };
+ 2A341F22AECC9350634749A9 /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D0B40D3B78D919B1D19604BC /* UIProgressView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 2B8F7B192A59BAAF912AE712 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 551B551AA3280D6BA8335A95 /* UIActivityIndicatorView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 37C0EFD701AE7760758BD7DC /* AFHTTPRequestOperationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F35D08450536F79059CA3B8F /* AFHTTPRequestOperationManager.h */; };
+ 3BB9707D34A1B32642EB71FF /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51BD7E303C7824651C140D50 /* Security.framework */; };
+ 3F7B393D7F0475C76239AEF5 /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 497A151ED83BFF5C3E5B595D /* AFSecurityPolicy.h */; };
+ 44648DED9CBCDDE10E27F589 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C156A7437E431745406C066 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 4702916A49A441A9A944E912 /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 57ADF24AEC45DB9B5B2B88EA /* AFURLConnectionOperation.h */; };
+ 4870AB9943E61FC2D614B70D /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 6015221E4A360237C44A8015 /* AFURLResponseSerialization.h */; };
+ 4900C036A4BF4E5C2EA93B03 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F35939851ED38CB5738C6911 /* AFNetworkReachabilityManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 4F01C6D7B6853EF4AA5B65C0 /* UIActivityIndicatorView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DC2B2A5E77746321B51034D /* UIActivityIndicatorView+AFNetworking.h */; };
+ 50C3B855E98EA0044351A87B /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = C024B152BB38AA08EF79BCA1 /* UIButton+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 522A96083A107EBDABC5A8E3 /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 505424A140C5A8E367324EB7 /* AFHTTPRequestOperation.h */; };
+ 543C00C69B2B794A949F073F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD3A78B755B763DA38819067 /* Security.framework */; };
+ 578705629C31E0FC3C99ACB5 /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CEE8864C15957F177F3E032 /* AFURLRequestSerialization.h */; };
+ 58C2691912FAE6112F221A24 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A6E08739E866C3624A421F65 /* AFNetworking.h */; };
+ 5D38932376ACB1D542540DE8 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A6E08739E866C3624A421F65 /* AFNetworking.h */; };
+ 5FFE1317E23BD6A2F1739550 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C3004FE78D278EBD2159B2D /* UIImageView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 63359255DE4DAB8D48D8398A /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A54E4650469C5E299F0D89E /* AFHTTPRequestOperationManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 6F1F3338B6C18B4B6A5FF672 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D2AC08FFF124E07A01EAFC2 /* CoreServices.framework */; };
+ 754E33A6C10F46A7A36092D8 /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 505424A140C5A8E367324EB7 /* AFHTTPRequestOperation.h */; };
+ 77D3C6F11D2CA0A86A3EAF29 /* Pods-OHHTTPStubs Mac Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 321953436B9349FCF7BF8964 /* Pods-OHHTTPStubs Mac Tests-dummy.m */; };
+ 81ADB8C804615D4048C91FDD /* Pods-OHHTTPStubs iOS Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D83EBBF184D064CDAD710A40 /* Pods-OHHTTPStubs iOS Tests-dummy.m */; };
+ 85B667118C68BEDF6F983AFC /* UIAlertView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = ED516141A9266AEAAD48B422 /* UIAlertView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 8763C4B08BB723B01752ED7A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D4DADF799A34500A06BD78A /* SystemConfiguration.framework */; };
+ 88512D9EC7516213FBEEDFE1 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D78D241677420BC40EAB1666 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 8F6FABABA39F6EB2B25939F3 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D78D241677420BC40EAB1666 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 92DADB41EC0F2CE69047AB84 /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 560D9D22979DFBE868DEDD88 /* UIRefreshControl+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 932CE4581D3CC4B038CCDC7B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FA4BA2FEF754E9D702A1150 /* Cocoa.framework */; };
+ 94ABFD6DD946F56D219ADC22 /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 3915011C479A0B120388E604 /* UIWebView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 96F3BAB009B5A271F0A4CAD7 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ACAD995D17054176A5526B8 /* AFSecurityPolicy.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 9A5155FDA741A40E62176688 /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 55B5C6EAB2939CF9557557FB /* AFNetworkActivityIndicatorManager.h */; };
+ 9B3D20C65197332A7B9D7A10 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E3CB595356B57E21F6B502D2 /* AFHTTPSessionManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ 9EF6386D389001640865A6A0 /* UIAlertView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = F23E7994981C3DACAAF7E45C /* UIAlertView+AFNetworking.h */; };
+ A89EEDF58A1E524677F157AA /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 6015221E4A360237C44A8015 /* AFURLResponseSerialization.h */; };
+ AB53CB4E94CC50F54326D9EC /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = F8B3CC903D3CB9DDE04B17D4 /* UIButton+AFNetworking.h */; };
+ B15E5A587912F49A725192DA /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ACAD995D17054176A5526B8 /* AFSecurityPolicy.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ B24CEF9198BE0DFD988FFCC8 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E3CB595356B57E21F6B502D2 /* AFHTTPSessionManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ B917CE9E60F38DA6AE956D10 /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 227A9F36B3754E843BA612D4 /* AFURLSessionManager.h */; };
+ BEE8719A65D2BF151C8FF1B1 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C156A7437E431745406C066 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ BF4EA978E0DB56CAF0A3D751 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 910E02E98AB0087421897E08 /* MobileCoreServices.framework */; };
+ C494DB10D68900498C06D033 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F4090349D8B910197D7DF11F /* Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m */; };
+ CCBEB7124FE5B8E0772ACFBD /* UIRefreshControl+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD3A50893C3DD6D814913A1 /* UIRefreshControl+AFNetworking.h */; };
+ D1803A9D2201964C36D553F2 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B303111D0141201348C4833 /* AFURLSessionManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ D348E2D2580AA24B5E35DAC0 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7581CD963368C82A3138112D /* SystemConfiguration.framework */; };
+ D999D52BA23C8B7FC607D108 /* UIKit+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E983A5C6230930CDB296DFA /* UIKit+AFNetworking.h */; };
+ E2ED8AB618422BC864886DCB /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 093C199AD28717A653273DE0 /* AFHTTPSessionManager.h */; };
+ E36FCA4D3E27E2FFA7E5A27B /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 762E066FFCD8D46681603BBB /* AFNetworkActivityIndicatorManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ E4DD261A8784962967035ABE /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B303111D0141201348C4833 /* AFURLSessionManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ E660CA7196C3AE15DA966314 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 739C1918DF54A0F91712A4A6 /* CoreGraphics.framework */; };
+ EC557A30CAD5634B82D54AED /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 227A9F36B3754E843BA612D4 /* AFURLSessionManager.h */; };
+ F04762E2C44454C499EA9042 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E571E4A2307F50521384E71 /* AFURLResponseSerialization.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ F21FECFE160DC8796FCF20ED /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FA4BA2FEF754E9D702A1150 /* Cocoa.framework */; };
+ F4F2BA5E80803A456F424CA8 /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A54E4650469C5E299F0D89E /* AFHTTPRequestOperationManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode"; }; };
+ F558FDD298AA8E37CD4AD341 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88C39391AEC2A6F4CE298276 /* Foundation.framework */; };
+ F6043955003537905B134B62 /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CEE8864C15957F177F3E032 /* AFURLRequestSerialization.h */; };
+ FA6A84FB2D6AF1D3183C1373 /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 57ADF24AEC45DB9B5B2B88EA /* AFURLConnectionOperation.h */; };
+ FEFED9420F6A72FB3F123BF5 /* UIWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ABBA795C17AC61F960788BE /* UIWebView+AFNetworking.h */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ C627703060BD61C91F2A4C64 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = E0DDD61A0770FF4B6366DB86 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 11C6440715C5C37466193A71;
+ remoteInfo = "Pods-OHHTTPStubs Mac Tests-AFNetworking";
+ };
+ F877A0D43CD157C66D5C6BB5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = E0DDD61A0770FF4B6366DB86 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = FFE6CE2F3BF00868F830AF0D;
+ remoteInfo = "Pods-OHHTTPStubs iOS Tests-AFNetworking";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 00B451C5114FF92A77CC1279 /* libPods-OHHTTPStubs Mac Tests-AFNetworking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs Mac Tests-AFNetworking.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 093C199AD28717A653273DE0 /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPSessionManager.h; path = AFNetworking/AFHTTPSessionManager.h; sourceTree = "<group>"; };
+ 0B163EB111AF4BAF3759BBA1 /* Pods-OHHTTPStubs iOS Tests-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs iOS Tests-environment.h"; sourceTree = "<group>"; };
+ 14337C81A6290F7C528EA00B /* Pods-OHHTTPStubs iOS Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-OHHTTPStubs iOS Tests-acknowledgements.plist"; sourceTree = "<group>"; };
+ 19D183DE47274EDE451A5BC5 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig"; path = "../Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig"; sourceTree = "<group>"; };
+ 1D4DADF799A34500A06BD78A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; };
+ 1EDD5C86339F3D8A90DEEAD3 /* Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown"; sourceTree = "<group>"; };
+ 21559B0A80457F825BA4C039 /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
+ 227A9F36B3754E843BA612D4 /* AFURLSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLSessionManager.h; path = AFNetworking/AFURLSessionManager.h; sourceTree = "<group>"; };
+ 274F152996A2D6D92762AAFC /* Pods-OHHTTPStubs Mac Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs Mac Tests.debug.xcconfig"; sourceTree = "<group>"; };
+ 29D3CFBC625C8949354A4766 /* Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig"; sourceTree = "<group>"; };
+ 2E983A5C6230930CDB296DFA /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIKit+AFNetworking.h"; path = "UIKit+AFNetworking/UIKit+AFNetworking.h"; sourceTree = "<group>"; };
+ 321953436B9349FCF7BF8964 /* Pods-OHHTTPStubs Mac Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-OHHTTPStubs Mac Tests-dummy.m"; sourceTree = "<group>"; };
+ 3915011C479A0B120388E604 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIWebView+AFNetworking.m"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.m"; sourceTree = "<group>"; };
+ 3CEE8864C15957F177F3E032 /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = AFNetworking/AFURLRequestSerialization.h; sourceTree = "<group>"; };
+ 3DC2B2A5E77746321B51034D /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActivityIndicatorView+AFNetworking.h"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h"; sourceTree = "<group>"; };
+ 3F8FF92F806E569F09F7C3CD /* Pods-OHHTTPStubs Mac Tests-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs Mac Tests-environment.h"; sourceTree = "<group>"; };
+ 42A5AD26F924F2FB09A7D68A /* Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig"; path = "../Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig"; sourceTree = "<group>"; };
+ 497A151ED83BFF5C3E5B595D /* AFSecurityPolicy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFSecurityPolicy.h; path = AFNetworking/AFSecurityPolicy.h; sourceTree = "<group>"; };
+ 49BC80768F1ECB71168E4F0E /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkReachabilityManager.h; path = AFNetworking/AFNetworkReachabilityManager.h; sourceTree = "<group>"; };
+ 4B303111D0141201348C4833 /* AFURLSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = AFNetworking/AFURLSessionManager.m; sourceTree = "<group>"; };
+ 4D7F0273765019AA5DEE864D /* Pods-OHHTTPStubs Mac Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-OHHTTPStubs Mac Tests-resources.sh"; sourceTree = "<group>"; };
+ 4E571E4A2307F50521384E71 /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLResponseSerialization.m; path = AFNetworking/AFURLResponseSerialization.m; sourceTree = "<group>"; };
+ 4FD3A50893C3DD6D814913A1 /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIRefreshControl+AFNetworking.h"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.h"; sourceTree = "<group>"; };
+ 505424A140C5A8E367324EB7 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperation.h; path = AFNetworking/AFHTTPRequestOperation.h; sourceTree = "<group>"; };
+ 51BD7E303C7824651C140D50 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
+ 5447FF01A06FD20A36A2E25D /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLRequestSerialization.m; path = AFNetworking/AFURLRequestSerialization.m; sourceTree = "<group>"; };
+ 551B551AA3280D6BA8335A95 /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActivityIndicatorView+AFNetworking.m"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m"; sourceTree = "<group>"; };
+ 55B5C6EAB2939CF9557557FB /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h"; sourceTree = "<group>"; };
+ 560D9D22979DFBE868DEDD88 /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIRefreshControl+AFNetworking.m"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.m"; sourceTree = "<group>"; };
+ 57ADF24AEC45DB9B5B2B88EA /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLConnectionOperation.h; path = AFNetworking/AFURLConnectionOperation.h; sourceTree = "<group>"; };
+ 589F6CBD907470D4ED9E48ED /* Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown"; sourceTree = "<group>"; };
+ 5A54E4650469C5E299F0D89E /* AFHTTPRequestOperationManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperationManager.m; path = AFNetworking/AFHTTPRequestOperationManager.m; sourceTree = "<group>"; };
+ 5D2AC08FFF124E07A01EAFC2 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; };
+ 5EA2CAEA9606CF3E2B7AC15F /* Pods-OHHTTPStubs iOS Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs iOS Tests.debug.xcconfig"; sourceTree = "<group>"; };
+ 6015221E4A360237C44A8015 /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLResponseSerialization.h; path = AFNetworking/AFURLResponseSerialization.h; sourceTree = "<group>"; };
+ 6C3004FE78D278EBD2159B2D /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.m"; sourceTree = "<group>"; };
+ 6F25EDE9E451323B84AEED61 /* Pods-OHHTTPStubs iOS Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-OHHTTPStubs iOS Tests-resources.sh"; sourceTree = "<group>"; };
+ 739C1918DF54A0F91712A4A6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
+ 74DFB2792104932B42329735 /* Pods-OHHTTPStubs iOS Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs iOS Tests.release.xcconfig"; sourceTree = "<group>"; };
+ 7581CD963368C82A3138112D /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; };
+ 762E066FFCD8D46681603BBB /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m"; sourceTree = "<group>"; };
+ 78B46767D42DDCD769A17785 /* libPods-OHHTTPStubs iOS Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs iOS Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7ACAD995D17054176A5526B8 /* AFSecurityPolicy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFSecurityPolicy.m; path = AFNetworking/AFSecurityPolicy.m; sourceTree = "<group>"; };
+ 7C156A7437E431745406C066 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLConnectionOperation.m; path = AFNetworking/AFURLConnectionOperation.m; sourceTree = "<group>"; };
+ 7D0F6E023E9623249382E1A8 /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIProgressView+AFNetworking.h"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.h"; sourceTree = "<group>"; };
+ 88C39391AEC2A6F4CE298276 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
+ 910E02E98AB0087421897E08 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; };
+ 9A2F6C5D14D45DCC71486040 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch"; sourceTree = "<group>"; };
+ 9ABBA795C17AC61F960788BE /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIWebView+AFNetworking.h"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.h"; sourceTree = "<group>"; };
+ 9E73E04B4EE7C8C760AE5357 /* libPods-OHHTTPStubs Mac Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs Mac Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 9FA4BA2FEF754E9D702A1150 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
+ 9FB42624CAB24DF25D07AAE8 /* Pods-OHHTTPStubs Mac Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-OHHTTPStubs Mac Tests-acknowledgements.plist"; sourceTree = "<group>"; };
+ A6E08739E866C3624A421F65 /* AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = AFNetworking/AFNetworking.h; sourceTree = "<group>"; };
+ B8CA917E680C843D80B254A4 /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs Mac Tests.release.xcconfig"; sourceTree = "<group>"; };
+ BE5080D59238C5D11E0B4732 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch"; path = "../Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch"; sourceTree = "<group>"; };
+ BF517ABC8323C43878EE5182 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m"; path = "../Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m"; sourceTree = "<group>"; };
+ C024B152BB38AA08EF79BCA1 /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+AFNetworking.m"; path = "UIKit+AFNetworking/UIButton+AFNetworking.m"; sourceTree = "<group>"; };
+ CEA9DC40500CC7C2D1322784 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.h"; sourceTree = "<group>"; };
+ D0B40D3B78D919B1D19604BC /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIProgressView+AFNetworking.m"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.m"; sourceTree = "<group>"; };
+ D78D241677420BC40EAB1666 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperation.m; path = AFNetworking/AFHTTPRequestOperation.m; sourceTree = "<group>"; };
+ D83EBBF184D064CDAD710A40 /* Pods-OHHTTPStubs iOS Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-OHHTTPStubs iOS Tests-dummy.m"; sourceTree = "<group>"; };
+ E3CB595356B57E21F6B502D2 /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = AFNetworking/AFHTTPSessionManager.m; sourceTree = "<group>"; };
+ ED516141A9266AEAAD48B422 /* UIAlertView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIAlertView+AFNetworking.m"; path = "UIKit+AFNetworking/UIAlertView+AFNetworking.m"; sourceTree = "<group>"; };
+ F23E7994981C3DACAAF7E45C /* UIAlertView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAlertView+AFNetworking.h"; path = "UIKit+AFNetworking/UIAlertView+AFNetworking.h"; sourceTree = "<group>"; };
+ F29ED5E808F38B9662A3D952 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig"; sourceTree = "<group>"; };
+ F35939851ED38CB5738C6911 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = AFNetworking/AFNetworkReachabilityManager.m; sourceTree = "<group>"; };
+ F35D08450536F79059CA3B8F /* AFHTTPRequestOperationManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperationManager.h; path = AFNetworking/AFHTTPRequestOperationManager.h; sourceTree = "<group>"; };
+ F4090349D8B910197D7DF11F /* Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m"; sourceTree = "<group>"; };
+ F8B3CC903D3CB9DDE04B17D4 /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+AFNetworking.h"; path = "UIKit+AFNetworking/UIButton+AFNetworking.h"; sourceTree = "<group>"; };
+ FD3A78B755B763DA38819067 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
+ FDC42A4A088707A78177FC59 /* libPods-OHHTTPStubs iOS Tests-AFNetworking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OHHTTPStubs iOS Tests-AFNetworking.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 08C808FA697B8118DD3D19F9 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ E660CA7196C3AE15DA966314 /* CoreGraphics.framework in Frameworks */,
+ F558FDD298AA8E37CD4AD341 /* Foundation.framework in Frameworks */,
+ BF4EA978E0DB56CAF0A3D751 /* MobileCoreServices.framework in Frameworks */,
+ 543C00C69B2B794A949F073F /* Security.framework in Frameworks */,
+ 8763C4B08BB723B01752ED7A /* SystemConfiguration.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 2F46D4BF3329AFCC2E0ABF7F /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F21FECFE160DC8796FCF20ED /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E1895CAADD4CD67C0D35599 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 932CE4581D3CC4B038CCDC7B /* Cocoa.framework in Frameworks */,
+ 6F1F3338B6C18B4B6A5FF672 /* CoreServices.framework in Frameworks */,
+ 3BB9707D34A1B32642EB71FF /* Security.framework in Frameworks */,
+ D348E2D2580AA24B5E35DAC0 /* SystemConfiguration.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97EF063BB4F1B51722BEEEEE /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 25142432152E0D0FC54821E0 /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 05169BCB42A2EF48FE2D19D5 /* Support Files */ = {
+ isa = PBXGroup;
+ children = (
+ 29D3CFBC625C8949354A4766 /* Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig */,
+ F29ED5E808F38B9662A3D952 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig */,
+ F4090349D8B910197D7DF11F /* Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m */,
+ 9A2F6C5D14D45DCC71486040 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch */,
+ 42A5AD26F924F2FB09A7D68A /* Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig */,
+ 19D183DE47274EDE451A5BC5 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig */,
+ BF517ABC8323C43878EE5182 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m */,
+ BE5080D59238C5D11E0B4732 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch */,
+ );
+ name = "Support Files";
+ path = "../Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking";
+ sourceTree = "<group>";
+ };
+ 070A94383B2AFA6C7D3962A7 /* NSURLConnection */ = {
+ isa = PBXGroup;
+ children = (
+ 505424A140C5A8E367324EB7 /* AFHTTPRequestOperation.h */,
+ D78D241677420BC40EAB1666 /* AFHTTPRequestOperation.m */,
+ F35D08450536F79059CA3B8F /* AFHTTPRequestOperationManager.h */,
+ 5A54E4650469C5E299F0D89E /* AFHTTPRequestOperationManager.m */,
+ 57ADF24AEC45DB9B5B2B88EA /* AFURLConnectionOperation.h */,
+ 7C156A7437E431745406C066 /* AFURLConnectionOperation.m */,
+ );
+ name = NSURLConnection;
+ sourceTree = "<group>";
+ };
+ 2741788D7C16E4291B3E2737 /* AFNetworking */ = {
+ isa = PBXGroup;
+ children = (
+ A6E08739E866C3624A421F65 /* AFNetworking.h */,
+ 070A94383B2AFA6C7D3962A7 /* NSURLConnection */,
+ 4DF1A361DFF937F38D57611A /* NSURLSession */,
+ AD3758B807D8663FD2B641DA /* Reachability */,
+ 644025E06DD06301D572A1DD /* Security */,
+ AD924DCA2EFDB9F9B379AF22 /* Serialization */,
+ 05169BCB42A2EF48FE2D19D5 /* Support Files */,
+ C9A1F23AF6BE37E3FF2E4EE8 /* UIKit */,
+ );
+ path = AFNetworking;
+ sourceTree = "<group>";
+ };
+ 3DC5022FE56EB79029E28B86 /* Pods-OHHTTPStubs iOS Tests */ = {
+ isa = PBXGroup;
+ children = (
+ 1EDD5C86339F3D8A90DEEAD3 /* Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown */,
+ 14337C81A6290F7C528EA00B /* Pods-OHHTTPStubs iOS Tests-acknowledgements.plist */,
+ D83EBBF184D064CDAD710A40 /* Pods-OHHTTPStubs iOS Tests-dummy.m */,
+ 0B163EB111AF4BAF3759BBA1 /* Pods-OHHTTPStubs iOS Tests-environment.h */,
+ 6F25EDE9E451323B84AEED61 /* Pods-OHHTTPStubs iOS Tests-resources.sh */,
+ 5EA2CAEA9606CF3E2B7AC15F /* Pods-OHHTTPStubs iOS Tests.debug.xcconfig */,
+ 74DFB2792104932B42329735 /* Pods-OHHTTPStubs iOS Tests.release.xcconfig */,
+ );
+ name = "Pods-OHHTTPStubs iOS Tests";
+ path = "Target Support Files/Pods-OHHTTPStubs iOS Tests";
+ sourceTree = "<group>";
+ };
+ 4C7E9800525AE6821F145253 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 2741788D7C16E4291B3E2737 /* AFNetworking */,
+ );
+ name = Pods;
+ sourceTree = "<group>";
+ };
+ 4DF1A361DFF937F38D57611A /* NSURLSession */ = {
+ isa = PBXGroup;
+ children = (
+ 093C199AD28717A653273DE0 /* AFHTTPSessionManager.h */,
+ E3CB595356B57E21F6B502D2 /* AFHTTPSessionManager.m */,
+ 227A9F36B3754E843BA612D4 /* AFURLSessionManager.h */,
+ 4B303111D0141201348C4833 /* AFURLSessionManager.m */,
+ );
+ name = NSURLSession;
+ sourceTree = "<group>";
+ };
+ 4F22DE6DD75BB25D57A6F08C = {
+ isa = PBXGroup;
+ children = (
+ 21559B0A80457F825BA4C039 /* Podfile */,
+ 594802449485ED7FCDA90219 /* Frameworks */,
+ 4C7E9800525AE6821F145253 /* Pods */,
+ 840E1705B7F3F6B6B5CAA8C1 /* Products */,
+ 76D31DB545556A7BCD8EB2F6 /* Targets Support Files */,
+ );
+ sourceTree = "<group>";
+ };
+ 50238B3AF25CBF2261585387 /* iOS */ = {
+ isa = PBXGroup;
+ children = (
+ 739C1918DF54A0F91712A4A6 /* CoreGraphics.framework */,
+ 88C39391AEC2A6F4CE298276 /* Foundation.framework */,
+ 910E02E98AB0087421897E08 /* MobileCoreServices.framework */,
+ FD3A78B755B763DA38819067 /* Security.framework */,
+ 1D4DADF799A34500A06BD78A /* SystemConfiguration.framework */,
+ );
+ name = iOS;
+ sourceTree = "<group>";
+ };
+ 594802449485ED7FCDA90219 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ EBF9743714B11144B2AFAA6A /* OS X */,
+ 50238B3AF25CBF2261585387 /* iOS */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 644025E06DD06301D572A1DD /* Security */ = {
+ isa = PBXGroup;
+ children = (
+ 497A151ED83BFF5C3E5B595D /* AFSecurityPolicy.h */,
+ 7ACAD995D17054176A5526B8 /* AFSecurityPolicy.m */,
+ );
+ name = Security;
+ sourceTree = "<group>";
+ };
+ 76D31DB545556A7BCD8EB2F6 /* Targets Support Files */ = {
+ isa = PBXGroup;
+ children = (
+ D5658B605F60D854FF21EBF8 /* Pods-OHHTTPStubs Mac Tests */,
+ 3DC5022FE56EB79029E28B86 /* Pods-OHHTTPStubs iOS Tests */,
+ );
+ name = "Targets Support Files";
+ sourceTree = "<group>";
+ };
+ 840E1705B7F3F6B6B5CAA8C1 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 9E73E04B4EE7C8C760AE5357 /* libPods-OHHTTPStubs Mac Tests.a */,
+ 00B451C5114FF92A77CC1279 /* libPods-OHHTTPStubs Mac Tests-AFNetworking.a */,
+ 78B46767D42DDCD769A17785 /* libPods-OHHTTPStubs iOS Tests.a */,
+ FDC42A4A088707A78177FC59 /* libPods-OHHTTPStubs iOS Tests-AFNetworking.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ AD3758B807D8663FD2B641DA /* Reachability */ = {
+ isa = PBXGroup;
+ children = (
+ 49BC80768F1ECB71168E4F0E /* AFNetworkReachabilityManager.h */,
+ F35939851ED38CB5738C6911 /* AFNetworkReachabilityManager.m */,
+ );
+ name = Reachability;
+ sourceTree = "<group>";
+ };
+ AD924DCA2EFDB9F9B379AF22 /* Serialization */ = {
+ isa = PBXGroup;
+ children = (
+ 3CEE8864C15957F177F3E032 /* AFURLRequestSerialization.h */,
+ 5447FF01A06FD20A36A2E25D /* AFURLRequestSerialization.m */,
+ 6015221E4A360237C44A8015 /* AFURLResponseSerialization.h */,
+ 4E571E4A2307F50521384E71 /* AFURLResponseSerialization.m */,
+ );
+ name = Serialization;
+ sourceTree = "<group>";
+ };
+ C9A1F23AF6BE37E3FF2E4EE8 /* UIKit */ = {
+ isa = PBXGroup;
+ children = (
+ 55B5C6EAB2939CF9557557FB /* AFNetworkActivityIndicatorManager.h */,
+ 762E066FFCD8D46681603BBB /* AFNetworkActivityIndicatorManager.m */,
+ 3DC2B2A5E77746321B51034D /* UIActivityIndicatorView+AFNetworking.h */,
+ 551B551AA3280D6BA8335A95 /* UIActivityIndicatorView+AFNetworking.m */,
+ F23E7994981C3DACAAF7E45C /* UIAlertView+AFNetworking.h */,
+ ED516141A9266AEAAD48B422 /* UIAlertView+AFNetworking.m */,
+ F8B3CC903D3CB9DDE04B17D4 /* UIButton+AFNetworking.h */,
+ C024B152BB38AA08EF79BCA1 /* UIButton+AFNetworking.m */,
+ CEA9DC40500CC7C2D1322784 /* UIImageView+AFNetworking.h */,
+ 6C3004FE78D278EBD2159B2D /* UIImageView+AFNetworking.m */,
+ 2E983A5C6230930CDB296DFA /* UIKit+AFNetworking.h */,
+ 7D0F6E023E9623249382E1A8 /* UIProgressView+AFNetworking.h */,
+ D0B40D3B78D919B1D19604BC /* UIProgressView+AFNetworking.m */,
+ 4FD3A50893C3DD6D814913A1 /* UIRefreshControl+AFNetworking.h */,
+ 560D9D22979DFBE868DEDD88 /* UIRefreshControl+AFNetworking.m */,
+ 9ABBA795C17AC61F960788BE /* UIWebView+AFNetworking.h */,
+ 3915011C479A0B120388E604 /* UIWebView+AFNetworking.m */,
+ );
+ name = UIKit;
+ sourceTree = "<group>";
+ };
+ D5658B605F60D854FF21EBF8 /* Pods-OHHTTPStubs Mac Tests */ = {
+ isa = PBXGroup;
+ children = (
+ 589F6CBD907470D4ED9E48ED /* Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown */,
+ 9FB42624CAB24DF25D07AAE8 /* Pods-OHHTTPStubs Mac Tests-acknowledgements.plist */,
+ 321953436B9349FCF7BF8964 /* Pods-OHHTTPStubs Mac Tests-dummy.m */,
+ 3F8FF92F806E569F09F7C3CD /* Pods-OHHTTPStubs Mac Tests-environment.h */,
+ 4D7F0273765019AA5DEE864D /* Pods-OHHTTPStubs Mac Tests-resources.sh */,
+ 274F152996A2D6D92762AAFC /* Pods-OHHTTPStubs Mac Tests.debug.xcconfig */,
+ B8CA917E680C843D80B254A4 /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */,
+ );
+ name = "Pods-OHHTTPStubs Mac Tests";
+ path = "Target Support Files/Pods-OHHTTPStubs Mac Tests";
+ sourceTree = "<group>";
+ };
+ EBF9743714B11144B2AFAA6A /* OS X */ = {
+ isa = PBXGroup;
+ children = (
+ 9FA4BA2FEF754E9D702A1150 /* Cocoa.framework */,
+ 5D2AC08FFF124E07A01EAFC2 /* CoreServices.framework */,
+ 51BD7E303C7824651C140D50 /* Security.framework */,
+ 7581CD963368C82A3138112D /* SystemConfiguration.framework */,
+ );
+ name = "OS X";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 256F5FE3B2E18567D1F66C08 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 754E33A6C10F46A7A36092D8 /* AFHTTPRequestOperation.h in Headers */,
+ 37C0EFD701AE7760758BD7DC /* AFHTTPRequestOperationManager.h in Headers */,
+ 20CD2FEFF175371C94C52D11 /* AFHTTPSessionManager.h in Headers */,
+ 09696F6B38AF4AA07130BDA5 /* AFNetworkReachabilityManager.h in Headers */,
+ 5D38932376ACB1D542540DE8 /* AFNetworking.h in Headers */,
+ 3F7B393D7F0475C76239AEF5 /* AFSecurityPolicy.h in Headers */,
+ FA6A84FB2D6AF1D3183C1373 /* AFURLConnectionOperation.h in Headers */,
+ F6043955003537905B134B62 /* AFURLRequestSerialization.h in Headers */,
+ A89EEDF58A1E524677F157AA /* AFURLResponseSerialization.h in Headers */,
+ EC557A30CAD5634B82D54AED /* AFURLSessionManager.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ A9C373A2E563593F432AD79C /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 522A96083A107EBDABC5A8E3 /* AFHTTPRequestOperation.h in Headers */,
+ 0ED74CA078B559E46733EB86 /* AFHTTPRequestOperationManager.h in Headers */,
+ E2ED8AB618422BC864886DCB /* AFHTTPSessionManager.h in Headers */,
+ 9A5155FDA741A40E62176688 /* AFNetworkActivityIndicatorManager.h in Headers */,
+ 07109DEE2D3CCAC6E27FF610 /* AFNetworkReachabilityManager.h in Headers */,
+ 58C2691912FAE6112F221A24 /* AFNetworking.h in Headers */,
+ 0B0AC3DCF875ACE1AB25DB06 /* AFSecurityPolicy.h in Headers */,
+ 4702916A49A441A9A944E912 /* AFURLConnectionOperation.h in Headers */,
+ 578705629C31E0FC3C99ACB5 /* AFURLRequestSerialization.h in Headers */,
+ 4870AB9943E61FC2D614B70D /* AFURLResponseSerialization.h in Headers */,
+ B917CE9E60F38DA6AE956D10 /* AFURLSessionManager.h in Headers */,
+ 4F01C6D7B6853EF4AA5B65C0 /* UIActivityIndicatorView+AFNetworking.h in Headers */,
+ 9EF6386D389001640865A6A0 /* UIAlertView+AFNetworking.h in Headers */,
+ AB53CB4E94CC50F54326D9EC /* UIButton+AFNetworking.h in Headers */,
+ 07C1C70C97F4B12085CF9B54 /* UIImageView+AFNetworking.h in Headers */,
+ D999D52BA23C8B7FC607D108 /* UIKit+AFNetworking.h in Headers */,
+ 111FA2DCCECDC450CCE86B79 /* UIProgressView+AFNetworking.h in Headers */,
+ CCBEB7124FE5B8E0772ACFBD /* UIRefreshControl+AFNetworking.h in Headers */,
+ FEFED9420F6A72FB3F123BF5 /* UIWebView+AFNetworking.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 11C6440715C5C37466193A71 /* Pods-OHHTTPStubs Mac Tests-AFNetworking */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = A66489F018353B6058D4D8CF /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs Mac Tests-AFNetworking" */;
+ buildPhases = (
+ 20F1F831CA391CB98DA7148C /* Sources */,
+ 6E1895CAADD4CD67C0D35599 /* Frameworks */,
+ 256F5FE3B2E18567D1F66C08 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "Pods-OHHTTPStubs Mac Tests-AFNetworking";
+ productName = "Pods-OHHTTPStubs Mac Tests-AFNetworking";
+ productReference = 00B451C5114FF92A77CC1279 /* libPods-OHHTTPStubs Mac Tests-AFNetworking.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 5A989F1DC87EA18917A83ED3 /* Pods-OHHTTPStubs Mac Tests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D1FCAD37DEA7C4E61C26DF3B /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs Mac Tests" */;
+ buildPhases = (
+ 114ABB025720040B090F8BC3 /* Sources */,
+ 2F46D4BF3329AFCC2E0ABF7F /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 1EA3D04C16DB6059C82BFBA1 /* PBXTargetDependency */,
+ );
+ name = "Pods-OHHTTPStubs Mac Tests";
+ productName = "Pods-OHHTTPStubs Mac Tests";
+ productReference = 9E73E04B4EE7C8C760AE5357 /* libPods-OHHTTPStubs Mac Tests.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ F692E0F1F69A02A187429A81 /* Pods-OHHTTPStubs iOS Tests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = EFA235A59A8027AB996E0D6B /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs iOS Tests" */;
+ buildPhases = (
+ 4DB617D0D63B727656D14BC6 /* Sources */,
+ 97EF063BB4F1B51722BEEEEE /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 0A6A94A7B2C7311729278CD0 /* PBXTargetDependency */,
+ );
+ name = "Pods-OHHTTPStubs iOS Tests";
+ productName = "Pods-OHHTTPStubs iOS Tests";
+ productReference = 78B46767D42DDCD769A17785 /* libPods-OHHTTPStubs iOS Tests.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ FFE6CE2F3BF00868F830AF0D /* Pods-OHHTTPStubs iOS Tests-AFNetworking */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 16E1077524B3F86733F1A5AE /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs iOS Tests-AFNetworking" */;
+ buildPhases = (
+ B84BB191C7AF13939DF58349 /* Sources */,
+ 08C808FA697B8118DD3D19F9 /* Frameworks */,
+ A9C373A2E563593F432AD79C /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "Pods-OHHTTPStubs iOS Tests-AFNetworking";
+ productName = "Pods-OHHTTPStubs iOS Tests-AFNetworking";
+ productReference = FDC42A4A088707A78177FC59 /* libPods-OHHTTPStubs iOS Tests-AFNetworking.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ E0DDD61A0770FF4B6366DB86 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0640;
+ };
+ buildConfigurationList = B1768547D52EBBCE2FF93150 /* Build configuration list for PBXProject "Pods" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 4F22DE6DD75BB25D57A6F08C;
+ productRefGroup = 840E1705B7F3F6B6B5CAA8C1 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 5A989F1DC87EA18917A83ED3 /* Pods-OHHTTPStubs Mac Tests */,
+ 11C6440715C5C37466193A71 /* Pods-OHHTTPStubs Mac Tests-AFNetworking */,
+ F692E0F1F69A02A187429A81 /* Pods-OHHTTPStubs iOS Tests */,
+ FFE6CE2F3BF00868F830AF0D /* Pods-OHHTTPStubs iOS Tests-AFNetworking */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 114ABB025720040B090F8BC3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 77D3C6F11D2CA0A86A3EAF29 /* Pods-OHHTTPStubs Mac Tests-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 20F1F831CA391CB98DA7148C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8F6FABABA39F6EB2B25939F3 /* AFHTTPRequestOperation.m in Sources */,
+ 63359255DE4DAB8D48D8398A /* AFHTTPRequestOperationManager.m in Sources */,
+ 9B3D20C65197332A7B9D7A10 /* AFHTTPSessionManager.m in Sources */,
+ 12614473A129EE388A04B562 /* AFNetworkReachabilityManager.m in Sources */,
+ B15E5A587912F49A725192DA /* AFSecurityPolicy.m in Sources */,
+ BEE8719A65D2BF151C8FF1B1 /* AFURLConnectionOperation.m in Sources */,
+ 05F10BA864A937B79CEF7AB7 /* AFURLRequestSerialization.m in Sources */,
+ 1B0340808D17594E7E20416E /* AFURLResponseSerialization.m in Sources */,
+ D1803A9D2201964C36D553F2 /* AFURLSessionManager.m in Sources */,
+ C494DB10D68900498C06D033 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4DB617D0D63B727656D14BC6 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 81ADB8C804615D4048C91FDD /* Pods-OHHTTPStubs iOS Tests-dummy.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ B84BB191C7AF13939DF58349 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 88512D9EC7516213FBEEDFE1 /* AFHTTPRequestOperation.m in Sources */,
+ F4F2BA5E80803A456F424CA8 /* AFHTTPRequestOperationManager.m in Sources */,
+ B24CEF9198BE0DFD988FFCC8 /* AFHTTPSessionManager.m in Sources */,
+ E36FCA4D3E27E2FFA7E5A27B /* AFNetworkActivityIndicatorManager.m in Sources */,
+ 4900C036A4BF4E5C2EA93B03 /* AFNetworkReachabilityManager.m in Sources */,
+ 96F3BAB009B5A271F0A4CAD7 /* AFSecurityPolicy.m in Sources */,
+ 44648DED9CBCDDE10E27F589 /* AFURLConnectionOperation.m in Sources */,
+ 1A69E8016FF6786724EA2DA5 /* AFURLRequestSerialization.m in Sources */,
+ F04762E2C44454C499EA9042 /* AFURLResponseSerialization.m in Sources */,
+ E4DD261A8784962967035ABE /* AFURLSessionManager.m in Sources */,
+ 0D8DD2899735197CB2EDFC53 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m in Sources */,
+ 2B8F7B192A59BAAF912AE712 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
+ 85B667118C68BEDF6F983AFC /* UIAlertView+AFNetworking.m in Sources */,
+ 50C3B855E98EA0044351A87B /* UIButton+AFNetworking.m in Sources */,
+ 5FFE1317E23BD6A2F1739550 /* UIImageView+AFNetworking.m in Sources */,
+ 2A341F22AECC9350634749A9 /* UIProgressView+AFNetworking.m in Sources */,
+ 92DADB41EC0F2CE69047AB84 /* UIRefreshControl+AFNetworking.m in Sources */,
+ 94ABFD6DD946F56D219ADC22 /* UIWebView+AFNetworking.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 0A6A94A7B2C7311729278CD0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "Pods-OHHTTPStubs iOS Tests-AFNetworking";
+ target = FFE6CE2F3BF00868F830AF0D /* Pods-OHHTTPStubs iOS Tests-AFNetworking */;
+ targetProxy = F877A0D43CD157C66D5C6BB5 /* PBXContainerItemProxy */;
+ };
+ 1EA3D04C16DB6059C82BFBA1 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "Pods-OHHTTPStubs Mac Tests-AFNetworking";
+ target = 11C6440715C5C37466193A71 /* Pods-OHHTTPStubs Mac Tests-AFNetworking */;
+ targetProxy = C627703060BD61C91F2A4C64 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 1FFF8AA98B0E9F51AF0A4CE0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 5EA2CAEA9606CF3E2B7AC15F /* Pods-OHHTTPStubs iOS Tests.debug.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 377FFB69F9741DDB7D6B51A4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = "${SRCROOT}/../build";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 42B00731E778630AB234053B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F29ED5E808F38B9662A3D952 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ EXECUTABLE_PREFIX = lib;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 4BA8335C897812C11D5A8C31 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 74DFB2792104932B42329735 /* Pods-OHHTTPStubs iOS Tests.release.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ A9A3FF96249A9958252BB1F6 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 19D183DE47274EDE451A5BC5 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ C49CFB955A1420ECBCD0BFDF /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 19D183DE47274EDE451A5BC5 /* Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ C9BD9E8F4CC2D9BCDC661322 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = B8CA917E680C843D80B254A4 /* Pods-OHHTTPStubs Mac Tests.release.xcconfig */;
+ buildSettings = {
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ EXECUTABLE_PREFIX = lib;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ E2F6597E58383F288EE79539 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F29ED5E808F38B9662A3D952 /* Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig */;
+ buildSettings = {
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ EXECUTABLE_PREFIX = lib;
+ GCC_PREFIX_HEADER = "Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ E2FCAC7CA6D459AA427B170B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = "${SRCROOT}/../build";
+ };
+ name = Debug;
+ };
+ F28053CEB69826456475093D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 274F152996A2D6D92762AAFC /* Pods-OHHTTPStubs Mac Tests.debug.xcconfig */;
+ buildSettings = {
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ EXECUTABLE_PREFIX = lib;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOLFLAGS = "";
+ PODS_ROOT = "$(SRCROOT)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 16E1077524B3F86733F1A5AE /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs iOS Tests-AFNetworking" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C49CFB955A1420ECBCD0BFDF /* Debug */,
+ A9A3FF96249A9958252BB1F6 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ A66489F018353B6058D4D8CF /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs Mac Tests-AFNetworking" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 42B00731E778630AB234053B /* Debug */,
+ E2F6597E58383F288EE79539 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ B1768547D52EBBCE2FF93150 /* Build configuration list for PBXProject "Pods" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ E2FCAC7CA6D459AA427B170B /* Debug */,
+ 377FFB69F9741DDB7D6B51A4 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ D1FCAD37DEA7C4E61C26DF3B /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs Mac Tests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F28053CEB69826456475093D /* Debug */,
+ C9BD9E8F4CC2D9BCDC661322 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ EFA235A59A8027AB996E0D6B /* Build configuration list for PBXNativeTarget "Pods-OHHTTPStubs iOS Tests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1FFF8AA98B0E9F51AF0A4CE0 /* Debug */,
+ 4BA8335C897812C11D5A8C31 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = E0DDD61A0770FF4B6366DB86 /* Project object */;
+}
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig
new file mode 100644
index 0000000000..a254ef11b3
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-Private.xcconfig
@@ -0,0 +1,6 @@
+#include "Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig"
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_LDFLAGS = ${PODS_OHHTTPSTUBS_MAC_TESTS_AFNETWORKING_OTHER_LDFLAGS} -ObjC
+PODS_ROOT = ${SRCROOT}
+SKIP_INSTALL = YES \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m
new file mode 100644
index 0000000000..2de591a2e2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods_OHHTTPStubs_Mac_Tests_AFNetworking : NSObject
+@end
+@implementation PodsDummy_Pods_OHHTTPStubs_Mac_Tests_AFNetworking
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch
new file mode 100644
index 0000000000..043318bf19
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking-prefix.pch
@@ -0,0 +1,5 @@
+#ifdef __OBJC__
+#import <Cocoa/Cocoa.h>
+#endif
+
+#import "Pods-OHHTTPStubs Mac Tests-environment.h"
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig
new file mode 100644
index 0000000000..1fb0c387d4
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests-AFNetworking/Pods-OHHTTPStubs Mac Tests-AFNetworking.xcconfig
@@ -0,0 +1 @@
+PODS_OHHTTPSTUBS_MAC_TESTS_AFNETWORKING_OTHER_LDFLAGS = -framework "CoreServices" -framework "Security" -framework "SystemConfiguration" \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown
new file mode 100644
index 0000000000..59a175087d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.markdown
@@ -0,0 +1,26 @@
+# Acknowledgements
+This application makes use of the following third party libraries:
+
+## AFNetworking
+
+Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/)
+
+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.
+
+Generated by CocoaPods - http://cocoapods.org
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.plist b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.plist
new file mode 100644
index 0000000000..899e8ae43e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-acknowledgements.plist
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PreferenceSpecifiers</key>
+ <array>
+ <dict>
+ <key>FooterText</key>
+ <string>This application makes use of the following third party libraries:</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/)
+
+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.
+</string>
+ <key>Title</key>
+ <string>AFNetworking</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>Generated by CocoaPods - http://cocoapods.org</string>
+ <key>Title</key>
+ <string></string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ </array>
+ <key>StringsTable</key>
+ <string>Acknowledgements</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-dummy.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-dummy.m
new file mode 100644
index 0000000000..f124d0bf53
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods_OHHTTPStubs_Mac_Tests : NSObject
+@end
+@implementation PodsDummy_Pods_OHHTTPStubs_Mac_Tests
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-environment.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-environment.h
new file mode 100644
index 0000000000..42c1cb9116
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-environment.h
@@ -0,0 +1,44 @@
+
+// To check if a library is compiled with CocoaPods you
+// can use the `COCOAPODS` macro definition which is
+// defined in the xcconfigs so it is available in
+// headers also when they are imported in the client
+// project.
+
+
+// AFNetworking
+#define COCOAPODS_POD_AVAILABLE_AFNetworking
+#define COCOAPODS_VERSION_MAJOR_AFNetworking 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking 0
+
+// AFNetworking/NSURLConnection
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLConnection
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLConnection 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLConnection 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLConnection 0
+
+// AFNetworking/NSURLSession
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLSession
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLSession 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLSession 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLSession 0
+
+// AFNetworking/Reachability
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_Reachability
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_Reachability 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_Reachability 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_Reachability 0
+
+// AFNetworking/Security
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_Security
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_Security 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_Security 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_Security 0
+
+// AFNetworking/Serialization
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_Serialization
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_Serialization 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_Serialization 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_Serialization 0
+
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-resources.sh b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-resources.sh
new file mode 100755
index 0000000000..43f08523e1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests-resources.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+set -e
+
+mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+
+RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
+> "$RESOURCES_TO_COPY"
+
+XCASSET_FILES=()
+
+realpath() {
+ DIRECTORY=$(cd "${1%/*}" && pwd)
+ FILENAME="${1##*/}"
+ echo "$DIRECTORY/$FILENAME"
+}
+
+install_resource()
+{
+ case $1 in
+ *.storyboard)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.xib)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.framework)
+ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ ;;
+ *.xcdatamodel)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
+ ;;
+ *.xcdatamodeld)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
+ ;;
+ *.xcmappingmodel)
+ echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
+ xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
+ ;;
+ *.xcassets)
+ ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
+ XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
+ ;;
+ /*)
+ echo "$1"
+ echo "$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ *)
+ echo "${PODS_ROOT}/$1"
+ echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ esac
+}
+
+rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+if [[ "${ACTION}" == "install" ]]; then
+ rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
+rm -f "$RESOURCES_TO_COPY"
+
+if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
+then
+ case "${TARGETED_DEVICE_FAMILY}" in
+ 1,2)
+ TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
+ ;;
+ 1)
+ TARGET_DEVICE_ARGS="--target-device iphone"
+ ;;
+ 2)
+ TARGET_DEVICE_ARGS="--target-device ipad"
+ ;;
+ *)
+ TARGET_DEVICE_ARGS="--target-device mac"
+ ;;
+ esac
+
+ # Find all other xcassets (this unfortunately includes those of path pods and other targets).
+ OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
+ while read line; do
+ if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
+ XCASSET_FILES+=("$line")
+ fi
+ done <<<"$OTHER_XCASSETS"
+
+ printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.debug.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.debug.xcconfig
new file mode 100644
index 0000000000..72f9cec4a5
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.debug.xcconfig
@@ -0,0 +1,6 @@
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs Mac Tests-AFNetworking" -framework "CoreServices" -framework "Security" -framework "SystemConfiguration"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.release.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.release.xcconfig
new file mode 100644
index 0000000000..72f9cec4a5
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs Mac Tests/Pods-OHHTTPStubs Mac Tests.release.xcconfig
@@ -0,0 +1,6 @@
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs Mac Tests-AFNetworking" -framework "CoreServices" -framework "Security" -framework "SystemConfiguration"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig
new file mode 100644
index 0000000000..6f43611720
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-Private.xcconfig
@@ -0,0 +1,6 @@
+#include "Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig"
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_LDFLAGS = ${PODS_OHHTTPSTUBS_IOS_TESTS_AFNETWORKING_OTHER_LDFLAGS} -ObjC
+PODS_ROOT = ${SRCROOT}
+SKIP_INSTALL = YES \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m
new file mode 100644
index 0000000000..8aa49d1389
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods_OHHTTPStubs_iOS_Tests_AFNetworking : NSObject
+@end
+@implementation PodsDummy_Pods_OHHTTPStubs_iOS_Tests_AFNetworking
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch
new file mode 100644
index 0000000000..80fbb8dc3c
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking-prefix.pch
@@ -0,0 +1,5 @@
+#ifdef __OBJC__
+#import <UIKit/UIKit.h>
+#endif
+
+#import "Pods-OHHTTPStubs iOS Tests-environment.h"
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig
new file mode 100644
index 0000000000..b8aeea85b3
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests-AFNetworking/Pods-OHHTTPStubs iOS Tests-AFNetworking.xcconfig
@@ -0,0 +1 @@
+PODS_OHHTTPSTUBS_IOS_TESTS_AFNETWORKING_OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown
new file mode 100644
index 0000000000..59a175087d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.markdown
@@ -0,0 +1,26 @@
+# Acknowledgements
+This application makes use of the following third party libraries:
+
+## AFNetworking
+
+Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/)
+
+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.
+
+Generated by CocoaPods - http://cocoapods.org
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.plist b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.plist
new file mode 100644
index 0000000000..899e8ae43e
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-acknowledgements.plist
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PreferenceSpecifiers</key>
+ <array>
+ <dict>
+ <key>FooterText</key>
+ <string>This application makes use of the following third party libraries:</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/)
+
+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.
+</string>
+ <key>Title</key>
+ <string>AFNetworking</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ <dict>
+ <key>FooterText</key>
+ <string>Generated by CocoaPods - http://cocoapods.org</string>
+ <key>Title</key>
+ <string></string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ </dict>
+ </array>
+ <key>StringsTable</key>
+ <string>Acknowledgements</string>
+ <key>Title</key>
+ <string>Acknowledgements</string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-dummy.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-dummy.m
new file mode 100644
index 0000000000..0fb6509a93
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-dummy.m
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+@interface PodsDummy_Pods_OHHTTPStubs_iOS_Tests : NSObject
+@end
+@implementation PodsDummy_Pods_OHHTTPStubs_iOS_Tests
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-environment.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-environment.h
new file mode 100644
index 0000000000..e1a5d47d3b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-environment.h
@@ -0,0 +1,50 @@
+
+// To check if a library is compiled with CocoaPods you
+// can use the `COCOAPODS` macro definition which is
+// defined in the xcconfigs so it is available in
+// headers also when they are imported in the client
+// project.
+
+
+// AFNetworking
+#define COCOAPODS_POD_AVAILABLE_AFNetworking
+#define COCOAPODS_VERSION_MAJOR_AFNetworking 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking 0
+
+// AFNetworking/NSURLConnection
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLConnection
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLConnection 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLConnection 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLConnection 0
+
+// AFNetworking/NSURLSession
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLSession
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLSession 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLSession 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLSession 0
+
+// AFNetworking/Reachability
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_Reachability
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_Reachability 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_Reachability 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_Reachability 0
+
+// AFNetworking/Security
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_Security
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_Security 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_Security 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_Security 0
+
+// AFNetworking/Serialization
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_Serialization
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_Serialization 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_Serialization 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_Serialization 0
+
+// AFNetworking/UIKit
+#define COCOAPODS_POD_AVAILABLE_AFNetworking_UIKit
+#define COCOAPODS_VERSION_MAJOR_AFNetworking_UIKit 2
+#define COCOAPODS_VERSION_MINOR_AFNetworking_UIKit 5
+#define COCOAPODS_VERSION_PATCH_AFNetworking_UIKit 0
+
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-resources.sh b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-resources.sh
new file mode 100755
index 0000000000..43f08523e1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests-resources.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+set -e
+
+mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+
+RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
+> "$RESOURCES_TO_COPY"
+
+XCASSET_FILES=()
+
+realpath() {
+ DIRECTORY=$(cd "${1%/*}" && pwd)
+ FILENAME="${1##*/}"
+ echo "$DIRECTORY/$FILENAME"
+}
+
+install_resource()
+{
+ case $1 in
+ *.storyboard)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.xib)
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
+ ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
+ ;;
+ *.framework)
+ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+ ;;
+ *.xcdatamodel)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
+ ;;
+ *.xcdatamodeld)
+ echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
+ ;;
+ *.xcmappingmodel)
+ echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
+ xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
+ ;;
+ *.xcassets)
+ ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
+ XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
+ ;;
+ /*)
+ echo "$1"
+ echo "$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ *)
+ echo "${PODS_ROOT}/$1"
+ echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
+ ;;
+ esac
+}
+
+rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+if [[ "${ACTION}" == "install" ]]; then
+ rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
+rm -f "$RESOURCES_TO_COPY"
+
+if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
+then
+ case "${TARGETED_DEVICE_FAMILY}" in
+ 1,2)
+ TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
+ ;;
+ 1)
+ TARGET_DEVICE_ARGS="--target-device iphone"
+ ;;
+ 2)
+ TARGET_DEVICE_ARGS="--target-device ipad"
+ ;;
+ *)
+ TARGET_DEVICE_ARGS="--target-device mac"
+ ;;
+ esac
+
+ # Find all other xcassets (this unfortunately includes those of path pods and other targets).
+ OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
+ while read line; do
+ if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
+ XCASSET_FILES+=("$line")
+ fi
+ done <<<"$OTHER_XCASSETS"
+
+ printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+fi
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.debug.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.debug.xcconfig
new file mode 100644
index 0000000000..89450f5b6a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.debug.xcconfig
@@ -0,0 +1,6 @@
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs iOS Tests-AFNetworking" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.release.xcconfig b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.release.xcconfig
new file mode 100644
index 0000000000..89450f5b6a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Pods/Target Support Files/Pods-OHHTTPStubs iOS Tests/Pods-OHHTTPStubs iOS Tests.release.xcconfig
@@ -0,0 +1,6 @@
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-OHHTTPStubs iOS Tests-AFNetworking" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration"
+OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
+PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs+NSURLSessionConfiguration.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs+NSURLSessionConfiguration.m
new file mode 100644
index 0000000000..1184dcad1f
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs+NSURLSessionConfiguration.m
@@ -0,0 +1,71 @@
+//
+// NSURLSessionConfiguration+OHHTTPStubs.m
+// OHHTTPStubs
+//
+// Created by Olivier Halligon on 06/10/13.
+// Copyright (c) 2013 AliSoftware. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#if defined(__IPHONE_7_0) || defined(__MAC_10_9)
+
+#import <objc/runtime.h>
+#import "OHHTTPStubs.h"
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * This helper is used to swizzle NSURLSessionConfiguration constructor methods
+ * defaultSessionConfiguration and ephemeralSessionConfiguration to insert the private
+ * OHHTTPStubsProtocol into their protocolClasses array so that OHHTTPStubs is automagically
+ * supported when you create a new NSURLSession based on one of there configurations.
+ */
+
+typedef NSURLSessionConfiguration*(*SessionConfigConstructor)(id,SEL);
+static SessionConfigConstructor orig_defaultSessionConfiguration;
+static SessionConfigConstructor orig_ephemeralSessionConfiguration;
+
+static SessionConfigConstructor OHHTTPStubsSwizzle(SEL selector, SessionConfigConstructor newImpl)
+{
+ Class cls = NSURLSessionConfiguration.class;
+ Class metaClass = object_getClass(cls);
+
+ Method origMethod = class_getClassMethod(cls, selector);
+ SessionConfigConstructor origImpl = (SessionConfigConstructor)method_getImplementation(origMethod);
+ if (!class_addMethod(metaClass, selector, (IMP)newImpl, method_getTypeEncoding(origMethod)))
+ {
+ method_setImplementation(origMethod, (IMP)newImpl);
+ }
+ return origImpl;
+}
+
+static NSURLSessionConfiguration* OHHTTPStubs_defaultSessionConfiguration(id self, SEL _cmd)
+{
+ NSURLSessionConfiguration* config = orig_defaultSessionConfiguration(self,_cmd); // call original method
+ [OHHTTPStubs setEnabled:YES forSessionConfiguration:config]; //OHHTTPStubsAddProtocolClassToNSURLSessionConfiguration(config);
+ return config;
+}
+
+static NSURLSessionConfiguration* OHHTTPStubs_ephemeralSessionConfiguration(id self, SEL _cmd)
+{
+ NSURLSessionConfiguration* config = orig_ephemeralSessionConfiguration(self,_cmd); // call original method
+ [OHHTTPStubs setEnabled:YES forSessionConfiguration:config]; //OHHTTPStubsAddProtocolClassToNSURLSessionConfiguration(config);
+ return config;
+}
+
+@interface NSURLSessionConfiguration(OHHTTPStubsSupport) @end
+@implementation NSURLSessionConfiguration(OHHTTPStubsSupport)
++(void)load
+{
+ orig_defaultSessionConfiguration = OHHTTPStubsSwizzle(@selector(defaultSessionConfiguration),
+ OHHTTPStubs_defaultSessionConfiguration);
+ orig_ephemeralSessionConfiguration = OHHTTPStubsSwizzle(@selector(ephemeralSessionConfiguration),
+ OHHTTPStubs_ephemeralSessionConfiguration);
+}
+@end
+
+#endif
+
+
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.h
new file mode 100644
index 0000000000..d4b85dc167
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.h
@@ -0,0 +1,195 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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.
+ *
+ ***********************************************************************************/
+
+// For SDK 7.1 Compatibility (as this macro was only included starting SDK 8.0)
+#ifndef NS_DESIGNATED_INITIALIZER
+ #if __has_attribute(objc_designated_initializer)
+ #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
+ #else
+ #define NS_DESIGNATED_INITIALIZER
+ #endif
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Imports
+
+#import <Foundation/Foundation.h>
+#import "OHHTTPStubsResponse.h"
+// Because this is supposed to be an umbrella header, we should import every public headers here
+#import "OHHTTPStubsResponse+HTTPMessage.h"
+#import "OHHTTPStubsResponse+JSON.h"
+#import "OHPathHelpers.h"
+
+#ifdef NS_ASSUME_NONNULL_BEGIN
+ NS_ASSUME_NONNULL_BEGIN
+ #define _nullable_ __nullable
+ #define _nonnull_ __nonnull
+#else
+ #define _nullable_
+ #define _nonnull_
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Types
+
+typedef BOOL(^OHHTTPStubsTestBlock)(NSURLRequest* request);
+typedef OHHTTPStubsResponse* _nonnull_ (^OHHTTPStubsResponseBlock)( NSURLRequest* request);
+
+/**
+ * This opaque type represents an installed stub and is used to uniquely
+ * identify a stub once it has been created.
+ *
+ * This type is returned by the `stubRequestsPassingTest:withStubResponse:` method
+ * so that you can later reference it and use this reference to remove the stub later.
+ *
+ * This type also let you add arbitrary metadata to a stub to differenciate it
+ * more easily when debugging.
+ */
+@protocol OHHTTPStubsDescriptor <NSObject>
+/**
+ * An arbitrary name that you can set and get to describe your stub.
+ * Use it as your own convenience.
+ *
+ * This is especially useful if you dump all installed stubs using `allStubs`
+ * or if you want to log which stubs are being triggered using `onStubActivation:`.
+ */
+@property(nonatomic, strong) NSString* _nullable_ name;
+@end
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Interface
+
+/**
+ * Stubs Manager. Use this class to add and remove stubs and stub your network requests.
+ */
+@interface OHHTTPStubs : NSObject
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Adding & Removing stubs
+
+
+
+/**
+ * Dedicated method to add a stub
+ *
+ * @param testBlock Block that should return `YES` if the request passed as parameter
+ * should be stubbed with the response block, and `NO` if it should
+ * hit the real world (or be managed by another stub).
+ * @param responseBlock Block that will return the `OHHTTPStubsResponse` (response to
+ * use for stubbing) corresponding to the given request
+ *
+ * @return a stub descriptor that uniquely identifies the stub and can be later used to remove it with `removeStub:`.
+ *
+ * @note The returned stub descriptor is retained (`__strong` reference) by `OHHTTPStubs`
+ * until it is removed (with one of the `removeStub:` / `removeAllStubs`
+ * methods); it is thus recommended to keep it in a `__weak` storage (and not `__strong`)
+ * in your app code, to let the stub descriptor be destroyed and let the variable go
+ * back to `nil` automatically when the stub is removed.
+ */
++(id<OHHTTPStubsDescriptor>)stubRequestsPassingTest:(OHHTTPStubsTestBlock)testBlock
+ withStubResponse:(OHHTTPStubsResponseBlock)responseBlock;
+
+/**
+ * Remove a stub from the list of stubs
+ *
+ * @param stubDesc The stub descriptor that has been returned when adding the stub
+ * using `stubRequestsPassingTest:withStubResponse:`
+ *
+ * @return `YES` if the stub has been successfully removed, `NO` if the parameter was
+ * not a valid stub identifier
+ */
++(BOOL)removeStub:(id<OHHTTPStubsDescriptor>)stubDesc;
+
+/**
+ * Remove all the stubs from the stubs list.
+ */
++(void)removeAllStubs;
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Disabling & Re-Enabling stubs
+
+/**
+ * Enable or disable the stubs for the shared session or for `NSURLConnection`
+ *
+ * @param enabled If `YES`, enables the stubs. If `NO`, disable all the
+ * stubs and let all the requests hit the real world.
+ *
+ * @note OHHTTPStubs are enabled by default, so there is no need to call
+ * this method with `YES` for stubs to work, except if you explicitely
+ * disabled the stubs before.
+ *
+ * @note This only affects requests that are further made using `NSURLConnection`
+ * or using `[NSURLSession sharedSession]`. This does not affect requests
+ * sent on an `NSURLSession` created using an `NSURLSessionConfiguration`.
+ */
++(void)setEnabled:(BOOL)enabled;
+
+#if defined(__IPHONE_7_0) || defined(__MAC_10_9)
+/**
+ * Enable or disable the stubs on a given `NSURLSessionConfiguration`.
+ *
+ * @param enabled If `YES`, enables the stubs for this `NSURLSessionConfiguration`.
+ * If `NO`, disable the stubs and let all the requests hit the real world
+ * @param sessionConfig The NSURLSessionConfiguration on which to enabled/disable the stubs
+ *
+ * @note OHHTTPStubs are enabled by default on newly created `defaultSessionConfiguration`
+ * and `ephemeralSessionConfiguration`, so there is no need to call this method with
+ * `YES` for stubs to work. You generally only use this if you want to disable
+ * `OHTTPStubs` per `NSURLSession` by calling it before building the `NSURLSession`
+ * with the `NSURLSessionConfiguration`.
+ *
+ * @note Important: As usual according to the way `NSURLSessionConfiguration` works, you
+ * MUST set this property BEFORE creating the `NSURLSession`. Once the `NSURLSession`
+ * object is created, they use a deep copy of the `NSURLSessionConfiguration` object
+ * used to create them, so changing the configuration later does not affect already
+ * created sessions.
+ */
++ (void)setEnabled:(BOOL)enabled forSessionConfiguration:(NSURLSessionConfiguration *)sessionConfig;
+#endif
+
+#pragma mark - Debug Methods
+
+/**
+ * List all the installed stubs
+ *
+ * @return An array of `id<OHHTTPStubsDescriptor>` objects currently installed. Useful for debug.
+ */
++(NSArray*)allStubs;
+
+/**
+ * Setup a block to be called each time a stub is triggered.
+ *
+ * Useful if you want to log all your requests being stubbed for example and see which stub
+ * was used to respond to each request.
+ *
+ * @param block The block to call each time a request is being stubbed by OHHTTPStubs.
+ * Set it to `nil` to do nothing. Defaults is `nil`.
+ */
++(void)onStubActivation:( void(^)(NSURLRequest* request, id<OHHTTPStubsDescriptor> stub) )block;
+
+@end
+
+#ifdef NS_ASSUME_NONNULL_END
+ NS_ASSUME_NONNULL_END
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.m
new file mode 100644
index 0000000000..4d36ae693a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.m
@@ -0,0 +1,530 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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.
+ *
+ ***********************************************************************************/
+
+#if ! __has_feature(objc_arc)
+#error This file is expected to be compiled with ARC turned ON
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Imports
+
+#import "OHHTTPStubs.h"
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Types & Constants
+
+@interface OHHTTPStubsProtocol : NSURLProtocol @end
+
+static NSTimeInterval const kSlotTime = 0.25; // Must be >0. We will send a chunk of the data from the stream each 'slotTime' seconds
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Private Interfaces
+
+@interface OHHTTPStubs()
++ (instancetype)sharedInstance;
+@property(atomic, copy) NSMutableArray* stubDescriptors;
+@property(atomic, copy) void (^onStubActivationBlock)(NSURLRequest*, id<OHHTTPStubsDescriptor>);
+@end
+
+@interface OHHTTPStubsDescriptor : NSObject <OHHTTPStubsDescriptor>
+@property(atomic, copy) OHHTTPStubsTestBlock testBlock;
+@property(atomic, copy) OHHTTPStubsResponseBlock responseBlock;
+@end
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - OHHTTPStubsDescriptor Implementation
+
+@implementation OHHTTPStubsDescriptor
+
+@synthesize name = _name;
+
++(instancetype)stubDescriptorWithTestBlock:(OHHTTPStubsTestBlock)testBlock
+ responseBlock:(OHHTTPStubsResponseBlock)responseBlock
+{
+ OHHTTPStubsDescriptor* stub = [OHHTTPStubsDescriptor new];
+ stub.testBlock = testBlock;
+ stub.responseBlock = responseBlock;
+ return stub;
+}
+
+-(NSString*)description
+{
+ return [NSString stringWithFormat:@"<%@ %p : %@>", self.class, self, self.name];
+}
+
+@end
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - OHHTTPStubs Implementation
+
+@implementation OHHTTPStubs
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Singleton methods
+
++ (instancetype)sharedInstance
+{
+ static OHHTTPStubs *sharedInstance = nil;
+
+ static dispatch_once_t predicate;
+ dispatch_once(&predicate, ^{
+ sharedInstance = [[self alloc] init];
+ });
+
+ return sharedInstance;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Setup & Teardown
+
++ (void)initialize
+{
+ if (self == [OHHTTPStubs class])
+ {
+ [self setEnabled:YES];
+ }
+}
+- (id)init
+{
+ self = [super init];
+ if (self)
+ {
+ _stubDescriptors = [NSMutableArray array];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [self.class setEnabled:NO];
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Public class methods
+
+#pragma mark > Adding & Removing stubs
+
++(id<OHHTTPStubsDescriptor>)stubRequestsPassingTest:(OHHTTPStubsTestBlock)testBlock
+ withStubResponse:(OHHTTPStubsResponseBlock)responseBlock
+{
+ OHHTTPStubsDescriptor* stub = [OHHTTPStubsDescriptor stubDescriptorWithTestBlock:testBlock
+ responseBlock:responseBlock];
+ [OHHTTPStubs.sharedInstance addStub:stub];
+ return stub;
+}
+
++(BOOL)removeStub:(id<OHHTTPStubsDescriptor>)stubDesc
+{
+ return [OHHTTPStubs.sharedInstance removeStub:stubDesc];
+}
+
++(void)removeAllStubs
+{
+ [OHHTTPStubs.sharedInstance removeAllStubs];
+}
+
+#pragma mark > Disabling & Re-Enabling stubs
+
++(void)setEnabled:(BOOL)enable
+{
+ static BOOL currentEnabledState = NO;
+ if (enable && !currentEnabledState)
+ {
+ [NSURLProtocol registerClass:OHHTTPStubsProtocol.class];
+ }
+ else if (!enable && currentEnabledState)
+ {
+ [NSURLProtocol unregisterClass:OHHTTPStubsProtocol.class];
+ }
+ currentEnabledState = enable;
+}
+
+#if defined(__IPHONE_7_0) || defined(__MAC_10_9)
++ (void)setEnabled:(BOOL)enable forSessionConfiguration:(NSURLSessionConfiguration*)sessionConfig
+{
+ // Runtime check to make sure the API is available on this version
+ if ( [sessionConfig respondsToSelector:@selector(protocolClasses)]
+ && [sessionConfig respondsToSelector:@selector(setProtocolClasses:)])
+ {
+ NSMutableArray * urlProtocolClasses = [NSMutableArray arrayWithArray:sessionConfig.protocolClasses];
+ Class protoCls = OHHTTPStubsProtocol.class;
+ if (enable && ![urlProtocolClasses containsObject:protoCls])
+ {
+ [urlProtocolClasses insertObject:protoCls atIndex:0];
+ }
+ else if (!enable && [urlProtocolClasses containsObject:protoCls])
+ {
+ [urlProtocolClasses removeObject:protoCls];
+ }
+ sessionConfig.protocolClasses = urlProtocolClasses;
+ }
+ else
+ {
+ NSLog(@"[OHHTTPStubs] %@ is only available when running on iOS7+/OSX9+. "
+ @"Use conditions like 'if ([NSURLSessionConfiguration class])' to only call "
+ @"this method if the user is running iOS7+/OSX9+.", NSStringFromSelector(_cmd));
+ }
+}
+#endif
+
+#pragma mark > Debug Methods
+
++(NSArray*)allStubs
+{
+ return [OHHTTPStubs.sharedInstance stubDescriptors];
+}
+
++(void)onStubActivation:( void(^)(NSURLRequest* request, id<OHHTTPStubsDescriptor> stub) )block
+{
+ [OHHTTPStubs.sharedInstance setOnStubActivationBlock:block];
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Private instance methods
+
+-(void)addStub:(OHHTTPStubsDescriptor*)stubDesc
+{
+ @synchronized(_stubDescriptors)
+ {
+ [_stubDescriptors addObject:stubDesc];
+ }
+}
+
+-(BOOL)removeStub:(id<OHHTTPStubsDescriptor>)stubDesc
+{
+ BOOL handlerFound = NO;
+ @synchronized(_stubDescriptors)
+ {
+ handlerFound = [_stubDescriptors containsObject:stubDesc];
+ [_stubDescriptors removeObject:stubDesc];
+ }
+ return handlerFound;
+}
+
+-(void)removeAllStubs
+{
+ @synchronized(_stubDescriptors)
+ {
+ [_stubDescriptors removeAllObjects];
+ }
+}
+
+- (OHHTTPStubsDescriptor*)firstStubPassingTestForRequest:(NSURLRequest*)request
+{
+ OHHTTPStubsDescriptor* foundStub = nil;
+ @synchronized(_stubDescriptors)
+ {
+ for(OHHTTPStubsDescriptor* stub in _stubDescriptors.reverseObjectEnumerator)
+ {
+ if (stub.testBlock(request))
+ {
+ foundStub = stub;
+ break;
+ }
+ }
+ }
+ return foundStub;
+}
+
+@end
+
+
+
+
+
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Private Protocol Class
+
+@interface OHHTTPStubsProtocol()
+@property(assign) BOOL stopped;
+@property(strong) OHHTTPStubsDescriptor* stub;
+@property(assign) CFRunLoopRef clientRunLoop;
+- (void)executeOnClientRunLoopAfterDelay:(NSTimeInterval)delayInSeconds block:(dispatch_block_t)block;
+@end
+
+@implementation OHHTTPStubsProtocol
+
++ (BOOL)canInitWithRequest:(NSURLRequest *)request
+{
+ return ([OHHTTPStubs.sharedInstance firstStubPassingTestForRequest:request] != nil);
+}
+
+- (id)initWithRequest:(NSURLRequest *)request cachedResponse:(NSCachedURLResponse *)response client:(id<NSURLProtocolClient>)client
+{
+ // Make super sure that we never use a cached response.
+ OHHTTPStubsProtocol* proto = [super initWithRequest:request cachedResponse:nil client:client];
+ proto.stub = [OHHTTPStubs.sharedInstance firstStubPassingTestForRequest:request];
+ return proto;
+}
+
++ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request
+{
+ return request;
+}
+
+- (NSCachedURLResponse *)cachedResponse
+{
+ return nil;
+}
+
+- (void)startLoading
+{
+ self.clientRunLoop = CFRunLoopGetCurrent();
+ NSURLRequest* request = self.request;
+ id<NSURLProtocolClient> client = self.client;
+
+ if (!self.stub)
+ {
+ NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+ @"It seems like the stub has been removed BEFORE the response had time to be sent.",
+ NSLocalizedFailureReasonErrorKey,
+ @"For more info, see https://github.com/AliSoftware/OHHTTPStubs/wiki/OHHTTPStubs-and-asynchronous-tests",
+ NSLocalizedRecoverySuggestionErrorKey,
+ request.URL, // Stop right here if request.URL is nil
+ NSURLErrorFailingURLErrorKey,
+ nil];
+ NSError* error = [NSError errorWithDomain:@"OHHTTPStubs" code:500 userInfo:userInfo];
+ [client URLProtocol:self didFailWithError:error];
+ return;
+ }
+
+ OHHTTPStubsResponse* responseStub = self.stub.responseBlock(request);
+
+ if (OHHTTPStubs.sharedInstance.onStubActivationBlock)
+ {
+ OHHTTPStubs.sharedInstance.onStubActivationBlock(request, self.stub);
+ }
+
+ if (responseStub.error == nil)
+ {
+ NSHTTPURLResponse* urlResponse = [[NSHTTPURLResponse alloc] initWithURL:request.URL
+ statusCode:responseStub.statusCode
+ HTTPVersion:@"HTTP/1.1"
+ headerFields:responseStub.httpHeaders];
+
+ // Cookies handling
+ if (request.HTTPShouldHandleCookies && request.URL)
+ {
+ NSArray* cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:responseStub.httpHeaders forURL:request.URL];
+ if (cookies)
+ {
+ [NSHTTPCookieStorage.sharedHTTPCookieStorage setCookies:cookies forURL:request.URL mainDocumentURL:request.mainDocumentURL];
+ }
+ }
+
+
+ NSString* redirectLocation = (responseStub.httpHeaders)[@"Location"];
+ NSURL* redirectLocationURL;
+ if (redirectLocation)
+ {
+ redirectLocationURL = [NSURL URLWithString:redirectLocation];
+ }
+ else
+ {
+ redirectLocationURL = nil;
+ }
+ if (((responseStub.statusCode > 300) && (responseStub.statusCode < 400)) && redirectLocationURL)
+ {
+ NSURLRequest* redirectRequest = [NSURLRequest requestWithURL:redirectLocationURL];
+ [self executeOnClientRunLoopAfterDelay:responseStub.requestTime block:^{
+ if (!self.stopped)
+ {
+ [client URLProtocol:self wasRedirectedToRequest:redirectRequest redirectResponse:urlResponse];
+ }
+ }];
+ }
+ else
+ {
+ [self executeOnClientRunLoopAfterDelay:responseStub.requestTime block:^{
+ if (!self.stopped)
+ {
+ [client URLProtocol:self didReceiveResponse:urlResponse cacheStoragePolicy:NSURLCacheStorageNotAllowed];
+ if(responseStub.inputStream.streamStatus == NSStreamStatusNotOpen)
+ {
+ [responseStub.inputStream open];
+ }
+ [self streamDataForClient:client
+ withStubResponse:responseStub
+ completion:^(NSError * error)
+ {
+ [responseStub.inputStream close];
+ if (error==nil)
+ {
+ [client URLProtocolDidFinishLoading:self];
+ }
+ else
+ {
+ [client URLProtocol:self didFailWithError:responseStub.error];
+ }
+ }];
+ }
+ }];
+ }
+ } else {
+ // Send the canned error
+ [self executeOnClientRunLoopAfterDelay:responseStub.responseTime block:^{
+ if (!self.stopped)
+ {
+ [client URLProtocol:self didFailWithError:responseStub.error];
+ }
+ }];
+ }
+}
+
+- (void)stopLoading
+{
+ self.stopped = YES;
+}
+
+typedef struct {
+ NSTimeInterval slotTime;
+ double chunkSizePerSlot;
+ double cumulativeChunkSize;
+} OHHTTPStubsStreamTimingInfo;
+
+- (void)streamDataForClient:(id<NSURLProtocolClient>)client
+ withStubResponse:(OHHTTPStubsResponse*)stubResponse
+ completion:(void(^)(NSError * error))completion
+{
+ if ((stubResponse.dataSize>0) && stubResponse.inputStream.hasBytesAvailable && (!self.stopped))
+ {
+ // Compute timing data once and for all for this stub
+
+ OHHTTPStubsStreamTimingInfo timingInfo = {
+ .slotTime = kSlotTime, // Must be >0. We will send a chunk of data from the stream each 'slotTime' seconds
+ .cumulativeChunkSize = 0
+ };
+
+ if(stubResponse.responseTime < 0)
+ {
+ // Bytes send each 'slotTime' seconds = Speed in KB/s * 1000 * slotTime in seconds
+ timingInfo.chunkSizePerSlot = (fabs(stubResponse.responseTime) * 1000) * timingInfo.slotTime;
+ }
+ else if (stubResponse.responseTime < kSlotTime) // includes case when responseTime == 0
+ {
+ // We want to send the whole data quicker than the slotTime, so send it all in one chunk.
+ timingInfo.chunkSizePerSlot = stubResponse.dataSize;
+ timingInfo.slotTime = stubResponse.responseTime;
+ }
+ else
+ {
+ // Bytes send each 'slotTime' seconds = (Whole size in bytes / response time) * slotTime = speed in bps * slotTime in seconds
+ timingInfo.chunkSizePerSlot = ((stubResponse.dataSize/stubResponse.responseTime) * timingInfo.slotTime);
+ }
+
+ [self streamDataForClient:client
+ fromStream:stubResponse.inputStream
+ timingInfo:timingInfo
+ completion:completion];
+ }
+ else
+ {
+ if (completion)
+ {
+ completion(nil);
+ }
+ }
+}
+
+- (void) streamDataForClient:(id<NSURLProtocolClient>)client
+ fromStream:(NSInputStream*)inputStream
+ timingInfo:(OHHTTPStubsStreamTimingInfo)timingInfo
+ completion:(void(^)(NSError * error))completion
+{
+ NSParameterAssert(timingInfo.chunkSizePerSlot > 0);
+
+ if (inputStream.hasBytesAvailable && (!self.stopped))
+ {
+ // This is needed in case we computed a non-integer chunkSizePerSlot, to avoid cumulative errors
+ double cumulativeChunkSizeAfterRead = timingInfo.cumulativeChunkSize + timingInfo.chunkSizePerSlot;
+ NSUInteger chunkSizeToRead = floor(cumulativeChunkSizeAfterRead) - floor(timingInfo.cumulativeChunkSize);
+ timingInfo.cumulativeChunkSize = cumulativeChunkSizeAfterRead;
+
+ if (chunkSizeToRead == 0)
+ {
+ // Nothing to read at this pass, but probably later
+ [self executeOnClientRunLoopAfterDelay:timingInfo.slotTime block:^{
+ [self streamDataForClient:client fromStream:inputStream
+ timingInfo:timingInfo completion:completion];
+ }];
+ } else {
+ uint8_t* buffer = (uint8_t*)malloc(sizeof(uint8_t)*chunkSizeToRead);
+ NSInteger bytesRead = [inputStream read:buffer maxLength:chunkSizeToRead];
+ if (bytesRead > 0)
+ {
+ NSData * data = [NSData dataWithBytes:buffer length:bytesRead];
+ // Wait for 'slotTime' seconds before sending the chunk.
+ // If bytesRead < chunkSizePerSlot (because we are near the EOF), adjust slotTime proportionally to the bytes remaining
+ [self executeOnClientRunLoopAfterDelay:((double)bytesRead / (double)chunkSizeToRead) * timingInfo.slotTime block:^{
+ [client URLProtocol:self didLoadData:data];
+ [self streamDataForClient:client fromStream:inputStream
+ timingInfo:timingInfo completion:completion];
+ }];
+ }
+ else
+ {
+ if (completion)
+ {
+ // Note: We may also arrive here with no error if we were just at the end of the stream (EOF)
+ // In that case, hasBytesAvailable did return YES (because at the limit of OEF) but nothing were read (because EOF)
+ // But then in that case inputStream.streamError will be nil so that's cool, we won't return an error anyway
+ completion(inputStream.streamError);
+ }
+ }
+ free(buffer);
+ }
+ }
+ else
+ {
+ if (completion)
+ {
+ completion(nil);
+ }
+ }
+}
+
+/////////////////////////////////////////////
+// Delayed execution utility methods
+/////////////////////////////////////////////
+
+- (void)executeOnClientRunLoopAfterDelay:(NSTimeInterval)delayInSeconds block:(dispatch_block_t)block
+{
+ dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
+ dispatch_after(popTime, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ CFRunLoopPerformBlock(self.clientRunLoop, kCFRunLoopDefaultMode, block);
+ CFRunLoopWakeUp(self.clientRunLoop);
+ });
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h
new file mode 100644
index 0000000000..0ac0f6e124
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h
@@ -0,0 +1,62 @@
+//
+// OHHTTPStubsResponse+HTTPMessage.h
+// OHHTTPStubs
+//
+// Created by Olivier Halligon on 01/09/13.
+// Copyright (c) 2013 AliSoftware. All rights reserved.
+//
+
+#import "OHHTTPStubsResponse.h"
+
+#ifdef NS_ASSUME_NONNULL_BEGIN
+ NS_ASSUME_NONNULL_BEGIN
+ #define _nullable_ __nullable
+#else
+ #define _nullable_
+#endif
+
+
+/**
+ * Adds support for building stubs from "HTTP Messages" conforming to
+ * the format output by `curl -is`
+ */
+@interface OHHTTPStubsResponse (HTTPMessage)
+
+/*! @name Building a response from HTTP Message data */
+
+// TODO: Try to implement it using NSInputStream someday?
+
+/**
+ * Builds a response given a message data as returned by `curl -is [url]`, that is containing both the headers and the body.
+ *
+ * This method will split the headers and the body and build a OHHTTPStubsReponse accordingly
+ *
+ * @param responseData The NSData containing the whole HTTP response, including the headers and the body
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ */
++(instancetype)responseWithHTTPMessageData:(NSData*)responseData;
+
+/**
+ * Builds a response given the name of a `"*.response"` file containing both the headers and the body.
+ *
+ * The response file is expected to be in the specified bundle (or the application bundle if nil).
+ * This method will split the headers and the body and build a OHHTTPStubsReponse accordingly
+ *
+ * @param responseName The name of the `"*.response"` file (without extension) containing the whole
+ * HTTP response (including the headers and the body)
+ * @param bundleOrNil The bundle in which the `"*.response"` file is located. If `nil`, the
+ * `[NSBundle bundleForClass:self.class]` will be used.
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ */
+
++(instancetype)responseNamed:(NSString*)responseName
+ inBundle:(NSBundle* _nullable_)bundleOrNil;
+
+
+@end
+
+#ifdef NS_ASSUME_NONNULL_END
+ NS_ASSUME_NONNULL_END
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.m
new file mode 100644
index 0000000000..03d0e7a6db
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.m
@@ -0,0 +1,54 @@
+//
+// OHHTTPStubsResponse+HTTPMessage.m
+// OHHTTPStubs
+//
+// Created by Olivier Halligon on 01/09/13.
+// Copyright (c) 2013 AliSoftware. All rights reserved.
+//
+
+#import "OHHTTPStubsResponse+HTTPMessage.h"
+
+@implementation OHHTTPStubsResponse (HTTPMessage)
+
+#pragma mark Building response from HTTP Message Data (dump from "curl -is")
+
++(instancetype)responseWithHTTPMessageData:(NSData*)responseData;
+{
+ NSData *data = [NSData data];
+ NSInteger statusCode = 200;
+ NSDictionary *headers = @{};
+
+ CFHTTPMessageRef httpMessage = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, FALSE);
+ if (httpMessage)
+ {
+ CFHTTPMessageAppendBytes(httpMessage, responseData.bytes, responseData.length);
+
+ data = responseData; // By default
+
+ if (CFHTTPMessageIsHeaderComplete(httpMessage))
+ {
+ statusCode = (NSInteger)CFHTTPMessageGetResponseStatusCode(httpMessage);
+ headers = (__bridge_transfer NSDictionary *)CFHTTPMessageCopyAllHeaderFields(httpMessage);
+ data = (__bridge_transfer NSData *)CFHTTPMessageCopyBody(httpMessage);
+ }
+ CFRelease(httpMessage);
+ }
+
+ return [self responseWithData:data
+ statusCode:(int)statusCode
+ headers:headers];
+}
+
++(instancetype)responseNamed:(NSString*)responseName
+ inBundle:(NSBundle*)responsesBundle
+{
+ NSURL *responseURL = [responsesBundle?:[NSBundle bundleForClass:self.class] URLForResource:responseName
+ withExtension:@"response"];
+
+ NSData *responseData = [NSData dataWithContentsOfURL:responseURL];
+ NSAssert(responseData, @"Could not find HTTP response named '%@' in bundle '%@'", responseName, responsesBundle);
+
+ return [self responseWithHTTPMessageData:responseData];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h
new file mode 100644
index 0000000000..fc8719df0d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h
@@ -0,0 +1,47 @@
+//
+// OHHTTPStubsResponse+JSON.h
+// OHHTTPStubs
+//
+// Created by Olivier Halligon on 01/09/13.
+// Copyright (c) 2013 AliSoftware. All rights reserved.
+//
+
+#import "OHHTTPStubsResponse.h"
+
+#ifdef NS_ASSUME_NONNULL_BEGIN
+ NS_ASSUME_NONNULL_BEGIN
+ #define _nullable_ __nullable
+#else
+ #define _nullable_
+#endif
+
+
+/**
+ * Adds convenience methods to manipulate JSON objects directly.
+ * Pass in an `NSDictionary` or `NSArray` to generate a corresponding JSON output.
+ */
+@interface OHHTTPStubsResponse (JSON)
+
+/**
+ * Builds a response given a JSON object for the response body, status code, and headers.
+ *
+ * @param jsonObject Object representing the response body.
+ * Typically a `NSDictionary`; may be any object accepted by `+[NSJSONSerialization dataWithJSONObject:options:error:]`
+ * @param statusCode The HTTP Status Code to use in the response
+ * @param httpHeaders The HTTP Headers to return in the response
+ * If a "Content-Type" header is not included, "Content-Type: application/json" will be added.
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ *
+ * @note This method typically calls `responseWithData:statusCode:headers:`, passing the serialized JSON
+ * object as the data parameter and adding the Content-Type header if necessary.
+ */
++ (instancetype)responseWithJSONObject:(id)jsonObject
+ statusCode:(int)statusCode
+ headers:(NSDictionary * _nullable_)httpHeaders;
+
+@end
+
+#ifdef NS_ASSUME_NONNULL_END
+ NS_ASSUME_NONNULL_END
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.m
new file mode 100644
index 0000000000..aebcb99080
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.m
@@ -0,0 +1,31 @@
+//
+// OHHTTPStubsResponse+JSON.m
+// OHHTTPStubs
+//
+// Created by Olivier Halligon on 01/09/13.
+// Copyright (c) 2013 AliSoftware. All rights reserved.
+//
+
+#import "OHHTTPStubsResponse+JSON.h"
+
+@implementation OHHTTPStubsResponse (JSON)
+
+/*! @name Building a response from JSON objects */
+
++ (instancetype)responseWithJSONObject:(id)jsonObject
+ statusCode:(int)statusCode
+ headers:(NSDictionary *)httpHeaders
+{
+ if (!httpHeaders[@"Content-Type"])
+ {
+ NSMutableDictionary* mutableHeaders = [NSMutableDictionary dictionaryWithDictionary:httpHeaders];
+ mutableHeaders[@"Content-Type"] = @"application/json";
+ httpHeaders = [NSDictionary dictionaryWithDictionary:mutableHeaders]; // make immutable again
+ }
+
+ return [self responseWithData:[NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:nil]
+ statusCode:statusCode
+ headers:httpHeaders];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.h
new file mode 100644
index 0000000000..a80abd1334
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.h
@@ -0,0 +1,271 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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.
+ *
+ ***********************************************************************************/
+
+// For SDK 7.1 Compatibility (as this macro was only included starting SDK 8.0)
+#ifndef NS_DESIGNATED_INITIALIZER
+ #if __has_attribute(objc_designated_initializer)
+ #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
+ #else
+ #define NS_DESIGNATED_INITIALIZER
+ #endif
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Imports
+
+#import <Foundation/Foundation.h>
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Defines & Constants
+
+// Standard download speeds.
+extern const double
+OHHTTPStubsDownloadSpeedGPRS,
+OHHTTPStubsDownloadSpeedEDGE,
+OHHTTPStubsDownloadSpeed3G,
+OHHTTPStubsDownloadSpeed3GPlus,
+OHHTTPStubsDownloadSpeedWifi;
+
+#ifdef NS_ASSUME_NONNULL_BEGIN
+ NS_ASSUME_NONNULL_BEGIN
+ #define _nullable_ __nullable
+#else
+ #define _nullable_
+#endif
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Interface
+
+/**
+ * Stubs Response. This describes a stubbed response to be returned by the URL Loading System,
+ * including its HTTP headers, body, statusCode and response time.
+ */
+@interface OHHTTPStubsResponse : NSObject
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Properties
+
+/**
+ * The headers to use for the fake response
+ */
+@property(nonatomic, strong) NSDictionary* _nullable_ httpHeaders;
+/**
+ * The HTTP status code to use for the fake response
+ */
+@property(nonatomic, assign) int statusCode;
+/**
+ * The inputStream used when sending the response.
+ * @note You generally don't manipulate this directly.
+ */
+@property(nonatomic, strong) NSInputStream* _nullable_ inputStream;
+/**
+ * The size of the fake response body, in bytes.
+ */
+@property(nonatomic, assign) unsigned long long dataSize;
+/**
+ * The duration to wait before faking receiving the response headers.
+ *
+ * Defaults to 0.0.
+ */
+@property(nonatomic, assign) NSTimeInterval requestTime;
+/**
+ * The duration to use to send the fake response body.
+ *
+ * @note if responseTime<0, it is interpreted as a download speed in KBps ( -200 => 200KB/s )
+ */
+@property(nonatomic, assign) NSTimeInterval responseTime;
+/**
+ * The fake error to generate to simulate a network error.
+ *
+ * If `error` is non-`nil`, the request will result in a failure and no response will be sent.
+ */
+@property(nonatomic, strong) NSError* _nullable_ error;
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Commodity Constructors
+/*! @name Commodity */
+
+/* -------------------------------------------------------------------------- */
+#pragma mark > Building response from NSData
+
+/**
+ * Builds a response given raw data.
+ *
+ * @note Internally calls `-initWithInputStream:dataSize:statusCode:headers:` with and inputStream built from the NSData.
+ *
+ * @param data The raw data to return in the response
+ * @param statusCode The HTTP Status Code to use in the response
+ * @param httpHeaders The HTTP Headers to return in the response
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ */
++(instancetype)responseWithData:(NSData*)data
+ statusCode:(int)statusCode
+ headers:(NSDictionary* _nullable_)httpHeaders;
+
+
+/* -------------------------------------------------------------------------- */
+#pragma mark > Building response from a file
+
+/**
+ * Builds a response given a file path, the status code and headers.
+ *
+ * @param filePath The file path that contains the response body to return.
+ * @param statusCode The HTTP Status Code to use in the response
+ * @param httpHeaders The HTTP Headers to return in the response
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ *
+ * @note It is encouraged to use the OHPathHelpers functions & macros to build
+ * the filePath parameter easily
+ */
++(instancetype)responseWithFileAtPath:(NSString *)filePath
+ statusCode:(int)statusCode
+ headers:(NSDictionary* _nullable_)httpHeaders;
+
+/* -------------------------------------------------------------------------- */
+#pragma mark > Building an error response
+
+/**
+ * Builds a response that corresponds to the given error
+ *
+ * @param error The error to use in the stubbed response.
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ *
+ * @note For example you could use an error like `[NSError errorWithDomain:NSURLErrorDomain code:kCFURLErrorNotConnectedToInternet userInfo:nil]`
+ */
++(instancetype)responseWithError:(NSError*)error;
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Commotidy Setters
+
+/**
+ * Set the `responseTime` of the `OHHTTPStubsResponse` and return `self`. Useful for chaining method calls.
+ *
+ * _Usage example:_
+ * <pre>return [[OHHTTPStubsReponse responseWithData:data statusCode:200 headers:nil] responseTime:5.0];</pre>
+ *
+ * @param responseTime If positive, the amount of time used to send the entire response.
+ * If negative, the rate in KB/s at which to send the response data.
+ * Useful to simulate slow networks for example. You may use the
+ * _OHHTTPStubsDownloadSpeed…_ constants here.
+ *
+ * @return `self` (= the same `OHHTTPStubsResponse` that was the target of this method).
+ * Returning `self` is useful for chaining method calls.
+ */
+-(instancetype)responseTime:(NSTimeInterval)responseTime;
+
+/**
+ * Set both the `requestTime` and the `responseTime` of the `OHHTTPStubsResponse` at once.
+ * Useful for chaining method calls.
+ *
+ * _Usage example:_
+ * <pre>return [[OHHTTPStubsReponse responseWithData:data statusCode:200 headers:nil]
+ * requestTime:1.0 responseTime:5.0];</pre>
+ *
+ * @param requestTime The time to wait before the response begins to send. This value must be greater than or equal to zero.
+ * @param responseTime If positive, the amount of time used to send the entire response.
+ * If negative, the rate in KB/s at which to send the response data.
+ * Useful to simulate slow networks for example. You may use the
+ * _OHHTTPStubsDownloadSpeed…_ constants here.
+ *
+ * @return `self` (= the same `OHHTTPStubsResponse` that was the target of this method). Useful for chaining method calls.
+ */
+-(instancetype)requestTime:(NSTimeInterval)requestTime responseTime:(NSTimeInterval)responseTime;
+
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Initializers
+/*! @name Initializers */
+
+/**
+ * Designed initializer. Initialize a response with the given input stream, dataSize,
+ * statusCode and headers.
+ *
+ * @param inputStream The input stream that will provide the data to return in the response
+ * @param dataSize The size of the data in the stream.
+ * @param statusCode The HTTP Status Code to use in the response
+ * @param httpHeaders The HTTP Headers to return in the response
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ *
+ * @note You will probably never need to call this method yourself. Prefer the other initializers (that will call this method eventually)
+ */
+-(instancetype)initWithInputStream:(NSInputStream*)inputStream
+ dataSize:(unsigned long long)dataSize
+ statusCode:(int)statusCode
+ headers:(NSDictionary* _nullable_)httpHeaders NS_DESIGNATED_INITIALIZER;
+
+
+/**
+ * Initialize a response with a given file path, statusCode and headers.
+ *
+ * @param filePath The file path of the data to return in the response
+ * @param statusCode The HTTP Status Code to use in the response
+ * @param httpHeaders The HTTP Headers to return in the response
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ *
+ * @note This method simply builds the NSInputStream, compute the file size, and then call `-initWithInputStream:dataSize:statusCode:headers:`
+ */
+-(instancetype)initWithFileAtPath:(NSString*)filePath
+ statusCode:(int)statusCode
+ headers:(NSDictionary* _nullable_)httpHeaders;
+
+
+/**
+ * Initialize a response with the given data, statusCode and headers.
+ *
+ * @param data The raw data to return in the response
+ * @param statusCode The HTTP Status Code to use in the response
+ * @param httpHeaders The HTTP Headers to return in the response
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ */
+-(instancetype)initWithData:(NSData*)data
+ statusCode:(int)statusCode
+ headers:(NSDictionary* _nullable_)httpHeaders;
+
+
+/**
+ * Designed initializer. Initialize a response with the given error.
+ *
+ * @param error The error to use in the stubbed response.
+ *
+ * @return An `OHHTTPStubsResponse` describing the corresponding response to return by the stub
+ *
+ * @note For example you could use an error like `[NSError errorWithDomain:NSURLErrorDomain code:kCFURLErrorNotConnectedToInternet userInfo:nil]`
+ */
+-(instancetype)initWithError:(NSError*)error NS_DESIGNATED_INITIALIZER;
+
+@end
+
+#ifdef NS_ASSUME_NONNULL_END
+ NS_ASSUME_NONNULL_END
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.m
new file mode 100644
index 0000000000..69d846a74a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.m
@@ -0,0 +1,187 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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.
+ *
+ ***********************************************************************************/
+
+#if ! __has_feature(objc_arc)
+#error This file is expected to be compiled with ARC turned ON
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Imports
+
+#import "OHHTTPStubsResponse.h"
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Defines & Constants
+
+const double OHHTTPStubsDownloadSpeedGPRS =- 56 / 8; // kbps -> KB/s
+const double OHHTTPStubsDownloadSpeedEDGE =- 128 / 8; // kbps -> KB/s
+const double OHHTTPStubsDownloadSpeed3G =- 3200 / 8; // kbps -> KB/s
+const double OHHTTPStubsDownloadSpeed3GPlus =- 7200 / 8; // kbps -> KB/s
+const double OHHTTPStubsDownloadSpeedWifi =- 12000 / 8; // kbps -> KB/s
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Implementation
+
+@implementation OHHTTPStubsResponse
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Commodity Constructors
+
+
+#pragma mark > Building response from NSData
+
++(instancetype)responseWithData:(NSData*)data
+ statusCode:(int)statusCode
+ headers:(NSDictionary*)httpHeaders
+{
+ OHHTTPStubsResponse* response = [[self alloc] initWithData:data
+ statusCode:statusCode
+ headers:httpHeaders];
+ return response;
+}
+
+
+#pragma mark > Building response from a file
+
++(instancetype)responseWithFileAtPath:(NSString *)filePath
+ statusCode:(int)statusCode
+ headers:(NSDictionary *)httpHeaders
+{
+ OHHTTPStubsResponse* response = [[self alloc] initWithFileAtPath:filePath
+ statusCode:statusCode
+ headers:httpHeaders];
+ return response;
+}
+
+
+#pragma mark > Building an error response
+
++(instancetype)responseWithError:(NSError*)error
+{
+ OHHTTPStubsResponse* response = [[self alloc] initWithError:error];
+ return response;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Commotidy Setters
+
+-(instancetype)responseTime:(NSTimeInterval)responseTime
+{
+ _responseTime = responseTime;
+ return self;
+}
+
+-(instancetype)requestTime:(NSTimeInterval)requestTime responseTime:(NSTimeInterval)responseTime
+{
+ _requestTime = requestTime;
+ _responseTime = responseTime;
+ return self;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Initializers
+
+-(instancetype)initWithInputStream:(NSInputStream*)inputStream
+ dataSize:(unsigned long long)dataSize
+ statusCode:(int)statusCode
+ headers:(NSDictionary*)httpHeaders
+{
+ self = [super init];
+ if (self)
+ {
+ _inputStream = inputStream;
+ _dataSize = dataSize;
+ _statusCode = statusCode;
+ NSMutableDictionary * headers = [NSMutableDictionary dictionaryWithDictionary:httpHeaders];
+ static NSString *const ContentLengthHeader = @"Content-Length";
+ if (!headers[ContentLengthHeader])
+ {
+ headers[ContentLengthHeader] = [NSString stringWithFormat:@"%llu",_dataSize];
+ }
+ _httpHeaders = [NSDictionary dictionaryWithDictionary:headers];
+ }
+ return self;
+}
+
+-(instancetype)initWithFileAtPath:(NSString*)filePath
+ statusCode:(int)statusCode
+ headers:(NSDictionary*)httpHeaders
+{
+ NSInputStream* inputStream;
+ if (filePath)
+ {
+ inputStream = [NSInputStream inputStreamWithFileAtPath:filePath];
+ }
+ else
+ {
+ NSLog(@"%s: nil file path. Returning empty data", __PRETTY_FUNCTION__);
+ inputStream = [NSInputStream inputStreamWithData:[NSData data]];
+ }
+
+ NSDictionary* attributes = [NSFileManager.defaultManager attributesOfItemAtPath:filePath error:nil];
+ unsigned long long fileSize = [[attributes valueForKey:NSFileSize] unsignedLongLongValue];
+ self = [self initWithInputStream:inputStream
+ dataSize:fileSize
+ statusCode:statusCode
+ headers:httpHeaders];
+ return self;
+}
+
+-(instancetype)initWithData:(NSData*)data
+ statusCode:(int)statusCode
+ headers:(NSDictionary*)httpHeaders
+{
+ NSInputStream* inputStream = [NSInputStream inputStreamWithData:data?:[NSData data]];
+ self = [self initWithInputStream:inputStream
+ dataSize:data.length
+ statusCode:statusCode
+ headers:httpHeaders];
+ return self;
+}
+
+-(instancetype)initWithError:(NSError*)error
+{
+ self = [super init];
+ if (self) {
+ _error = error;
+ }
+ return self;
+}
+
+-(NSString*)debugDescription
+{
+ return [NSString stringWithFormat:@"<%@ %p requestTime:%f responseTime:%f status:%d dataSize:%llu>",
+ self.class, self, self.requestTime, self.responseTime, self.statusCode, self.dataSize];
+}
+
+////////////////////////////////////////////////////////////////////////////////
+#pragma mark - Accessors
+
+-(void)setRequestTime:(NSTimeInterval)requestTime
+{
+ NSAssert(requestTime >= 0, @"Invalid Request Time (%f) for OHHTTPStubResponse. Request time must be greater than or equal to zero",requestTime);
+ _requestTime = requestTime;
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.h b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.h
new file mode 100644
index 0000000000..aa250547b8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.h
@@ -0,0 +1,77 @@
+//
+// OHPathHelpers.h
+// Pods
+//
+// Created by Olivier Halligon on 18/04/2015.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+#ifdef NS_ASSUME_NONNULL_BEGIN
+ NS_ASSUME_NONNULL_BEGIN
+ #define _nullable_ __nullable
+#else
+ #define _nullable_
+#endif
+
+
+/**
+ * Useful function to build a path given a file name and a class.
+ *
+ * @param fileName The name of the file to get the path to, including file extension
+ * @param inBundleForClass The class of the caller, used to determine the current bundle
+ * in which the file is supposed to be located.
+ * You should typically pass `self.class` (ObjC) or
+ * `self.dynamicType` (Swift) when calling this function.
+ *
+ * @return The path of the given file in the same bundle as the inBundleForClass class
+ */
+NSString* _nullable_ OHPathForFile(NSString* fileName, Class inBundleForClass);
+
+/**
+ * Useful function to build a path given a file name and a bundle.
+ *
+ * @param fileName The name of the file to get the path to, including file extension
+ * @param bundle The bundle in which the file is supposed to be located.
+ * This parameter can't be null.
+ *
+ * @return The path of the given file in given bundle
+ *
+ * @note You should avoid using `[NSBundle mainBundle]` for the `bundle` parameter,
+ * as in the context of Unit Tests, this points to the Simulator's bundle,
+ * not the bundle of the app under test. That's why `nil` is not an acceptable
+ * value (so you won't expect it to default to the `mainBundle`).
+ * You should use `[NSBundle bundleForClass:]` instead.
+ */
+NSString* _nullable_ OHPathForFileInBundle(NSString* fileName, NSBundle* bundle);
+
+/**
+ * Useful function to build a path to a file in the Documents's directory in the
+ * app sandbox, used by iTunes File Sharing for example.
+ *
+ * @param fileName The name of the file to get the path to, including file extension
+ *
+ * @return The path of the file in the Documents directory in your App Sandbox
+ */
+NSString* _nullable_ OHPathForFileInDocumentsDir(NSString* fileName);
+
+
+
+/**
+ * Useful function to build an NSBundle located in the application's resources simply from its name
+ *
+ * @param bundleBasename The base name, without extension (extension is assumed to be ".bundle").
+ * @param inBundleForClass The class of the caller, used to determine the current bundle
+ * in which the file is supposed to be located.
+ * You should typically pass `self.class` (ObjC) or
+ * `self.dynamicType` (Swift) when calling this function.
+ *
+ * @return The NSBundle object representing the bundle with the given basename located in your application's resources.
+ */
+NSBundle* _nullable_ OHResourceBundle(NSString* bundleBasename, Class inBundleForClass);
+
+
+#ifdef NS_ASSUME_NONNULL_END
+ NS_ASSUME_NONNULL_END
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.m b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.m
new file mode 100644
index 0000000000..cac24a636a
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.m
@@ -0,0 +1,35 @@
+//
+// OHPathHelpers.m
+// Pods
+//
+// Created by Olivier Halligon on 18/04/2015.
+//
+//
+
+#import "OHPathHelpers.h"
+
+NSString* OHPathForFile(NSString* fileName, Class inBundleForClass)
+{
+ NSBundle* bundle = [NSBundle bundleForClass:inBundleForClass];
+ return OHPathForFileInBundle(fileName, bundle);
+}
+
+NSString* OHPathForFileInBundle(NSString* fileName, NSBundle* bundle)
+{
+ return [bundle pathForResource:[fileName stringByDeletingPathExtension]
+ ofType:[fileName pathExtension]];
+}
+
+NSString* OHPathForFileInDocumentsDir(NSString* fileName)
+{
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *basePath = (paths.count > 0) ? [paths objectAtIndex:0] : nil;
+ return [basePath stringByAppendingPathComponent:fileName];
+}
+
+NSBundle* OHResourceBundleForClass(NSString* bundleBasename, Class inBundleForClass)
+{
+ NSBundle* classBundle = [NSBundle bundleForClass:inBundleForClass];
+ return [NSBundle bundleWithPath:[classBundle pathForResource:bundleBasename
+ ofType:@"bundle"]];
+} \ No newline at end of file
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs Mac-Info.plist b/test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs Mac-Info.plist
new file mode 100644
index 0000000000..a3da7a555b
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs Mac-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.alisoftware.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2014 AliSoftware. All rights reserved.</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs iOS-Info.plist b/test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs iOS-Info.plist
new file mode 100644
index 0000000000..a321905ba1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/Supporting Files/OHHTTPStubs iOS-Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.alisoftware.$(PRODUCT_NAME:rfc1034identifier)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Fixtures/emptyfile.json b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Fixtures/emptyfile.json
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Fixtures/emptyfile.json
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/AFNetworkingTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/AFNetworkingTests.m
new file mode 100644
index 0000000000..f0dcc952c8
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/AFNetworkingTests.m
@@ -0,0 +1,226 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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 <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+#import "OHHTTPStubsResponse+JSON.h"
+
+#import "AFHTTPRequestOperation.h"
+
+static const NSTimeInterval kResponseTimeTolerence = 1.0;
+
+@interface AFNetworkingTests : XCTestCase @end
+
+@implementation AFNetworkingTests
+
+-(void)setUp
+{
+ [super setUp];
+ [OHHTTPStubs removeAllStubs];
+}
+
+-(void)test_AFHTTPRequestOperation_success
+{
+ static const NSTimeInterval kRequestTime = 0.05;
+ static const NSTimeInterval kResponseTime = 0.1;
+ NSData* expectedResponse = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:expectedResponse statusCode:200 headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"AFHTTPRequestOperation request finished"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ AFHTTPRequestOperation* op = [[AFHTTPRequestOperation alloc] initWithRequest:req];
+ [op setResponseSerializer:[AFHTTPResponseSerializer serializer]];
+ __block __strong id response = nil;
+ [op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ response = responseObject; // keep strong reference
+ [expectation fulfill];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ XCTFail(@"Unexpected network failure");
+ [expectation fulfill];
+ }];
+ [op start];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(response, expectedResponse, @"Unexpected data received");
+}
+
+-(void)test_AFHTTPRequestOperation_multiple_choices
+{
+ static const NSTimeInterval kRequestTime = 0.05;
+ static const NSTimeInterval kResponseTime = 0.1;
+ NSData* expectedResponse = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:expectedResponse statusCode:300 headers:@{@"Location":@"http://www.iana.org/domains/another/example"}]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"AFHTTPRequestOperation request finished"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ AFHTTPRequestOperation* op = [[AFHTTPRequestOperation alloc] initWithRequest:req];
+ AFHTTPResponseSerializer* serializer = [AFHTTPResponseSerializer serializer];
+ [serializer setAcceptableStatusCodes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 101)]];
+ [op setResponseSerializer:serializer];
+
+ __block __strong id response = nil;
+ [op setRedirectResponseBlock:^NSURLRequest *(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse) {
+ if (redirectResponse == nil) {
+ return request;
+ }
+ XCTFail(@"Unexpected redirect");
+ return nil;
+ }];
+
+ [op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ response = responseObject; // keep strong reference
+ [expectation fulfill];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ XCTFail(@"Unexpected network failure");
+ [expectation fulfill];
+ }];
+ [op start];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(response, expectedResponse, @"Unexpected data received");
+}
+
+-(void)test_AFHTTPRequestOperation_redirect
+{
+ static const NSTimeInterval kRequestTime = 0.05;
+ static const NSTimeInterval kResponseTime = 0.1;
+
+ NSURL* redirectURL = [NSURL URLWithString:@"http://www.iana.org/domains/another/example"];
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:[NSData data] statusCode:311 headers:@{@"Location":redirectURL.absoluteString}]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"AFHTTPRequestOperation request finished"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ AFHTTPRequestOperation* op = [[AFHTTPRequestOperation alloc] initWithRequest:req];
+ [op setResponseSerializer:[AFHTTPResponseSerializer serializer]];
+
+ __block __strong NSURL* url = nil;
+ [op setRedirectResponseBlock:^NSURLRequest *(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *redirectResponse) {
+ if (redirectResponse == nil) {
+ return request;
+ }
+ url = request.URL;
+ [expectation fulfill];
+ return nil;
+ }];
+
+ [op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ XCTFail(@"Unexpected response");
+ [expectation fulfill];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ XCTFail(@"Unexpected network failure");
+ [expectation fulfill];
+ }];
+ [op start];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(url, redirectURL, @"Unexpected data received");
+}
+
+@end
+
+
+
+#pragma mark - NSURLSession / AFHTTPURLSession support
+
+// Compile this only if SDK version (…MAX_ALLOWED) is iOS7+/10.9+ because NSURLSession is a class only known starting these SDKs
+// (this code won't compile if we use an eariler SDKs, like when building with Xcode4)
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) \
+ || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
+
+#import "AFHTTPSessionManager.h"
+
+@interface AFNetworkingTests (NSURLSession) @end
+@implementation AFNetworkingTests (NSURLSession)
+
+- (void)test_AFHTTPURLSessionCustom
+{
+ if ([NSURLSession class] && [NSURLSessionConfiguration class])
+ {
+ static const NSTimeInterval kRequestTime = 0.1;
+ static const NSTimeInterval kResponseTime = 0.2;
+ NSDictionary *expectedResponseDict = @{@"Success" : @"Yes"};
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return [request.URL.scheme isEqualToString:@"stubs"];
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithJSONObject:expectedResponseDict statusCode:200 headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"AFHTTPSessionManager request finished"];
+
+ NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
+ NSURL* baseURL = [NSURL URLWithString:@"stubs://stubs/"];
+ AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL
+ sessionConfiguration:sessionConfig];
+
+ __block __strong id response = nil;
+ [sessionManager GET:@"foo"
+ parameters:nil
+ success:^(NSURLSessionDataTask *task, id responseObject) {
+ response = responseObject; // keep strong reference
+ [expectation fulfill];
+ }
+ failure:^(NSURLSessionDataTask *task, NSError *error) {
+ XCTFail(@"Unexpected network failure");
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(response, expectedResponseDict, @"Unexpected data received");
+ }
+ else
+ {
+ NSLog(@"/!\\ Test skipped because the NSURLSession class is not available on this OS version. Run the tests a target with a more recent OS.\n");
+ }
+}
+
+@end
+
+#else
+#warning Unit Tests using NSURLSession were not compiled nor executed, because NSURLSession is only available since iOS7/OSX10.9 SDK. \
+-------- Compile using iOS7 or OSX10.9 SDK then launch the tests on the iOS7 simulator or an OSX10.9 target for them to be executed.
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionDelegateTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionDelegateTests.m
new file mode 100644
index 0000000000..2a37ff1298
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionDelegateTests.m
@@ -0,0 +1,394 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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 <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+
+@interface NSURLConnectionDelegateTests : XCTestCase <NSURLConnectionDataDelegate> @end
+
+static const NSTimeInterval kResponseTimeTolerence = 0.2;
+
+@implementation NSURLConnectionDelegateTests
+{
+ NSMutableData* _data;
+ NSError* _error;
+
+ NSURL* _redirectRequestURL;
+ NSInteger _redirectResponseStatusCode;
+
+ XCTestExpectation* _connectionFinishedExpectation;
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark Global Setup + NSURLConnectionDelegate implementation
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)setUp
+{
+ [super setUp];
+ _data = [[NSMutableData alloc] init];
+ [OHHTTPStubs removeAllStubs];
+}
+
+-(void)tearDown
+{
+ // in case the test timed out and finished before a running NSURLConnection ended,
+ // we may continue receive delegate messages anyway if we forgot to cancel.
+ // So avoid sending messages to deallocated object in this case by ensuring we reset it to nil
+ _data = nil;
+ _error = nil;
+ _connectionFinishedExpectation = nil;
+ [super tearDown];
+}
+
+- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response
+{
+ _redirectRequestURL = request.URL;
+ if (response)
+ {
+ if ([response isKindOfClass:NSHTTPURLResponse.class])
+ {
+ _redirectResponseStatusCode = [((NSHTTPURLResponse *) response) statusCode];
+ }
+ else
+ {
+ _redirectResponseStatusCode = 0;
+ }
+ }
+ else
+ {
+ // we get a nil response when NSURLConnection canonicalizes the URL, we don't care about that.
+ }
+ return request;
+}
+
+-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
+{
+ [_data setLength:0U];
+}
+
+-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
+{
+ [_data appendData:data];
+}
+
+-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+ _error = error; // keep strong reference
+ [_connectionFinishedExpectation fulfill];
+}
+
+-(void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+ [_connectionFinishedExpectation fulfill];
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark NSURLConnection + Delegate
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)test_NSURLConnectionDelegate_success
+{
+ static const NSTimeInterval kRequestTime = 0.1;
+ static const NSTimeInterval kResponseTime = 0.5;
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:testData
+ statusCode:200
+ headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ _connectionFinishedExpectation = [self expectationWithDescription:@"NSURLConnection did finish (with error or success)"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSDate* startDate = [NSDate date];
+
+ NSURLConnection* cxn = [NSURLConnection connectionWithRequest:req delegate:self];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(_data, testData, @"Invalid data response");
+ XCTAssertNil(_error, @"Received unexpected network error %@", _error);
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kRequestTime+kResponseTime, kResponseTimeTolerence, @"Invalid response time");
+
+ // in case we timed out before the end of the request (test failed), cancel the request to avoid further delegate method calls
+ [cxn cancel];
+}
+
+-(void)test_NSURLConnectionDelegate_multiple_choices
+{
+ static const NSTimeInterval kRequestTime = 0.1;
+ static const NSTimeInterval kResponseTime = 0.5;
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:testData
+ statusCode:300
+ headers:@{@"Location":@"http://www.iana.org/domains/another/example"}]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ _connectionFinishedExpectation = [self expectationWithDescription:@"NSURLConnection did finish (with error or success)"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSDate* startDate = [NSDate date];
+
+ NSURLConnection* cxn = [NSURLConnection connectionWithRequest:req delegate:self];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(_data, testData, @"Invalid data response");
+ XCTAssertNil(_error, @"Received unexpected network error %@", _error);
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kRequestTime+kResponseTime, kResponseTimeTolerence, @"Invalid response time");
+
+ // in case we timed out before the end of the request (test failed), cancel the request to avoid further delegate method calls
+ [cxn cancel];
+}
+
+-(void)test_NSURLConnectionDelegate_error
+{
+ static const NSTimeInterval kResponseTime = 0.5;
+ NSError* expectedError = [NSError errorWithDomain:NSURLErrorDomain code:404 userInfo:nil];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ OHHTTPStubsResponse* resp = [OHHTTPStubsResponse responseWithError:expectedError];
+ resp.responseTime = kResponseTime;
+ return resp;
+ }];
+
+ _connectionFinishedExpectation = [self expectationWithDescription:@"NSURLConnection did finish (with error or success)"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSDate* startDate = [NSDate date];
+
+ NSURLConnection* cxn = [NSURLConnection connectionWithRequest:req delegate:self];
+
+ [self waitForExpectationsWithTimeout:kResponseTime+kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqual(_data.length, (NSUInteger)0, @"Received unexpected network data %@", _data);
+ XCTAssertEqualObjects(_error.domain, expectedError.domain, @"Invalid error response domain");
+ XCTAssertEqual(_error.code, expectedError.code, @"Invalid error response code");
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kResponseTime, kResponseTimeTolerence, @"Invalid response time");
+
+ // in case we timed out before the end of the request (test failed), cancel the request to avoid further delegate method calls
+ [cxn cancel];
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark Cancelling requests
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)test_NSURLConnection_cancel
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:[@"<this data should never have time to arrive>" dataUsingEncoding:NSUTF8StringEncoding]
+ statusCode:500
+ headers:nil]
+ requestTime:0.0 responseTime:1.5];
+ }];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSURLConnection* cxn = [NSURLConnection connectionWithRequest:req delegate:self];
+
+ XCTestExpectation* waitExpectation = [self expectationWithDescription:@"Waiting 2s, after cancelling in the middle"];
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ [cxn cancel];
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ [waitExpectation fulfill];
+ });
+ });
+
+ [self waitForExpectationsWithTimeout:5 handler:^(NSError *error) {
+ // in case we timed out before the end of the request (test failed), cancel the request to avoid further delegate method calls
+ [cxn cancel];
+ }];
+
+ XCTAssertEqual(_data.length, (NSUInteger)0, @"Received unexpected data but the request should have been cancelled");
+ XCTAssertNil(_error, @"Received unexpected network error but the request should have been cancelled");
+
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark Cancelling requests
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)test_NSURLConnection_cookies
+{
+ NSString* const cookieName = @"SESSIONID";
+ NSString* const cookieValue = [NSProcessInfo.processInfo globallyUniqueString];
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ NSString* cookie = [NSString stringWithFormat:@"%@=%@;", cookieName, cookieValue];
+ NSDictionary* headers = @{@"Set-Cookie": cookie};
+ return [[OHHTTPStubsResponse responseWithData:[@"Yummy cookies" dataUsingEncoding:NSUTF8StringEncoding]
+ statusCode:200
+ headers:headers]
+ requestTime:0.0 responseTime:0.1];
+ }];
+
+ _connectionFinishedExpectation = [self expectationWithDescription:@"NSURLConnection did finish (with error or success)"];
+
+ // Set the cookie accept policy to accept all cookies from the main document domain
+ // (especially in case the previous policy was "NSHTTPCookieAcceptPolicyNever")
+ NSHTTPCookieStorage* cookieStorage = NSHTTPCookieStorage.sharedHTTPCookieStorage;
+ NSHTTPCookieAcceptPolicy previousAcceptPolicy = cookieStorage.cookieAcceptPolicy; // keep it to restore later
+ [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
+
+ // Send the request and wait for the response containing the Set-Cookie headers
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSURLConnection* cxn = [NSURLConnection connectionWithRequest:req delegate:self];
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:^(NSError *error) {
+ [cxn cancel]; // In case we timed out (test failed), cancel the request to avoid further delegate method calls
+ }];
+
+ /* Check that the cookie has been properly stored */
+ NSArray* cookies = [cookieStorage cookiesForURL:req.URL];
+ BOOL cookieFound = NO;
+ for (NSHTTPCookie* cookie in cookies)
+ {
+ if ([cookie.name isEqualToString:cookieName])
+ {
+ cookieFound = YES;
+ XCTAssertEqualObjects(cookie.value, cookieValue, @"The cookie does not have the expected value");
+ }
+ }
+ XCTAssertTrue(cookieFound, @"The cookie was not stored as expected");
+
+
+ // As a courtesy, restore previous policy before leaving
+ [cookieStorage setCookieAcceptPolicy:previousAcceptPolicy];
+
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark Redirected requests
+///////////////////////////////////////////////////////////////////////////////////
+
+- (void)test_NSURLConnection_redirected
+{
+ static const NSTimeInterval kRequestTime = 0.1;
+ static const NSTimeInterval kResponseTime = 0.5;
+ NSData* redirectData = [[NSString stringWithFormat:@"%@ - redirect", NSStringFromSelector(_cmd)] dataUsingEncoding:NSUTF8StringEncoding];
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ NSURL* redirectURL = [NSURL URLWithString:@"http://www.yahoo.com/"];
+ NSString* redirectCookieName = @"yahooCookie";
+ NSString* redirectCookieValue = [NSProcessInfo.processInfo globallyUniqueString];
+
+ // Set the cookie accept policy to accept all cookies from the main document domain
+ // (especially in case the previous policy was "NSHTTPCookieAcceptPolicyNever")
+ NSHTTPCookieStorage* cookieStorage = NSHTTPCookieStorage.sharedHTTPCookieStorage;
+ NSHTTPCookieAcceptPolicy previousAcceptPolicy = cookieStorage.cookieAcceptPolicy; // keep it to restore later
+ [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
+
+ NSString* endCookieName = @"googleCookie";
+ NSString* endCookieValue = [NSProcessInfo.processInfo globallyUniqueString];
+ NSURL *endURL = [NSURL URLWithString:@"http://www.google.com/"];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ if ([request.URL isEqual:redirectURL]) {
+ NSString* redirectCookie = [NSString stringWithFormat:@"%@=%@;", redirectCookieName, redirectCookieValue];
+ NSDictionary* headers = @{ @"Location": endURL.absoluteString,
+ @"Set-Cookie": redirectCookie };
+ return [[OHHTTPStubsResponse responseWithData:redirectData
+ statusCode:311 // any 300-level request will do
+ headers:headers]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ } else {
+ NSString* endCookie = [NSString stringWithFormat:@"%@=%@;", endCookieName, endCookieValue];
+ NSDictionary* headers = @{ @"Set-Cookie": endCookie };
+ return [[OHHTTPStubsResponse responseWithData:testData
+ statusCode:200
+ headers:headers]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }
+ }];
+
+ _connectionFinishedExpectation = [self expectationWithDescription:@"NSURLConnection did finish (with error or success)"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:redirectURL];
+ NSDate* startDate = [NSDate date];
+
+ NSURLConnection* cxn = [NSURLConnection connectionWithRequest:req delegate:self];
+
+ [self waitForExpectationsWithTimeout:2 * (kRequestTime+kResponseTime+kResponseTimeTolerence) handler:^(NSError *error) {
+ // in case we timed out before the end of the request (test failed), cancel the request to avoid further delegate method calls
+ [cxn cancel];
+ }];
+
+ XCTAssertEqualObjects(_redirectRequestURL, endURL, @"Invalid redirect request URL");
+ XCTAssertEqual(_redirectResponseStatusCode, (NSInteger)311, @"Invalid redirect response status code");
+ XCTAssertEqualObjects(_data, testData, @"Invalid data response");
+ XCTAssertNil(_error, @"Received unexpected network error %@", _error);
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], (2 * kRequestTime) + kResponseTime, 2 * kResponseTimeTolerence, @"Invalid response time");
+
+ /* Check that the redirect cookie has been properly stored */
+ NSArray* redirectCookies = [cookieStorage cookiesForURL:req.URL];
+ BOOL redirectCookieFound = NO;
+ for (NSHTTPCookie* cookie in redirectCookies)
+ {
+ if ([cookie.name isEqualToString:redirectCookieName])
+ {
+ redirectCookieFound = YES;
+ XCTAssertEqualObjects(cookie.value, redirectCookieValue, @"The redirect cookie does not have the expected value");
+ }
+ }
+ XCTAssertTrue(redirectCookieFound, @"The redirect cookie was not stored as expected");
+
+ /* Check that the end cookie has been properly stored */
+ NSArray* endCookies = [cookieStorage cookiesForURL:endURL];
+ BOOL endCookieFound = NO;
+ for (NSHTTPCookie* cookie in endCookies)
+ {
+ if ([cookie.name isEqualToString:endCookieName])
+ {
+ endCookieFound = YES;
+ XCTAssertEqualObjects(cookie.value, endCookieValue, @"The end cookie does not have the expected value");
+ }
+ }
+ XCTAssertTrue(endCookieFound, @"The end cookie was not stored as expected");
+
+
+ // As a courtesy, restore previous policy before leaving
+ [cookieStorage setCookieAcceptPolicy:previousAcceptPolicy];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionTests.m
new file mode 100644
index 0000000000..0621384db1
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLConnectionTests.m
@@ -0,0 +1,187 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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 <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+
+@interface NSURLConnectionTests : XCTestCase @end
+
+static const NSTimeInterval kResponseTimeTolerence = 0.3;
+
+@implementation NSURLConnectionTests
+
+-(void)setUp
+{
+ [super setUp];
+ [OHHTTPStubs removeAllStubs];
+}
+
+static const NSTimeInterval kRequestTime = 0.1;
+static const NSTimeInterval kResponseTime = 0.5;
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark [NSURLConnection sendSynchronousRequest:returningResponse:error:]
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)test_NSURLConnection_sendSyncronousRequest_mainQueue
+{
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:testData
+ statusCode:200
+ headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSDate* startDate = [NSDate date];
+
+ NSData* data = [NSURLConnection sendSynchronousRequest:req returningResponse:NULL error:NULL];
+
+ XCTAssertEqualObjects(data, testData, @"Invalid data response");
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kRequestTime+kResponseTime, kResponseTimeTolerence, @"Invalid response time");
+}
+
+-(void)test_NSURLConnection_sendSyncronousRequest_parallelQueue
+{
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Synchronous request completed"];
+ [[NSOperationQueue new] addOperationWithBlock:^{
+ [self test_NSURLConnection_sendSyncronousRequest_mainQueue];
+ [expectation fulfill];
+ }];
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark Single [NSURLConnection sendAsynchronousRequest:queue:completionHandler:]
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)_test_NSURLConnection_sendAsyncronousRequest_onOperationQueue:(NSOperationQueue*)queue
+{
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:testData
+ statusCode:200
+ headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Asynchronous request finished"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSDate* startDate = [NSDate date];
+
+ [NSURLConnection sendAsynchronousRequest:req queue:queue completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ XCTAssertEqualObjects(data, testData, @"Invalid data response");
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kRequestTime+kResponseTime, kResponseTimeTolerence, @"Invalid response time");
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+}
+
+
+-(void)test_NSURLConnection_sendAsyncronousRequest_mainQueue
+{
+ [self _test_NSURLConnection_sendAsyncronousRequest_onOperationQueue:NSOperationQueue.mainQueue];
+}
+
+
+-(void)test_NSURLConnection_sendAsyncronousRequest_parallelQueue
+{
+ [self _test_NSURLConnection_sendAsyncronousRequest_onOperationQueue:[NSOperationQueue new]];
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark Multiple Parallel [NSURLConnection sendAsynchronousRequest:queue:completionHandler:]
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)_test_NSURLConnection_sendMultipleAsyncronousRequestsOnOperationQueue:(NSOperationQueue*)queue
+{
+ __block BOOL testFinished = NO;
+ NSData* (^dataForRequest)(NSURLRequest*) = ^(NSURLRequest* req) {
+ return [[NSString stringWithFormat:@"<Response for URL %@>",req.URL.absoluteString] dataUsingEncoding:NSUTF8StringEncoding];
+ };
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ NSData* retData = dataForRequest(request);
+ NSTimeInterval responseTime = [request.URL.lastPathComponent doubleValue];
+ return [[OHHTTPStubsResponse responseWithData:retData
+ statusCode:200
+ headers:nil]
+ requestTime:responseTime*.1 responseTime:responseTime];
+ }];
+
+ // Reusable code to send a request that will respond in the given response time
+ void (^sendAsyncRequest)(NSTimeInterval) = ^(NSTimeInterval responseTime)
+ {
+ NSString* desc = [NSString stringWithFormat:@"Asynchronous request with response time %.f finished", responseTime];
+ XCTestExpectation* expectation = [self expectationWithDescription:desc];
+
+ NSString* urlString = [NSString stringWithFormat:@"http://dummyrequest/concurrent/time/%f",responseTime];
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];
+// [SenTestLog testLogWithFormat:@"== Sending request %@\n", req];
+ NSDate* startDate = [NSDate date];
+ [NSURLConnection sendAsynchronousRequest:req queue:queue completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+// [SenTestLog testLogWithFormat:@"== Received response for request %@\n", req];
+ XCTAssertEqualObjects(data, dataForRequest(req), @"Invalid data response");
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], (responseTime*.1)+responseTime, kResponseTimeTolerence, @"Invalid response time");
+
+ if (!testFinished) [expectation fulfill];
+ }];
+ };
+
+ static NSTimeInterval time3 = 1.5, time2 = 1.0, time1 = 0.5;
+ sendAsyncRequest(time3); // send this one first, should receive last
+ sendAsyncRequest(time2); // send this one next, shoud receive 2nd
+ sendAsyncRequest(time1); // send this one last, should receive first
+
+ [self waitForExpectationsWithTimeout:MAX(time1,MAX(time2,time3))+kResponseTimeTolerence handler:nil];
+ testFinished = YES;
+}
+
+-(void)test_NSURLConnection_sendMultipleAsyncronousRequests_mainQueue
+{
+ [self _test_NSURLConnection_sendMultipleAsyncronousRequestsOnOperationQueue:NSOperationQueue.mainQueue];
+}
+
+-(void)test_NSURLConnection_sendMultipleAsyncronousRequests_parallelQueue
+{
+ [self _test_NSURLConnection_sendMultipleAsyncronousRequestsOnOperationQueue:[NSOperationQueue new]];
+}
+
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLSessionTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLSessionTests.m
new file mode 100644
index 0000000000..08f67e8284
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NSURLSessionTests.m
@@ -0,0 +1,228 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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.
+ *
+ ***********************************************************************************/
+
+
+// Compile this only if SDK version (…MAX_ALLOWED) is iOS7+/10.9+ because NSURLSession is a class only known starting these SDKs
+// (this code won't compile if we use an eariler SDKs, like when building with Xcode4)
+#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) \
+ || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
+
+#import <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+#import "OHHTTPStubsResponse+JSON.h"
+
+@interface NSURLSessionTests : XCTestCase <NSURLSessionDataDelegate> @end
+
+@implementation NSURLSessionTests
+{
+ NSMutableData* _receivedData;
+ XCTestExpectation* _taskDidCompleteExpectation;
+}
+
+- (void)setUp
+{
+ [super setUp];
+ [OHHTTPStubs removeAllStubs];
+ _receivedData = nil;
+}
+
+- (void)_test_NSURLSession:(NSURLSession*)session
+ jsonForStub:(id)json
+ completion:(void(^)(NSError* errorResponse,id jsonResponse))completion
+{
+ if ([NSURLSession class])
+ {
+ static const NSTimeInterval kRequestTime = 0.0;
+ static const NSTimeInterval kResponseTime = 0.2;
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithJSONObject:json statusCode:200 headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"NSURLSessionDataTask completed"];
+
+ __block __strong id dataResponse = nil;
+ __block __strong NSError* errorResponse = nil;
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"foo://unknownhost:666"]];
+ [request setHTTPMethod:@"GET"];
+ [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
+ [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
+
+ NSURLSessionDataTask *task = [session dataTaskWithRequest:request
+ completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)
+ {
+ errorResponse = error;
+ if (!error)
+ {
+ NSError *jsonError = nil;
+ NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
+ XCTAssertNil(jsonError, @"Unexpected error deserializing JSON response");
+ dataResponse = jsonObject;
+ }
+ [expectation fulfill];
+ }];
+
+ [task resume];
+
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+0.5 handler:nil];
+
+ completion(errorResponse, dataResponse);
+ }
+}
+
+// The shared session use the same mechanism as NSURLConnection
+// (based on protocols registered via +[NSURLProtocol registerClass:] and all)
+// and no NSURLSessionConfiguration
+- (void)test_SharedNSURLSession
+{
+ if ([NSURLSession class])
+ {
+ NSURLSession *session = [NSURLSession sharedSession];
+
+ NSDictionary* json = @{@"Success": @"Yes"};
+ [self _test_NSURLSession:session jsonForStub:json completion:^(NSError *errorResponse, id jsonResponse) {
+ XCTAssertNil(errorResponse, @"Unexpected error");
+ XCTAssertEqualObjects(jsonResponse, json, @"Unexpected data received");
+ }];
+ }
+ else
+ {
+ NSLog(@"/!\\ Test skipped because the NSURLSession class is not available on this OS version. Run the tests a target with a more recent OS.\n");
+ }
+}
+
+- (void)test_NSURLSessionDefaultConfig
+{
+ if ([NSURLSessionConfiguration class] && [NSURLSession class])
+ {
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
+
+ NSDictionary* json = @{@"Success": @"Yes"};
+ [self _test_NSURLSession:session jsonForStub:json completion:^(NSError *errorResponse, id jsonResponse) {
+ XCTAssertNil(errorResponse, @"Unexpected error");
+ XCTAssertEqualObjects(jsonResponse, json, @"Unexpected data received");
+ }];
+ }
+ else
+ {
+ NSLog(@"/!\\ Test skipped because the NSURLSession class is not available on this OS version. Run the tests a target with a more recent OS.\n");
+ }
+}
+
+- (void)test_NSURLSessionEphemeralConfig
+{
+ if ([NSURLSessionConfiguration class] && [NSURLSession class])
+ {
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration ephemeralSessionConfiguration];
+ NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
+
+ NSDictionary* json = @{@"Success": @"Yes"};
+ [self _test_NSURLSession:session jsonForStub:json completion:^(NSError *errorResponse, id jsonResponse) {
+ XCTAssertNil(errorResponse, @"Unexpected error");
+ XCTAssertEqualObjects(jsonResponse, json, @"Unexpected data received");
+ }];
+ }
+ else
+ {
+ NSLog(@"/!\\ Test skipped because the NSURLSession class is not available on this OS version. Run the tests a target with a more recent OS.\n");
+ }
+}
+
+- (void)test_NSURLSessionDefaultConfig_Disabled
+{
+ if ([NSURLSessionConfiguration class] && [NSURLSession class])
+ {
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration ephemeralSessionConfiguration];
+ [OHHTTPStubs setEnabled:NO forSessionConfiguration:config]; // Disable stubs for this session
+ NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
+
+ NSDictionary* json = @{@"Success": @"Yes"};
+ [self _test_NSURLSession:session jsonForStub:json completion:^(NSError *errorResponse, id jsonResponse) {
+ // Stubs were disable for this session, so we should get an error instead of the stubs data
+ XCTAssertNotNil(errorResponse, @"Expected error but none found");
+ XCTAssertNil(jsonResponse, @"Data should not have been received as stubs should be disabled");
+ }];
+ }
+ else
+ {
+ NSLog(@"/!\\ Test skipped because the NSURLSession class is not available on this OS version. Run the tests a target with a more recent OS.\n");
+ }
+}
+
+- (void)test_NSURLSession_DataTask_DelegateMethods
+{
+ if ([NSURLSessionConfiguration class] && [NSURLSession class])
+ {
+ NSData* expectedResponse = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return [request.URL.scheme isEqualToString:@"stub"];
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:expectedResponse statusCode:200 headers:nil]
+ responseTime:0.5];
+ }];
+
+ _taskDidCompleteExpectation = [self expectationWithDescription:@"NSURLSessionDataTask completion delegate method called"];
+
+ NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
+ NSURLSession* session = [NSURLSession sessionWithConfiguration:config delegate:self delegateQueue:nil];
+
+ [[session dataTaskWithURL:[NSURL URLWithString:@"stub://foo"]] resume];
+
+ [self waitForExpectationsWithTimeout:5 handler:nil];
+
+ XCTAssertEqualObjects(_receivedData, expectedResponse, @"Unexpected response");
+ }
+ else
+ {
+ NSLog(@"/!\\ Test skipped because the NSURLSession class is not available on this OS version. Run the tests a target with a more recent OS.\n");
+ }
+}
+
+//---------------------------------------------------------------
+#pragma mark - Delegate Methods
+
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
+{
+ _receivedData = [NSMutableData new];
+ completionHandler(NSURLSessionResponseAllow);
+}
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
+{
+ [_receivedData appendData:data];
+}
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
+{
+ [_taskDidCompleteExpectation fulfill];
+}
+
+@end
+
+#else
+#warning Unit Tests using NSURLSession were not compiled nor executed, because NSURLSession is only available since iOS7/OSX10.9 SDK. \
+-------- Compile using iOS7 or OSX10.9 SDK then launch the tests on the iOS7 simulator or an OSX10.9 target for them to be executed.
+#endif
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NilValuesTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NilValuesTests.m
new file mode 100644
index 0000000000..ea13174023
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/NilValuesTests.m
@@ -0,0 +1,213 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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 <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+
+static const NSTimeInterval kResponseTimeTolerence = 0.3;
+
+@interface NilValuesTests : XCTestCase @end
+
+@implementation NilValuesTests
+
+-(void)setUp
+{
+ [super setUp];
+ [OHHTTPStubs removeAllStubs];
+}
+
+- (void)test_NilData
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+ return [OHHTTPStubsResponse responseWithData:nil statusCode:400 headers:nil];
+#pragma clang diagnostic pop
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Network request's completionHandler called"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ XCTAssertEqual(data.length, (NSUInteger)0, @"Data should be empty");
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:nil];
+}
+
+- (void)test_EmptyData
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:[NSData data] statusCode:400 headers:nil]
+ requestTime:0.01 responseTime:0.01];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Network request's completionHandler called"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ XCTAssertEqual(data.length, (NSUInteger)0, @"Data should be empty");
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:nil];
+}
+
+- (void)test_NilPath
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+ return [[OHHTTPStubsResponse responseWithFileAtPath:nil statusCode:501 headers:nil]
+ requestTime:0.01 responseTime:0.01];
+#pragma clang diagnostic pop
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Network request's completionHandler called"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ XCTAssertEqual(data.length, (NSUInteger)0, @"Data should be empty");
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:nil];
+}
+
+- (void)test_InvalidPath
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithFileAtPath:@"-invalid-path-" statusCode:500 headers:nil]
+ requestTime:0.01 responseTime:0.01];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Network request's completionHandler called"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ XCTAssertEqual(data.length, (NSUInteger)0, @"Data should be empty");
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:nil];
+}
+
+- (void)test_EmptyFile
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ NSString* emptyFile = OHPathForFile(@"emptyfile.json", self.class);
+ return [[OHHTTPStubsResponse responseWithFileAtPath:emptyFile statusCode:500 headers:nil]
+ requestTime:0.01 responseTime:0.01];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Network request's completionHandler called"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ XCTAssertEqual(data.length, (NSUInteger)0, @"Data should be empty");
+
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:nil];
+}
+
+- (void)_test_NilURLAndCookieHandlingEnabled:(BOOL)handleCookiesEnabled
+{
+ NSData* expectedResponse = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [OHHTTPStubsResponse responseWithData:expectedResponse
+ statusCode:200
+ headers:nil];
+ }];
+
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Network request's completionHandler called"];
+
+ NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:nil];
+ [req setHTTPShouldHandleCookies:handleCookiesEnabled];
+
+ __block NSData* response = nil;
+
+ [NSURLConnection sendAsynchronousRequest:req
+ queue:[NSOperationQueue mainQueue]
+ completionHandler:^(NSURLResponse* resp, NSData* data, NSError* error)
+ {
+ response = data;
+ [expectation fulfill];
+ }];
+
+ [self waitForExpectationsWithTimeout:kResponseTimeTolerence handler:nil];
+
+ XCTAssertEqualObjects(response, expectedResponse, @"Unexpected data received");
+}
+
+- (void)test_NilURLAndCookieHandlingEnabled
+{
+ [self _test_NilURLAndCookieHandlingEnabled:YES];
+}
+
+- (void)test_NilURLAndCookieHandlingDisabled
+{
+ [self _test_NilURLAndCookieHandlingEnabled:NO];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/TimingTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/TimingTests.m
new file mode 100644
index 0000000000..a805070aa0
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/TimingTests.m
@@ -0,0 +1,162 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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 <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+
+@interface TimingTests : XCTestCase
+{
+ NSMutableData* _data;
+ NSError* _error;
+ XCTestExpectation* _connectionFinishedExpectation;
+
+// NSDate* _didReceiveResponseTS;
+ NSDate* _didFinishLoadingTS;
+}
+@end
+
+@implementation TimingTests
+
+-(void)setUp
+{
+ [super setUp];
+
+ _data = [NSMutableData new];
+ _error = nil;
+// _didReceiveResponseTS = nil;
+ _didFinishLoadingTS = nil;
+ [OHHTTPStubs removeAllStubs];
+}
+-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
+{
+ [_data setLength:0U];
+ // NOTE: This timing info is not reliable as Cocoa always calls the connection:didReceiveResponse: delegate method just before
+ // calling the first "connection:didReceiveData:", even if the [id<NSURLProtocolClient> URLProtocol:didReceiveResponse:…] method was called way before. So we are not testing this
+// _didReceiveResponseTS = [NSDate date];
+}
+
+-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
+{
+ [_data appendData:data];
+}
+
+-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+ _error = error; // keep strong reference
+ _didFinishLoadingTS = [NSDate date];
+ [_connectionFinishedExpectation fulfill];
+}
+
+-(void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+ _didFinishLoadingTS = [NSDate date];
+ [_connectionFinishedExpectation fulfill];
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+
+static NSTimeInterval const kResponseTimeTolerence = 0.8;
+static NSTimeInterval const kSecurityTimeout = 5.0;
+
+-(void)_testWithData:(NSData*)stubData requestTime:(NSTimeInterval)requestTime responseTime:(NSTimeInterval)responseTime
+{
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:stubData
+ statusCode:200
+ headers:nil]
+ requestTime:requestTime responseTime:responseTime];
+ }];
+
+ _connectionFinishedExpectation = [self expectationWithDescription:@"NSURLConnection did finish (with error or success)"];
+
+ NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+ NSDate* startTS = [NSDate date];
+
+ [NSURLConnection connectionWithRequest:req delegate:self];
+
+ [self waitForExpectationsWithTimeout:requestTime+responseTime+kResponseTimeTolerence+kSecurityTimeout handler:nil];
+
+ XCTAssertEqualObjects(_data, stubData, @"Invalid data response");
+
+// XCTAssertEqualWithAccuracy([_didReceiveResponseTS timeIntervalSinceDate:startTS], requestTime,
+// kResponseTimeTolerence, @"Invalid request time");
+ XCTAssertEqualWithAccuracy([_didFinishLoadingTS timeIntervalSinceDate:startTS], requestTime + responseTime,
+ kResponseTimeTolerence, @"Invalid response time");
+
+ [NSThread sleepForTimeInterval:0.01]; // Time for the test to wrap it all (otherwise we may have "Test did not finish" warning)
+}
+
+
+
+
+
+
+-(void)test_RequestTime0_ResponseTime0
+{
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ [self _testWithData:testData requestTime:0 responseTime:0];
+}
+
+-(void)test_SmallDataLargeTime_CumulativeAlgorithm
+{
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ // 21 bytes in 23/4 of a second = 0.913042 byte per slot: we need to check that the cumulative algorithm works
+ [self _testWithData:testData requestTime:0 responseTime:5.75];
+}
+
+-(void)test_RequestTime1_ResponseTime0
+{
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+ [self _testWithData:testData requestTime:1 responseTime:0];
+}
+
+-(void)test_LongData_RequestTime1_ResponseTime5
+{
+ static NSUInteger const kDataLength = 1024;
+ NSMutableData* testData = [NSMutableData dataWithCapacity:kDataLength];
+ NSData* chunk = [[NSProcessInfo.processInfo globallyUniqueString] dataUsingEncoding:NSUTF8StringEncoding];
+ while(testData.length<kDataLength)
+ {
+ [testData appendData:chunk];
+ }
+ [self _testWithData:testData requestTime:1 responseTime:5];
+}
+
+-(void)test_VeryLongData_RequestTime1_ResponseTime0
+{
+ static NSUInteger const kDataLength = 609792;
+ NSMutableData* testData = [NSMutableData dataWithCapacity:kDataLength];
+ NSData* chunk = [[NSProcessInfo.processInfo globallyUniqueString] dataUsingEncoding:NSUTF8StringEncoding];
+ while(testData.length<kDataLength)
+ {
+ [testData appendData:chunk];
+ }
+ [self _testWithData:testData requestTime:1 responseTime:0];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/WithContentsOfURLTests.m b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/WithContentsOfURLTests.m
new file mode 100644
index 0000000000..f68c3d3cdf
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/Test Suites/WithContentsOfURLTests.m
@@ -0,0 +1,116 @@
+/***********************************************************************************
+ *
+ * Copyright (c) 2012 Olivier Halligon
+ *
+ * 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 <XCTest/XCTest.h>
+#import "OHHTTPStubs.h"
+
+@interface WithContentsOfURLTests : XCTestCase @end
+
+static const NSTimeInterval kResponseTimeTolerence = 0.2;
+
+@implementation WithContentsOfURLTests
+
+-(void)setUp
+{
+ [super setUp];
+ [OHHTTPStubs removeAllStubs];
+}
+
+static const NSTimeInterval kRequestTime = 0.1;
+static const NSTimeInterval kResponseTime = 0.5;
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark [NSString stringWithContentsOfURL:encoding:error:]
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)test_NSString_stringWithContentsOfURL_mainQueue
+{
+ NSString* testString = NSStringFromSelector(_cmd);
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:[testString dataUsingEncoding:NSUTF8StringEncoding]
+ statusCode:200
+ headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ NSDate* startDate = [NSDate date];
+
+ NSString* string = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]
+ encoding:NSUTF8StringEncoding
+ error:NULL];
+
+ XCTAssertEqualObjects(string, testString, @"Invalid returned string");
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kResponseTime+kRequestTime, kResponseTimeTolerence, @"Invalid response time");
+}
+
+-(void)test_NSString_stringWithContentsOfURL_parallelQueue
+{
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Synchronous download finished"];
+ [[NSOperationQueue new] addOperationWithBlock:^{
+ [self test_NSString_stringWithContentsOfURL_mainQueue];
+ [expectation fulfill];
+ }];
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+#pragma mark [NSData dataWithContentsOfURL:]
+///////////////////////////////////////////////////////////////////////////////////
+
+-(void)test_NSData_dataWithContentsOfURL_mainQueue
+{
+ NSData* testData = [NSStringFromSelector(_cmd) dataUsingEncoding:NSUTF8StringEncoding];
+
+ [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return YES;
+ } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
+ return [[OHHTTPStubsResponse responseWithData:testData
+ statusCode:200
+ headers:nil]
+ requestTime:kRequestTime responseTime:kResponseTime];
+ }];
+
+ NSDate* startDate = [NSDate date];
+
+ NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.iana.org/domains/example/"]];
+
+ XCTAssertEqualObjects(data, testData, @"Invalid returned string");
+ XCTAssertEqualWithAccuracy(-[startDate timeIntervalSinceNow], kRequestTime+kResponseTime, kResponseTimeTolerence, @"Invalid response time");
+}
+
+-(void)test_NSData_dataWithContentsOfURL_parallelQueue
+{
+ XCTestExpectation* expectation = [self expectationWithDescription:@"Synchronous download finished"];
+ [[NSOperationQueue new] addOperationWithBlock:^{
+ [self test_NSData_dataWithContentsOfURL_mainQueue];
+ [expectation fulfill];
+ }];
+ [self waitForExpectationsWithTimeout:kRequestTime+kResponseTime+kResponseTimeTolerence handler:nil];
+}
+
+@end
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Info.plist b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Info.plist
new file mode 100644
index 0000000000..e2305ec01d
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.alisoftware.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Prefix.pch b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Prefix.pch
new file mode 100644
index 0000000000..a0a31a66c6
--- /dev/null
+++ b/test/ios/OHHTTPStubs/OHHTTPStubs/UnitTests/UnitTests-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'OHHTTPStubs Unit Tests' target in the 'OHHTTPStubs Unit Tests' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+#endif
diff --git a/test/ios/OHHTTPStubs/README.md b/test/ios/OHHTTPStubs/README.md
new file mode 100644
index 0000000000..dafd89fa53
--- /dev/null
+++ b/test/ios/OHHTTPStubs/README.md
@@ -0,0 +1,113 @@
+OHHTTPStubs
+===========
+
+[![Platform](http://cocoapod-badges.herokuapp.com/p/OHHTTPStubs/badge.png)](http://cocoadocs.org/docsets/OHHTTPStubs)
+[![Version](http://cocoapod-badges.herokuapp.com/v/OHHTTPStubs/badge.png)](http://cocoadocs.org/docsets/OHHTTPStubs)
+[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
+[![Build Status](https://travis-ci.org/AliSoftware/OHHTTPStubs.png?branch=master)](https://travis-ci.org/AliSoftware/OHHTTPStubs)
+
+`OHHTTPStubs` is a library designed to stub your network requests very easily. It can help you:
+
+* test your apps with **fake network data** (stubbed from file) and **simulate slow networks**, to check your application behavior in bad network conditions
+* write **Unit Tests** that use fake network data from your fixtures.
+
+It works with `NSURLConnection`, new iOS7/OSX.9's `NSURLSession`, `AFNetworking` (both 1.x and 2.x), or any networking framework that use Cocoa's URL Loading System.
+
+[![Donate](http://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TRTU3UEWEHV92 "Donate")
+
+----
+
+# Documentation & Usage Examples
+
+`OHHTTPStubs` headers are fully documented using Appledoc-like / Headerdoc-like comments in the header files. You can also [read the **online documentation** here](http://cocoadocs.org/docsets/OHHTTPStubs)
+[![Version](http://cocoapod-badges.herokuapp.com/v/OHHTTPStubs/badge.png)](http://cocoadocs.org/docsets/OHHTTPStubs)
+
+
+## Basic example
+
+### In Objective-C
+
+```objc
+[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
+ return [request.URL.host isEqualToString:@"mywebservice.com"];
+} withStubResponse:^OHHTTPStubsResponse*(NSURLRequest *request) {
+ // Stub it with our "wsresponse.json" stub file (which is in same bundle as self)
+ NSString* fixture = OHPathForFile(@"wsresponse.json", self.class);
+ return [OHHTTPStubsResponse responseWithFileAtPath:fixture
+ statusCode:200 headers:@{@"Content-Type":@"application/json"}];
+}];
+```
+
+### In Swift
+
+```swift
+OHHTTPStubs.stubRequestsPassingTest({$0.URL!.host == "mywebservice.com"}) { _ in
+ // Stub it with our "wsresponse.json" stub file (which is in same bundle as self)
+ let fixture = OHPathForFile("wsresponse.json", self.dynamicType)
+ return OHHTTPStubsResponse(fileAtPath: fixture!,
+ statusCode: 200, headers: ["Content-Type":"application/json"])
+}
+```
+
+## More examples & Help Topics
+
+* For a lot more examples, see the dedicated "[Usage Examples](https://github.com/AliSoftware/OHHTTPStubs/wiki/Usage-Examples)" wiki page.
+* The wiki also contain [some articles that can help you get started](https://github.com/AliSoftware/OHHTTPStubs/wiki) with (and troubleshoot if needed) `OHHTTPStubs`.
+
+# Compatibility
+
+`OHHTTPStubs` is compatible with **iOS 5.0+** and **OSX 10.7+**.
+
+`OHHTTPStubs` also works with iOS7's and OSX 10.9's `NSURLSession` mechanism.
+
+`OHHTTPStubs` is fully **Swift-compatible**. [Nullability annotations](https://developer.apple.com/swift/blog/?id=25) have been added to allow a cleaner API when used from Swift.
+
+# Installing in your projects
+
+Using [CocoaPods](https://guides.cocoapods.org) is the recommended way.
+Simply add `pod 'OHHTTPStubs'` to your `Podfile`.
+
+_`OHHTTPStubs` should also be compatible with Carthage — but I won't guarantee help/support for it as I don't use it personally._
+
+# Special Considerations
+
+## Using OHHTTPStubs in your Unit Tests
+
+`OHHTTPStubs` is ideal to write Unit Tests that normally would perform network requests. But if you use it in your Unit Tests, don't forget to:
+
+* remove any stubs you installed after each test — to avoid those stubs to still be installed when executing the next Test Case — by calling `[OHHTTPStubs removeAllStubs]` in your `tearDown` method. [see this wiki page for more info](https://github.com/AliSoftware/OHHTTPStubs/wiki/Remove-stubs-after-each-test)
+* be sure to wait until the request has received its response before doing your assertions and letting the test case finish (like for any asynchronous test). [see this wiki page for more info](https://github.com/AliSoftware/OHHTTPStubs/wiki/OHHTTPStubs-and-asynchronous-tests)
+
+## Automatic loading
+
+Thanks to method swizzling, `OHHTTPStubs` is automatically loaded and installed both for:
+
+* requests made using `NSURLConnection` or `[NSURLSession sharedSession]`;
+* requests made using a `NSURLSession` created using a `[NSURLSessionConfiguration defaultSessionConfiguration]` or `[NSURLSessionConfiguration ephemeralSessionConfiguration]` configuration (using `[NSURLSession sessionWithConfiguration:…]`-like methods).
+
+If you need to disable (and re-enable) `OHHTTPStubs` — globally or per `NSURLSession` — you can use `[OHHTTPStubs setEnabled:]` / `[OHHTTPStubs setEnabled:forSessionConfiguration:]`.
+
+## Known limitations
+
+* `OHHTTPStubs` **can't work on background sessions** (sessions created using `[NSURLSessionConfiguration backgroundSessionConfiguration]`) because background sessions don't allow the use of custom `NSURLProtocols` and are handled by the iOS Operating System itself.
+* `OHHTTPStubs` don't simulate data upload. The `NSURLProtocolClient` `@protocol` does not provide a way to signal the delegate that data has been **sent** (only that some has been loaded), so any data in the `HTTPBody` or `HTTPBodyStream` of an `NSURLRequest`, or data provided to `-[NSURLSession uploadTaskWithRequest:fromData:];` will be ignored, and more importantly, the `-URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` delegate method will never be called when you stub the request using `OHHTTPStubs`.
+
+_As far as I know, there's nothing we can do about those two limitations. Please let me know if you know a solution that would make that possible anyway._
+
+
+## Submitting to the AppStore
+
+`OHHTTPStubs` **can be used** on apps subbmiting **on the AppStore**. It does not use any private API and nothing prevents you from shipping it.
+
+But you generally only use stubs during the development phase and want to remove your stubs when submitting to the AppStore. So be careful to only include `OHHTTPStubs` when needed (only in your test targets, or only inside `#if DEBUG` portions, or by using [per-Build-Configuration pods](https://guides.cocoapods.org/syntax/podfile.html#pod)) to avoid forgetting to remove it when the time comes that you release for the AppStore and you want your requests to hit the net!
+
+
+
+# License and Credits
+
+This project and library has been created by Olivier Halligon (@aligatr on Twitter) and is under the MIT License.
+
+It has been inspired by [this article from InfiniteLoop.dk](http://www.infinite-loop.dk/blog/2011/09/using-nsurlprotocol-for-injecting-test-data/).
+I would also like to thank to @kcharwood for its contribution, and everyone who contributed to this project on GitHub.
+
+If you want to support the development of this library, feel free to [![Donate](http://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TRTU3UEWEHV92 "Donate"). Thanks to all contributors so far!
diff --git a/test/ios/OHHTTPStubs/Rakefile b/test/ios/OHHTTPStubs/Rakefile
new file mode 100644
index 0000000000..094945cdc5
--- /dev/null
+++ b/test/ios/OHHTTPStubs/Rakefile
@@ -0,0 +1,55 @@
+# Build & test OHHTTPStubs lib from the CLI
+
+desc 'Build an iOS scheme'
+task :ios, [:scheme, :ios_version, :action] do |_,args|
+ destination = "platform=iOS Simulator,name=iPhone 5,OS=#{args.ios_version}"
+ build("OHHTTPStubs #{args.scheme}", "iphonesimulator", destination, args.action)
+end
+
+desc 'Build an OSX scheme'
+task :osx, [:scheme, :arch, :action] do |_,args|
+ destination = "platform=OS X,arch=#{args.arch}"
+ build("OHHTTPStubs #{args.scheme}", "macosx", destination, args.action)
+end
+
+desc 'List installed simulators'
+task :simlist do
+ sh 'xcrun simctl list'
+end
+
+desc 'Run all travis env tasks locally'
+task :travis do
+ require 'YAML'
+ travis = YAML.load_file('.travis.yml')
+ travis['env'].each do |env|
+ arg = env.split('=')[1]
+ puts "\n" + ('-'*80) + "\n\n"
+ sh "rake #{arg}"
+ end
+end
+
+
+# Build the xcodebuild command and run it
+def build(scheme, sdk, destination, action)
+ puts <<-ANNOUNCE
+ =============================
+ | Action: #{action}
+ | Scheme: "#{scheme}"
+ | #{destination}
+ =============================
+
+ ANNOUNCE
+
+ cmd = %W(
+ xcodebuild
+ -workspace OHHTTPStubs/OHHTTPStubs.xcworkspace
+ -scheme "#{scheme}"
+ -sdk #{sdk}
+ -configuration Release
+ ONLY_ACTIVE_ARCH=NO
+ -destination '#{destination}'
+ #{action}
+ )
+
+ sh "set -o pipefail && #{cmd.join(' ')} | xcpretty -c"
+end
diff --git a/test/ios/ios-tests.xcodeproj/project.pbxproj b/test/ios/ios-tests.xcodeproj/project.pbxproj
index f644d912de..4f31a5b4a4 100644
--- a/test/ios/ios-tests.xcodeproj/project.pbxproj
+++ b/test/ios/ios-tests.xcodeproj/project.pbxproj
@@ -14,6 +14,14 @@
DD0581041ACB661200B112C9 /* Headers in Resources */ = {isa = PBXBuildFile; fileRef = DD0581031ACB661200B112C9 /* Headers */; };
DD0581061ACB661C00B112C9 /* MapboxGL.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DD0581051ACB661C00B112C9 /* MapboxGL.bundle */; };
DD0581081ACB663200B112C9 /* libMapboxGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DD0581071ACB663200B112C9 /* libMapboxGL.a */; };
+ DD0E6F671B01806600DC035A /* MetricsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F661B01806600DC035A /* MetricsTests.m */; };
+ DD0E6F841B0190E200DC035A /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DD0E6F701B0190E200DC035A /* libOCMock.a */; };
+ DD0E6F981B01B68E00DC035A /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F8E1B01B68E00DC035A /* OHHTTPStubs.m */; };
+ DD0E6F991B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F8F1B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m */; };
+ DD0E6F9A1B01B68E00DC035A /* OHHTTPStubsResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F911B01B68E00DC035A /* OHHTTPStubsResponse.m */; };
+ DD0E6F9B1B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F931B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m */; };
+ DD0E6F9C1B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F951B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m */; };
+ DD0E6F9D1B01B68E00DC035A /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F971B01B68E00DC035A /* OHPathHelpers.m */; };
DD41CE091ACB5DBC00FA7979 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE081ACB5DBC00FA7979 /* CoreTelephony.framework */; };
DD41CE0B1ACB5DC400FA7979 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE0A1ACB5DC400FA7979 /* SystemConfiguration.framework */; };
DD41CE0D1ACB5DCB00FA7979 /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE0C1ACB5DCB00FA7979 /* libc++.dylib */; };
@@ -73,6 +81,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ DACAD7111B08719F009119DC /* MGLMapboxEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLMapboxEvents.h; path = ../../platform/ios/MGLMapboxEvents.h; sourceTree = SOURCE_ROOT; };
DD043323196DB9BC00E6F39D /* Mapbox GL Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mapbox GL Tests.app"; sourceTree = BUILT_PRODUCTS_DIR; };
DD04335F196DBBD500E6F39D /* MGLTAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLTAppDelegate.m; sourceTree = SOURCE_ROOT; };
DD043360196DBBD500E6F39D /* MGLTViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLTViewController.m; sourceTree = SOURCE_ROOT; };
@@ -85,6 +94,28 @@
DD0581031ACB661200B112C9 /* Headers */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Headers; path = ../../build/ios/pkg/static/Headers; sourceTree = SOURCE_ROOT; };
DD0581051ACB661C00B112C9 /* MapboxGL.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = MapboxGL.bundle; path = ../../build/ios/pkg/static/MapboxGL.bundle; sourceTree = SOURCE_ROOT; };
DD0581071ACB663200B112C9 /* libMapboxGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMapboxGL.a; path = ../../build/ios/pkg/static/libMapboxGL.a; sourceTree = SOURCE_ROOT; };
+ DD0E6F661B01806600DC035A /* MetricsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MetricsTests.m; sourceTree = SOURCE_ROOT; };
+ DD0E6F701B0190E200DC035A /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOCMock.a; path = OCMock/libOCMock.a; sourceTree = SOURCE_ROOT; };
+ DD0E6F721B0190E200DC035A /* NSNotificationCenter+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNotificationCenter+OCMAdditions.h"; sourceTree = "<group>"; };
+ DD0E6F731B0190E200DC035A /* OCMArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMArg.h; sourceTree = "<group>"; };
+ DD0E6F741B0190E200DC035A /* OCMConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMConstraint.h; sourceTree = "<group>"; };
+ DD0E6F751B0190E200DC035A /* OCMLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMLocation.h; sourceTree = "<group>"; };
+ DD0E6F761B0190E200DC035A /* OCMMacroState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMMacroState.h; sourceTree = "<group>"; };
+ DD0E6F771B0190E200DC035A /* OCMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMock.h; sourceTree = "<group>"; };
+ DD0E6F781B0190E200DC035A /* OCMockObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMockObject.h; sourceTree = "<group>"; };
+ DD0E6F791B0190E200DC035A /* OCMRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMRecorder.h; sourceTree = "<group>"; };
+ DD0E6F7A1B0190E200DC035A /* OCMStubRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMStubRecorder.h; sourceTree = "<group>"; };
+ DD0E6F8D1B01B68E00DC035A /* OHHTTPStubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHHTTPStubs.h; path = OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.h; sourceTree = SOURCE_ROOT; };
+ DD0E6F8E1B01B68E00DC035A /* OHHTTPStubs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHHTTPStubs.m; path = OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs.m; sourceTree = SOURCE_ROOT; };
+ DD0E6F8F1B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OHHTTPStubs+NSURLSessionConfiguration.m"; path = "OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubs+NSURLSessionConfiguration.m"; sourceTree = SOURCE_ROOT; };
+ DD0E6F901B01B68E00DC035A /* OHHTTPStubsResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHHTTPStubsResponse.h; path = OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.h; sourceTree = SOURCE_ROOT; };
+ DD0E6F911B01B68E00DC035A /* OHHTTPStubsResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHHTTPStubsResponse.m; path = OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse.m; sourceTree = SOURCE_ROOT; };
+ DD0E6F921B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OHHTTPStubsResponse+HTTPMessage.h"; path = "OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.h"; sourceTree = SOURCE_ROOT; };
+ DD0E6F931B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OHHTTPStubsResponse+HTTPMessage.m"; path = "OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+HTTPMessage.m"; sourceTree = SOURCE_ROOT; };
+ DD0E6F941B01B68E00DC035A /* OHHTTPStubsResponse+JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OHHTTPStubsResponse+JSON.h"; path = "OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.h"; sourceTree = SOURCE_ROOT; };
+ DD0E6F951B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OHHTTPStubsResponse+JSON.m"; path = "OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.m"; sourceTree = SOURCE_ROOT; };
+ DD0E6F961B01B68E00DC035A /* OHPathHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHPathHelpers.h; path = OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.h; sourceTree = SOURCE_ROOT; };
+ DD0E6F971B01B68E00DC035A /* OHPathHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHPathHelpers.m; path = OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.m; sourceTree = SOURCE_ROOT; };
DD41CE061ACB5DB300FA7979 /* libMapboxGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMapboxGL.a; path = ../../build/ios/pkg/static/libMapboxGL.a; sourceTree = "<group>"; };
DD41CE081ACB5DBC00FA7979 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
DD41CE0A1ACB5DC400FA7979 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
@@ -125,6 +156,7 @@
files = (
DD0580E81ACB628200B112C9 /* IOKit.framework in Frameworks */,
DDBD016E196DC4A10033959E /* libKIF.a in Frameworks */,
+ DD0E6F841B0190E200DC035A /* libOCMock.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -191,10 +223,55 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ DD0E6F6B1B01906600DC035A /* OCMock */ = {
+ isa = PBXGroup;
+ children = (
+ DD0E6F701B0190E200DC035A /* libOCMock.a */,
+ DD0E6F711B0190E200DC035A /* OCMock */,
+ );
+ name = OCMock;
+ sourceTree = "<group>";
+ };
+ DD0E6F711B0190E200DC035A /* OCMock */ = {
+ isa = PBXGroup;
+ children = (
+ DD0E6F721B0190E200DC035A /* NSNotificationCenter+OCMAdditions.h */,
+ DD0E6F731B0190E200DC035A /* OCMArg.h */,
+ DD0E6F741B0190E200DC035A /* OCMConstraint.h */,
+ DD0E6F751B0190E200DC035A /* OCMLocation.h */,
+ DD0E6F761B0190E200DC035A /* OCMMacroState.h */,
+ DD0E6F771B0190E200DC035A /* OCMock.h */,
+ DD0E6F781B0190E200DC035A /* OCMockObject.h */,
+ DD0E6F791B0190E200DC035A /* OCMRecorder.h */,
+ DD0E6F7A1B0190E200DC035A /* OCMStubRecorder.h */,
+ );
+ name = OCMock;
+ path = OCMock/OCMock;
+ sourceTree = SOURCE_ROOT;
+ };
+ DD0E6F861B01B67100DC035A /* OHHTTPStubs */ = {
+ isa = PBXGroup;
+ children = (
+ DD0E6F8D1B01B68E00DC035A /* OHHTTPStubs.h */,
+ DD0E6F8E1B01B68E00DC035A /* OHHTTPStubs.m */,
+ DD0E6F8F1B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m */,
+ DD0E6F901B01B68E00DC035A /* OHHTTPStubsResponse.h */,
+ DD0E6F911B01B68E00DC035A /* OHHTTPStubsResponse.m */,
+ DD0E6F921B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.h */,
+ DD0E6F931B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m */,
+ DD0E6F941B01B68E00DC035A /* OHHTTPStubsResponse+JSON.h */,
+ DD0E6F951B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m */,
+ DD0E6F961B01B68E00DC035A /* OHPathHelpers.h */,
+ DD0E6F971B01B68E00DC035A /* OHPathHelpers.m */,
+ );
+ name = OHHTTPStubs;
+ sourceTree = "<group>";
+ };
DDAE739B1ACB557500E1A793 /* GL Library */ = {
isa = PBXGroup;
children = (
DD0581031ACB661200B112C9 /* Headers */,
+ DACAD7111B08719F009119DC /* MGLMapboxEvents.h */,
DD0581071ACB663200B112C9 /* libMapboxGL.a */,
DD0581051ACB661C00B112C9 /* MapboxGL.bundle */,
);
@@ -207,8 +284,11 @@
DDBD016B196DC4740033959E /* KIFTestActor+MapboxGL.h */,
DDBD016A196DC4740033959E /* KIFTestActor+MapboxGL.m */,
DDBD0168196DC4740033959E /* MapViewTests.m */,
+ DD0E6F661B01806600DC035A /* MetricsTests.m */,
DDBD0167196DC46B0033959E /* Supporting Files */,
DDBD014D196DC3B00033959E /* KIF */,
+ DD0E6F6B1B01906600DC035A /* OCMock */,
+ DD0E6F861B01B67100DC035A /* OHHTTPStubs */,
);
name = Tests;
path = "Mapbox GL Tests";
@@ -392,8 +472,15 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ DD0E6F981B01B68E00DC035A /* OHHTTPStubs.m in Sources */,
+ DD0E6F9C1B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m in Sources */,
+ DD0E6F9B1B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m in Sources */,
DDBD016D196DC4740033959E /* KIFTestActor+MapboxGL.m in Sources */,
+ DD0E6F991B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */,
+ DD0E6F9A1B01B68E00DC035A /* OHHTTPStubsResponse.m in Sources */,
+ DD0E6F671B01806600DC035A /* MetricsTests.m in Sources */,
DDBD016C196DC4740033959E /* MapViewTests.m in Sources */,
+ DD0E6F9D1B01B68E00DC035A /* OHPathHelpers.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -545,8 +632,14 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"../../build/ios/pkg/static/**",
+ OCMock,
+ OHHTTPStubs/OHHTTPStubs/Sources,
);
INFOPLIST_FILE = "Bundle-Info.plist";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/OCMock",
+ );
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
@@ -574,8 +667,14 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"../../build/ios/pkg/static/**",
+ OCMock,
+ OHHTTPStubs/OHHTTPStubs/Sources,
);
INFOPLIST_FILE = "Bundle-Info.plist";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/OCMock",
+ );
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
diff --git a/test/ios/ios-tests.xcodeproj/project.xcworkspace/xcshareddata/ios-tests.xccheckout b/test/ios/ios-tests.xcodeproj/project.xcworkspace/xcshareddata/ios-tests.xccheckout
index e2f98de8f1..b6ff646f18 100644
--- a/test/ios/ios-tests.xcodeproj/project.xcworkspace/xcshareddata/ios-tests.xccheckout
+++ b/test/ios/ios-tests.xcodeproj/project.xcworkspace/xcshareddata/ios-tests.xccheckout
@@ -12,6 +12,8 @@
<dict>
<key>10265E242415D473A6A613214DB7AC3EE3D43F93</key>
<string>https://github.com/mapbox/KIF.git</string>
+ <key>38C2A0D4F62B675E8C16C8BC1437C7753846C8AC</key>
+ <string>https://github.com/AliSoftware/OHHTTPStubs.git</string>
<key>7E68CB584078A487C0535CC191D3B7551EEE2095</key>
<string>github.com:mapbox/mapbox-gl-native.git</string>
</dict>
@@ -21,6 +23,8 @@
<dict>
<key>10265E242415D473A6A613214DB7AC3EE3D43F93</key>
<string>../../../..test/ios/KIF</string>
+ <key>38C2A0D4F62B675E8C16C8BC1437C7753846C8AC</key>
+ <string>../../../../test/ios/OHHTTPStubs/</string>
<key>7E68CB584078A487C0535CC191D3B7551EEE2095</key>
<string>../../../..</string>
</dict>
@@ -48,6 +52,14 @@
<key>IDESourceControlWCCName</key>
<string>KIF</string>
</dict>
+ <dict>
+ <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
+ <string>public.vcs.git</string>
+ <key>IDESourceControlWCCIdentifierKey</key>
+ <string>38C2A0D4F62B675E8C16C8BC1437C7753846C8AC</string>
+ <key>IDESourceControlWCCName</key>
+ <string>OHHTTPStubs</string>
+ </dict>
</array>
</dict>
</plist>
diff --git a/test/miscellaneous/binpack.cpp b/test/miscellaneous/binpack.cpp
new file mode 100644
index 0000000000..a597f0a299
--- /dev/null
+++ b/test/miscellaneous/binpack.cpp
@@ -0,0 +1,51 @@
+#include "../fixtures/util.hpp"
+
+#include <mbgl/geometry/binpack.hpp>
+
+#include <iosfwd>
+#include <array>
+
+namespace mbgl {
+template <typename T> ::std::ostream& operator<<(::std::ostream& os, const Rect<T>& t) {
+ return os << "Rect { " << t.x << ", " << t.y << ", " << t.w << ", " << t.h << " }";
+}
+}
+
+TEST(BinPack, Allocating) {
+ mbgl::BinPack<uint16_t> bin(128, 128);
+ std::array<mbgl::Rect<uint16_t>, 4> rects;
+
+ rects[0] = bin.allocate(32, 48);
+ ASSERT_EQ(mbgl::Rect<uint16_t>(0, 0, 32, 48), rects[0]);
+ rects[1] = bin.allocate(8, 17);
+ ASSERT_EQ(mbgl::Rect<uint16_t>(32, 0, 8, 17), rects[1]);
+ rects[2] = bin.allocate(8, 17);
+ ASSERT_EQ(mbgl::Rect<uint16_t>(0, 48, 8, 17), rects[2]);
+
+ bin.release(rects[0]);
+ rects[0] = bin.allocate(32, 24);
+ ASSERT_EQ(mbgl::Rect<uint16_t>(0, 0, 32, 24), rects[0]);
+ rects[3] = bin.allocate(32, 24);
+ ASSERT_EQ(mbgl::Rect<uint16_t>(32, 17, 32, 24), rects[3]);
+}
+
+
+TEST(BinPack, Full) {
+ mbgl::BinPack<uint16_t> bin(128, 128);
+ std::vector<mbgl::Rect<uint16_t>> rects;
+
+ for (int j = 0; j < 3; j++) {
+ for (int i = 0; i < 256; i++) {
+ auto rect = bin.allocate(8, 8);
+ ASSERT_TRUE(rect.hasArea());
+ rects.push_back(rect);
+ }
+
+ ASSERT_FALSE(bin.allocate(8, 8).hasArea());
+
+ for (auto& rect: rects) {
+ bin.release(rect);
+ }
+ rects.clear();
+ }
+}
diff --git a/test/miscellaneous/comparisons.cpp b/test/miscellaneous/comparisons.cpp
index 315416c135..afb3990f80 100644
--- a/test/miscellaneous/comparisons.cpp
+++ b/test/miscellaneous/comparisons.cpp
@@ -72,6 +72,13 @@ TEST(FilterComparison, EqualsType) {
ASSERT_TRUE(evaluate(f, {{}}, FeatureType::LineString));
}
+TEST(FilterComparison, InType) {
+ FilterExpression f = parse("[\"in\", \"$type\", \"LineString\", \"Polygon\"]");
+ ASSERT_FALSE(evaluate(f, {{}}, FeatureType::Point));
+ ASSERT_TRUE(evaluate(f, {{}}, FeatureType::LineString));
+ ASSERT_TRUE(evaluate(f, {{}}, FeatureType::Polygon));
+}
+
TEST(FilterComparison, Any) {
ASSERT_FALSE(evaluate(parse("[\"any\"]"), {{}}));
ASSERT_TRUE(evaluate(parse("[\"any\", [\"==\", \"foo\", 1]]"),
diff --git a/test/miscellaneous/map.cpp b/test/miscellaneous/map.cpp
index 5834addb7b..b8707f3902 100644
--- a/test/miscellaneous/map.cpp
+++ b/test/miscellaneous/map.cpp
@@ -1,22 +1,59 @@
#include "../fixtures/util.hpp"
-#include <mbgl/util/run_loop.hpp>
-#include <mbgl/map/map_data.hpp>
-#include <mbgl/map/map_context.hpp>
+#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
#include <mbgl/storage/default_file_source.hpp>
using namespace mbgl;
-TEST(MapContext, DoubleStyleLoad) {
- util::RunLoop runLoop(uv_default_loop());
- std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>();
- HeadlessView view(display, 512, 512, 1);
+TEST(Map, PauseResume) {
+ using namespace mbgl;
+
+ auto display = std::make_shared<mbgl::HeadlessDisplay>();
+ HeadlessView view(display);
+ DefaultFileSource fileSource(nullptr);
+
+ Map map(view, fileSource, MapMode::Continuous);
+
+ map.pause();
+ map.resume();
+}
+
+TEST(Map, DoublePause) {
+ using namespace mbgl;
+
+ auto display = std::make_shared<mbgl::HeadlessDisplay>();
+ HeadlessView view(display);
+ DefaultFileSource fileSource(nullptr);
+
+ Map map(view, fileSource, MapMode::Continuous);
+
+ map.pause();
+ map.pause();
+ map.resume();
+}
+
+TEST(Map, ResumeWithoutPause) {
+ using namespace mbgl;
+
+ auto display = std::make_shared<mbgl::HeadlessDisplay>();
+ HeadlessView view(display);
+ DefaultFileSource fileSource(nullptr);
+
+ Map map(view, fileSource, MapMode::Continuous);
+
+ map.resume();
+}
+
+TEST(Map, DestroyPaused) {
+ using namespace mbgl;
+
+ auto display = std::make_shared<mbgl::HeadlessDisplay>();
+ HeadlessView view(display);
DefaultFileSource fileSource(nullptr);
- MapData data(view, MapMode::Continuous);
- MapContext context(uv_default_loop(), view, fileSource, data, false);
- context.setStyleJSON("", "");
- context.setStyleJSON("", "");
+ Map map(view, fileSource, MapMode::Continuous);
+
+ map.pause();
}
diff --git a/test/miscellaneous/map_context.cpp b/test/miscellaneous/map_context.cpp
new file mode 100644
index 0000000000..ed51923036
--- /dev/null
+++ b/test/miscellaneous/map_context.cpp
@@ -0,0 +1,22 @@
+#include "../fixtures/util.hpp"
+
+#include <mbgl/map/map_data.hpp>
+#include <mbgl/map/map_context.hpp>
+#include <mbgl/platform/default/headless_view.hpp>
+#include <mbgl/platform/default/headless_display.hpp>
+#include <mbgl/storage/default_file_source.hpp>
+#include <mbgl/util/thread.hpp>
+
+using namespace mbgl;
+
+TEST(MapContext, DoubleStyleLoad) {
+ std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>();
+ HeadlessView view(display, 512, 512, 1);
+ DefaultFileSource fileSource(nullptr);
+ MapData data(view, MapMode::Continuous);
+
+ util::Thread<MapContext> context("Map", util::ThreadPriority::Regular, view, fileSource, data);
+
+ context.invokeSync(&MapContext::setStyleJSON, "", "");
+ context.invokeSync(&MapContext::setStyleJSON, "", "");
+}
diff --git a/test/miscellaneous/transform.cpp b/test/miscellaneous/transform.cpp
new file mode 100644
index 0000000000..6025cbce40
--- /dev/null
+++ b/test/miscellaneous/transform.cpp
@@ -0,0 +1,125 @@
+#include "../fixtures/util.hpp"
+
+#include <mbgl/util/run_loop.hpp>
+#include <mbgl/map/map_data.hpp>
+#include <mbgl/map/map_context.hpp>
+#include <mbgl/platform/default/headless_view.hpp>
+#include <mbgl/platform/default/headless_display.hpp>
+#include <mbgl/storage/default_file_source.hpp>
+
+#include <cstdlib>
+
+using namespace mbgl;
+
+class MockView : public View {
+public:
+ void activate() override {
+ }
+ void deactivate() override {
+ }
+ void notify() override {
+ }
+ void invalidate(std::function<void()>) override {
+ }
+};
+
+TEST(Transform, InvalidScale) {
+ MockView view;
+ Transform transform(view);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(1, transform.getScale());
+
+ transform.setScale(2);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+
+ const double invalid = std::nan("");
+ transform.setScale(invalid);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+
+ transform.scaleBy(invalid);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+
+ transform.setZoom(invalid);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+
+ transform.setLatLngZoom({ 0, 0 }, invalid);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+}
+
+TEST(Transform, InvalidLatLng) {
+ MockView view;
+ Transform transform(view);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(1, transform.getScale());
+
+ transform.setScale(2);
+ transform.setLatLng({ 8, 10 });
+
+ ASSERT_DOUBLE_EQ(8, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(10, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+
+ transform.setLatLngZoom({ 10, 8 }, 2);
+
+ ASSERT_DOUBLE_EQ(10, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(8, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(4, transform.getScale());
+
+ const double invalid = std::nan("");
+ transform.setLatLngZoom({ invalid, 8 }, 2);
+
+ ASSERT_DOUBLE_EQ(10, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(8, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(4, transform.getScale());
+
+ transform.setLatLngZoom({ 10, invalid }, 2);
+
+ ASSERT_DOUBLE_EQ(10, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(8, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(4, transform.getScale());
+}
+
+
+TEST(Transform, InvalidBearing) {
+ MockView view;
+ Transform transform(view);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(1, transform.getScale());
+
+ transform.setScale(2);
+ transform.setAngle(2);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+ ASSERT_DOUBLE_EQ(2, transform.getAngle());
+
+ const double invalid = std::nan("");
+ transform.setAngle(invalid);
+
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().latitude);
+ ASSERT_DOUBLE_EQ(0, transform.getLatLng().longitude);
+ ASSERT_DOUBLE_EQ(2, transform.getScale());
+ ASSERT_DOUBLE_EQ(2, transform.getAngle());
+}
diff --git a/test/miscellaneous/worker.cpp b/test/miscellaneous/worker.cpp
new file mode 100644
index 0000000000..3d3c781b8c
--- /dev/null
+++ b/test/miscellaneous/worker.cpp
@@ -0,0 +1,104 @@
+#include "../fixtures/util.hpp"
+
+#include <mbgl/util/worker.hpp>
+#include <mbgl/util/work_request.hpp>
+#include <mbgl/util/run_loop.hpp>
+
+using namespace mbgl;
+using namespace mbgl::util;
+
+TEST(Worker, ExecutesWorkAndAfter) {
+ RunLoop loop(uv_default_loop());
+
+ Worker worker(1);
+ std::unique_ptr<WorkRequest> request;
+
+ bool didWork = false;
+ bool didAfter = false;
+
+ loop.invoke([&] {
+ request = worker.send([&] {
+ didWork = true;
+ }, [&] {
+ didAfter = true;
+ loop.stop();
+ });
+ });
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+ EXPECT_TRUE(didWork);
+ EXPECT_TRUE(didAfter);
+}
+
+TEST(Worker, WorkRequestDeletionWaitsForWorkToComplete) {
+ RunLoop loop(uv_default_loop());
+
+ Worker worker(1);
+ std::promise<void> started;
+ bool didWork = false;
+
+ loop.invoke([&] {
+ auto request = worker.send([&] {
+ started.set_value();
+ usleep(10000);
+ didWork = true;
+ }, [&] {});
+ started.get_future().get();
+
+ request.reset();
+ EXPECT_TRUE(didWork);
+ loop.stop();
+ });
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+}
+
+TEST(Worker, WorkRequestJoinCancelsAfter) {
+ RunLoop loop(uv_default_loop());
+
+ Worker worker(1);
+ std::promise<void> started;
+ bool didAfter = false;
+
+ loop.invoke([&] {
+ auto request = worker.send([&] {
+ started.set_value();
+ }, [&] {
+ didAfter = true;
+ });
+ started.get_future().get();
+
+ request.reset();
+ loop.stop();
+ });
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+ EXPECT_FALSE(didAfter);
+}
+
+TEST(Worker, WorkRequestCancelsImmediately) {
+ RunLoop loop(uv_default_loop());
+
+ Worker worker(1);
+
+ loop.invoke([&] {
+ std::promise<void> started;
+ // First worker item.
+ auto request1 = worker.send([&] {
+ usleep(10000);
+ started.set_value();
+ }, [&] {});
+
+ auto request2 = worker.send([&] {
+ ADD_FAILURE() << "Second work item should not be invoked";
+ }, [&] {});
+ request2.reset();
+
+ started.get_future().get();
+ request1.reset();
+
+ loop.stop();
+ });
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+}
diff --git a/test/storage/http_issue_1369.cpp b/test/storage/http_issue_1369.cpp
new file mode 100644
index 0000000000..44c190c825
--- /dev/null
+++ b/test/storage/http_issue_1369.cpp
@@ -0,0 +1,44 @@
+#include "storage.hpp"
+
+#include <uv.h>
+
+#include <mbgl/storage/default_file_source.hpp>
+#include <mbgl/storage/sqlite_cache.hpp>
+
+// Test for https://github.com/mapbox/mapbox-gl-native/issue/1369
+//
+// A request for http://example.com is made. This triggers a cache get. While the cache get is
+// pending, the request is canceled. This removes it from pending. Then, still while the cache get
+// is pending, a second request is made for the same resource. This adds an entry back to pending
+// and queues another cache request, even though the first one is still pending. Now both cache
+// requests resolve to misses, resulting in two HTTP requests for the same resource. The first one
+// will notify as expected, the second one will have bound a DefaultFileRequest* in the lambda that
+// gets invalidated by the first notify's pending.erase, and when it gets notified, the crash
+// occurs.
+
+TEST_F(Storage, HTTPIssue1369) {
+ SCOPED_TEST(HTTPIssue1369)
+
+ using namespace mbgl;
+
+ SQLiteCache cache;
+ DefaultFileSource fs(&cache);
+
+ const Resource resource { Resource::Unknown, "http://127.0.0.1:3000/test" };
+
+ auto req = fs.request(resource, uv_default_loop(), [&](const Response&) {
+ ADD_FAILURE() << "Callback should not be called";
+ });
+ fs.cancel(req);
+ fs.request(resource, uv_default_loop(), [&](const Response &res) {
+ EXPECT_EQ(Response::Successful, res.status);
+ EXPECT_EQ("Hello World!", res.data);
+ EXPECT_EQ(0, res.expires);
+ EXPECT_EQ(0, res.modified);
+ EXPECT_EQ("", res.etag);
+ EXPECT_EQ("", res.message);
+ HTTPIssue1369.finish();
+ });
+
+ uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+}
diff --git a/test/storage/http_noloop.cpp b/test/storage/http_noloop.cpp
deleted file mode 100644
index e133d3e0c2..0000000000
--- a/test/storage/http_noloop.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "storage.hpp"
-
-#include <uv.h>
-
-#include <mbgl/storage/default_file_source.hpp>
-#include <mbgl/util/uv.hpp>
-
-TEST_F(Storage, HTTPNoLoop) {
- SCOPED_TEST(HTTPNoLoop)
-
- using namespace mbgl;
-
- DefaultFileSource fs(nullptr);
-
- const auto mainThread = uv_thread_self();
-
- // Async handle that keeps the main loop alive until the thread finished
- auto async = new uv_async_t;
- uv_async_init(uv_default_loop(), async, [] (uv_async_t *as, int) {
- uv::close(as);
- });
-
- fs.request({ Resource::Unknown, "http://127.0.0.1:3000/temporary-error" }, nullptr,
- [&](const Response &res) {
- EXPECT_NE(uv_thread_self(), mainThread) << "Response was called in the same thread";
- EXPECT_EQ(Response::Successful, res.status);
- EXPECT_EQ("Hello World!", res.data);
- EXPECT_EQ(0, res.expires);
- EXPECT_EQ(0, res.modified);
- EXPECT_EQ("", res.etag);
- EXPECT_EQ("", res.message);
- HTTPNoLoop.finish();
-
- uv_async_send(async);
- });
-
- uv_run(uv_default_loop(), UV_RUN_DEFAULT);
-}
diff --git a/test/storage/http_reading.cpp b/test/storage/http_reading.cpp
index 09d33fd6ab..b322bbf2a7 100644
--- a/test/storage/http_reading.cpp
+++ b/test/storage/http_reading.cpp
@@ -56,20 +56,3 @@ TEST_F(Storage, HTTPNoCallback) {
HTTPTest.finish();
}
-
-TEST_F(Storage, HTTPCallbackNotOnLoop) {
- using namespace mbgl;
-
- DefaultFileSource fs(nullptr);
-
- SCOPED_TEST(HTTPTest)
-
- std::promise<void> promise;
- fs.request({ Resource::Unknown, "http://127.0.0.1:3000/test" }, [&] (const Response &) {
- promise.set_value();
- });
-
- promise.get_future().get();
-
- HTTPTest.finish();
-}
diff --git a/test/suite b/test/suite
-Subproject fe4b1ff3717b1b67b82391f004db6c163806d08
+Subproject aeead7e030747c7a262bbba69522c6b39b0b9e3
diff --git a/test/test.gypi b/test/test.gypi
index 3898090c73..75301751cf 100644
--- a/test/test.gypi
+++ b/test/test.gypi
@@ -41,18 +41,22 @@
'headless/headless.cpp',
'miscellaneous/clip_ids.cpp',
+ 'miscellaneous/binpack.cpp',
'miscellaneous/bilinear.cpp',
'miscellaneous/comparisons.cpp',
'miscellaneous/enums.cpp',
'miscellaneous/functions.cpp',
'miscellaneous/map.cpp',
+ 'miscellaneous/map_context.cpp',
'miscellaneous/mapbox.cpp',
'miscellaneous/merge_lines.cpp',
'miscellaneous/rotation_range.cpp',
'miscellaneous/style_parser.cpp',
'miscellaneous/text_conversions.cpp',
+ 'miscellaneous/transform.cpp',
'miscellaneous/tile.cpp',
'miscellaneous/variant.cpp',
+ 'miscellaneous/worker.cpp',
'storage/storage.hpp',
'storage/storage.cpp',
@@ -65,8 +69,8 @@
'storage/http_coalescing.cpp',
'storage/http_error.cpp',
'storage/http_header_parsing.cpp',
+ 'storage/http_issue_1369.cpp',
'storage/http_load.cpp',
- 'storage/http_noloop.cpp',
'storage/http_other_loop.cpp',
'storage/http_reading.cpp',
],