Updating the project so that the activities are clearly separated from Test and Helper code

This commit is contained in:
Joe Bowser 2012-11-02 16:15:51 -07:00
parent cf494f3238
commit 69f11a29e1
37 changed files with 6781 additions and 85 deletions

View File

@ -59,24 +59,17 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".CordovaWebViewTestActivity" >
android:name=".actions.CordovaWebViewTestActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="tests" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".JailActivity" >
android:name=".actions.backbbuttonmultipage" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@ -86,8 +79,8 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".CordovaDriverAction" >
<intent-filter >
android:name=".actions.background" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
@ -96,62 +89,171 @@
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".CordovaActivity" >
android:name=".actions.basicauth" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="splashscreen" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.CordovaActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="timeout" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.CordovaDriverAction" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="htmlnotfound" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.errorurl" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="errorurl" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="userwebview" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.htmlnotfound" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="menus" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.iframe" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="loading" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.jqmtabbackbutton" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="lifecycle" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.lifecycle" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="jqmtabbackbutton" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.loading" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="backbuttonmultipage" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.menus" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="whitelist" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.splashscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="background" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.tests" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="iframe" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.timeout" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="xhr" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.userwebview" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="basicauth" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.whitelist" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="fullscreen" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
</activity>
<activity android:name="backgroundcolor" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<activity
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:name=".actions.xhr" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
</application>
</manifest>

File diff suppressed because it is too large Load Diff

View File

@ -45,24 +45,24 @@
<h4>Cordova Version: <span id="cordova">&nbsp;</span></h4>
</div>
<div id="info">
<h4>Run each of the tests below:</h4>
<h4>Run each of the test activities below:</h4>
</div>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.jqmtabbackbutton');">Backbutton jQM tab</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.backbuttonmultipage');">Backbutton with multiple pages</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.backgroundcolor');">Background Color</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.basicauth');">Basic Authentication</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.errorurl');">Error URL</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.fullscreen');">Full Screen</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.htmlnotfound');">HTML not found</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.iframe');">IFrame</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.lifecycle');">Lifecycle</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.loading');">Loading indicator</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.menus');">Menus</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.background');">No multitasking</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.splashscreen');">Splash screen</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.timeout');">Load timeout</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.userwebview');">User WebView/Client/Chrome</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.whitelist');">Whitelist</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.xhr');">XHR</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.jqmtabbackbutton');">Backbutton jQM tab</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.backbuttonmultipage');">Backbutton with multiple pages</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.backgroundcolor');">Background Color</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.basicauth');">Basic Authentication</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.errorurl');">Error URL</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.fullscreen');">Full Screen</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.htmlnotfound');">HTML not found</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.iframe');">IFrame</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.lifecycle');">Lifecycle</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.loading');">Loading indicator</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.menus');">Menus</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.background');">No multitasking</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.splashscreen');">Splash screen</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.timeout');">Load timeout</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.userwebview');">User WebView/Client/Chrome</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.whitelist');">Whitelist</button>
<button class="btn large" onclick="startActivity('org.apache.cordova.test.actions.xhr');">XHR</button>
</body>
</html>

56
test/res/xml/config.xml Normal file
View File

@ -0,0 +1,56 @@
<?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="true" />
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Activity" value="org.apache.cordova.test.ActivityPlugin"/>
<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" />
</plugins>
</cordova>

View File

@ -22,6 +22,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.test.actions.backbuttonmultipage;
import android.test.ActivityInstrumentationTestCase2;
import android.view.KeyEvent;

View File

@ -21,6 +21,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.api.PluginManager;
import org.apache.cordova.test.actions.CordovaActivity;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;

View File

@ -20,6 +20,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.api.PluginManager;
import org.apache.cordova.test.actions.CordovaWebViewTestActivity;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;

View File

@ -22,6 +22,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.test.actions.errorurl;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.FrameLayout;

View File

@ -22,6 +22,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaChromeClient;
import org.apache.cordova.api.PluginManager;
import org.apache.cordova.test.actions.CordovaWebViewTestActivity;
import android.content.Context;
import android.content.res.AssetManager;

View File

@ -22,6 +22,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.test.actions.htmlnotfound;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.FrameLayout;

View File

@ -21,6 +21,8 @@ package org.apache.cordova.test;
*/
import org.apache.cordova.test.actions.iframe;
import android.test.ActivityInstrumentationTestCase2;
public class IFrameTest extends ActivityInstrumentationTestCase2<iframe> {

View File

@ -21,6 +21,8 @@ package org.apache.cordova.test;
*/
import org.apache.cordova.test.actions.jqmtabbackbutton;
import android.test.ActivityInstrumentationTestCase2;
public class JQMTabTest extends ActivityInstrumentationTestCase2<jqmtabbackbutton> {

View File

@ -21,6 +21,8 @@ package org.apache.cordova.test;
*/
import org.apache.cordova.test.actions.lifecycle;
import android.test.ActivityInstrumentationTestCase2;
public class LifecycleTest extends ActivityInstrumentationTestCase2<lifecycle> {

View File

@ -21,6 +21,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.api.PluginManager;
import org.apache.cordova.test.actions.CordovaWebViewTestActivity;
import android.test.ActivityInstrumentationTestCase2;
import android.view.View;

View File

@ -22,6 +22,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.test.actions.splashscreen;
import android.app.Dialog;
import android.test.ActivityInstrumentationTestCase2;

View File

@ -24,6 +24,7 @@ package org.apache.cordova.test;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaWebViewClient;
import org.apache.cordova.CordovaChromeClient;
import org.apache.cordova.test.actions.userwebview;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.FrameLayout;

View File

@ -21,6 +21,8 @@ package org.apache.cordova.test;
*/
import org.apache.cordova.test.actions.xhr;
import android.test.ActivityInstrumentationTestCase2;
public class XhrTest extends ActivityInstrumentationTestCase2<xhr> {

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import org.apache.cordova.DroidGap;

View File

@ -17,7 +17,7 @@
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import java.util.concurrent.ExecutorService;

View File

@ -17,7 +17,7 @@
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -25,6 +25,9 @@ import java.util.concurrent.Executors;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.api.CordovaInterface;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.test.R;
import org.apache.cordova.test.R.id;
import org.apache.cordova.test.R.layout;
import android.app.Activity;
import android.content.Context;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import android.view.ContextMenu;

View File

@ -16,10 +16,12 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;
import org.apache.cordova.test.R;
import org.apache.cordova.test.R.drawable;
public class splashscreen extends DroidGap {
@Override

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import android.webkit.WebView;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import android.webkit.WebView;

View File

@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova.test;
package org.apache.cordova.test.actions;
import android.os.Bundle;
import org.apache.cordova.*;