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

brodybits pushed a commit to branch brodybits-uwp-only-wip0030
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit 9b9ecea71ec21d0886c37a10c5c2b0dcaf761718
Author: Christopher J. Brody <[email protected]>
AuthorDate: Sun Dec 22 13:30:55 2019 -0500

    remove unit tests for Windows 8.1
    
    Co-authored-by: Jan Piotrowski <[email protected]>
    Co-authored-by: Christopher J. Brody <[email protected]>
---
 spec/unit/Prepare.Win10.spec.js |  64 ------------------------
 spec/unit/build.spec.js         |  56 ---------------------
 spec/unit/deployment.spec.js    | 108 ----------------------------------------
 3 files changed, 228 deletions(-)

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 4023ea1..e18c951 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -257,18 +257,6 @@ describe('run method', function () {
         );
     });
 
-    it('spec.9 should call buildProject of MSBuildTools if built for windows 
8.1', function () {
-        var buildSpy = jasmine.createSpy();
-
-        createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: 
buildSpy, path: testPath }]);
-        createConfigParserMock('8.1');
-
-        return build.run({ argv: ['--win'] })
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-            });
-    });
-
     xit('spec.10 should throw an error if windows-target-version has 
unsupported value', function () {
         var buildSpy = jasmine.createSpy();
 
@@ -284,18 +272,6 @@ describe('run method', function () {
         );
     });
 
-    it('spec.11 should call buildProject of MSBuildTools if built for windows 
phone 8.1', function () {
-        var buildSpy = jasmine.createSpy();
-
-        createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: 
buildSpy, path: testPath }]);
-        createConfigParserMock(null, '8.1');
-
-        return build.run({ argv: ['--phone'] })
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-            });
-    });
-
     xit('spec.12 should throw an error if windows-phone-target-version has 
unsupported value', function () {
         var buildSpy = jasmine.createSpy();
 
@@ -311,38 +287,6 @@ describe('run method', function () {
         );
     });
 
-    it('spec.13a should be able to override target via --appx parameter', 
function () {
-        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
-        return build.run({ argv: ['--appx=uap'] })
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-            });
-    });
-
-    it('spec.13b should be able to override target via --appx parameter', 
function () {
-        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
-        return build.run({ argv: ['--appx=uwp'] })
-            .finally(function () {
-                expect(buildSpy).toHaveBeenCalled();
-            });
-    });
-
     it('spec.14a should use user-specified msbuild if VSINSTALLDIR variable is 
set', function () {
         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 a93b63f..7b304c0 100644
--- a/spec/unit/deployment.spec.js
+++ b/spec/unit/deployment.spec.js
@@ -21,7 +21,6 @@ var rewire = require('rewire');
 var deployment = rewire('../../template/cordova/lib/deployment');
 var Q = require('q');
 var path = require('path');
-var AppDeployCmdTool = deployment.__get__('AppDeployCmdTool');
 var WinAppDeployCmdTool = deployment.__get__('WinAppDeployCmdTool');
 
 var TEST_APP_PACKAGE_NAME = '"c:\\testapppackage.appx"';
@@ -43,13 +42,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');
@@ -133,103 +125,3 @@ describe('Windows 10 deployment interacts with the file 
system as expected.', fu
             });
     });
 });
-
-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 
() {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        return 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');
-            });
-    });
-
-    it('Test #007 : installAppPackage passes the correct set of parameters', 
function () {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        return deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                return deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, 
deviceList[0], /* shouldLaunch */ false, /* shouldUpdate */ false);
-            });
-    });
-
-    it('Test #008 : installAppPackage passes the correct set of parameters 
when updating', function () {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        return deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                return deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, 
deviceList[0], /* shouldLaunch */ false, /* shouldUpdate */ true);
-            });
-    });
-
-    it('Test #009 : installAppPackage passes the correct set of parameters 
when launching', function () {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        return deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                return deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, 
deviceList[0], /* shouldLaunch */ true, /* shouldUpdate */ false);
-            });
-    });
-
-    it('Test #010 : installAppPackage passes the correct set of parameters 
when updating and launching', function () {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        return deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                return deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, 
deviceList[0], /* shouldLaunch */ true, /* shouldUpdate */ true);
-            });
-    });
-
-    it('Test #011 : uninstallAppPackage passes the correct set of parameters', 
function () {
-        var deploymentTool = deployment.getDeploymentTool('8.1');
-        return deploymentTool.enumerateDevices()
-            .then(function (deviceList) {
-                return deploymentTool.uninstallAppPackage(TEST_APP_PACKAGE_ID, 
deviceList[5]);
-            });
-    });
-});


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to