You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/09/21 23:44:36 UTC
[12/14] stub of build specs related to config.xml interpolation.
added a bunch of fixtures for tests.
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/css/index.css
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/css/index.css b/spec/fixtures/projects/native/android/assets/www/css/index.css
new file mode 100644
index 0000000..f1f9d76
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+* {
+ -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
+ -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
+ -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+ -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
+}
+
+body {
+ background-color:#E4E4E4;
+ background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0, #A7A7A7),
+ color-stop(0.51, #E4E4E4)
+ );
+ background-attachment:fixed;
+ font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+ font-size:12px;
+ height:100%;
+ margin:0px;
+ padding:0px;
+ text-transform:uppercase;
+ width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+ background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+ position:absolute; /* position in the center of the screen */
+ left:50%;
+ top:50%;
+ height:50px; /* text area height */
+ width:225px; /* text area width */
+ text-align:center;
+ padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
+ margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
+ /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+ .app {
+ background-position:left center;
+ padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
+ margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
+ /* offset horizontal: half of image width and text area width */
+ }
+}
+
+h1 {
+ font-size:24px;
+ font-weight:normal;
+ margin:0px;
+ overflow:visible;
+ padding:0px;
+ text-align:center;
+}
+
+.event {
+ border-radius:4px;
+ -webkit-border-radius:4px;
+ color:#FFFFFF;
+ font-size:12px;
+ margin:0px 30px;
+ padding:2px 0px;
+}
+
+.event.listening {
+ background-color:#333333;
+ display:block;
+}
+
+.event.received {
+ background-color:#4B946A;
+ display:none;
+}
+
+@keyframes fade {
+ from { opacity: 1.0; }
+ 50% { opacity: 0.4; }
+ to { opacity: 1.0; }
+}
+
+@-webkit-keyframes fade {
+ from { opacity: 1.0; }
+ 50% { opacity: 0.4; }
+ to { opacity: 1.0; }
+}
+
+.blink {
+ animation:fade 3000ms infinite;
+ -webkit-animation:fade 3000ms infinite;
+}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/img/cordova.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/img/cordova.png b/spec/fixtures/projects/native/android/assets/www/img/cordova.png
new file mode 100644
index 0000000..e8169cf
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/img/cordova.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/img/logo.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/img/logo.png b/spec/fixtures/projects/native/android/assets/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/img/logo.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/index.html
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/index.html b/spec/fixtures/projects/native/android/assets/www/index.html
new file mode 100644
index 0000000..92484ad
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="format-detection" content="telephone=no" />
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
+ <link rel="stylesheet" type="text/css" href="css/index.css" />
+ <title>Hello World</title>
+ </head>
+ <body>
+ <div class="app">
+ <h1>Apache Cordova</h1>
+ <div id="deviceready" class="blink">
+ <p class="event listening">Connecting to Device</p>
+ <p class="event received">Device is Ready</p>
+ </div>
+ </div>
+ <script type="text/javascript" src="cordova-2.1.0.js"></script>
+ <script type="text/javascript" src="js/index.js"></script>
+ <script type="text/javascript">
+ app.initialize();
+ </script>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/js/index.js
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/js/index.js b/spec/fixtures/projects/native/android/assets/www/js/index.js
new file mode 100644
index 0000000..87b5660
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/js/index.js
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+var app = {
+ // Application Constructor
+ initialize: function() {
+ this.bindEvents();
+ },
+ // Bind Event Listeners
+ //
+ // Bind any events that are required on startup. Common events are:
+ // 'load', 'deviceready', 'offline', and 'online'.
+ bindEvents: function() {
+ document.addEventListener('deviceready', this.onDeviceReady, false);
+ },
+ // deviceready Event Handler
+ //
+ // The scope of 'this' is the event. In order to call the 'receivedEvent'
+ // function, we must explicitly call 'app.receivedEvent(...);'
+ onDeviceReady: function() {
+ app.receivedEvent('deviceready');
+ },
+ // Update DOM on a Received Event
+ receivedEvent: function(id) {
+ var parentElement = document.getElementById(id);
+ var listeningElement = parentElement.querySelector('.listening');
+ var receivedElement = parentElement.querySelector('.received');
+
+ listeningElement.setAttribute('style', 'display:none;');
+ receivedElement.setAttribute('style', 'display:block;');
+
+ console.log('Received Event: ' + id);
+ }
+};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/main.js
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/main.js b/spec/fixtures/projects/native/android/assets/www/main.js
new file mode 100644
index 0000000..3a8b04a
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/main.js
@@ -0,0 +1,165 @@
+/*
+ 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.
+*/
+
+var deviceInfo = function() {
+ document.getElementById("platform").innerHTML = device.platform;
+ document.getElementById("version").innerHTML = device.version;
+ document.getElementById("uuid").innerHTML = device.uuid;
+ document.getElementById("name").innerHTML = device.name;
+ document.getElementById("width").innerHTML = screen.width;
+ document.getElementById("height").innerHTML = screen.height;
+ document.getElementById("colorDepth").innerHTML = screen.colorDepth;
+};
+
+var getLocation = function() {
+ var suc = function(p) {
+ alert(p.coords.latitude + " " + p.coords.longitude);
+ };
+ var locFail = function() {
+ };
+ navigator.geolocation.getCurrentPosition(suc, locFail);
+};
+
+var beep = function() {
+ navigator.notification.beep(2);
+};
+
+var vibrate = function() {
+ navigator.notification.vibrate(0);
+};
+
+function roundNumber(num) {
+ var dec = 3;
+ var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
+ return result;
+}
+
+var accelerationWatch = null;
+
+function updateAcceleration(a) {
+ document.getElementById('x').innerHTML = roundNumber(a.x);
+ document.getElementById('y').innerHTML = roundNumber(a.y);
+ document.getElementById('z').innerHTML = roundNumber(a.z);
+}
+
+var toggleAccel = function() {
+ if (accelerationWatch !== null) {
+ navigator.accelerometer.clearWatch(accelerationWatch);
+ updateAcceleration({
+ x : "",
+ y : "",
+ z : ""
+ });
+ accelerationWatch = null;
+ } else {
+ var options = {};
+ options.frequency = 1000;
+ accelerationWatch = navigator.accelerometer.watchAcceleration(
+ updateAcceleration, function(ex) {
+ alert("accel fail (" + ex.name + ": " + ex.message + ")");
+ }, options);
+ }
+};
+
+var preventBehavior = function(e) {
+ e.preventDefault();
+};
+
+function dump_pic(data) {
+ var viewport = document.getElementById('viewport');
+ console.log(data);
+ viewport.style.display = "";
+ viewport.style.position = "absolute";
+ viewport.style.top = "10px";
+ viewport.style.left = "10px";
+ document.getElementById("test_img").src = data;
+}
+
+function fail(msg) {
+ alert(msg);
+}
+
+function show_pic() {
+ navigator.camera.getPicture(dump_pic, fail, {
+ quality : 50
+ });
+}
+
+function close() {
+ var viewport = document.getElementById('viewport');
+ viewport.style.position = "relative";
+ viewport.style.display = "none";
+}
+
+function contacts_success(contacts) {
+ alert(contacts.length
+ + ' contacts returned.'
+ + (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted)
+ : ''));
+}
+
+function get_contacts() {
+ var obj = new ContactFindOptions();
+ obj.filter = "";
+ obj.multiple = true;
+ navigator.contacts.find(
+ [ "displayName", "name" ], contacts_success,
+ fail, obj);
+}
+
+function check_network() {
+ var networkState = navigator.network.connection.type;
+
+ var states = {};
+ states[Connection.UNKNOWN] = 'Unknown connection';
+ states[Connection.ETHERNET] = 'Ethernet connection';
+ states[Connection.WIFI] = 'WiFi connection';
+ states[Connection.CELL_2G] = 'Cell 2G connection';
+ states[Connection.CELL_3G] = 'Cell 3G connection';
+ states[Connection.CELL_4G] = 'Cell 4G connection';
+ states[Connection.NONE] = 'No network connection';
+
+ confirm('Connection type:\n ' + states[networkState]);
+}
+
+var watchID = null;
+
+function updateHeading(h) {
+ document.getElementById('h').innerHTML = h.magneticHeading;
+}
+
+function toggleCompass() {
+ if (watchID !== null) {
+ navigator.compass.clearWatch(watchID);
+ watchID = null;
+ updateHeading({ magneticHeading : "Off"});
+ } else {
+ var options = { frequency: 1000 };
+ watchID = navigator.compass.watchHeading(updateHeading, function(e) {
+ alert('Compass Error: ' + e.code);
+ }, options);
+ }
+}
+
+function init() {
+ // the next line makes it impossible to see Contacts on the HTC Evo since it
+ // doesn't have a scroll button
+ // document.addEventListener("touchmove", preventBehavior, false);
+ document.addEventListener("deviceready", deviceInfo, true);
+}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/master.css
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/master.css b/spec/fixtures/projects/native/android/assets/www/master.css
new file mode 100644
index 0000000..3aad33d
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/master.css
@@ -0,0 +1,116 @@
+/*
+ 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.
+*/
+
+
+ body {
+ background:#222 none repeat scroll 0 0;
+ color:#666;
+ font-family:Helvetica;
+ font-size:72%;
+ line-height:1.5em;
+ margin:0;
+ border-top:1px solid #393939;
+ }
+
+ #info{
+ background:#ffa;
+ border: 1px solid #ffd324;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ clear:both;
+ margin:15px 6px 0;
+ width:295px;
+ padding:4px 0px 2px 10px;
+ }
+
+ #info > h4{
+ font-size:.95em;
+ margin:5px 0;
+ }
+
+ #stage.theme{
+ padding-top:3px;
+ }
+
+ /* Definition List */
+ #stage.theme > dl{
+ padding-top:10px;
+ clear:both;
+ margin:0;
+ list-style-type:none;
+ padding-left:10px;
+ overflow:auto;
+ }
+
+ #stage.theme > dl > dt{
+ font-weight:bold;
+ float:left;
+ margin-left:5px;
+ }
+
+ #stage.theme > dl > dd{
+ width:45px;
+ float:left;
+ color:#a87;
+ font-weight:bold;
+ }
+
+ /* Content Styling */
+ #stage.theme > h1, #stage.theme > h2, #stage.theme > p{
+ margin:1em 0 .5em 13px;
+ }
+
+ #stage.theme > h1{
+ color:#eee;
+ font-size:1.6em;
+ text-align:center;
+ margin:0;
+ margin-top:15px;
+ padding:0;
+ }
+
+ #stage.theme > h2{
+ clear:both;
+ margin:0;
+ padding:3px;
+ font-size:1em;
+ text-align:center;
+ }
+
+ /* Stage Buttons */
+ #stage.theme a.btn{
+ border: 1px solid #555;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ text-align:center;
+ display:block;
+ float:left;
+ background:#444;
+ width:150px;
+ color:#9ab;
+ font-size:1.1em;
+ text-decoration:none;
+ padding:1.2em 0;
+ margin:3px 0px 3px 5px;
+ }
+ #stage.theme a.btn.large{
+ width:308px;
+ padding:1.2em 0;
+ }
+
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-36-ldpi.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-36-ldpi.png b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-36-ldpi.png
new file mode 100644
index 0000000..cd5032a
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-36-ldpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-48-mdpi.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-48-mdpi.png b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-48-mdpi.png
new file mode 100644
index 0000000..e79c606
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-48-mdpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-72-hdpi.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-72-hdpi.png b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-72-hdpi.png
new file mode 100644
index 0000000..4d27634
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-72-hdpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-96-xhdpi.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-96-xhdpi.png b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-96-xhdpi.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/icon/android/icon-96-xhdpi.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-landscape.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-landscape.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-landscape.png
new file mode 100644
index 0000000..a61e2b1
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-portrait.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-portrait.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-portrait.png
new file mode 100644
index 0000000..5d6a28a
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-hdpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-landscape.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-landscape.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-landscape.png
new file mode 100644
index 0000000..f3934cd
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-portrait.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-portrait.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-portrait.png
new file mode 100644
index 0000000..65ad163
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-ldpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-landscape.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-landscape.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-landscape.png
new file mode 100644
index 0000000..a1b697c
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-portrait.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-portrait.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-portrait.png
new file mode 100644
index 0000000..ea15693
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-mdpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-landscape.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-landscape.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-landscape.png
new file mode 100644
index 0000000..79f2f09
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-landscape.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-portrait.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-portrait.png b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-portrait.png
new file mode 100644
index 0000000..c2e8042
Binary files /dev/null and b/spec/fixtures/projects/native/android/assets/www/res/screen/android/screen-xhdpi-portrait.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/spec.html
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/spec.html b/spec/fixtures/projects/native/android/assets/www/spec.html
new file mode 100644
index 0000000..71f00de
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/spec.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Jasmine Spec Runner</title>
+
+ <!-- jasmine source -->
+ <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
+ <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
+ <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
+ <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
+
+ <!-- include source files here... -->
+ <script type="text/javascript" src="js/index.js"></script>
+
+ <!-- include spec files here... -->
+ <script type="text/javascript" src="spec/helper.js"></script>
+ <script type="text/javascript" src="spec/index.js"></script>
+
+ <script type="text/javascript">
+ (function() {
+ var jasmineEnv = jasmine.getEnv();
+ jasmineEnv.updateInterval = 1000;
+
+ var htmlReporter = new jasmine.HtmlReporter();
+
+ jasmineEnv.addReporter(htmlReporter);
+
+ jasmineEnv.specFilter = function(spec) {
+ return htmlReporter.specFilter(spec);
+ };
+
+ var currentWindowOnload = window.onload;
+
+ window.onload = function() {
+ if (currentWindowOnload) {
+ currentWindowOnload();
+ }
+ execJasmine();
+ };
+
+ function execJasmine() {
+ jasmineEnv.execute();
+ }
+ })();
+ </script>
+ </head>
+ <body>
+ <div id="stage" style="display:none;"></div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/spec/helper.js
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/spec/helper.js b/spec/fixtures/projects/native/android/assets/www/spec/helper.js
new file mode 100644
index 0000000..929f776
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/spec/helper.js
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+afterEach(function() {
+ document.getElementById('stage').innerHTML = '';
+});
+
+var helper = {
+ trigger: function(obj, name) {
+ var e = document.createEvent('Event');
+ e.initEvent(name, true, true);
+ obj.dispatchEvent(e);
+ },
+ getComputedStyle: function(querySelector, property) {
+ var element = document.querySelector(querySelector);
+ return window.getComputedStyle(element).getPropertyValue(property);
+ }
+};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/assets/www/spec/index.js
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/assets/www/spec/index.js b/spec/fixtures/projects/native/android/assets/www/spec/index.js
new file mode 100644
index 0000000..20f8be5
--- /dev/null
+++ b/spec/fixtures/projects/native/android/assets/www/spec/index.js
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+describe('app', function() {
+ describe('initialize', function() {
+ it('should bind deviceready', function() {
+ runs(function() {
+ spyOn(app, 'onDeviceReady');
+ app.initialize();
+ helper.trigger(window.document, 'deviceready');
+ });
+
+ waitsFor(function() {
+ return (app.onDeviceReady.calls.length > 0);
+ }, 'onDeviceReady should be called once', 500);
+
+ runs(function() {
+ expect(app.onDeviceReady).toHaveBeenCalled();
+ });
+ });
+ });
+
+ describe('onDeviceReady', function() {
+ it('should report that it fired', function() {
+ spyOn(app, 'receivedEvent');
+ app.onDeviceReady();
+ expect(app.receivedEvent).toHaveBeenCalledWith('deviceready');
+ });
+ });
+
+ describe('receivedEvent', function() {
+ beforeEach(function() {
+ var el = document.getElementById('stage');
+ el.innerHTML = ['<div id="deviceready">',
+ ' <p class="event listening">Listening</p>',
+ ' <p class="event received">Received</p>',
+ '</div>'].join('\n');
+ });
+
+ it('should hide the listening element', function() {
+ app.receivedEvent('deviceready');
+ var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display');
+ expect(displayStyle).toEqual('none');
+ });
+
+ it('should show the received element', function() {
+ app.receivedEvent('deviceready');
+ var displayStyle = helper.getComputedStyle('#deviceready .received', 'display');
+ expect(displayStyle).toEqual('block');
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/build.xml
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/build.xml b/spec/fixtures/projects/native/android/build.xml
new file mode 100644
index 0000000..9d5c206
--- /dev/null
+++ b/spec/fixtures/projects/native/android/build.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="cordovaExample" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The ant.properties file can be created by you. It is only edited by the
+ 'android' tool to add properties to it.
+ This is the place to change some Ant specific build properties.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ For other overridable properties, look at the beginning of the rules
+ files in the SDK, at tools/ant/build.xml
+
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
+
+ -->
+ <property file="ant.properties" />
+
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var.
+ This must be done before we load project.properties since
+ the proguard config can use sdk.dir -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
+ <!-- The project.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+
+ This contains project specific properties such as project target, and library
+ dependencies. Lower level build properties are stored in ant.properties
+ (or in .classpath for Eclipse projects).
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <loadproperties srcFile="project.properties" />
+
+ <!-- quick check on sdk.dir -->
+ <fail
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+ unless="sdk.dir"
+ />
+
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
+
+ <!-- Import the actual build file.
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <import> task.
+ - customize it to your needs.
+ - Customize the whole content of build.xml
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, replacing the <import> task.
+ - customize to your needs.
+
+ ***********************
+ ****** IMPORTANT ******
+ ***********************
+ In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+ in order to avoid having your file be overridden by tools such as "android update project"
+ -->
+ <!-- version-tag: 1 -->
+ <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/BOOM
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/BOOM b/spec/fixtures/projects/native/android/cordova/BOOM
new file mode 100755
index 0000000..443502d
--- /dev/null
+++ b/spec/fixtures/projects/native/android/cordova/BOOM
@@ -0,0 +1,24 @@
+# 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.
+
+#!/bin/bash
+
+set -e
+
+CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd )
+
+bash $CORDOVA_PATH/cordova BOOM
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/appinfo.jar
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/appinfo.jar b/spec/fixtures/projects/native/android/cordova/appinfo.jar
new file mode 100644
index 0000000..1b41904
Binary files /dev/null and b/spec/fixtures/projects/native/android/cordova/appinfo.jar differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/clean
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/clean b/spec/fixtures/projects/native/android/cordova/clean
new file mode 100755
index 0000000..2a6bf96
--- /dev/null
+++ b/spec/fixtures/projects/native/android/cordova/clean
@@ -0,0 +1,24 @@
+# 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.
+
+#!/bin/bash
+
+set -e
+
+CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd )
+
+bash $CORDOVA_PATH/cordova clean
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/cordova
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/cordova b/spec/fixtures/projects/native/android/cordova/cordova
new file mode 100755
index 0000000..8159b33
--- /dev/null
+++ b/spec/fixtures/projects/native/android/cordova/cordova
@@ -0,0 +1,102 @@
+# 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.
+
+#!/bin/bash
+
+set -e
+
+PROJECT_PATH=$( cd "$( dirname "$0" )/.." && pwd )
+
+function check_devices {
+ local devices=`adb devices | awk '/List of devices attached/ { while(getline > 0) { print }}'`
+ if [ -z "$devices" ] ; then
+ echo "1"
+ else
+ echo "0"
+ fi
+}
+
+function emulate {
+ declare -a avd_list=($(android list avd | grep "Name:" | cut -f 2 -d ":" | xargs))
+ # we need to start adb-server
+ adb start-server 1>/dev/null
+
+ # Do not launch an emulator if there is already one running or if a device is attached
+ if [ $(check_devices) == 0 ] ; then
+ echo "Device attached or emulator already running"
+ return
+ fi
+
+ local avd_id="1000" #FIXME: hopefully user does not have 1000 AVDs
+ # User has no AVDs
+ if [ ${#avd_list[@]} == 0 ]
+ then
+ echo "You don't have any Android Virtual Devices. Please create at least one AVD."
+ echo "android"
+ fi
+ # User has only one AVD
+ if [ ${#avd_list[@]} == 1 ]
+ then
+ emulator -cpu-delay 0 -no-boot-anim -cache /tmp/cache -avd ${avd_list[0]} 1> /dev/null 2>&1 &
+ # User has more than 1 AVD
+ elif [ ${#avd_list[@]} -gt 1 ]
+ then
+ while [ -z ${avd_list[$avd_id]} ]
+ do
+ echo "Choose from one of the following Android Virtual Devices [0 to $((${#avd_list[@]}-1))]:"
+ for(( i = 0 ; i < ${#avd_list[@]} ; i++ ))
+ do
+ echo "$i) ${avd_list[$i]}"
+ done
+ echo -n "> "
+ read avd_id
+ done
+ emulator -cpu-delay 0 -no-boot-anim -cache /tmp/cache -avd ${avd_list[$avd_id]} 1> /dev/null 2>&1 &
+ fi
+
+}
+
+function clean {
+ ant clean
+}
+# has to be used independently and not in conjunction with other commands
+function log {
+ adb logcat
+}
+
+function debug {
+ if [ $(check_devices) == 0 ] ; then
+ ant debug install
+ else
+ ant debug
+ echo "##################################################################"
+ echo "# Plug in your device or launch an emulator with cordova/emulate #"
+ echo "##################################################################"
+ fi
+}
+
+function launch {
+ local launch_str=$(java -jar $PROJECT_PATH/cordova/appinfo.jar $PROJECT_PATH/AndroidManifest.xml)
+ adb shell am start -n $launch_str
+}
+
+function BOOM {
+ clean && debug && launch
+}
+
+# TODO parse arguments
+(cd $PROJECT_PATH && $1)
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/debug
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/debug b/spec/fixtures/projects/native/android/cordova/debug
new file mode 100755
index 0000000..b1e30c0
--- /dev/null
+++ b/spec/fixtures/projects/native/android/cordova/debug
@@ -0,0 +1,24 @@
+# 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.
+
+#!/bin/bash
+
+set -e
+
+CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd )
+
+bash $CORDOVA_PATH/cordova debug
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/emulate
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/emulate b/spec/fixtures/projects/native/android/cordova/emulate
new file mode 100755
index 0000000..5ba723a
--- /dev/null
+++ b/spec/fixtures/projects/native/android/cordova/emulate
@@ -0,0 +1,24 @@
+# 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.
+
+#!/bin/bash
+
+set -e
+
+CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd )
+
+bash $CORDOVA_PATH/cordova emulate
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/cordova/log
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/cordova/log b/spec/fixtures/projects/native/android/cordova/log
new file mode 100755
index 0000000..432a5c6
--- /dev/null
+++ b/spec/fixtures/projects/native/android/cordova/log
@@ -0,0 +1,24 @@
+# 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.
+
+#!/bin/bash
+
+set -e
+
+PROJECT_PATH=$( cd "$( dirname "$0" )/.." && pwd )
+
+bash $PROJECT_PATH/cordova/cordova log
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/libs/cordova-2.1.0.jar
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/libs/cordova-2.1.0.jar b/spec/fixtures/projects/native/android/libs/cordova-2.1.0.jar
new file mode 100644
index 0000000..b55476f
Binary files /dev/null and b/spec/fixtures/projects/native/android/libs/cordova-2.1.0.jar differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/local.properties
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/local.properties b/spec/fixtures/projects/native/android/local.properties
new file mode 100644
index 0000000..793d18c
--- /dev/null
+++ b/spec/fixtures/projects/native/android/local.properties
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked into Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=/Users/fil/SDKs/android-sdk-macosx
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/proguard-project.txt
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/proguard-project.txt b/spec/fixtures/projects/native/android/proguard-project.txt
new file mode 100644
index 0000000..f2fe155
--- /dev/null
+++ b/spec/fixtures/projects/native/android/proguard-project.txt
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/project.properties
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/project.properties b/spec/fixtures/projects/native/android/project.properties
new file mode 100644
index 0000000..e484b3c
--- /dev/null
+++ b/spec/fixtures/projects/native/android/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=Google Inc.:Google APIs:16
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-hdpi/ic_launcher.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-hdpi/ic_launcher.png b/spec/fixtures/projects/native/android/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..96a442e
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-hdpi/ic_launcher.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-hdpi/icon.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-hdpi/icon.png b/spec/fixtures/projects/native/android/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..4d27634
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-hdpi/icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-ldpi/ic_launcher.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-ldpi/ic_launcher.png b/spec/fixtures/projects/native/android/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 0000000..9923872
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-ldpi/ic_launcher.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-ldpi/icon.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-ldpi/icon.png b/spec/fixtures/projects/native/android/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..cd5032a
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-ldpi/icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-mdpi/ic_launcher.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-mdpi/ic_launcher.png b/spec/fixtures/projects/native/android/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..359047d
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-mdpi/ic_launcher.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-mdpi/icon.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-mdpi/icon.png b/spec/fixtures/projects/native/android/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..e79c606
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-mdpi/icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-xhdpi/ic_launcher.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-xhdpi/ic_launcher.png b/spec/fixtures/projects/native/android/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..71c6d76
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-xhdpi/ic_launcher.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable-xhdpi/icon.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable-xhdpi/icon.png b/spec/fixtures/projects/native/android/res/drawable-xhdpi/icon.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable-xhdpi/icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/drawable/icon.png
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/drawable/icon.png b/spec/fixtures/projects/native/android/res/drawable/icon.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/spec/fixtures/projects/native/android/res/drawable/icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/layout/main.xml
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/layout/main.xml b/spec/fixtures/projects/native/android/res/layout/main.xml
new file mode 100644
index 0000000..fed0c96
--- /dev/null
+++ b/spec/fixtures/projects/native/android/res/layout/main.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Hello World, cordovaExample"
+ />
+</LinearLayout>
+
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/values/strings.xml
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/values/strings.xml b/spec/fixtures/projects/native/android/res/values/strings.xml
new file mode 100644
index 0000000..867cc1f
--- /dev/null
+++ b/spec/fixtures/projects/native/android/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">cordovaExample</string>
+</resources>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/res/xml/config.xml
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/res/xml/config.xml b/spec/fixtures/projects/native/android/res/xml/config.xml
new file mode 100644
index 0000000..1117f8d
--- /dev/null
+++ b/spec/fixtures/projects/native/android/res/xml/config.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<cordova>
+ <!--
+ access elements control the Android whitelist.
+ Domains are assumed blocked unless set otherwise
+ -->
+
+ <access origin="http://127.0.0.1*"/> <!-- allow local pages -->
+
+ <!-- <access origin="https://example.com" /> allow any secure requests to example.com -->
+ <!-- <access origin="https://example.com" subdomains="true" /> such as above, but including subdomains, such as www -->
+ <access origin=".*"/>
+
+ <log level="DEBUG"/>
+ <preference name="useBrowserHistory" value="false" />
+ <preference name="exit-on-suspend" value="false" />
+<plugins>
+ <plugin name="App" value="org.apache.cordova.App"/>
+ <plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
+ <plugin name="Device" value="org.apache.cordova.Device"/>
+ <plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
+ <plugin name="Compass" value="org.apache.cordova.CompassListener"/>
+ <plugin name="Media" value="org.apache.cordova.AudioHandler"/>
+ <plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
+ <plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
+ <plugin name="File" value="org.apache.cordova.FileUtils"/>
+ <plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
+ <plugin name="Notification" value="org.apache.cordova.Notification"/>
+ <plugin name="Storage" value="org.apache.cordova.Storage"/>
+ <plugin name="Temperature" value="org.apache.cordova.TempListener"/>
+ <plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
+ <plugin name="Capture" value="org.apache.cordova.Capture"/>
+ <plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
+ <plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
+ <plugin name="Echo" value="org.apache.cordova.Echo" />
+ <plugin name="Globalization" value="org.apache.cordova.Globalization"/>
+</plugins>
+</cordova>
+
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/native/android/src/org/apache/cordova/example/cordovaExample.java
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/native/android/src/org/apache/cordova/example/cordovaExample.java b/spec/fixtures/projects/native/android/src/org/apache/cordova/example/cordovaExample.java
new file mode 100644
index 0000000..56b8dd3
--- /dev/null
+++ b/spec/fixtures/projects/native/android/src/org/apache/cordova/example/cordovaExample.java
@@ -0,0 +1,35 @@
+/*
+ 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.
+ */
+
+package org.apache.cordova.example;
+
+import android.app.Activity;
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class cordovaExample extends DroidGap
+{
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ super.loadUrl("file:///android_asset/www/index.html");
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/fixtures/projects/test/www/config.xml
----------------------------------------------------------------------
diff --git a/spec/fixtures/projects/test/www/config.xml b/spec/fixtures/projects/test/www/config.xml
new file mode 100644
index 0000000..ef2dfd9
--- /dev/null
+++ b/spec/fixtures/projects/test/www/config.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="com.phonegap.hello-world" version="2.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
 <name>bond. james bond.</name></widget>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/metadata/.android_parser.spec.js.swp
----------------------------------------------------------------------
diff --git a/spec/metadata/.android_parser.spec.js.swp b/spec/metadata/.android_parser.spec.js.swp
new file mode 100644
index 0000000..11f10db
Binary files /dev/null and b/spec/metadata/.android_parser.spec.js.swp differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/android_parser.spec.js b/spec/metadata/android_parser.spec.js
new file mode 100644
index 0000000..ea3e89e
--- /dev/null
+++ b/spec/metadata/android_parser.spec.js
@@ -0,0 +1,54 @@
+var android_parser = require('../../src/metadata/android_parser'),
+ config_parser = require('../../src/config_parser'),
+ path = require('path'),
+ fs = require('fs'),
+ et = require('elementtree'),
+ cfg_path = path.join(__dirname, '..', 'fixtures', 'projects', 'test', 'www', 'config.xml'),
+ android_path = path.join(__dirname, '..', 'fixtures', 'projects', 'native', 'android'),
+ android_strings = path.join(android_path, 'res', 'values', 'strings.xml');
+
+var cwd = process.cwd();
+
+var original_strings = fs.readFileSync(android_strings, 'utf-8');
+
+describe('android project parser', function() {
+ it('should throw an exception with a path that is not a native android project', function() {
+ expect(function() {
+ var project = new android_parser(cwd);
+ }).toThrow();
+ });
+ it('should accept a proper native android project path as construction parameter', function() {
+ var project;
+ expect(function() {
+ project = new android_parser(android_path);
+ }).not.toThrow();
+ expect(project).toBeDefined();
+ });
+
+ describe('update_from_config method', function() {
+ var project, config;
+
+ beforeEach(function() {
+ project = new android_parser(android_path);
+ config = new config_parser(cfg_path);
+ });
+ afterEach(function() {
+ fs.writeFileSync(android_strings, original_strings, 'utf-8');
+ });
+ it('should throw an exception if a non config_parser object is passed into it', function() {
+ expect(function() {
+ project.update_from_config({});
+ }).toThrow();
+ });
+ it('should update the application name properly', function() {
+ config.name('bond. james bond.');
+ project.update_from_config(config);
+
+ var strings = new et.ElementTree(et.XML(fs.readFileSync(android_strings, 'utf-8')));
+ var app_name = strings.find('string[@name="app_name"]').text;
+
+ expect(app_name).toBe('bond. james bond.');
+ });
+ it('should update the application package name properly');
+ });
+});
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c3017bc5/spec/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/ios_parser.spec.js b/spec/metadata/ios_parser.spec.js
new file mode 100644
index 0000000..e69de29