cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [08/50] [abbrv] CB-5302: Massive movement to get tests working again
Date Wed, 22 Jan 2014 19:38:19 GMT
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/XhrTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/XhrTest.java b/test/src/org/apache/cordova/test/XhrTest.java
deleted file mode 100644
index 7c3ed9f..0000000
--- a/test/src/org/apache/cordova/test/XhrTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.apache.cordova.test;
-/*
- *
- * 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.
- *
-*/
-
-
-import org.apache.cordova.test.actions.xhr;
-
-import android.test.ActivityInstrumentationTestCase2;
-
-public class XhrTest extends ActivityInstrumentationTestCase2<xhr> {
-
-  public XhrTest()
-  {
-    super(xhr.class);
-  }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/CordovaActivity.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/CordovaActivity.java b/test/src/org/apache/cordova/test/actions/CordovaActivity.java
deleted file mode 100644
index f709737..0000000
--- a/test/src/org/apache/cordova/test/actions/CordovaActivity.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-       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.test.actions;
-
-import org.apache.cordova.DroidGap;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class CordovaActivity extends DroidGap {
-    /** Called when the activity is first created. */
-    @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/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/CordovaDriverAction.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/CordovaDriverAction.java b/test/src/org/apache/cordova/test/actions/CordovaDriverAction.java
deleted file mode 100644
index 2021346..0000000
--- a/test/src/org/apache/cordova/test/actions/CordovaDriverAction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-       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.test.actions;
-
-import java.util.concurrent.ExecutorService;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-
-import com.amazon.android.webkit.AmazonWebKitFactories;
-import com.amazon.android.webkit.AmazonWebKitFactory;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-
-
-public class CordovaDriverAction extends Activity implements CordovaInterface {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-    }
-
-    public void startActivityForResult(CordovaPlugin command, Intent intent,
-            int requestCode) {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void setActivityResultCallback(CordovaPlugin plugin) {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public Activity getActivity() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Deprecated
-    public Context getContext() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Deprecated
-    public void cancelLoadUrl() {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public Object onMessage(String id, Object data) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public ExecutorService getThreadPool() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public AmazonWebKitFactory getFactory() {
-        return AmazonWebKitFactories.getDefaultFactory();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/CordovaWebViewTestActivity.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/CordovaWebViewTestActivity.java b/test/src/org/apache/cordova/test/actions/CordovaWebViewTestActivity.java
deleted file mode 100644
index b96e48f..0000000
--- a/test/src/org/apache/cordova/test/actions/CordovaWebViewTestActivity.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-       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.test.actions;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-import org.apache.cordova.test.R;
-import org.apache.cordova.test.R.id;
-import org.apache.cordova.test.R.layout;
-
-import com.amazon.android.webkit.AmazonWebKitFactories;
-import com.amazon.android.webkit.AmazonWebKitFactory;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-
-public class CordovaWebViewTestActivity extends Activity implements CordovaInterface {
-    public CordovaWebView cordovaWebView;
-
-    private final ExecutorService threadPool = Executors.newCachedThreadPool();
-    
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        setContentView(R.layout.main);
-
-        cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView);
-
-        cordovaWebView.loadUrl("file:///android_asset/www/index.html");
-
-    }
-
-    public Context getContext() {
-        return this;
-    }
-
-    public void startActivityForResult(CordovaPlugin command, Intent intent,
-            int requestCode) {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void setActivityResultCallback(CordovaPlugin plugin) {
-        // TODO Auto-generated method stub
-        
-    }
-
-    //Note: This must always return an activity!
-    public Activity getActivity() {
-        return this;
-    }
-
-    @Deprecated
-    public void cancelLoadUrl() {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public Object onMessage(String id, Object data) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public ExecutorService getThreadPool() {
-        // TODO Auto-generated method stub
-        return threadPool;
-    }
-    
-    @Override
-    /**
-     * The final call you receive before your activity is destroyed.
-     */
-    public void onDestroy() {
-        super.onDestroy();
-        if (cordovaWebView != null) {
-            // Send destroy event to JavaScript
-            cordovaWebView.handleDestroy();
-        }
-    }
-
-    @Override
-    public AmazonWebKitFactory getFactory() {
-        return AmazonWebKitFactories.getDefaultFactory();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/backbuttonmultipage.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/backbuttonmultipage.java b/test/src/org/apache/cordova/test/actions/backbuttonmultipage.java
deleted file mode 100755
index 3b90484..0000000
--- a/test/src/org/apache/cordova/test/actions/backbuttonmultipage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class backbuttonmultipage extends DroidGap {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.loadUrl("file:///android_asset/www/backbuttonmultipage/index.html");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/background.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/background.java b/test/src/org/apache/cordova/test/actions/background.java
deleted file mode 100755
index 47c6bc7..0000000
--- a/test/src/org/apache/cordova/test/actions/background.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-
-import org.apache.cordova.*;
-
-public class background extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        //super.init(new FixWebView(this), new CordovaWebViewClient(this), new CordovaChromeClient(this));
-        super.setBooleanProperty("keepRunning", false);
-        super.loadUrl("file:///android_asset/www/background/index.html");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/backgroundcolor.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/backgroundcolor.java b/test/src/org/apache/cordova/test/actions/backgroundcolor.java
deleted file mode 100755
index d501824..0000000
--- a/test/src/org/apache/cordova/test/actions/backgroundcolor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-       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.test.actions;
-
-import android.graphics.Color;
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class backgroundcolor extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        // Properties must be set before init() is called, since some are processed during init().
-
-        // backgroundColor can also be set in cordova.xml, but you must use the number equivalent of the color.  For example, Color.RED is
-        //      <preference name="backgroundColor" value="-65536" />
-        super.setIntegerProperty("backgroundColor", Color.GREEN);
-
-        super.init();
-        super.loadUrl("file:///android_asset/www/backgroundcolor/index.html");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/basicauth.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/basicauth.java b/test/src/org/apache/cordova/test/actions/basicauth.java
deleted file mode 100755
index ad739c9..0000000
--- a/test/src/org/apache/cordova/test/actions/basicauth.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class basicauth extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-
-        // LogCat: onReceivedHttpAuthRequest(browserspy.dk:80,BrowserSpy.dk - HTTP Password Test)
-        AuthenticationToken token = new AuthenticationToken();
-        token.setUserName("test");
-        token.setPassword("test");
-        super.setAuthenticationToken(token, "browserspy.dk:80", "BrowserSpy.dk - HTTP Password Test");
-
-        // Add web site to whitelist
-        Config.init();
-        Config.addWhiteListEntry("http://browserspy.dk*", true);
-
-        // Load test
-        super.loadUrl("file:///android_asset/www/basicauth/index.html");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/errorurl.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/errorurl.java b/test/src/org/apache/cordova/test/actions/errorurl.java
deleted file mode 100755
index 8015c4f..0000000
--- a/test/src/org/apache/cordova/test/actions/errorurl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class errorurl extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-        this.setStringProperty("errorUrl", "file:///android_asset/www/htmlnotfound/error.html");
-        super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/fullscreen.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/fullscreen.java b/test/src/org/apache/cordova/test/actions/fullscreen.java
deleted file mode 100755
index 60726ad..0000000
--- a/test/src/org/apache/cordova/test/actions/fullscreen.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class fullscreen extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        // Properties must be set before init() is called, since some are processed during init(). 
-
-        // fullscreen can also be set in cordova.xml.  For example, 
-        //      <preference name="fullscreen" value="true" />
-        super.setBooleanProperty("fullscreen", true);
-
-        super.init();
-        super.loadUrl("file:///android_asset/www/fullscreen/index.html");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/htmlnotfound.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/htmlnotfound.java b/test/src/org/apache/cordova/test/actions/htmlnotfound.java
deleted file mode 100755
index da849e0..0000000
--- a/test/src/org/apache/cordova/test/actions/htmlnotfound.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class htmlnotfound extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-        super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/iframe.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/iframe.java b/test/src/org/apache/cordova/test/actions/iframe.java
deleted file mode 100755
index 3398aa4..0000000
--- a/test/src/org/apache/cordova/test/actions/iframe.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class iframe extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.loadUrl("file:///android_asset/www/iframe/index.html");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/lifecycle.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/lifecycle.java b/test/src/org/apache/cordova/test/actions/lifecycle.java
deleted file mode 100755
index 8419b0e..0000000
--- a/test/src/org/apache/cordova/test/actions/lifecycle.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class lifecycle extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.loadUrl("file:///android_asset/www/lifecycle/index.html");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/loading.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/loading.java b/test/src/org/apache/cordova/test/actions/loading.java
deleted file mode 100755
index 4c52c9f..0000000
--- a/test/src/org/apache/cordova/test/actions/loading.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class loading extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.setStringProperty("loadingDialog", "Testing,Loading...");
-        super.loadUrl("http://www.google.com");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/menus.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/menus.java b/test/src/org/apache/cordova/test/actions/menus.java
deleted file mode 100755
index c4cb674..0000000
--- a/test/src/org/apache/cordova/test/actions/menus.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import android.view.ContextMenu;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ContextMenu.ContextMenuInfo;
-
-import org.apache.cordova.*;
-import org.apache.cordova.LOG;
-
-public class menus extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-        super.registerForContextMenu(super.appView);
-        super.loadUrl("file:///android_asset/www/menus/index.html");
-    }
-
-    // Demonstrate how to add your own menus to app
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        super.onCreateOptionsMenu(menu);
-        int base = Menu.FIRST;
-        // Group, item id, order, title
-        menu.add(base, base, base, "Item1");
-        menu.add(base, base + 1, base + 1, "Item2");
-        menu.add(base, base + 2, base + 2, "Item3");
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        LOG.d("menus", "Item " + item.getItemId() + " pressed.");
-        this.appView.loadUrl("javascript:alert('Menu " + item.getItemId() + " pressed.')");
-        return super.onOptionsItemSelected(item);
-    }
-
-    @Override
-    public boolean onPrepareOptionsMenu(Menu menu) {
-        LOG.d("menus", "onPrepareOptionsMenu()");
-        // this.appView.loadUrl("javascript:alert('onPrepareOptionsMenu()')");
-        return true;
-    }
-
-    @Override
-    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo info) {
-        LOG.d("menus", "onCreateContextMenu()");
-        menu.setHeaderTitle("Test Context Menu");
-        menu.add(200, 200, 200, "Context Item1");
-    }
-
-    @Override
-    public boolean onContextItemSelected(MenuItem item) {
-        this.appView.loadUrl("javascript:alert('Context Menu " + item.getItemId() + " pressed.')");
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/splashscreen.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/splashscreen.java b/test/src/org/apache/cordova/test/actions/splashscreen.java
deleted file mode 100755
index 3d924e0..0000000
--- a/test/src/org/apache/cordova/test/actions/splashscreen.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-       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.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
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-
-        // Show splashscreen
-        this.setIntegerProperty("splashscreen", R.drawable.sandy);
-
-        super.loadUrl("file:///android_asset/www/splashscreen/index.html", 2000);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/tests.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/tests.java b/test/src/org/apache/cordova/test/actions/tests.java
deleted file mode 100755
index bc326e3..0000000
--- a/test/src/org/apache/cordova/test/actions/tests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class tests extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-        //super.pluginManager.addService("Activity", "org.apache.cordova.test.ActivityPlugin");
-        super.loadUrl("file:///android_asset/www/index.html");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/timeout.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/timeout.java b/test/src/org/apache/cordova/test/actions/timeout.java
deleted file mode 100755
index 22c0881..0000000
--- a/test/src/org/apache/cordova/test/actions/timeout.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class timeout extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init();
-
-        // Short timeout to cause error
-        this.setIntegerProperty("loadUrlTimeoutValue", 10);
-        super.loadUrl("http://www.google.com");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/userwebview.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/userwebview.java b/test/src/org/apache/cordova/test/actions/userwebview.java
deleted file mode 100755
index 2beb793..0000000
--- a/test/src/org/apache/cordova/test/actions/userwebview.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import com.amazon.android.webkit.AmazonGeolocationPermissions.Callback;
-import org.apache.cordova.*;
-
-import com.amazon.android.webkit.AmazonWebView;
-
-public class userwebview extends DroidGap {
-    
-    public TestViewClient testViewClient;
-    public TestChromeClient testChromeClient;
-    
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        testViewClient = new TestViewClient(this);
-        testChromeClient = new TestChromeClient(this);
-        super.init(new CordovaWebView(this), new TestViewClient(this), new TestChromeClient(this));
-        super.loadUrl("file:///android_asset/www/userwebview/index.html");
-    }
-
-    public class TestChromeClient extends CordovaChromeClient {
-        public TestChromeClient(DroidGap arg0) {
-            super(arg0);
-            LOG.d("userwebview", "TestChromeClient()");
-        }
-
-        public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
-            LOG.d("userwebview", "onGeolocationPermissionsShowPrompt(" + origin + ")");
-            super.onGeolocationPermissionsShowPrompt(origin, callback);
-            callback.invoke(origin, true, false);
-        }
-    }
-
-    /**
-     * This class can be used to override the GapViewClient and receive notification of webview events.
-     */
-    public class TestViewClient extends CordovaWebViewClient {
-        public TestViewClient(DroidGap arg0) {
-            super(arg0);
-            LOG.d("userwebview", "TestViewClient()");
-        }
-        
-        @Override
-        public boolean shouldOverrideUrlLoading(AmazonWebView view, String url) {
-            LOG.d("userwebview", "shouldOverrideUrlLoading(" + url + ")");
-            return super.shouldOverrideUrlLoading(view, url);
-        }
-        
-        @Override
-        public void onReceivedError(AmazonWebView view, int errorCode, String description, String failingUrl) {
-            LOG.d("userwebview", "onReceivedError: Error code=" + errorCode + " Description=" + description + " URL=" + failingUrl);
-            super.onReceivedError(view, errorCode, description, failingUrl);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/whitelist.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/whitelist.java b/test/src/org/apache/cordova/test/actions/whitelist.java
deleted file mode 100755
index 85a4dcb..0000000
--- a/test/src/org/apache/cordova/test/actions/whitelist.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-
-import org.apache.cordova.*;
-
-import com.amazon.android.webkit.AmazonWebView;
-
-public class whitelist extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.init(new CordovaWebView(this), new TestViewClient(this), new CordovaChromeClient(this));
-        super.loadUrl("file:///android_asset/www/whitelist/index.html");
-    }
-
-    /**
-     * This class can be used to override the GapViewClient and receive notification of webview events.
-     */
-    public class TestViewClient extends CordovaWebViewClient {
-
-        public TestViewClient(DroidGap arg0) {
-            super(arg0);
-        }
-        
-        @Override
-        public boolean shouldOverrideUrlLoading(AmazonWebView view, String url) {
-            LOG.d("whitelist", "shouldOverrideUrlLoading(" + url + ")");
-            LOG.d("whitelist", "originalUrl=" + view.getOriginalUrl());
-            return super.shouldOverrideUrlLoading(view, url);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/actions/xhr.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/actions/xhr.java b/test/src/org/apache/cordova/test/actions/xhr.java
deleted file mode 100755
index 3695c11..0000000
--- a/test/src/org/apache/cordova/test/actions/xhr.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-       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.test.actions;
-
-import android.os.Bundle;
-import org.apache.cordova.*;
-
-public class xhr extends DroidGap {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        super.loadUrl("file:///android_asset/www/xhr/index.html");
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/backbuttonmultipage.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/backbuttonmultipage.java b/test/src/org/apache/cordova/test/backbuttonmultipage.java
new file mode 100755
index 0000000..8457235
--- /dev/null
+++ b/test/src/org/apache/cordova/test/backbuttonmultipage.java
@@ -0,0 +1,31 @@
+/*
+       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.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class backbuttonmultipage extends DroidGap {
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        super.loadUrl("file:///android_asset/www/backbuttonmultipage/index.html");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/background.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/background.java b/test/src/org/apache/cordova/test/background.java
new file mode 100755
index 0000000..7a0ba89
--- /dev/null
+++ b/test/src/org/apache/cordova/test/background.java
@@ -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.
+ */
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+
+import org.apache.cordova.*;
+
+public class background extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        //super.init(new FixWebView(this), new CordovaWebViewClient(this), new CordovaChromeClient(this));
+        super.setBooleanProperty("keepRunning", false);
+        super.loadUrl("file:///android_asset/www/background/index.html");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/backgroundcolor.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/backgroundcolor.java b/test/src/org/apache/cordova/test/backgroundcolor.java
new file mode 100755
index 0000000..f40a673
--- /dev/null
+++ b/test/src/org/apache/cordova/test/backgroundcolor.java
@@ -0,0 +1,40 @@
+/*
+       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.test;
+
+import android.graphics.Color;
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class backgroundcolor extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Properties must be set before init() is called, since some are processed during init().
+
+        // backgroundColor can also be set in cordova.xml, but you must use the number equivalent of the color.  For example, Color.RED is
+        //      <preference name="backgroundColor" value="-65536" />
+        super.setIntegerProperty("backgroundColor", Color.GREEN);
+
+        super.init();
+        super.loadUrl("file:///android_asset/www/backgroundcolor/index.html");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/basicauth.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/basicauth.java b/test/src/org/apache/cordova/test/basicauth.java
new file mode 100755
index 0000000..1b09f3d
--- /dev/null
+++ b/test/src/org/apache/cordova/test/basicauth.java
@@ -0,0 +1,44 @@
+/*
+       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.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class basicauth extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        super.init();
+
+        // LogCat: onReceivedHttpAuthRequest(browserspy.dk:80,BrowserSpy.dk - HTTP Password Test)
+        AuthenticationToken token = new AuthenticationToken();
+        token.setUserName("test");
+        token.setPassword("test");
+        super.setAuthenticationToken(token, "browserspy.dk:80", "BrowserSpy.dk - HTTP Password Test");
+
+        // Add web site to whitelist
+        Config.init();
+        Config.addWhiteListEntry("http://browserspy.dk*", true);
+
+        // Load test
+        super.loadUrl("file:///android_asset/www/basicauth/index.html");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/errorurl.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/errorurl.java b/test/src/org/apache/cordova/test/errorurl.java
new file mode 100755
index 0000000..c271076
--- /dev/null
+++ b/test/src/org/apache/cordova/test/errorurl.java
@@ -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.
+*/
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class errorurl extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        super.init();
+        this.setStringProperty("errorUrl", "file:///android_asset/www/htmlnotfound/error.html");
+        super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/fullscreen.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/fullscreen.java b/test/src/org/apache/cordova/test/fullscreen.java
new file mode 100755
index 0000000..7fcd79b
--- /dev/null
+++ b/test/src/org/apache/cordova/test/fullscreen.java
@@ -0,0 +1,39 @@
+/*
+       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.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class fullscreen extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Properties must be set before init() is called, since some are processed during init(). 
+
+        // fullscreen can also be set in cordova.xml.  For example, 
+        //      <preference name="fullscreen" value="true" />
+        super.setBooleanProperty("fullscreen", true);
+
+        super.init();
+        super.loadUrl("file:///android_asset/www/fullscreen/index.html");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/htmlnotfound.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/htmlnotfound.java b/test/src/org/apache/cordova/test/htmlnotfound.java
new file mode 100755
index 0000000..4551ca3
--- /dev/null
+++ b/test/src/org/apache/cordova/test/htmlnotfound.java
@@ -0,0 +1,31 @@
+/*
+       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.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class htmlnotfound extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        super.init();
+        super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/iframe.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/iframe.java b/test/src/org/apache/cordova/test/iframe.java
new file mode 100755
index 0000000..de854fc
--- /dev/null
+++ b/test/src/org/apache/cordova/test/iframe.java
@@ -0,0 +1,30 @@
+/*
+       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.test;
+
+import android.os.Bundle;
+import org.apache.cordova.*;
+
+public class iframe extends DroidGap {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        super.loadUrl("file:///android_asset/www/iframe/index.html");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/junit/BackButtonMultiPageTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/junit/BackButtonMultiPageTest.java b/test/src/org/apache/cordova/test/junit/BackButtonMultiPageTest.java
new file mode 100644
index 0000000..e1c9a28
--- /dev/null
+++ b/test/src/org/apache/cordova/test/junit/BackButtonMultiPageTest.java
@@ -0,0 +1,170 @@
+package org.apache.cordova.test.junit;
+
+/*
+ *
+ * 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.
+ *
+ */
+
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.test.backbuttonmultipage;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.inputmethod.BaseInputConnection;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+
+public class BackButtonMultiPageTest extends
+		ActivityInstrumentationTestCase2<backbuttonmultipage> {
+
+	private int TIMEOUT = 1000;
+	backbuttonmultipage testActivity;
+	private FrameLayout containerView;
+	private LinearLayout innerContainer;
+	private CordovaWebView testView;
+
+	private AmazonWebViewOnUiThread mUiThread;
+
+	public BackButtonMultiPageTest() {
+		super("org.apache.cordova.test", backbuttonmultipage.class);
+	}
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		testActivity = this.getActivity();
+		// Sleep to make sure main page is properly loaded
+		sleep();
+		containerView = (FrameLayout) testActivity
+				.findViewById(android.R.id.content);
+		innerContainer = (LinearLayout) containerView.getChildAt(0);
+		testView = (CordovaWebView) innerContainer.getChildAt(0);
+		mUiThread = new AmazonWebViewOnUiThread(this, testView);
+	}
+
+	public void testPreconditions() {
+		assertNotNull(innerContainer);
+		assertNotNull(testView);
+	}
+
+	public void testViaHref() {
+		testView.sendJavascript("window.location = 'sample2.html';");
+		sleep();
+		String url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		testView.sendJavascript("window.location = 'sample3.html';");
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample3.html"));
+		boolean didGoBack = mUiThread.backHistory();
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		assertTrue(didGoBack);
+		didGoBack = mUiThread.backHistory();
+		sleep();
+		url = mUiThread.getUrl();		
+		assertTrue(url.endsWith("index.html"));
+		assertTrue(didGoBack);
+	}
+
+	public void testViaLoadUrl() {
+		testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample2.html");
+		sleep();
+		String url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample3.html"));
+		boolean didGoBack = mUiThread.backHistory();
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		assertTrue(didGoBack);
+		didGoBack = mUiThread.backHistory();
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("index.html"));
+		assertTrue(didGoBack);
+	}
+
+	public void testViaBackButtonOnView() {
+		testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample2.html");
+		sleep();
+		String url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample3.html"));
+		BaseInputConnection viewConnection = new BaseInputConnection(testView,
+				true);
+		KeyEvent backDown = new KeyEvent(KeyEvent.ACTION_DOWN,
+				KeyEvent.KEYCODE_BACK);
+		KeyEvent backUp = new KeyEvent(KeyEvent.ACTION_UP,
+				KeyEvent.KEYCODE_BACK);
+		viewConnection.sendKeyEvent(backDown);
+		viewConnection.sendKeyEvent(backUp);
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		viewConnection.sendKeyEvent(backDown);
+		viewConnection.sendKeyEvent(backUp);
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("index.html"));
+	}
+
+	public void testViaBackButtonOnLayout() {
+		testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample2.html");
+		sleep();
+		String url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample3.html"));
+		BaseInputConnection viewConnection = new BaseInputConnection(
+				containerView, true);
+		KeyEvent backDown = new KeyEvent(KeyEvent.ACTION_DOWN,
+				KeyEvent.KEYCODE_BACK);
+		KeyEvent backUp = new KeyEvent(KeyEvent.ACTION_UP,
+				KeyEvent.KEYCODE_BACK);
+		viewConnection.sendKeyEvent(backDown);
+		viewConnection.sendKeyEvent(backUp);
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("sample2.html"));
+		viewConnection.sendKeyEvent(backDown);
+		viewConnection.sendKeyEvent(backUp);
+		sleep();
+		url = mUiThread.getUrl();
+		assertTrue(url.endsWith("index.html"));
+	}
+
+	private void sleep() {
+		try {
+			Thread.sleep(TIMEOUT);
+		} catch (InterruptedException e) {
+			fail("Unexpected Timeout");
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/junit/CordovaActivityTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/junit/CordovaActivityTest.java b/test/src/org/apache/cordova/test/junit/CordovaActivityTest.java
new file mode 100644
index 0000000..a2bbb07
--- /dev/null
+++ b/test/src/org/apache/cordova/test/junit/CordovaActivityTest.java
@@ -0,0 +1,96 @@
+/*
+       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.test.junit;
+
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.PluginManager;
+import org.apache.cordova.test.CordovaActivity;
+
+import android.app.Instrumentation;
+import android.test.ActivityInstrumentationTestCase2;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+
+public class CordovaActivityTest extends ActivityInstrumentationTestCase2<CordovaActivity> {
+
+    private CordovaActivity testActivity;
+    private FrameLayout containerView;
+    private LinearLayout innerContainer;
+    private CordovaWebView testView;
+    private Instrumentation mInstr;
+    private int TIMEOUT = 1000;
+    
+    @SuppressWarnings("deprecation")
+    public CordovaActivityTest()
+    {
+        super("org.apache.cordova.test",CordovaActivity.class);
+    }
+    
+    protected void setUp() throws Exception {
+        super.setUp();
+        mInstr = this.getInstrumentation();
+        testActivity = this.getActivity();
+        containerView = (FrameLayout) testActivity.findViewById(android.R.id.content);
+        innerContainer = (LinearLayout) containerView.getChildAt(0);
+        testView = (CordovaWebView) innerContainer.getChildAt(0);
+        
+    }
+    
+    public void testPreconditions(){
+        assertNotNull(innerContainer);
+        assertNotNull(testView);
+    }
+    
+
+    public void testForCordovaView() {
+        String className = testView.getClass().getSimpleName();
+        assertTrue(className.equals("CordovaWebView"));
+    }
+    
+    public void testForLinearLayout() {
+        String className = innerContainer.getClass().getSimpleName();
+        assertTrue(className.equals("LinearLayoutSoftKeyboardDetect"));
+    }
+    
+
+    public void testPauseAndResume() throws Throwable
+    {
+        runTestOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mInstr.callActivityOnPause(testActivity);
+                sleep();
+                assertTrue(testView.isPaused());
+                mInstr.callActivityOnResume(testActivity);
+                sleep();
+                assertFalse(testView.isPaused());
+            }
+        });
+
+    }
+    
+    private void sleep() {
+        try {
+          Thread.sleep(TIMEOUT);
+        } catch (InterruptedException e) {
+          fail("Unexpected Timeout");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/junit/CordovaResourceApiTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/junit/CordovaResourceApiTest.java b/test/src/org/apache/cordova/test/junit/CordovaResourceApiTest.java
new file mode 100644
index 0000000..4ed4b88
--- /dev/null
+++ b/test/src/org/apache/cordova/test/junit/CordovaResourceApiTest.java
@@ -0,0 +1,282 @@
+
+package org.apache.cordova.test.junit;
+
+/*
+ *
+ * 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.
+ *
+ */
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.Environment;
+import android.provider.MediaStore;
+import android.test.ActivityInstrumentationTestCase2;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaResourceApi;
+import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.PluginEntry;
+import org.apache.cordova.test.CordovaWebViewTestActivity;
+import org.apache.cordova.test.R;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Scanner;
+
+public class CordovaResourceApiTest extends ActivityInstrumentationTestCase2<CordovaWebViewTestActivity> {
+
+    public CordovaResourceApiTest()
+    {
+        super(CordovaWebViewTestActivity.class);
+    }
+
+    CordovaWebView cordovaWebView;
+    CordovaResourceApi resourceApi;
+
+    private CordovaWebViewTestActivity activity;
+    String execPayload;
+    Integer execStatus;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        activity = this.getActivity();
+        cordovaWebView = activity.cordovaWebView;
+        resourceApi = cordovaWebView.getResourceApi();
+        resourceApi.setThreadCheckingEnabled(false);
+        cordovaWebView.pluginManager.addService(new PluginEntry("CordovaResourceApiTestPlugin1", new CordovaPlugin() {
+            @Override
+            public Uri remapUri(Uri uri) {
+                if (uri.getQuery() != null && uri.getQuery().contains("pluginRewrite")) {
+                    return cordovaWebView.getResourceApi().remapUri(
+                            Uri.parse("data:text/plain;charset=utf-8,pass"));
+                }
+                return null;
+            }
+            public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+                synchronized (CordovaResourceApiTest.this) {
+                    execPayload = args.getString(0);
+                    execStatus = args.getInt(1);
+                    CordovaResourceApiTest.this.notify();
+                }
+                return true;
+            }
+        }));
+    }
+
+    private Uri createTestImageContentUri() {
+        Bitmap imageBitmap = BitmapFactory.decodeResource(activity.getResources(), R.drawable.icon);
+        String stored = MediaStore.Images.Media.insertImage(activity.getContentResolver(),
+                imageBitmap, "app-icon", "desc");
+        return Uri.parse(stored);
+    }
+
+    private void performApiTest(Uri uri, String expectedMimeType, File expectedLocalFile,
+            boolean expectRead, boolean expectWrite) throws IOException {
+        uri = resourceApi.remapUri(uri);
+        assertEquals(expectedLocalFile, resourceApi.mapUriToFile(uri));
+        
+        try {
+            OpenForReadResult readResult = resourceApi.openForRead(uri);
+            String mimeType2 = resourceApi.getMimeType(uri);
+            assertEquals("openForRead mime-type", expectedMimeType, readResult.mimeType);
+            assertEquals("getMimeType mime-type", expectedMimeType, mimeType2);
+            readResult.inputStream.read();
+            if (!expectRead) {
+                fail("Expected getInputStream to throw.");
+            }
+        } catch (IOException e) {
+            if (expectRead) {
+                throw e;
+            }
+        }
+        try {
+            OutputStream outStream = resourceApi.openOutputStream(uri);
+            outStream.write(123);
+            if (!expectWrite) {
+                fail("Expected getOutputStream to throw.");
+            }
+            outStream.close();
+        } catch (IOException e) {
+            if (expectWrite) {
+                throw e;
+            }
+        }
+    }
+
+    public void testValidContentUri() throws IOException
+    {
+        Uri contentUri = createTestImageContentUri();
+        File localFile = resourceApi.mapUriToFile(contentUri);
+        assertNotNull(localFile);
+        performApiTest(contentUri, "image/jpeg", localFile, true, true);
+    }
+
+    public void testInvalidContentUri() throws IOException
+    {
+        Uri contentUri = Uri.parse("content://media/external/images/media/999999999");
+        performApiTest(contentUri, null, null, false, false);
+    }
+
+    public void testValidAssetUri() throws IOException
+    {
+        Uri assetUri = Uri.parse("file:///android_asset/www/index.html?foo#bar"); // Also check for stripping off ? and # correctly.
+        performApiTest(assetUri, "text/html", null, true, false);
+    }
+
+    public void testInvalidAssetUri() throws IOException
+    {
+        Uri assetUri = Uri.parse("file:///android_asset/www/missing.html");
+        performApiTest(assetUri, "text/html", null, false, false);
+    }
+
+    public void testFileUriToExistingFile() throws IOException
+    {
+        File f = File.createTempFile("te s t", ".txt"); // Also check for dealing with spaces.
+        try {
+            Uri fileUri = Uri.parse(f.toURI().toString() + "?foo#bar"); // Also check for stripping off ? and # correctly.
+            performApiTest(fileUri, "text/plain", f, true, true);
+        } finally {
+            f.delete();
+        }
+    }
+
+    public void testFileUriToMissingFile() throws IOException
+    {
+        File f = new File(Environment.getExternalStorageDirectory() + "/somefilethatdoesntexist");
+        Uri fileUri = Uri.parse(f.toURI().toString());
+        try {
+            performApiTest(fileUri, null, f, false, true);
+        } finally {
+            f.delete();
+        }
+    }
+    
+    public void testFileUriToMissingFileWithMissingParent() throws IOException
+    {
+        File f = new File(Environment.getExternalStorageDirectory() + "/somedirthatismissing" + System.currentTimeMillis() + "/somefilethatdoesntexist");
+        Uri fileUri = Uri.parse(f.toURI().toString());
+        performApiTest(fileUri, null, f, false, true);
+    }
+
+    public void testUnrecognizedUri() throws IOException
+    {
+        Uri uri = Uri.parse("somescheme://foo");
+        performApiTest(uri, null, null, false, false);
+    }
+
+    public void testRelativeUri()
+    {
+        try {
+            resourceApi.openForRead(Uri.parse("/foo"));
+            fail("Should have thrown for relative URI 1.");
+        } catch (Throwable t) {
+        }
+        try {
+            resourceApi.openForRead(Uri.parse("//foo/bar"));
+            fail("Should have thrown for relative URI 2.");
+        } catch (Throwable t) {
+        }
+        try {
+            resourceApi.openForRead(Uri.parse("foo.png"));
+            fail("Should have thrown for relative URI 3.");
+        } catch (Throwable t) {
+        }
+    }
+    
+    public void testPluginOverride() throws IOException
+    {
+        Uri uri = Uri.parse("plugin-uri://foohost/android_asset/www/index.html?pluginRewrite=yes");
+        performApiTest(uri, "text/plain", null, true, false);
+    }
+
+    public void testMainThreadUsage() throws IOException
+    {
+        Uri assetUri = Uri.parse("file:///android_asset/www/index.html");
+        resourceApi.setThreadCheckingEnabled(true);
+        try {
+            resourceApi.openForRead(assetUri);
+            fail("Should have thrown for main thread check.");
+        } catch (Throwable t) {
+        }
+    }
+    
+    
+    public void testDataUriPlain() throws IOException
+    {
+        Uri uri = Uri.parse("data:text/plain;charset=utf-8,pa%20ss");
+        OpenForReadResult readResult = resourceApi.openForRead(uri);
+        assertEquals("text/plain", readResult.mimeType);
+        String data = new Scanner(readResult.inputStream, "UTF-8").useDelimiter("\\A").next();
+        assertEquals("pa ss", data);
+    }
+    
+    public void testDataUriBase64() throws IOException
+    {
+        Uri uri = Uri.parse("data:text/js;charset=utf-8;base64,cGFzcw==");
+        OpenForReadResult readResult = resourceApi.openForRead(uri);
+        assertEquals("text/js", readResult.mimeType);
+        String data = new Scanner(readResult.inputStream, "UTF-8").useDelimiter("\\A").next();
+        assertEquals("pass", data);
+    }
+    
+    public void testWebViewRequestIntercept() throws IOException
+    {
+        cordovaWebView.sendJavascript(
+            "var x = new XMLHttpRequest;\n" +
+            "x.open('GET', 'file://foo?pluginRewrite=1', false);\n" + 
+            "x.send();\n" + 
+            "cordova.require('cordova/exec')(null,null,'CordovaResourceApiTestPlugin1', 'foo', [x.responseText, x.status])");
+        
+        execPayload = null;
+        execStatus = null;
+        try {
+            synchronized (this) {
+                this.wait(2000);
+            }
+        } catch (InterruptedException e) {
+        }
+        assertEquals("pass", execPayload);
+        assertEquals(execStatus.intValue(), 200);
+    }
+    
+    public void testWebViewWhiteListRejection() throws IOException
+    {
+        cordovaWebView.sendJavascript(
+            "var x = new XMLHttpRequest;\n" +
+            "x.open('GET', 'http://foo/bar', false);\n" + 
+            "x.send();\n" + 
+            "cordova.require('cordova/exec')(null,null,'CordovaResourceApiTestPlugin1', 'foo', [x.responseText, x.status])");
+        execPayload = null;
+        execStatus = null;
+        try {
+            synchronized (this) {
+                this.wait(2000);
+            }
+        } catch (InterruptedException e) {
+        }
+        assertEquals("", execPayload);
+        assertEquals(execStatus.intValue(), 404);
+    }    
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/junit/CordovaTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/junit/CordovaTest.java b/test/src/org/apache/cordova/test/junit/CordovaTest.java
new file mode 100644
index 0000000..02f4ee6
--- /dev/null
+++ b/test/src/org/apache/cordova/test/junit/CordovaTest.java
@@ -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.
+*/
+package org.apache.cordova.test.junit;
+
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.PluginManager;
+import org.apache.cordova.test.CordovaWebViewTestActivity;
+import org.apache.cordova.test.R;
+
+import android.app.Instrumentation;
+import android.test.ActivityInstrumentationTestCase2;
+import android.view.View;
+
+public class CordovaTest extends
+    ActivityInstrumentationTestCase2<CordovaWebViewTestActivity> {
+
+  private static final long TIMEOUT = 1000;
+  private CordovaWebViewTestActivity testActivity;
+  private View testView;
+  private String rString;
+
+  public CordovaTest() {
+    super("org.apache.cordova.test.activities", CordovaWebViewTestActivity.class);
+  }
+
+  protected void setUp() throws Exception {
+    super.setUp();
+    testActivity = this.getActivity();
+    testView = testActivity.findViewById(R.id.cordovaWebView);
+  }
+
+  public void testPreconditions() {
+    assertNotNull(testView);
+  }
+
+  public void testForCordovaView() {
+    //Sleep for no reason!!!!
+    sleep();
+    String className = testView.getClass().getSimpleName();
+    assertTrue(className.equals("CordovaWebView"));
+  }
+
+  /*
+  public void testForPluginManager() {
+    CordovaWebView v = (CordovaWebView) testView;
+    PluginManager p = v.getPluginManager();
+    assertNotNull(p);
+    String className = p.getClass().getSimpleName();
+    assertTrue(className.equals("PluginManager"));
+  }
+
+  public void testBackButton() {
+    CordovaWebView v = (CordovaWebView) testView;
+    assertFalse(v.checkBackKey());
+  }
+
+  public void testLoadUrl() {
+    CordovaWebView v = (CordovaWebView) testView;
+    v.loadUrlIntoView("file:///android_asset/www/index.html");
+    sleep();
+    String url = v.getUrl();
+    boolean result = url.equals("file:///android_asset/www/index.html");
+    assertTrue(result);
+    int visible = v.getVisibility();
+    assertTrue(visible == View.VISIBLE);
+  }
+
+  public void testBackHistoryFalse() {
+    CordovaWebView v = (CordovaWebView) testView;
+    // Move back in the history
+    boolean test = v.backHistory();
+    assertFalse(test);
+  }
+
+  // Make sure that we can go back
+  public void testBackHistoryTrue() {
+    this.testLoadUrl();
+    CordovaWebView v = (CordovaWebView) testView;
+    v.loadUrlIntoView("file:///android_asset/www/compass/index.html");
+    sleep();
+    String url = v.getUrl();
+    assertTrue(url.equals("file:///android_asset/www/compass/index.html"));
+    // Move back in the history
+    boolean test = v.backHistory();
+    assertTrue(test);
+    sleep();
+    url = v.getUrl();
+    assertTrue(url.equals("file:///android_asset/www/index.html"));
+  }
+  */
+  
+
+  private void sleep() {
+    try {
+      Thread.sleep(TIMEOUT);
+    } catch (InterruptedException e) {
+      fail("Unexpected Timeout");
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f768066d/test/src/org/apache/cordova/test/junit/ErrorUrlTest.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/junit/ErrorUrlTest.java b/test/src/org/apache/cordova/test/junit/ErrorUrlTest.java
new file mode 100644
index 0000000..c04804d
--- /dev/null
+++ b/test/src/org/apache/cordova/test/junit/ErrorUrlTest.java
@@ -0,0 +1,79 @@
+package org.apache.cordova.test.junit;
+
+/*
+ *
+ * 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.
+ *
+ */
+
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.test.errorurl;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+
+public class ErrorUrlTest extends ActivityInstrumentationTestCase2<errorurl> {
+
+	private int TIMEOUT = 1000;
+	errorurl testActivity;
+	private FrameLayout containerView;
+	private LinearLayout innerContainer;
+	private CordovaWebView testView;
+
+	private AmazonWebViewOnUiThread mUiThread;
+
+	public ErrorUrlTest() {
+		super("org.apache.cordova.test", errorurl.class);
+	}
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		testActivity = this.getActivity();
+		containerView = (FrameLayout) testActivity
+				.findViewById(android.R.id.content);
+		innerContainer = (LinearLayout) containerView.getChildAt(0);
+		testView = (CordovaWebView) innerContainer.getChildAt(0);
+		mUiThread = new AmazonWebViewOnUiThread(this, testView);
+	}
+
+	public void testPreconditions() {
+		assertNotNull(innerContainer);
+		assertNotNull(testView);
+	}
+
+	// This will fail for AWV because the current url on a wrong page will
+	// return the URL used to load
+	public void testUrl() {
+		mUiThread.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
+		sleep();
+		String good_url = "file:///android_asset/www/error.html";
+		String url = mUiThread.getUrl();
+		assertNotNull(url);
+		assertTrue(url.equals(good_url));
+	}
+
+	private void sleep() {
+		try {
+			Thread.sleep(TIMEOUT);
+		} catch (InterruptedException e) {
+			fail("Unexpected Timeout");
+		}
+	}
+
+}


Mime
View raw message