Updated Branches: refs/heads/master 5cf95cfa0 -> 792aa78ae
Updating imports on all the tests Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/792aa78a Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/792aa78a Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/792aa78a Branch: refs/heads/master Commit: 792aa78aecb1d4a73033ae970cb44cd9b325db39 Parents: 5cf95cf Author: Joe Bowser <[email protected]> Authored: Thu Jul 11 15:04:24 2013 -0700 Committer: Joe Bowser <[email protected]> Committed: Thu Jul 11 15:04:24 2013 -0700 ---------------------------------------------------------------------- .../org/apache/cordova/test/ActivityPlugin.java | 8 +- .../org/apache/cordova/test/BlacklistTest.java | 87 ++++++++++++++++++++ .../cordova/test/CordovaActivityTest.java | 2 +- .../org/apache/cordova/test/CordovaTest.java | 2 +- .../org/apache/cordova/test/GapClientTest.java | 2 +- test/src/org/apache/cordova/test/MenuTest.java | 32 +++++++ .../apache/cordova/test/PluginManagerTest.java | 2 +- .../apache/cordova/test/UriResolversTest.java | 6 +- .../test/actions/CordovaDriverAction.java | 4 +- .../actions/CordovaWebViewTestActivity.java | 6 +- .../org/apache/cordova/test/actions/menus.java | 2 +- .../cordova/test/actions/userwebview.java | 2 +- .../apache/cordova/test/actions/whitelist.java | 2 +- 13 files changed, 138 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/ActivityPlugin.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/ActivityPlugin.java b/test/src/org/apache/cordova/test/ActivityPlugin.java index 0c1d1da..19a50a2 100755 --- a/test/src/org/apache/cordova/test/ActivityPlugin.java +++ b/test/src/org/apache/cordova/test/ActivityPlugin.java @@ -19,15 +19,15 @@ package org.apache.cordova.test; import org.apache.cordova.CordovaArgs; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; import org.json.JSONArray; import org.json.JSONException; import android.content.Intent; -import org.apache.cordova.api.CallbackContext; -import org.apache.cordova.api.CordovaPlugin; -import org.apache.cordova.api.PluginResult; +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.PluginResult; /** * This class provides a service. http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/BlacklistTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/BlacklistTest.java b/test/src/org/apache/cordova/test/BlacklistTest.java new file mode 100644 index 0000000..d71e84c --- /dev/null +++ b/test/src/org/apache/cordova/test/BlacklistTest.java @@ -0,0 +1,87 @@ +/* + 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 org.apache.cordova.CordovaWebView; +import org.apache.cordova.test.actions.CordovaActivity; +import org.apache.cordova.test.actions.backbuttonmultipage; + +import android.app.Instrumentation; +import android.test.ActivityInstrumentationTestCase2; +import android.widget.FrameLayout; +import android.widget.LinearLayout; + +public class BlacklistTest extends ActivityInstrumentationTestCase2<CordovaActivity> { + + private int TIMEOUT = 1000; + private Instrumentation mInstr; + private CordovaActivity testActivity; + private FrameLayout containerView; + private LinearLayout innerContainer; + private CordovaWebView testView; + + public BlacklistTest() + { + super("org.apache.cordova.test", CordovaActivity.class); + } + + public BlacklistTest(Class<CordovaActivity> activityClass) { + super(activityClass); + } + + + 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 testWhitelist(){ + testView.loadUrl("http://cordova.apache.org"); + sleep(); + String url = testView.getUrl(); + assertTrue(url.equals("http://cordova.apache.org")); + } + + public void testBlacklist() + { + testView.loadUrl("http://phonegap.com"); + sleep(); + String url = testView.getUrl(); + assertTrue(url.equals("http://phonegap.com")); + } + + private void sleep() { + try { + Thread.sleep(TIMEOUT); + } catch (InterruptedException e) { + fail("Unexpected Timeout"); + } + } +} http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/CordovaActivityTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/CordovaActivityTest.java b/test/src/org/apache/cordova/test/CordovaActivityTest.java index efb80c1..a100f0a 100644 --- a/test/src/org/apache/cordova/test/CordovaActivityTest.java +++ b/test/src/org/apache/cordova/test/CordovaActivityTest.java @@ -20,7 +20,7 @@ package org.apache.cordova.test; import org.apache.cordova.CordovaWebView; -import org.apache.cordova.api.PluginManager; +import org.apache.cordova.PluginManager; import org.apache.cordova.test.actions.CordovaActivity; import android.app.Instrumentation; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/CordovaTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/CordovaTest.java b/test/src/org/apache/cordova/test/CordovaTest.java index 8dd409c..0e11b68 100644 --- a/test/src/org/apache/cordova/test/CordovaTest.java +++ b/test/src/org/apache/cordova/test/CordovaTest.java @@ -19,7 +19,7 @@ package org.apache.cordova.test; import org.apache.cordova.CordovaWebView; -import org.apache.cordova.api.PluginManager; +import org.apache.cordova.PluginManager; import org.apache.cordova.test.actions.CordovaWebViewTestActivity; import android.app.Instrumentation; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/GapClientTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/GapClientTest.java b/test/src/org/apache/cordova/test/GapClientTest.java index b9b113b..a3c2a62 100644 --- a/test/src/org/apache/cordova/test/GapClientTest.java +++ b/test/src/org/apache/cordova/test/GapClientTest.java @@ -21,7 +21,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.PluginManager; import org.apache.cordova.test.actions.CordovaWebViewTestActivity; import android.content.Context; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/MenuTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/MenuTest.java b/test/src/org/apache/cordova/test/MenuTest.java new file mode 100644 index 0000000..1486cca --- /dev/null +++ b/test/src/org/apache/cordova/test/MenuTest.java @@ -0,0 +1,32 @@ +/* + 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 org.apache.cordova.test.actions.menus; + +import android.test.ActivityInstrumentationTestCase2; + +public class MenuTest extends ActivityInstrumentationTestCase2<menus> { + + public MenuTest() { + super("org.apache.cordova.test", menus.class); + } + +} http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/PluginManagerTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/PluginManagerTest.java b/test/src/org/apache/cordova/test/PluginManagerTest.java index d322e6c..c767e7d 100644 --- a/test/src/org/apache/cordova/test/PluginManagerTest.java +++ b/test/src/org/apache/cordova/test/PluginManagerTest.java @@ -20,7 +20,7 @@ package org.apache.cordova.test; import org.apache.cordova.CordovaWebView; -import org.apache.cordova.api.PluginManager; +import org.apache.cordova.PluginManager; import org.apache.cordova.test.actions.CordovaWebViewTestActivity; import android.test.ActivityInstrumentationTestCase2; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/test/src/org/apache/cordova/test/UriResolversTest.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/UriResolversTest.java b/test/src/org/apache/cordova/test/UriResolversTest.java index 21584b9..bf2fd63 100644 --- a/test/src/org/apache/cordova/test/UriResolversTest.java +++ b/test/src/org/apache/cordova/test/UriResolversTest.java @@ -25,9 +25,9 @@ package org.apache.cordova.test; import org.apache.cordova.CordovaWebView; import org.apache.cordova.UriResolver; import org.apache.cordova.UriResolvers; -import org.apache.cordova.api.CallbackContext; -import org.apache.cordova.api.CordovaPlugin; -import org.apache.cordova.api.PluginEntry; +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.PluginEntry; import org.apache.cordova.test.actions.CordovaWebViewTestActivity; import org.json.JSONArray; import org.json.JSONException; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/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 index e6156ec..2e5d740 100644 --- a/test/src/org/apache/cordova/test/actions/CordovaDriverAction.java +++ b/test/src/org/apache/cordova/test/actions/CordovaDriverAction.java @@ -21,8 +21,8 @@ package org.apache.cordova.test.actions; import java.util.concurrent.ExecutorService; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.CordovaPlugin; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; import android.app.Activity; import android.content.Context; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/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 index 3be5ab2..02d4b8d 100644 --- a/test/src/org/apache/cordova/test/actions/CordovaWebViewTestActivity.java +++ b/test/src/org/apache/cordova/test/actions/CordovaWebViewTestActivity.java @@ -23,9 +23,9 @@ import java.util.concurrent.ExecutorService; 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.api.LOG; +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; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/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 index e567905..c4cb674 100755 --- a/test/src/org/apache/cordova/test/actions/menus.java +++ b/test/src/org/apache/cordova/test/actions/menus.java @@ -26,7 +26,7 @@ import android.view.View; import android.view.ContextMenu.ContextMenuInfo; import org.apache.cordova.*; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; public class menus extends DroidGap { @Override http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/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 index 84320f4..305a2e9 100755 --- a/test/src/org/apache/cordova/test/actions/userwebview.java +++ b/test/src/org/apache/cordova/test/actions/userwebview.java @@ -23,7 +23,7 @@ import android.webkit.WebView; import android.webkit.GeolocationPermissions.Callback; import org.apache.cordova.*; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; public class userwebview extends DroidGap { http://git-wip-us.apache.org/repos/asf/cordova-android/blob/792aa78a/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 index 57a0723..7d5a51a 100755 --- a/test/src/org/apache/cordova/test/actions/whitelist.java +++ b/test/src/org/apache/cordova/test/actions/whitelist.java @@ -22,7 +22,7 @@ import android.os.Bundle; import android.webkit.WebView; import org.apache.cordova.*; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; public class whitelist extends DroidGap { @Override
