You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/02/27 12:43:20 UTC

[cordova-windows] 02/26: remove 8.1 tests

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-win10only
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit a3f0490ae543a731a11f6d20d835c54ccdb928b7
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 19:07:47 2018 +0100

    remove 8.1 tests
---
 spec/e2e/endtoend.spec.js       |  84 -------------------------
 spec/unit/Prepare.Win10.spec.js |  64 -------------------
 spec/unit/build.spec.js         |  60 ------------------
 spec/unit/deployment.spec.js    | 133 +---------------------------------------
 4 files changed, 1 insertion(+), 340 deletions(-)

diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 97dbf41..be3deb8 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -93,22 +93,6 @@ describe('Cordova create and build', function () {
         _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
     });
 
-    it('spec.2d should build 8.1 win project', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-win', {silent: silent});
-        _expectExist(/.*Windows.*\.appxupload/);
-    });
-
-    it('spec.2e should build 8.1 phone project', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-phone', {silent: silent});
-        _expectExist(/.*Phone.*\.appxupload/);
-    });
-
-    it('spec.2f should build 8.1 win + phone project', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1', {silent: silent});
-        _expectExist(/.*Windows.*\.appxupload/);
-        _expectExist(/.*Phone.*\.appxupload/);
-    });
-
     // --archs
 
     it('spec.3a should build project for particular CPU', function () {
@@ -116,22 +100,6 @@ describe('Cordova create and build', function () {
         _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
     });
 
-    it('spec.3b should build project (8.1) for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64\"', {silent: silent}); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Phone.*x64.*\.appxupload/);
-        _expectExist(/.*Windows.*x64.*\.appxupload/);
-    });
-
-    it('spec.3c should build project (8.1-win) for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-win --archs=\"x64\"', {silent: silent}); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Windows.*x64.*\.appxupload/);
-    });
-
-    it('spec.3d should build project (8.1-phone) for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-phone --archs=\"x64\"', {silent: silent}); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Phone.*x64.*\.appxupload/);
-    });
-
     it('spec.4a should build project for CPUs separated by whitespaces', function () {
         shell.exec(buildScriptPath + ' --archs=\"x64 x86 arm anycpu\"', {silent: silent}); /* eslint no-useless-escape : 0 */
         _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
@@ -140,18 +108,6 @@ describe('Cordova create and build', function () {
         _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
     });
 
-    it('spec.4b should build project (8.1) for CPUs separated by whitespaces', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64 x86 arm anycpu\"', {silent: silent}); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Phone.*x86.*\.appxupload/);
-        _expectExist(/.*Phone.*x64.*\.appxupload/);
-        _expectExist(/.*Phone.*arm.*\.appxupload/);
-        _expectExist(/.*Phone.*AnyCPU.*\.appxupload/i);
-        _expectExist(/.*Windows.*x64.*\.appxupload/);
-        _expectExist(/.*Windows.*x86.*\.appxupload/);
-        _expectExist(/.*Windows.*arm.*\.appxupload/);
-        _expectExist(/.*Windows.*anycpu.*\.appxupload/i);
-    });
-
     // "InProcessServer extension"
 
     it('spec.5a should build project containing plugin with InProcessServer extension', function (done) {
@@ -180,43 +136,10 @@ describe('Cordova create and build', function () {
             });
     });
 
-    it('spec.5b should build project (8.1) containing plugin with InProcessServer extension', function (done) {
-        var extensionsPluginInfo, api;
-
-        extensionsPluginInfo = new PluginInfo(extensionsPlugin);
-        api = new Api();
-        api.root = projectFolder;
-        api.locations.root = projectFolder;
-        api.locations.www = path.join(projectFolder, 'www');
-
-        var fail = jasmine.createSpy('fail')
-            .and.callFake(function (err) {
-                console.error(err);
-            });
-
-        api.addPlugin(extensionsPluginInfo)
-            .then(function () {
-                shell.exec(buildScriptPath + ' --appx=8.1', {silent: silent});
-                _expectExist(/.*Windows.*\.appxupload/);
-                _expectExist(/.*Phone.*\.appxupload/);
-            })
-            .catch(fail)
-            .finally(function () {
-                expect(fail).not.toHaveBeenCalled();
-                done();
-            });
-    });
-
     // --release --bundle
 
     // here be 6a
 
-    it('spec.6b should generate appxupload and appxbundle for Windows Phone 8.1 project bundle release build', function () {
-        shell.exec(buildScriptPath + ' --release --appx=8.1-phone --bundle --archs=\"x64 x86 arm\"', {silent: silent});
-        _expectExist(/.*bundle\.appxupload$/, 3);
-        _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_Test', 'CordovaApp.Phone_1.0.0.0_x64_x86_arm.appxbundle');
-    });
-
     // --release (non-bundle)
 
     it('spec.7 should generate appxupload for Windows 10 project non-bundle release build', function () {
@@ -230,13 +153,6 @@ describe('Cordova create and build', function () {
         _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x86_Test', 'CordovaApp.Windows10_1.0.0.0_x86.appx');
     });
 
-    it('spec.8 for a non-bundle case for Windows Phone 8.1 it should build appx in separate dirs for each architecture', function () {
-        shell.exec(buildScriptPath + ' --release --appx=8.1-phone --phone --archs=\"x86 arm\"', {silent: silent});
-        _expectExist(/.*\.appxupload$/, 2);
-        _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_arm_Test', 'CordovaApp.Phone_1.0.0.0_arm.appx');
-        _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_x86_Test', 'CordovaApp.Phone_1.0.0.0_x86.appx');
-    });
-
     // this will be move up again when it is fixed for VS 2017 on AppVeyor
     it('spec.6a should generate appxupload and appxbundle for Windows 10 project bundle release build', function () {
         shell.exec(buildScriptPath + ' --release --bundle --archs=\"x64 x86 arm\"', {silent: silent});
diff --git a/spec/unit/Prepare.Win10.spec.js b/spec/unit/Prepare.Win10.spec.js
index 847ed01..52377be 100644
--- a/spec/unit/Prepare.Win10.spec.js
+++ b/spec/unit/Prepare.Win10.spec.js
@@ -92,33 +92,6 @@ function addCapabilityDeclarationToMockManifest (manifest, capability) {
     capRoot.append(cap);
 }
 
-describe('Windows 8.1 project', function () {
-
-    it('should not have an HTTP or HTTPS scheme for its startup URI.', function () {
-
-        // arrange
-        var mockConfig = createMockConfigAndManifestForApplyCoreProperties('index.html', { 'WindowsDefaultUriPrefix': 'http://' }, false);
-
-        // act
-        applyCoreProperties(mockConfig.config, mockConfig.manifest, 'fake-path', 'm2:', false);
-
-        var app = mockConfig.manifest.doc.find('.//Application');
-        expect(app.attrib.StartPage).toBe('www/index.html');
-    });
-
-    it('should not have any scheme for its startup URI.', function () {
-
-        // arrange
-        var mockConfig = createMockConfigAndManifestForApplyCoreProperties('index.html', { 'WindowsDefaultUriPrefix': 'ms-appx://' }, false);
-
-        // act
-        applyCoreProperties(mockConfig.config, mockConfig.manifest, 'fake-path', 'm2:', false);
-
-        var app = mockConfig.manifest.doc.find('.//Application');
-        expect(app.attrib.StartPage).toBe('www/index.html');
-    });
-});
-
 describe('Windows 10 project', function () {
     it('should default to ms-appx-web for its startup URI.', function () {
 
@@ -285,24 +258,6 @@ function createMockConfigAndManifestForApplyAccessRules (isWin10) {
 
 describe('Access rules management', function () {
     // body...
-    it('A Windows 8.1 project should not have WindowsRuntimeAccess attributes in access rules.', function () {
-
-        var mockConfig = createMockConfigAndManifestForApplyAccessRules(false, 'https://www.contoso.com');
-
-        applyAccessRules(mockConfig.config, mockConfig.manifest);
-
-        var app = mockConfig.manifest.doc.find('.//Application');
-        var accessRules = app.find('.//ApplicationContentUriRules');
-
-        expect(accessRules).toBeDefined();
-        expect(accessRules.len()).toBe(1);
-
-        var rule = accessRules.getItem(0);
-        expect(rule).toBeDefined();
-        expect(rule.attrib.WindowsRuntimeAccess).toBeUndefined();
-
-    });
-
     it('A Windows 10 project should have WindowsRuntimeAccess attributes in access rules.', function () {
 
         var mockConfig = createMockConfigAndManifestForApplyAccessRules(true, 'https://www.contoso.com');
@@ -322,25 +277,6 @@ describe('Access rules management', function () {
 
     });
 
-    describe('A Windows 8.1 project should reject http:// URI scheme rules.', function () {
-
-        var stringIndex = -1;
-        var searchStr = 'Access rules must begin with "https://", the following rule will be ignored: ';
-
-        beforeEach(function () {
-            require('cordova-common').events.on('warn', function (evt) {
-                stringIndex = evt.indexOf(searchStr);
-            });
-        });
-
-        it('applies access rules and verifies at least one was rejected', function () {
-            var mockConfig = createMockConfigAndManifestForApplyAccessRules(false, 'http://www.contoso.com');
-            applyAccessRules(mockConfig.config, mockConfig.manifest, false);
-
-            expect(stringIndex).toBe(0);
-        });
-    });
-
     describe('A Windows 10 project should accept http:// URI access rules.', function () {
 
         var stringIndex = -1;
diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index f9f55fa..e6bb97b 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -273,19 +273,6 @@ describe('run method', function () {
             });
     });
 
-    it('spec.9 should call buildProject of MSBuildTools if built for windows 8.1', function (done) {
-        var buildSpy = jasmine.createSpy();
-
-        createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: buildSpy, path: testPath }]);
-        createConfigParserMock('8.1');
-
-        build.run({argv: ['--win']})
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-                done();
-            });
-    });
-
     xit('spec.10 should throw an error if windows-target-version has unsupported value', function (done) {
         var buildSpy = jasmine.createSpy();
         var errorSpy = jasmine.createSpy();
@@ -305,19 +292,6 @@ describe('run method', function () {
             });
     });
 
-    it('spec.11 should call buildProject of MSBuildTools if built for windows phone 8.1', function (done) {
-        var buildSpy = jasmine.createSpy();
-
-        createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: buildSpy, path: testPath }]);
-        createConfigParserMock(null, '8.1');
-
-        build.run({argv: ['--phone']})
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-                done();
-            });
-    });
-
     xit('spec.12 should throw an error if windows-phone-target-version has unsupported value', function (done) {
         var buildSpy = jasmine.createSpy();
         var errorSpy = jasmine.createSpy();
@@ -337,40 +311,6 @@ describe('run method', function () {
             });
     });
 
-    it('spec.13a should be able to override target via --appx parameter', function (done) {
-        var buildSpy = jasmine.createSpy().and.callFake(function (solutionFile, buildType, buildArch) {
-            // check that we build Windows 10 and not Windows 8.1
-            expect(solutionFile.toLowerCase()).toMatch('cordovaapp.windows10.jsproj');
-        });
-
-        createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: buildSpy, path: testPath }]);
-        // provision config to target Windows 8.1
-        createConfigParserMock('8.1', '8.1');
-        // explicitly specify Windows 10 as target
-        build.run({argv: ['--appx=uap']})
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-                done();
-            });
-    });
-
-    it('spec.13b should be able to override target via --appx parameter', function (done) {
-        var buildSpy = jasmine.createSpy().and.callFake(function (solutionFile, buildType, buildArch) {
-            // check that we build Windows 10 and not Windows 8.1
-            expect(solutionFile.toLowerCase()).toMatch('cordovaapp.windows10.jsproj');
-        });
-
-        createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: buildSpy, path: testPath }]);
-        // provision config to target Windows 8.1
-        createConfigParserMock('8.1', '8.1');
-        // explicitly specify Windows 10 as target
-        build.run({argv: ['--appx=uwp']})
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-                done();
-            });
-    });
-
     it('spec.14a should use user-specified msbuild if VSINSTALLDIR variable is set', function (done) {
         var customMSBuildPath = '/some/path';
         var msBuildBinPath = path.join(customMSBuildPath, 'MSBuild/15.0/Bin');
diff --git a/spec/unit/deployment.spec.js b/spec/unit/deployment.spec.js
index fb62d48..24177d1 100644
--- a/spec/unit/deployment.spec.js
+++ b/spec/unit/deployment.spec.js
@@ -43,13 +43,6 @@ describe('The correct version of the app deployment tool is obtained.', function
         }
     });
 
