Loading build/mobile/robocop/Actions.java.in +0 −8 Original line number Diff line number Diff line Loading @@ -39,9 +39,6 @@ package @ANDROID_PACKAGE_NAME@; import java.util.List; import java.util.ArrayList; import android.database.Cursor; public interface Actions { Loading Loading @@ -95,9 +92,4 @@ public interface Actions { void sendSpecialKey(SpecialKey key); void drag(int startingX, int endingX, int startingY, int endingY); /** * Run a sql query on the specified database */ public Cursor querySql(String dbPath, String sql); } build/mobile/robocop/FennecMochitestAssert.java.in +23 −44 Original line number Diff line number Diff line Loading @@ -166,13 +166,21 @@ public class FennecMochitestAssert implements Assert { } public void is(Object a, Object b, String name) { boolean pass = checkObjectsEqual(a,b); ok(pass, name, getEqualString(a,b, pass)); boolean pass = a.equals(b); String diag = "got " + a.toString() + ", expected " + b.toString(); if (pass) { diag = a.toString() + " should equal " + b.toString(); } ok(pass, name, diag); } public void isnot(Object a, Object b, String name) { boolean pass = checkObjectsNotEqual(a,b); ok(pass, name, getNotEqualString(a,b,pass)); boolean pass = !a.equals(b); String diag = "didn't expect " + a.toString() + ", but got it"; if (pass) { diag = a.toString() + " should not equal " + b.toString(); } ok(pass, name, diag); } public void ispixel(int actual, int r, int g, int b, String name) { Loading @@ -199,50 +207,21 @@ public class FennecMochitestAssert implements Assert { } public void todo_is(Object a, Object b, String name) { boolean pass = checkObjectsEqual(a,b); todo(pass, name, getEqualString(a,b,pass)); } public void todo_isnot(Object a, Object b, String name) { boolean pass = checkObjectsNotEqual(a,b); todo(pass, name, getNotEqualString(a,b,pass)); } private boolean checkObjectsEqual(Object a, Object b) { if (a == null || b == null) { if (a == null && b == null) { return true; } return false; } else { return a.equals(b); } } private String getEqualString(Object a, Object b, boolean pass) { boolean pass = a.equals(b); String diag = "got " + a.toString() + ", expected " + b.toString(); if (pass) { return a + " should equal " + b; } return "got " + a + ", expected " + b; } private boolean checkObjectsNotEqual(Object a, Object b) { if (a == null || b == null) { if ((a == null && b != null) || (a != null && b == null)) { return true; } else { return false; } } else { return !a.equals(b); diag = a.toString() + " should equal " + b.toString(); } todo(pass, name, diag); } private String getNotEqualString(Object a, Object b, boolean pass) { public void todo_isnot(Object a, Object b, String name) { boolean pass = !a.equals(b); String diag = "didn't expect " + a.toString() + ", but got it"; if (pass) { return a + " should not equal " + b; diag = a.toString() + " should not equal " + b.toString(); } return "didn't expect " + a + ", but got it"; todo(pass, name, diag); } public void info(String name, String message) { Loading build/mobile/robocop/FennecNativeActions.java.in +2 −40 Original line number Diff line number Diff line Loading @@ -40,24 +40,19 @@ package @ANDROID_PACKAGE_NAME@; import java.lang.Class; import java.lang.ClassLoader; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.lang.reflect.InvocationHandler; import java.lang.Long; import java.util.concurrent.SynchronousQueue; import java.util.ArrayList; import android.app.Activity; import android.content.Context; import android.app.Instrumentation; import android.database.Cursor; import android.os.SystemClock; import android.view.View; import android.view.KeyEvent; import android.util.Log; import java.util.concurrent.SynchronousQueue; import org.json.*; Loading @@ -79,7 +74,6 @@ public class FennecNativeActions implements Actions { private Method mSendGE; private Method mGetLayerClient; private Method mSetDrawListener; private static final String LOGTAG = "FennecNativeActions"; public FennecNativeActions(Activity activity, Solo robocop, Instrumentation instrumentation) { mSolo = robocop; Loading Loading @@ -355,36 +349,4 @@ public class FennecNativeActions implements Actions { public void drag(int startingX, int endingX, int startingY, int endingY) { mSolo.drag(startingX, endingX, startingY, endingY, 10); } public Cursor querySql(String dbPath, String sql) { try { ClassLoader classLoader = mGeckoApp.getClassLoader(); Class sqlClass = classLoader.loadClass("org.mozilla.gecko.sqlite.SQLiteBridge"); Class stringClass = String.class; Class stringArrayClass = String[].class; Class appshell = classLoader.loadClass("org.mozilla.gecko.GeckoAppShell"); Class contextClass = Context.class; Constructor bridgeConstructor = sqlClass.getConstructor(stringClass); Method query = sqlClass.getMethod("rawQuery", stringClass, stringArrayClass); Method loadSQLiteLibs = appshell.getMethod("loadSQLiteLibs", contextClass, stringClass); Object bridge = bridgeConstructor.newInstance(dbPath); String resourcePath = mGeckoApp.getApplication().getPackageResourcePath(); loadSQLiteLibs.invoke(null, mGeckoApp, resourcePath); return (Cursor)query.invoke(bridge, sql, null); } catch(ClassNotFoundException ex) { Log.e(LOGTAG, "Error getting class", ex); } catch(NoSuchMethodException ex) { Log.e(LOGTAG, "Error getting method", ex); } catch(InvocationTargetException ex) { Log.e(LOGTAG, "Error invoking method", ex); } catch(InstantiationException ex) { Log.e(LOGTAG, "Error calling constructor", ex); } catch(IllegalAccessException ex) { Log.e(LOGTAG, "Error using field", ex); } return null; } } mobile/android/base/AndroidManifest.xml.in +2 −13 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"/> #ifdef MOZ_WEBSMS_BACKEND <!-- WebSMS --> Loading Loading @@ -117,13 +116,6 @@ </intent-filter> </receiver> <receiver android:name="org.mozilla.gecko.GeckoMessageReceiver" android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"> <intent-filter> <action android:name="org.mozilla.gecko.INIT_PW"></action> </intent-filter> </receiver> <activity android:name="Restarter" android:process="@ANDROID_PACKAGE_NAME@Restarter" android:theme="@style/Gecko" Loading Loading @@ -179,8 +171,8 @@ <provider android:name="@ANDROID_PACKAGE_NAME@.db.PasswordsProvider" android:authorities="@ANDROID_PACKAGE_NAME@.db.passwords" android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER" android:process="org.mozilla.gecko.PasswordsProvider"/> android:permission="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER" android:protectionLevel="signature"/> <provider android:name="@ANDROID_PACKAGE_NAME@.db.FormHistoryProvider" android:authorities="@ANDROID_PACKAGE_NAME@.db.formhistory" Loading @@ -197,9 +189,6 @@ <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER" android:protectionLevel="signature"/> <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER" android:protectionLevel="signature"/> <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.FORMHISTORY_PROVIDER" android:protectionLevel="signature"/> Loading mobile/android/base/GeckoApp.java +6 −3 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ abstract public class GeckoApp public static final String ACTION_BOOKMARK = "org.mozilla.gecko.BOOKMARK"; public static final String ACTION_LOAD = "org.mozilla.gecko.LOAD"; public static final String ACTION_UPDATE = "org.mozilla.gecko.UPDATE"; public static final String ACTION_INIT_PW = "org.mozilla.gecko.INIT_PW"; public static final String SAVED_STATE_URI = "uri"; public static final String SAVED_STATE_TITLE = "title"; public static final String SAVED_STATE_VIEWPORT = "viewport"; Loading @@ -122,6 +121,7 @@ abstract public class GeckoApp public static SurfaceView cameraView; public static GeckoApp mAppContext; public static boolean mDOMFullScreen = false; public static File sGREDir = null; public static Menu sMenu; private static GeckoThread sGeckoThread = null; public GeckoAppHandler mMainHandler; Loading Loading @@ -1616,7 +1616,7 @@ abstract public class GeckoApp enableStrictMode(); } GeckoAppShell.loadMozGlue(); System.loadLibrary("mozglue"); mMainHandler = new GeckoAppHandler(); Log.w(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - onCreate"); if (savedInstanceState != null) { Loading Loading @@ -1687,6 +1687,9 @@ abstract public class GeckoApp mBrowserToolbar.updateTabCount(1); } if (sGREDir == null) sGREDir = new File(this.getApplicationInfo().dataDir); Uri data = intent.getData(); if (data != null && "http".equals(data.getScheme()) && isHostOnPrefetchWhitelist(data.getHost())) { Loading Loading @@ -2510,7 +2513,7 @@ abstract public class GeckoApp fileExt = name.substring(period); fileName = name.substring(0, period); } File file = File.createTempFile(fileName, fileExt, GeckoAppShell.getGREDir(GeckoApp.mAppContext)); File file = File.createTempFile(fileName, fileExt, sGREDir); FileOutputStream fos = new FileOutputStream(file); InputStream is = cr.openInputStream(uri); Loading Loading
build/mobile/robocop/Actions.java.in +0 −8 Original line number Diff line number Diff line Loading @@ -39,9 +39,6 @@ package @ANDROID_PACKAGE_NAME@; import java.util.List; import java.util.ArrayList; import android.database.Cursor; public interface Actions { Loading Loading @@ -95,9 +92,4 @@ public interface Actions { void sendSpecialKey(SpecialKey key); void drag(int startingX, int endingX, int startingY, int endingY); /** * Run a sql query on the specified database */ public Cursor querySql(String dbPath, String sql); }
build/mobile/robocop/FennecMochitestAssert.java.in +23 −44 Original line number Diff line number Diff line Loading @@ -166,13 +166,21 @@ public class FennecMochitestAssert implements Assert { } public void is(Object a, Object b, String name) { boolean pass = checkObjectsEqual(a,b); ok(pass, name, getEqualString(a,b, pass)); boolean pass = a.equals(b); String diag = "got " + a.toString() + ", expected " + b.toString(); if (pass) { diag = a.toString() + " should equal " + b.toString(); } ok(pass, name, diag); } public void isnot(Object a, Object b, String name) { boolean pass = checkObjectsNotEqual(a,b); ok(pass, name, getNotEqualString(a,b,pass)); boolean pass = !a.equals(b); String diag = "didn't expect " + a.toString() + ", but got it"; if (pass) { diag = a.toString() + " should not equal " + b.toString(); } ok(pass, name, diag); } public void ispixel(int actual, int r, int g, int b, String name) { Loading @@ -199,50 +207,21 @@ public class FennecMochitestAssert implements Assert { } public void todo_is(Object a, Object b, String name) { boolean pass = checkObjectsEqual(a,b); todo(pass, name, getEqualString(a,b,pass)); } public void todo_isnot(Object a, Object b, String name) { boolean pass = checkObjectsNotEqual(a,b); todo(pass, name, getNotEqualString(a,b,pass)); } private boolean checkObjectsEqual(Object a, Object b) { if (a == null || b == null) { if (a == null && b == null) { return true; } return false; } else { return a.equals(b); } } private String getEqualString(Object a, Object b, boolean pass) { boolean pass = a.equals(b); String diag = "got " + a.toString() + ", expected " + b.toString(); if (pass) { return a + " should equal " + b; } return "got " + a + ", expected " + b; } private boolean checkObjectsNotEqual(Object a, Object b) { if (a == null || b == null) { if ((a == null && b != null) || (a != null && b == null)) { return true; } else { return false; } } else { return !a.equals(b); diag = a.toString() + " should equal " + b.toString(); } todo(pass, name, diag); } private String getNotEqualString(Object a, Object b, boolean pass) { public void todo_isnot(Object a, Object b, String name) { boolean pass = !a.equals(b); String diag = "didn't expect " + a.toString() + ", but got it"; if (pass) { return a + " should not equal " + b; diag = a.toString() + " should not equal " + b.toString(); } return "didn't expect " + a + ", but got it"; todo(pass, name, diag); } public void info(String name, String message) { Loading
build/mobile/robocop/FennecNativeActions.java.in +2 −40 Original line number Diff line number Diff line Loading @@ -40,24 +40,19 @@ package @ANDROID_PACKAGE_NAME@; import java.lang.Class; import java.lang.ClassLoader; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.lang.reflect.InvocationHandler; import java.lang.Long; import java.util.concurrent.SynchronousQueue; import java.util.ArrayList; import android.app.Activity; import android.content.Context; import android.app.Instrumentation; import android.database.Cursor; import android.os.SystemClock; import android.view.View; import android.view.KeyEvent; import android.util.Log; import java.util.concurrent.SynchronousQueue; import org.json.*; Loading @@ -79,7 +74,6 @@ public class FennecNativeActions implements Actions { private Method mSendGE; private Method mGetLayerClient; private Method mSetDrawListener; private static final String LOGTAG = "FennecNativeActions"; public FennecNativeActions(Activity activity, Solo robocop, Instrumentation instrumentation) { mSolo = robocop; Loading Loading @@ -355,36 +349,4 @@ public class FennecNativeActions implements Actions { public void drag(int startingX, int endingX, int startingY, int endingY) { mSolo.drag(startingX, endingX, startingY, endingY, 10); } public Cursor querySql(String dbPath, String sql) { try { ClassLoader classLoader = mGeckoApp.getClassLoader(); Class sqlClass = classLoader.loadClass("org.mozilla.gecko.sqlite.SQLiteBridge"); Class stringClass = String.class; Class stringArrayClass = String[].class; Class appshell = classLoader.loadClass("org.mozilla.gecko.GeckoAppShell"); Class contextClass = Context.class; Constructor bridgeConstructor = sqlClass.getConstructor(stringClass); Method query = sqlClass.getMethod("rawQuery", stringClass, stringArrayClass); Method loadSQLiteLibs = appshell.getMethod("loadSQLiteLibs", contextClass, stringClass); Object bridge = bridgeConstructor.newInstance(dbPath); String resourcePath = mGeckoApp.getApplication().getPackageResourcePath(); loadSQLiteLibs.invoke(null, mGeckoApp, resourcePath); return (Cursor)query.invoke(bridge, sql, null); } catch(ClassNotFoundException ex) { Log.e(LOGTAG, "Error getting class", ex); } catch(NoSuchMethodException ex) { Log.e(LOGTAG, "Error getting method", ex); } catch(InvocationTargetException ex) { Log.e(LOGTAG, "Error invoking method", ex); } catch(InstantiationException ex) { Log.e(LOGTAG, "Error calling constructor", ex); } catch(IllegalAccessException ex) { Log.e(LOGTAG, "Error using field", ex); } return null; } }
mobile/android/base/AndroidManifest.xml.in +2 −13 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"/> #ifdef MOZ_WEBSMS_BACKEND <!-- WebSMS --> Loading Loading @@ -117,13 +116,6 @@ </intent-filter> </receiver> <receiver android:name="org.mozilla.gecko.GeckoMessageReceiver" android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"> <intent-filter> <action android:name="org.mozilla.gecko.INIT_PW"></action> </intent-filter> </receiver> <activity android:name="Restarter" android:process="@ANDROID_PACKAGE_NAME@Restarter" android:theme="@style/Gecko" Loading Loading @@ -179,8 +171,8 @@ <provider android:name="@ANDROID_PACKAGE_NAME@.db.PasswordsProvider" android:authorities="@ANDROID_PACKAGE_NAME@.db.passwords" android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER" android:process="org.mozilla.gecko.PasswordsProvider"/> android:permission="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER" android:protectionLevel="signature"/> <provider android:name="@ANDROID_PACKAGE_NAME@.db.FormHistoryProvider" android:authorities="@ANDROID_PACKAGE_NAME@.db.formhistory" Loading @@ -197,9 +189,6 @@ <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER" android:protectionLevel="signature"/> <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER" android:protectionLevel="signature"/> <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.FORMHISTORY_PROVIDER" android:protectionLevel="signature"/> Loading
mobile/android/base/GeckoApp.java +6 −3 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ abstract public class GeckoApp public static final String ACTION_BOOKMARK = "org.mozilla.gecko.BOOKMARK"; public static final String ACTION_LOAD = "org.mozilla.gecko.LOAD"; public static final String ACTION_UPDATE = "org.mozilla.gecko.UPDATE"; public static final String ACTION_INIT_PW = "org.mozilla.gecko.INIT_PW"; public static final String SAVED_STATE_URI = "uri"; public static final String SAVED_STATE_TITLE = "title"; public static final String SAVED_STATE_VIEWPORT = "viewport"; Loading @@ -122,6 +121,7 @@ abstract public class GeckoApp public static SurfaceView cameraView; public static GeckoApp mAppContext; public static boolean mDOMFullScreen = false; public static File sGREDir = null; public static Menu sMenu; private static GeckoThread sGeckoThread = null; public GeckoAppHandler mMainHandler; Loading Loading @@ -1616,7 +1616,7 @@ abstract public class GeckoApp enableStrictMode(); } GeckoAppShell.loadMozGlue(); System.loadLibrary("mozglue"); mMainHandler = new GeckoAppHandler(); Log.w(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - onCreate"); if (savedInstanceState != null) { Loading Loading @@ -1687,6 +1687,9 @@ abstract public class GeckoApp mBrowserToolbar.updateTabCount(1); } if (sGREDir == null) sGREDir = new File(this.getApplicationInfo().dataDir); Uri data = intent.getData(); if (data != null && "http".equals(data.getScheme()) && isHostOnPrefetchWhitelist(data.getHost())) { Loading Loading @@ -2510,7 +2513,7 @@ abstract public class GeckoApp fileExt = name.substring(period); fileName = name.substring(0, period); } File file = File.createTempFile(fileName, fileExt, GeckoAppShell.getGREDir(GeckoApp.mAppContext)); File file = File.createTempFile(fileName, fileExt, sGREDir); FileOutputStream fos = new FileOutputStream(file); InputStream is = cr.openInputStream(uri); Loading