You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by da...@apache.org on 2016/11/02 09:31:38 UTC

cordova-windows git commit: CB-12071 Fix for CB-11825 breaks usage of InProcessServer in Cordova Windows

Repository: cordova-windows
Updated Branches:
  refs/heads/master 7ed3c997a -> d6322b774


CB-12071 Fix for CB-11825 breaks usage of InProcessServer in Cordova Windows

Adds a test for missing InProcessServer extension case to prevent further breakages


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/d6322b77
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/d6322b77
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/d6322b77

Branch: refs/heads/master
Commit: d6322b774a6b4db624813f58c3cd8e15a5924a83
Parents: 7ed3c99
Author: daserge <v-...@microsoft.com>
Authored: Tue Nov 1 11:27:49 2016 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Wed Nov 2 10:32:17 2016 +0300

----------------------------------------------------------------------
 spec/e2e/endtoend.spec.js                       | 36 ++++++++++++++
 .../plugin.xml                                  | 51 ++++++++++++++++++++
 .../src/windows/Foo.dll                         |  0
 3 files changed, 87 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/d6322b77/spec/e2e/endtoend.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 3732693..209ff39 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -20,6 +20,14 @@ var shell = require('shelljs'),
     fs = require('fs'),
     path = require('path');
 
+var FIXTURES = path.join(__dirname, '../unit/fixtures');
+var EXTENSIONS_PLUGIN = 'org.test.plugins.extensionsplugin';
+var extensionsPlugin = path.join(FIXTURES, EXTENSIONS_PLUGIN);
+
+var templateFolder = path.join(__dirname, '../../template');
+var Api = require(path.join(templateFolder, 'cordova/Api'));
+var PluginInfo = require('cordova-common').PluginInfo;
+
 describe('Cordova create and build', function(){
 
     var projectFolder     = 'testcreate \u5fdc\u7528',
@@ -66,4 +74,32 @@ describe('Cordova create and build', function(){
         expect(packages.filter(function(file) { return file.match(/.*Windows.*arm.*\.appx.*/); }).length).toBe(1);
         expect(packages.filter(function(file) { return file.match(/.*Windows.*anycpu.*\.appx.*/); }).length).toBe(1);
     });
+
+    it('spec.5 should build project 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')
+        .andCallFake(function (err) {
+            console.error(err);
+        });
+
+        api.addPlugin(extensionsPluginInfo)
+        .then(function() {
+            shell.exec(buildScriptPath, {silent:true});
+            var packages = shell.ls(appPackagesFolder);
+            expect(packages.filter(function(file) { return file.match(/.*Phone.*\.appx.*/); }).length).toBe(1);
+            expect(packages.filter(function(file) { return file.match(/.*Windows.*\.appx.*/); }).length).toBe(1);
+        })
+        .catch(fail)
+        .finally(function() {
+            expect(fail).not.toHaveBeenCalled();
+            done();
+        });
+    });
 });

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/d6322b77/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml b/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml
new file mode 100644
index 0000000..cf39b89
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ Licensed 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.
+
+-->
+
+<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    id="org.test.plugins.extensionsplugin"
+    version="1.0.0">
+
+    <!-- new requirement: NO SPACES -->
+    <name>extensionsplugin</name>
+    <!-- These are going to be required by plugman-registry -->
+    <description>my description</description>
+    <author>Jackson Badman</author>
+    <keywords>extensions,plugin</keywords>
+    <license>BSD</license>
+    <!-- end plugman-registry requirements -->
+
+    <!-- windows -->
+    <platform name="windows">
+        <config-file target="package.windows.appxmanifest" parent="/Package">
+            <Extensions>
+                <Extension Category="windows.activatableClass.inProcessServer">
+                    <InProcessServer>
+                        <Path>Foo.dll</Path>
+                        <ActivatableClass ActivatableClassId="Foo.Class" ThreadingModel="both" />
+                    </InProcessServer>
+                </Extension>
+            </Extensions>
+        </config-file>
+
+        <resource-file src="src/windows/Foo.dll" target="Foo.dll" />
+    </platform>
+
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/d6322b77/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll b/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll
new file mode 100644
index 0000000..e69de29


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