-    it('Test #000 : Provides an AppDeployCmdTool when 8.1 is requested.', function () {
-
-        var tool = deployment.getDeploymentTool('8.1');
-        expect(tool instanceof AppDeployCmdTool).toBe(true);
-
-    });
-
     it('Test #001 : Provides a WinAppDeployCmdTool when 10.0 is requested.', function () {
 
         var tool = deployment.getDeploymentTool('10.0');
@@ -148,128 +141,4 @@ describe('Windows 10 deployment interacts with the file system as expected.', fu
                 done();
             });
     });
-});
-
-describe('Windows 8.1 deployment interacts with the file system as expected.', function () {
-
-    function fakeSpawn (cmd, args, cwd) {
-        expect(cmd).toBe(path.join('c:/Program Files (x86)/Microsoft SDKs/Windows Phone/v8.1/Tools/AppDeploy/AppDeployCmd.exe'));
-        switch (args[0]) {
-        case '/EnumerateDevices':
-            var output = '\r\nDevice Index    Device Name\r\n------------    -------------------------------\r\n 0              Device\r\n 1              Mobile Emulator 10.0.10150.0 WVGA 4 inch 512MB\r\n 2              Mobile Emulator 10.0.10150.0 WVGA 4 inch 1GB\r\n 3              Mobile Emulator 10.0.10150.0 WXGA 4.5 inch 1GB\r\n 4              Mobile Emulator 10.0.10150.0 720p 5 inch 1GB\r\n 5              Mobile Emulator 10.0.10150.0 1080p 6 inch 2GB\r\n 6              Emulator 8.1  [...]
-            return Q(output);
-
-        case '/update':
-        case '/install':
-        case '/updatelaunch':
-        case '/installlaunch':
-            expect(args[1]).toBe(TEST_APP_PACKAGE_NAME);
-            expect(args[2]).toBe('/targetdevice:de');
-            return Q('');
-
-        case '/uninstall':
-            expect(args[1]).toBe(TEST_APP_PACKAGE_ID);
-            expect(args[2]).toBe('/targetdevice:5');
-            return Q('');
-
-        default:
-            throw new Error('Unrecognized AppDeployCmd parameter "' + args[0] + '"');
-
-        }
-    }
-
-    var mockedSpawn = deployment.__get__('spawn');
-    var mockedProgramFiles = process.env['ProgramFiles(x86)'];
-
-    beforeEach(function () {
-        deployment.__set__('spawn', fakeSpawn);
-        process.env['ProgramFiles(x86)'] = path.join('c:/Program Files (x86)');
-    });
-
-    afterEach(function () {
-        deployment.__set__('spawn', mockedSpawn);
-        if (mockedProgramFiles) {
-            process.env['ProgramFiles(x86)'] = mockedProgramFiles;
-        } else {
-            delete process.env['ProgramFiles(x86)'];
-        }
-    });
-
-    it('Test #006 : enumerateDevices returns a valid set of objects', function (done) {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                expect(deviceList.length).toBe(12);
-                expect(deviceList[0].name).toBe('Device');
-                expect(deviceList[0].index).toBe(0);
-                expect(deviceList[0].type).toBe('device');
-                expect(deviceList[5].name).toBe('Mobile Emulator 10.0.10150.0 1080p 6 inch 2GB');
-                expect(deviceList[5].index).toBe(5);
-                expect(deviceList[5].type).toBe('emulator');
-                done();
-            }).fail(function err (errMsg) {
-                expect(errMsg).toBeUndefined();
-                done();
-            });
-    });
-
-    it('Test #007 : installAppPackage passes the correct set of parameters', function (done) {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /* shouldLaunch */ false, /* shouldUpdate */ false);
-                done();
-            }).fail(function err (errMsg) {
-                expect(errMsg).toBeUndefined();
-                done();
-            });
-    });
-
-    it('Test #008 : installAppPackage passes the correct set of parameters when updating', function (done) {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /* shouldLaunch */ false, /* shouldUpdate */ true);
-                done();
-            }).fail(function err (errMsg) {
-                expect(errMsg).toBeUndefined();
-                done();
-            });
-    });
-
-    it('Test #009 : installAppPackage passes the correct set of parameters when launching', function (done) {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /* shouldLaunch */ true, /* shouldUpdate */ false);
-                done();
-            }).fail(function err (errMsg) {
-                expect(errMsg).toBeUndefined();
-                done();
-            });
-    });
-
-    it('Test #010 : installAppPackage passes the correct set of parameters when updating and launching', function (done) {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /* shouldLaunch */ true, /* shouldUpdate */ true);
-                done();
-            }).fail(function err (errMsg) {
-                expect(errMsg).toBeUndefined();
-                done();
-            });
-    });
-
-    it('Test #011 : uninstallAppPackage passes the correct set of parameters', function (done) {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                deploymentTool.uninstallAppPackage(TEST_APP_PACKAGE_ID, deviceList[5]);
-                done();
-            }).fail(function err (errMsg) {
-                expect(errMsg).toBeUndefined();
-                done();
-            });
-    });
-});
+});
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
janpio@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org