From d57416a598e943cebdd0154bf06c21ca27e1e14d Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Tue, 28 Jun 2016 17:35:50 -0700 Subject: [PATCH] CB-11496 - Create Obj-C unit-tests for wkwebview-engine (stubs) --- .../contents.xcworkspacedata | 7 + .../CDVWKWebViewEngineTest.xccheckout | 41 ++ .../xcschemes/CordovaLib.xcscheme | 77 +++ tests/ios/CDVWKWebViewEngineTest/.gitignore | 1 + .../CDVWKWebViewEngineTest.m | 57 ++ .../CDVWKWebViewEngineLibTests/Info.plist | 44 ++ .../project.pbxproj | 503 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../CDVWKWebViewEngineTest.xccheckout | 41 ++ .../xcschemes/CDVWKWebViewEngineLib.xcscheme | 77 +++ .../CDVWKWebViewEngineLibTests.xcscheme | 96 ++++ tests/ios/README.md | 40 ++ tests/ios/package.json | 13 + tests/plugin.xml | 29 + tests/tests.js | 44 ++ 15 files changed, 1077 insertions(+) create mode 100644 tests/ios/CDVWKWebViewEngineTest.xcworkspace/contents.xcworkspacedata create mode 100644 tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout create mode 100644 tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme create mode 100644 tests/ios/CDVWKWebViewEngineTest/.gitignore create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/CDVWKWebViewEngineTest.m create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/Info.plist create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.pbxproj create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLib.xcscheme create mode 100644 tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLibTests.xcscheme create mode 100644 tests/ios/README.md create mode 100644 tests/ios/package.json create mode 100644 tests/plugin.xml create mode 100644 tests/tests.js diff --git a/tests/ios/CDVWKWebViewEngineTest.xcworkspace/contents.xcworkspacedata b/tests/ios/CDVWKWebViewEngineTest.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..e4f97fa --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout b/tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout new file mode 100644 index 0000000..fd8d16a --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 6BE9AD73-1B9F-4362-98D7-DC631BEC6185 + IDESourceControlProjectName + CDVWKWebViewEngineTest + IDESourceControlProjectOriginsDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git + + IDESourceControlProjectPath + tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + ../../../../.. + + IDESourceControlProjectURL + https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlWCCName + cordova-plugin-wkwebview-engine + + + + diff --git a/tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme new file mode 100644 index 0000000..13f9a15 --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ios/CDVWKWebViewEngineTest/.gitignore b/tests/ios/CDVWKWebViewEngineTest/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/CDVWKWebViewEngineTest.m b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/CDVWKWebViewEngineTest.m new file mode 100644 index 0000000..73b5b0a --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/CDVWKWebViewEngineTest.m @@ -0,0 +1,57 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file 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 +#import +#import "CDVWKWebViewEngine.h" + +@interface CDVWKWebViewEngineTest : XCTestCase + +@property (nonatomic, strong) CDVWKWebViewEngine* plugin; + +@end + +@interface CDVWKWebViewEngine () + +// TODO: expose private interface, if needed + +@end + +@implementation CDVWKWebViewEngineTest + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. + + self.plugin = [[CDVWKWebViewEngine alloc] init]; +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void) testCDVWKWebViewEngine { + + // Failing tests + XCTAssertTrue(NO); + XCTAssertFalse(YES); +} + +@end diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/Info.plist b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/Info.plist new file mode 100644 index 0000000..95c8add --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineLibTests/Info.plist @@ -0,0 +1,44 @@ + + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.pbxproj b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fb7e8fc --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.pbxproj @@ -0,0 +1,503 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 7E9F51AB19DA10AE00DA31AC /* CDVWKWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51A919DA10AE00DA31AC /* CDVWKWebViewEngine.m */; }; + 7E9F51B119DA114400DA31AC /* CDVWKWebViewEngineTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* CDVWKWebViewEngineTest.m */; }; + 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B219DA116500DA31AC /* Foundation.framework */; }; + 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B419DA127E00DA31AC /* UIKit.framework */; }; + 7E9F51B919DA1B1600DA31AC /* libCDVWKWebViewEngineLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */; }; + 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; }; + 7EACDCE71D234E2A00494C9E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EACDCE61D234E2A00494C9E /* WebKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 68A32D7114102E1C006B237C; + remoteInfo = CordovaLib; + }; + 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7E9F519419DA102000DA31AC; + remoteInfo = CDVWKWebViewEngineLib; + }; + 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = CordovaLib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 7E9F519319DA102000DA31AC /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = ""; }; + 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVWKWebViewEngineLib.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E9F519F19DA102000DA31AC /* CDVWKWebViewEngineLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVWKWebViewEngineLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7E9F51A919DA10AE00DA31AC /* CDVWKWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVWKWebViewEngine.m; path = ../../../src/ios/CDVWKWebViewEngine.m; sourceTree = SOURCE_ROOT; }; + 7E9F51AA19DA10AE00DA31AC /* CDVWKWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVWKWebViewEngine.h; path = ../../../src/ios/CDVWKWebViewEngine.h; sourceTree = SOURCE_ROOT; }; + 7E9F51B019DA114400DA31AC /* CDVWKWebViewEngineTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWKWebViewEngineTest.m; sourceTree = ""; }; + 7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 7EACDCE61D234E2A00494C9E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7E9F519219DA102000DA31AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7EACDCE71D234E2A00494C9E /* WebKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E9F519C19DA102000DA31AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */, + 7E9F51B919DA1B1600DA31AC /* libCDVWKWebViewEngineLib.a in Frameworks */, + 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */, + 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7E9F517119DA09CE00DA31AC = { + isa = PBXGroup; + children = ( + 7EACDCE61D234E2A00494C9E /* WebKit.framework */, + 7E9F51B419DA127E00DA31AC /* UIKit.framework */, + 7E9F51B219DA116500DA31AC /* Foundation.framework */, + 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */, + 7E9F519619DA102000DA31AC /* CDVWKWebViewEngineLib */, + 7E9F51A019DA102000DA31AC /* CDVWKWebViewEngineLibTests */, + 7E9F517D19DA0A0A00DA31AC /* Products */, + ); + sourceTree = ""; + }; + 7E9F517D19DA0A0A00DA31AC /* Products */ = { + isa = PBXGroup; + children = ( + 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */, + 7E9F519F19DA102000DA31AC /* CDVWKWebViewEngineLibTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 7E9F518C19DA0F8300DA31AC /* Products */ = { + isa = PBXGroup; + children = ( + 7E9F519019DA0F8300DA31AC /* libCordova.a */, + ); + name = Products; + sourceTree = ""; + }; + 7E9F519619DA102000DA31AC /* CDVWKWebViewEngineLib */ = { + isa = PBXGroup; + children = ( + 7E9F51A919DA10AE00DA31AC /* CDVWKWebViewEngine.m */, + 7E9F51AA19DA10AE00DA31AC /* CDVWKWebViewEngine.h */, + ); + path = CDVWKWebViewEngineLib; + sourceTree = SOURCE_ROOT; + }; + 7E9F51A019DA102000DA31AC /* CDVWKWebViewEngineLibTests */ = { + isa = PBXGroup; + children = ( + 7E9F51A119DA102000DA31AC /* Supporting Files */, + 7E9F51B019DA114400DA31AC /* CDVWKWebViewEngineTest.m */, + ); + path = CDVWKWebViewEngineLibTests; + sourceTree = ""; + }; + 7E9F51A119DA102000DA31AC /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 7E9F51A219DA102000DA31AC /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7E9F519419DA102000DA31AC /* CDVWKWebViewEngineLib */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLib" */; + buildPhases = ( + 7E9F519119DA102000DA31AC /* Sources */, + 7E9F519219DA102000DA31AC /* Frameworks */, + 7E9F519319DA102000DA31AC /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CDVWKWebViewEngineLib; + productName = CDVWKWebViewEngineLib; + productReference = 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */; + productType = "com.apple.product-type.library.static"; + }; + 7E9F519E19DA102000DA31AC /* CDVWKWebViewEngineLibTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLibTests" */; + buildPhases = ( + 7E9F519B19DA102000DA31AC /* Sources */, + 7E9F519C19DA102000DA31AC /* Frameworks */, + 7E9F519D19DA102000DA31AC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */, + 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */, + ); + name = CDVWKWebViewEngineLibTests; + productName = CDVWKWebViewEngineLibTests; + productReference = 7E9F519F19DA102000DA31AC /* CDVWKWebViewEngineLibTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7E9F517219DA09CE00DA31AC /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + TargetAttributes = { + 7E9F519419DA102000DA31AC = { + CreatedOnToolsVersion = 6.0; + }; + 7E9F519E19DA102000DA31AC = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVWKWebViewEngineTest" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7E9F517119DA09CE00DA31AC; + productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */; + ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 7E9F519419DA102000DA31AC /* CDVWKWebViewEngineLib */, + 7E9F519E19DA102000DA31AC /* CDVWKWebViewEngineLibTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 7E9F519019DA0F8300DA31AC /* libCordova.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libCordova.a; + remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 7E9F519D19DA102000DA31AC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7E9F519119DA102000DA31AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51AB19DA10AE00DA31AC /* CDVWKWebViewEngine.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E9F519B19DA102000DA31AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E9F51B119DA114400DA31AC /* CDVWKWebViewEngineTest.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7E9F519419DA102000DA31AC /* CDVWKWebViewEngineLib */; + targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */; + }; + 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CordovaLib; + targetProxy = 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 7E9F517619DA09CE00DA31AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + 7E9F517719DA09CE00DA31AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; + 7E9F51A419DA102000DA31AC /* 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; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + 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_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"", + "\"$(OBJROOT)/UninstalledProducts/include\"", + "\"$(BUILT_PRODUCTS_DIR)\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 7E9F51A519DA102000DA31AC /* 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; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"", + "\n\"$(OBJROOT)/UninstalledProducts/include\"\n\"$(BUILT_PRODUCTS_DIR)\"", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 7E9F51A719DA102000DA31AC /* 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; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + 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_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = CDVWKWebViewEngineLibTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 7E9F51A819DA102000DA31AC /* 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; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + 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; + INFOPLIST_FILE = CDVWKWebViewEngineLibTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVWKWebViewEngineTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F517619DA09CE00DA31AC /* Debug */, + 7E9F517719DA09CE00DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLib" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F51A419DA102000DA31AC /* Debug */, + 7E9F51A519DA102000DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLibTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E9F51A719DA102000DA31AC /* Debug */, + 7E9F51A819DA102000DA31AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7E9F517219DA09CE00DA31AC /* Project object */; +} diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..bd6cf4a --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout new file mode 100644 index 0000000..fd8d16a --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/project.xcworkspace/xcshareddata/CDVWKWebViewEngineTest.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 6BE9AD73-1B9F-4362-98D7-DC631BEC6185 + IDESourceControlProjectName + CDVWKWebViewEngineTest + IDESourceControlProjectOriginsDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git + + IDESourceControlProjectPath + tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj + IDESourceControlProjectRelativeInstallPathDictionary + + BEF5A5D0FF64801E558286389440357A9233D7DB + ../../../../.. + + IDESourceControlProjectURL + https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + BEF5A5D0FF64801E558286389440357A9233D7DB + IDESourceControlWCCName + cordova-plugin-wkwebview-engine + + + + diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLib.xcscheme b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLib.xcscheme new file mode 100644 index 0000000..fd22159 --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLib.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLibTests.xcscheme b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLibTests.xcscheme new file mode 100644 index 0000000..c002a4e --- /dev/null +++ b/tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj/xcshareddata/xcschemes/CDVWKWebViewEngineLibTests.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ios/README.md b/tests/ios/README.md new file mode 100644 index 0000000..ac5e93f --- /dev/null +++ b/tests/ios/README.md @@ -0,0 +1,40 @@ + + +# iOS Tests for CDVWKWebViewEngine + +You need to install `node.js` to pull in `cordova-ios`. + +First install cordova-ios: + + npm install + +... in the current folder. + + +# Testing from Xcode + +1. Launch the `CDVWKWebViewEngineTest.xcworkspace` file. +2. Choose "CDVWKWebViewEngineLibTests" from the scheme drop-down menu +3. Click and hold on the `Play` button, and choose the `Wrench` icon to run the tests + + +# Testing from the command line + + npm test diff --git a/tests/ios/package.json b/tests/ios/package.json new file mode 100644 index 0000000..4c1ace3 --- /dev/null +++ b/tests/ios/package.json @@ -0,0 +1,13 @@ +{ + "name": "cordova-plugin-wkwebview-engine-test-ios", + "version": "1.0.0", + "description": "iOS Unit Tests for cordova-plugin-wkwebview-engine Plugin", + "author": "Apache Software Foundation", + "license": "Apache Version 2.0", + "dependencies": { + "cordova-ios": "*" + }, + "scripts": { + "test": "xcodebuild test -workspace CDVWKWebViewEngineTest.xcworkspace -scheme CDVWKWebViewEngineLibTests -destination 'platform=iOS Simulator,name=iPhone 5' CONFIGURATION_BUILD_DIR='/tmp' HEADER_SEARCH_PATHS='$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include'" + } +} diff --git a/tests/plugin.xml b/tests/plugin.xml new file mode 100644 index 0000000..e58d83c --- /dev/null +++ b/tests/plugin.xml @@ -0,0 +1,29 @@ + + + + + cordova-plugin-wkwebview-engine Tests + Apache 2.0 + + + + diff --git a/tests/tests.js b/tests/tests.js new file mode 100644 index 0000000..879b6a0 --- /dev/null +++ b/tests/tests.js @@ -0,0 +1,44 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file 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. + * +*/ + +/* jshint jasmine: true */ + +exports.defineAutoTests = function () { + describe('cordova-plugin-wkwebview-engine (cordova)', function () { + it("cordova-plugin-wkwebview-engine.spec.1 should exist", function () { + //expect(window).toBeDefined(); + }); + }); +}; + +exports.defineManualTests = function (contentEl, createActionButton) { + + contentEl.innerHTML = 'Your HTML instructions here'; + + createActionButton('Do something 1', function () { + // do something 1; + }, 'do-something-1'); + + createActionButton('Do something 2', function () { + // do something 2; + }, 'do-something-2'); + +};