Skip to content

Commit

Permalink
Various fixes (#20)
Browse files Browse the repository at this point in the history
* fix missing set self.contentController (renamed userContentController) causing script injection to fail silently

* Remove extmap-allow-mixed sdp header on RTCPeerConnection.prototype.setRemoteDescription to handle chrome 89

* allow registerGlobals to be called multiple time without error: Attempting to change value of a readonly property.

* fix RTCPeerConnection_addIceCandidate pluginRTCPeerConnection argument is NIL

* Check if pluginMediaStream had already the new track, otherwise add new track on PluginRTCPeerConnection ontrack

* Add pluginVideoTrack to PluginMediaStreamRenderer so that the renderer can unregister itself from the track when the renderer resets. This lets it deinit properly.

* update jsWKWebViewRTC.js build

* update travis to use xcode11

* add --allow-warnings to travis tests

* fix add --allow-warnings to travis tests

* fix travis error: SDK iphonesimulator9.3 cannot be located.

* fix travis error: 'Example/WKWebViewRTC.xcworkspace' does not exist.

* implement basic WKWebViewRTC_ExampleTests bundle

* update WKWebViewRTC_ExampleTests bundle
  • Loading branch information
hthetiot authored May 24, 2021
1 parent b53de42 commit 90600af
Show file tree
Hide file tree
Showing 14 changed files with 345 additions and 70 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# * https://www.objc.io/issues/6-build-tools/travis-ci/
# * https://github.com/supermarin/xcpretty#usage

osx_image: xcode7.3
osx_image: xcode11
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/WKWebViewRTC.xcworkspace -scheme WKWebViewRTC-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/WKWebViewRTC.xcworkspace -scheme WKWebViewRTC-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint --allow-warnings
151 changes: 150 additions & 1 deletion Example/WKWebViewRTC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,20 @@
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
7EE10A56265802BC002106AB /* WKWebViewRTC_ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE10A55265802BC002106AB /* WKWebViewRTC_ExampleTests.swift */; };
C66545EAFAA6C35DB6CA2184 /* Pods_WKWebViewRTC_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE6027618E5326D15BB46FD8 /* Pods_WKWebViewRTC_Example.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
7EE10A58265802BC002106AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
remoteInfo = WKWebViewRTC_Example;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
081BDE7624D12628001896C7 /* WKWebViewRTC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = WKWebViewRTC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0BBF29669602AC4D9879027C /* Pods-WKWebViewRTC_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Tests.debug.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Tests/Pods-WKWebViewRTC_Tests.debug.xcconfig"; sourceTree = "<group>"; };
Expand All @@ -25,15 +37,27 @@
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
7EE10A53265802BC002106AB /* WKWebViewRTC_ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WKWebViewRTC_ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7EE10A55265802BC002106AB /* WKWebViewRTC_ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKWebViewRTC_ExampleTests.swift; sourceTree = "<group>"; };
7EE10A57265802BC002106AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8AEFE6B0E7BA7E2E33BE4AAE /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
A0EDBD4CCC0BEDDAEE236367 /* Pods-WKWebViewRTC_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Example.release.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Example/Pods-WKWebViewRTC_Example.release.xcconfig"; sourceTree = "<group>"; };
B35BA54F2CDD708693E71D05 /* WKWebViewRTC.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = WKWebViewRTC.podspec; path = ../WKWebViewRTC.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
BE6027618E5326D15BB46FD8 /* Pods_WKWebViewRTC_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WKWebViewRTC_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DB050538E6A08CA58E6DAF4E /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
EE6CE03A4ED4077B0CE8B3D6 /* Pods-WKWebViewRTC_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WKWebViewRTC_Example.debug.xcconfig"; path = "Target Support Files/Pods-WKWebViewRTC_Example/Pods-WKWebViewRTC_Example.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
607FACCD1AFB9204008FA782 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C66545EAFAA6C35DB6CA2184 /* Pods_WKWebViewRTC_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7EE10A50265802BC002106AB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -48,6 +72,7 @@
children = (
607FACF51AFB993E008FA782 /* Podspec Metadata */,
607FACD21AFB9204008FA782 /* Example for WKWebViewRTC */,
7EE10A54265802BC002106AB /* WKWebViewRTC_ExampleTests */,
607FACD11AFB9204008FA782 /* Products */,
7D4535BB2E06396403CCBF10 /* Pods */,
9FCA6F8BBA28C27F5334B33B /* Frameworks */,
Expand All @@ -58,6 +83,7 @@
isa = PBXGroup;
children = (
607FACD01AFB9204008FA782 /* WKWebViewRTC_Example.app */,
7EE10A53265802BC002106AB /* WKWebViewRTC_ExampleTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -105,10 +131,20 @@
path = Pods;
sourceTree = "<group>";
};
7EE10A54265802BC002106AB /* WKWebViewRTC_ExampleTests */ = {
isa = PBXGroup;
children = (
7EE10A55265802BC002106AB /* WKWebViewRTC_ExampleTests.swift */,
7EE10A57265802BC002106AB /* Info.plist */,
);
path = WKWebViewRTC_ExampleTests;
sourceTree = "<group>";
};
9FCA6F8BBA28C27F5334B33B /* Frameworks */ = {
isa = PBXGroup;
children = (
081BDE7624D12628001896C7 /* WKWebViewRTC.framework */,
BE6027618E5326D15BB46FD8 /* Pods_WKWebViewRTC_Example.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -135,20 +171,43 @@
productReference = 607FACD01AFB9204008FA782 /* WKWebViewRTC_Example.app */;
productType = "com.apple.product-type.application";
};
7EE10A52265802BC002106AB /* WKWebViewRTC_ExampleTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7EE10A5A265802BC002106AB /* Build configuration list for PBXNativeTarget "WKWebViewRTC_ExampleTests" */;
buildPhases = (
7EE10A4F265802BC002106AB /* Sources */,
7EE10A50265802BC002106AB /* Frameworks */,
7EE10A51265802BC002106AB /* Resources */,
);
buildRules = (
);
dependencies = (
7EE10A59265802BC002106AB /* PBXTargetDependency */,
);
name = WKWebViewRTC_ExampleTests;
productName = WKWebViewRTC_ExampleTests;
productReference = 7EE10A53265802BC002106AB /* WKWebViewRTC_ExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
607FACC81AFB9204008FA782 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
};
7EE10A52265802BC002106AB = {
CreatedOnToolsVersion = 12.5;
ProvisioningStyle = Automatic;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
};
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "WKWebViewRTC" */;
Expand All @@ -166,6 +225,7 @@
projectRoot = "";
targets = (
607FACCF1AFB9204008FA782 /* WKWebViewRTC_Example */,
7EE10A52265802BC002106AB /* WKWebViewRTC_ExampleTests */,
);
};
/* End PBXProject section */
Expand All @@ -181,6 +241,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
7EE10A51265802BC002106AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -238,8 +305,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
7EE10A4F265802BC002106AB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7EE10A56265802BC002106AB /* WKWebViewRTC_ExampleTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
7EE10A59265802BC002106AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 607FACCF1AFB9204008FA782 /* WKWebViewRTC_Example */;
targetProxy = 7EE10A58265802BC002106AB /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
607FACD91AFB9204008FA782 /* Main.storyboard */ = {
isa = PBXVariantGroup;
Expand Down Expand Up @@ -395,6 +478,63 @@
};
name = Release;
};
7EE10A5B265802BC002106AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES;
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = WKWebViewRTC_ExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.WKWebViewRTC-ExampleTests.WKWebViewRTC-ExampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WKWebViewRTC_Example.app/WKWebViewRTC_Example";
};
name = Debug;
};
7EE10A5C265802BC002106AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES;
CODE_SIGN_STYLE = Automatic;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = WKWebViewRTC_ExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.WKWebViewRTC-ExampleTests.WKWebViewRTC-ExampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WKWebViewRTC_Example.app/WKWebViewRTC_Example";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand All @@ -416,6 +556,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7EE10A5A265802BC002106AB /* Build configuration list for PBXNativeTarget "WKWebViewRTC_ExampleTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7EE10A5B265802BC002106AB /* Debug */,
7EE10A5C265802BC002106AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 607FACC81AFB9204008FA782 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACE41AFB9204008FA782"
BuildableName = "WKWebViewRTC_Tests.xctest"
BlueprintName = "WKWebViewRTC_Tests"
ReferencedContainer = "container:WKWebViewRTC.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -63,14 +50,23 @@
ReferencedContainer = "container:WKWebViewRTC.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7EE10A422657FFC8002106AB"
BuildableName = "WKWebViewRTC_ExampleTests.xctest"
BlueprintName = "WKWebViewRTC_ExampleTests"
ReferencedContainer = "container:WKWebViewRTC.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand All @@ -87,8 +83,6 @@
ReferencedContainer = "container:WKWebViewRTC.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
10 changes: 10 additions & 0 deletions Example/WKWebViewRTC.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
22 changes: 22 additions & 0 deletions Example/WKWebViewRTC_ExampleTests/Info.plist
Original file line number Diff line number Diff line change
@@ -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>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Loading

0 comments on commit 90600af

Please sign in to comment.