Bug 905703 - Remove preprocessing from robocop harness and tests. r=nalexander
☠☠ backed out by 1b166374191c ☠ ☠
authorBrian Nicholson <bnicholson@mozilla.com>
Tue, 22 Oct 2013 13:54:39 -0700
changeset 165575 cf634a1ac73e6da7d399f9d9b136e8afee850484
parent 165574 e940416656ea15efc1ef534fdb69333905df0e84
child 165576 1b166374191c0953a1b3846579b98fdb0dc451cc
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs905703
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 905703 - Remove preprocessing from robocop harness and tests. r=nalexander
build/mobile/robocop/Actions.java
build/mobile/robocop/Actions.java.in
build/mobile/robocop/AndroidManifest.xml.in
build/mobile/robocop/Assert.java
build/mobile/robocop/Assert.java.in
build/mobile/robocop/Driver.java
build/mobile/robocop/Driver.java.in
build/mobile/robocop/Element.java
build/mobile/robocop/Element.java.in
build/mobile/robocop/FennecInstrumentationTestRunner.java
build/mobile/robocop/FennecInstrumentationTestRunner.java.in
build/mobile/robocop/FennecMochitestAssert.java
build/mobile/robocop/FennecMochitestAssert.java.in
build/mobile/robocop/FennecNativeActions.java
build/mobile/robocop/FennecNativeActions.java.in
build/mobile/robocop/FennecNativeDriver.java
build/mobile/robocop/FennecNativeDriver.java.in
build/mobile/robocop/FennecNativeElement.java
build/mobile/robocop/FennecNativeElement.java.in
build/mobile/robocop/FennecTalosAssert.java
build/mobile/robocop/FennecTalosAssert.java.in
build/mobile/robocop/Makefile.in
build/mobile/robocop/PaintedSurface.java
build/mobile/robocop/PaintedSurface.java.in
build/mobile/robocop/RoboCopException.java
build/mobile/robocop/RoboCopException.java.in
build/mobile/robocop/RobocopUtils.java
build/mobile/robocop/RobocopUtils.java.in
mobile/android/base/tests/AboutHomeTest.java
mobile/android/base/tests/AboutHomeTest.java.in
mobile/android/base/tests/BaseTest.java
mobile/android/base/tests/BaseTest.java.in
mobile/android/base/tests/ContentContextMenuTest.java
mobile/android/base/tests/ContentContextMenuTest.java.in
mobile/android/base/tests/ContentProviderTest.java
mobile/android/base/tests/ContentProviderTest.java.in
mobile/android/base/tests/DatabaseHelper.java
mobile/android/base/tests/DatabaseHelper.java.in
mobile/android/base/tests/JavascriptTest.java
mobile/android/base/tests/JavascriptTest.java.in
mobile/android/base/tests/MotionEventHelper.java
mobile/android/base/tests/MotionEventHelper.java.in
mobile/android/base/tests/MotionEventReplayer.java
mobile/android/base/tests/MotionEventReplayer.java.in
mobile/android/base/tests/PixelTest.java
mobile/android/base/tests/PixelTest.java.in
mobile/android/base/tests/StringHelper.java
mobile/android/base/tests/StringHelper.java.in
mobile/android/base/tests/TestConstants.java.in
mobile/android/base/tests/testAboutPage.java
mobile/android/base/tests/testAboutPage.java.in
mobile/android/base/tests/testAddSearchEngine.java
mobile/android/base/tests/testAddSearchEngine.java.in
mobile/android/base/tests/testAddonManager.java
mobile/android/base/tests/testAddonManager.java.in
mobile/android/base/tests/testAwesomebar.java
mobile/android/base/tests/testAwesomebar.java.in
mobile/android/base/tests/testAwesomebarSwipes.java
mobile/android/base/tests/testAwesomebarSwipes.java.in
mobile/android/base/tests/testAxisLocking.java
mobile/android/base/tests/testAxisLocking.java.in
mobile/android/base/tests/testBookmark.java
mobile/android/base/tests/testBookmark.java.in
mobile/android/base/tests/testBookmarkKeyword.java
mobile/android/base/tests/testBookmarkKeyword.java.in
mobile/android/base/tests/testBookmarklets.java
mobile/android/base/tests/testBookmarklets.java.in
mobile/android/base/tests/testBrowserProvider.java
mobile/android/base/tests/testBrowserProvider.java.in
mobile/android/base/tests/testBrowserProviderPerf.java
mobile/android/base/tests/testBrowserProviderPerf.java.in
mobile/android/base/tests/testBrowserSearchVisibility.java
mobile/android/base/tests/testBrowserSearchVisibility.java.in
mobile/android/base/tests/testCheck.java
mobile/android/base/tests/testCheck.java.in
mobile/android/base/tests/testCheck2.java
mobile/android/base/tests/testCheck2.java.in
mobile/android/base/tests/testClearPrivateData.java
mobile/android/base/tests/testClearPrivateData.java.in
mobile/android/base/tests/testDeviceSearchEngine.java
mobile/android/base/tests/testDeviceSearchEngine.java.in
mobile/android/base/tests/testDistribution.java
mobile/android/base/tests/testDistribution.java.in
mobile/android/base/tests/testDoorHanger.java
mobile/android/base/tests/testDoorHanger.java.in
mobile/android/base/tests/testFindInPage.java
mobile/android/base/tests/testFindInPage.java.in
mobile/android/base/tests/testFlingCorrectness.java
mobile/android/base/tests/testFlingCorrectness.java.in
mobile/android/base/tests/testFormHistory.java
mobile/android/base/tests/testFormHistory.java.in
mobile/android/base/tests/testHistory.java
mobile/android/base/tests/testHistory.java.in
mobile/android/base/tests/testImportFromAndroid.java
mobile/android/base/tests/testImportFromAndroid.java.in
mobile/android/base/tests/testInputUrlBar.java
mobile/android/base/tests/testInputUrlBar.java.in
mobile/android/base/tests/testJNI.java
mobile/android/base/tests/testJNI.java.in
mobile/android/base/tests/testJarReader.java
mobile/android/base/tests/testJarReader.java.in
mobile/android/base/tests/testLinkContextMenu.java
mobile/android/base/tests/testLinkContextMenu.java.in
mobile/android/base/tests/testLoad.java
mobile/android/base/tests/testLoad.java.in
mobile/android/base/tests/testMailToContextMenu.java
mobile/android/base/tests/testMailToContextMenu.java.in
mobile/android/base/tests/testMasterPassword.java
mobile/android/base/tests/testMasterPassword.java.in
mobile/android/base/tests/testNewTab.java
mobile/android/base/tests/testNewTab.java.in
mobile/android/base/tests/testOrderedBroadcast.java
mobile/android/base/tests/testOrderedBroadcast.java.in
mobile/android/base/tests/testOverscroll.java
mobile/android/base/tests/testOverscroll.java.in
mobile/android/base/tests/testPan.java
mobile/android/base/tests/testPan.java.in
mobile/android/base/tests/testPanCorrectness.java
mobile/android/base/tests/testPanCorrectness.java.in
mobile/android/base/tests/testPasswordEncrypt.java
mobile/android/base/tests/testPasswordEncrypt.java.in
mobile/android/base/tests/testPasswordProvider.java
mobile/android/base/tests/testPasswordProvider.java.in
mobile/android/base/tests/testPermissions.java
mobile/android/base/tests/testPermissions.java.in
mobile/android/base/tests/testPictureLinkContextMenu.java
mobile/android/base/tests/testPictureLinkContextMenu.java.in
mobile/android/base/tests/testPrefsObserver.java
mobile/android/base/tests/testPrefsObserver.java.in
mobile/android/base/tests/testPrivateBrowsing.java
mobile/android/base/tests/testPrivateBrowsing.java.in
mobile/android/base/tests/testPromptGridInput.java
mobile/android/base/tests/testPromptGridInput.java.in
mobile/android/base/tests/testReaderMode.java
mobile/android/base/tests/testReaderMode.java.in
mobile/android/base/tests/testSearchSuggestions.java
mobile/android/base/tests/testSearchSuggestions.java.in
mobile/android/base/tests/testSettingsMenuItems.java
mobile/android/base/tests/testSettingsMenuItems.java.in
mobile/android/base/tests/testShareLink.java
mobile/android/base/tests/testShareLink.java.in
mobile/android/base/tests/testSharedPreferences.java
mobile/android/base/tests/testSharedPreferences.java.in
mobile/android/base/tests/testSystemPages.java
mobile/android/base/tests/testSystemPages.java.in
mobile/android/base/tests/testTabHistory.java
mobile/android/base/tests/testTabHistory.java.in
mobile/android/base/tests/testThumbnails.java
mobile/android/base/tests/testThumbnails.java.in
mobile/android/base/tests/testVkbOverlap.java
mobile/android/base/tests/testVkbOverlap.java.in
mobile/android/base/tests/test_bug720538.java
mobile/android/base/tests/test_bug720538.java.in
testing/mochitest/runtestsremote.py
rename from build/mobile/robocop/Actions.java.in
rename to build/mobile/robocop/Actions.java
--- a/build/mobile/robocop/Actions.java.in
+++ b/build/mobile/robocop/Actions.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 import java.util.List;
 import java.util.ArrayList;
 
 import android.database.Cursor;
 
 public interface Actions {
 
     /** Special keys supported by sendSpecialKey() */
--- a/build/mobile/robocop/AndroidManifest.xml.in
+++ b/build/mobile/robocop/AndroidManifest.xml.in
@@ -3,17 +3,17 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.mozilla.roboexample.test"
     android:versionCode="1"
     android:versionName="1.0" >
 
     <uses-sdk android:minSdkVersion="8" />
 
     <instrumentation
-        android:name="@ANDROID_PACKAGE_NAME@.FennecInstrumentationTestRunner"
+        android:name="org.mozilla.gecko.FennecInstrumentationTestRunner"
         android:targetPackage="@ANDROID_PACKAGE_NAME@" />
 
     <application
         android:label="@string/app_name" >
         <uses-library android:name="android.test.runner" />
     </application>
 
 </manifest>
rename from build/mobile/robocop/Assert.java.in
rename to build/mobile/robocop/Assert.java
--- a/build/mobile/robocop/Assert.java.in
+++ b/build/mobile/robocop/Assert.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 public interface Assert {
     void dumpLog(String message);
     void dumpLog(String message, Throwable t);
     void setLogFile(String filename);
     void setTestName(String testName);
     void endTest();
 
rename from build/mobile/robocop/Driver.java.in
rename to build/mobile/robocop/Driver.java
--- a/build/mobile/robocop/Driver.java.in
+++ b/build/mobile/robocop/Driver.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import java.util.List;
 import android.app.Activity;
 
 public interface Driver {
     /**
      * Find the first Element using the given method.
      * 
rename from build/mobile/robocop/Element.java.in
rename to build/mobile/robocop/Element.java
--- a/build/mobile/robocop/Element.java.in
+++ b/build/mobile/robocop/Element.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 /** 
  *  Element provides access to a specific UI view (android.view.View). 
  *  See also Driver.findElement().
  */
 public interface Element {
 
     /** Click on the element's view. Returns true on success. */
rename from build/mobile/robocop/FennecInstrumentationTestRunner.java.in
rename to build/mobile/robocop/FennecInstrumentationTestRunner.java
--- a/build/mobile/robocop/FennecInstrumentationTestRunner.java.in
+++ b/build/mobile/robocop/FennecInstrumentationTestRunner.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import android.os.Bundle;
 import android.test.InstrumentationTestRunner;
 import android.util.Log;
 
 public class FennecInstrumentationTestRunner extends InstrumentationTestRunner {
     private static Bundle sArguments;
 
rename from build/mobile/robocop/FennecMochitestAssert.java.in
rename to build/mobile/robocop/FennecMochitestAssert.java
--- a/build/mobile/robocop/FennecMochitestAssert.java.in
+++ b/build/mobile/robocop/FennecMochitestAssert.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import java.util.LinkedList;
 import android.os.SystemClock;
 
 public class FennecMochitestAssert implements Assert {
     private LinkedList<testInfo> mTestList = new LinkedList<testInfo>();
 
     // Internal state variables to make logging match up with existing mochitests
rename from build/mobile/robocop/FennecNativeActions.java.in
rename to build/mobile/robocop/FennecNativeActions.java
--- a/build/mobile/robocop/FennecNativeActions.java.in
+++ b/build/mobile/robocop/FennecNativeActions.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.InvocationHandler;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
@@ -23,17 +22,17 @@ import android.text.TextUtils;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewConfiguration;
 
 import com.jayway.android.robotium.solo.Solo;
 
-import static @ANDROID_PACKAGE_NAME@.FennecNativeDriver.LogLevel;
+import static org.mozilla.gecko.FennecNativeDriver.LogLevel;
 
 public class FennecNativeActions implements Actions {
     private Solo mSolo;
     private Instrumentation mInstr;
     private Activity mGeckoApp;
     private Assert mAsserter;
 
     // Objects for reflexive access of fennec classes.
rename from build/mobile/robocop/FennecNativeDriver.java.in
rename to build/mobile/robocop/FennecNativeDriver.java
--- a/build/mobile/robocop/FennecNativeDriver.java.in
+++ b/build/mobile/robocop/FennecNativeDriver.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import java.io.BufferedOutputStream;
 import java.io.BufferedReader;
 import java.io.DataOutputStream;
 import java.io.File;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.FileOutputStream;
rename from build/mobile/robocop/FennecNativeElement.java.in
rename to build/mobile/robocop/FennecNativeElement.java
--- a/build/mobile/robocop/FennecNativeElement.java.in
+++ b/build/mobile/robocop/FennecNativeElement.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import android.app.Activity;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ListView;
 import android.widget.TextView;
rename from build/mobile/robocop/FennecTalosAssert.java.in
rename to build/mobile/robocop/FennecTalosAssert.java
--- a/build/mobile/robocop/FennecTalosAssert.java.in
+++ b/build/mobile/robocop/FennecTalosAssert.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 
 public class FennecTalosAssert implements Assert {
     
     public FennecTalosAssert() { }
 
     /**
      *  Write information to a logfile and logcat
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -25,28 +25,24 @@ ANDROID_ASSETS_DIR := $(TESTPATH)/assets
   FennecTalosAssert.java \
   FennecNativeDriver.java \
   FennecNativeElement.java \
   RoboCopException.java \
   RobocopUtils.java \
   PaintedSurface.java \
   $(NULL)
 
-# pre-process harness sources
-PP_TARGETS        += java-harness
-java-harness      := $(addprefix $(srcdir)/,$(addsuffix .in,$(_JAVA_HARNESS)))
-java-harness-dep  := $(addprefix $(CURDIR)/,$(_JAVA_HARNESS))
-java-harness_PATH := $(CURDIR)
+java-harness := $(addprefix $(srcdir)/,$(_JAVA_HARNESS))
+java-tests   := $(wildcard $(TESTPATH)/*.java)
 
-# pre-process test sources
-PP_TARGETS      += java-tests
-java-tests-src  := $(wildcard $(TESTPATH)/*.java.in)
-java-tests-dep  := $(patsubst $(TESTPATH)/%.java.in,$(dir-tests)/%.java,$(java-tests-src))
-java-tests      := $(java-tests-src)
-java-tests_PATH := $(dir-tests)
+# pre-process TestConstants.java.in
+PP_TARGETS         += testconstants
+testconstants-dep  := $(dir-tests)/TestConstants.java
+testconstants      := $(TESTPATH)/TestConstants.java.in
+testconstants_PATH := $(dir-tests)
 
 PP_TARGETS        += manifest
 manifest          := $(srcdir)/AndroidManifest.xml.in
 manifest_TARGET   := AndroidManifest.xml
 
 # Install robocop configs and helper
 INSTALL_TARGETS += robocop
 robocop_TARGET  := libs
@@ -64,33 +60,28 @@ MOCHITEST_ROBOCOP_FILES := \
   $(wildcard $(TESTPATH)/*.sjs) \
   $(wildcard $(TESTPATH)/test*.js) \
   $(wildcard $(TESTPATH)/robocop*.js) \
   $(wildcard $(TESTPATH)/*.xml) \
   $(NULL)
 
 GARBAGE += \
   AndroidManifest.xml \
-  $(java-tests-dep) \
-  $(java-harness-dep) \
   $(robocop-deps) \
+  $(testconstants-dep) \
   $(NULL)
 
 JAVAFILES += \
+  $(java-harness) \
+  $(java-tests) \
   $(robocop-deps) \
-  $(java-harness-dep) \
-  $(java-tests-dep) \
+  $(testconstants-dep) \
   $(NULL)
 
 DEFINES += \
   -DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 tools:: $(ANDROID_APK_NAME).apk
 
 GENERATED_DIRS += $(dir-tests)
-
-# PP_java-tests not fully usable here
-# Intermediate step toward a library rule.
-$(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests))
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $< > $@
rename from build/mobile/robocop/PaintedSurface.java.in
rename to build/mobile/robocop/PaintedSurface.java
--- a/build/mobile/robocop/PaintedSurface.java.in
+++ b/build/mobile/robocop/PaintedSurface.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
 import java.nio.MappedByteBuffer;
 import java.nio.channels.FileChannel;
 
 public class PaintedSurface {
rename from build/mobile/robocop/RoboCopException.java.in
rename to build/mobile/robocop/RoboCopException.java
--- a/build/mobile/robocop/RoboCopException.java.in
+++ b/build/mobile/robocop/RoboCopException.java
@@ -1,14 +1,13 @@
-#filter substitution
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 public class RoboCopException extends RuntimeException {
     
     public RoboCopException() {
         super();
     }
     
     public RoboCopException(String message) {
rename from build/mobile/robocop/RobocopUtils.java.in
rename to build/mobile/robocop/RobocopUtils.java
--- a/build/mobile/robocop/RobocopUtils.java.in
+++ b/build/mobile/robocop/RobocopUtils.java
@@ -1,15 +1,13 @@
-#filter substitution
-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package @ANDROID_PACKAGE_NAME@;
+package org.mozilla.gecko;
 
 import android.app.Activity;
 
 import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.TimeUnit;
 
 public final class RobocopUtils {
     private static final int MAX_WAIT_MS = 20000;
rename from mobile/android/base/tests/AboutHomeTest.java.in
rename to mobile/android/base/tests/AboutHomeTest.java
--- a/mobile/android/base/tests/AboutHomeTest.java.in
+++ b/mobile/android/base/tests/AboutHomeTest.java
@@ -1,13 +1,12 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import com.jayway.android.robotium.solo.Condition;
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.content.ContentResolver;
 import android.database.Cursor;
 import android.net.Uri;
 import android.support.v4.view.ViewPager;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewGroup;
rename from mobile/android/base/tests/BaseTest.java.in
rename to mobile/android/base/tests/BaseTest.java
--- a/mobile/android/base/tests/BaseTest.java.in
+++ b/mobile/android/base/tests/BaseTest.java
@@ -1,14 +1,13 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import com.jayway.android.robotium.solo.Condition;
 import com.jayway.android.robotium.solo.Solo;
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.app.Activity;
 import android.app.Instrumentation;
 import android.content.ContentResolver;
 import android.content.ContentValues;
 import android.content.ContentUris;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
@@ -40,17 +39,17 @@ import java.util.HashMap;
 /**
  *  A convenient base class suitable for most Robocop tests.
  */
 abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
     public static final int TEST_MOCHITEST = 0;
     public static final int TEST_TALOS = 1;
 
     private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";
-    private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME ="@ANDROID_PACKAGE_NAME@.App";
+    private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME = TestConstants.ANDROID_PACKAGE_NAME + ".App";
     private static final int VERIFY_URL_TIMEOUT = 2000;
     private static final int MAX_LIST_ATTEMPTS = 3;
     private static final int MAX_WAIT_ENABLED_TEXT_MS = 10000;
     private static final int MAX_WAIT_HOME_PAGER_HIDDEN_MS = 15000;
     public static final int MAX_WAIT_MS = 4500;
 
     // IDs for UI views
     private static final String BROWSER_TOOLBAR_ID = "browser_toolbar";
rename from mobile/android/base/tests/ContentContextMenuTest.java.in
rename to mobile/android/base/tests/ContentContextMenuTest.java
--- a/mobile/android/base/tests/ContentContextMenuTest.java.in
+++ b/mobile/android/base/tests/ContentContextMenuTest.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.content.ContentResolver;
 import android.util.DisplayMetrics;
 
 import java.lang.reflect.Method;
 
 /**
  * This class covers interactions with the context menu opened from web content
  */
rename from mobile/android/base/tests/ContentProviderTest.java.in
rename to mobile/android/base/tests/ContentProviderTest.java
--- a/mobile/android/base/tests/ContentProviderTest.java.in
+++ b/mobile/android/base/tests/ContentProviderTest.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.content.ContentProvider;
 import android.content.ContentValues;
 import android.content.Context;
 import android.content.ContentProviderResult;
 import android.content.ContentProviderOperation;
 import android.content.OperationApplicationException;
 import android.content.res.AssetManager;
rename from mobile/android/base/tests/DatabaseHelper.java.in
rename to mobile/android/base/tests/DatabaseHelper.java
--- a/mobile/android/base/tests/DatabaseHelper.java.in
+++ b/mobile/android/base/tests/DatabaseHelper.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.app.Activity;
 import android.content.ContentResolver;
 import android.database.Cursor;
 import android.net.Uri;
 import android.test.ActivityInstrumentationTestCase2;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -34,17 +33,17 @@ class DatabaseHelper {
             mAsserter.ok(false, "Exception while checking if url is bookmarked", e.toString());
             return false;
         }
     }
 
     protected Uri buildUri(BrowserDataType dataType) {
         Uri uri = null;
         if (dataType == BrowserDataType.BOOKMARKS || dataType == BrowserDataType.HISTORY) {
-            uri = Uri.parse("content://@ANDROID_PACKAGE_NAME@.db.browser/" + dataType.toString().toLowerCase());
+            uri = Uri.parse("content://" + TestConstants.ANDROID_PACKAGE_NAME + ".db.browser/" + dataType.toString().toLowerCase());
         } else {
            mAsserter.ok(false, "The wrong data type has been provided = " + dataType.toString(), "Please provide the correct data type");
         }
         uri = uri.buildUpon().appendQueryParameter("profile", "default")
                              .appendQueryParameter("sync", "true").build();
         return uri;
     }
 
rename from mobile/android/base/tests/JavascriptTest.java.in
rename to mobile/android/base/tests/JavascriptTest.java
--- a/mobile/android/base/tests/JavascriptTest.java.in
+++ b/mobile/android/base/tests/JavascriptTest.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.util.Log;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import junit.framework.AssertionFailedError;
 
rename from mobile/android/base/tests/MotionEventHelper.java.in
rename to mobile/android/base/tests/MotionEventHelper.java
--- a/mobile/android/base/tests/MotionEventHelper.java.in
+++ b/mobile/android/base/tests/MotionEventHelper.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.app.Instrumentation;
 import android.os.SystemClock;
 import android.util.FloatMath;
 import android.util.Log;
 import android.view.MotionEvent;
 
 class MotionEventHelper {
rename from mobile/android/base/tests/MotionEventReplayer.java.in
rename to mobile/android/base/tests/MotionEventReplayer.java
--- a/mobile/android/base/tests/MotionEventReplayer.java.in
+++ b/mobile/android/base/tests/MotionEventReplayer.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Map;
rename from mobile/android/base/tests/PixelTest.java.in
rename to mobile/android/base/tests/PixelTest.java
--- a/mobile/android/base/tests/PixelTest.java.in
+++ b/mobile/android/base/tests/PixelTest.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 abstract class PixelTest extends BaseTest {
     private static final long PAINT_CLEAR_DELAY = 10000; // milliseconds
 
     protected final PaintedSurface loadAndGetPainted(String url) {
         Actions.RepeatedEventExpecter paintExpecter = mActions.expectPaint();
         inputAndLoadUrl(url);
         verifyHomePagerHidden();
rename from mobile/android/base/tests/StringHelper.java.in
rename to mobile/android/base/tests/StringHelper.java
--- a/mobile/android/base/tests/StringHelper.java.in
+++ b/mobile/android/base/tests/StringHelper.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 class StringHelper {
     // Note: DEFAULT_BOOKMARKS_TITLES.length == DEFAULT_BOOKMARKS_URLS.length
     public static final String[] DEFAULT_BOOKMARKS_TITLES = new String[] {
         "Firefox: About your browser",
         "Firefox: Support",
         "Firefox: Customize with add-ons"
     };
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/TestConstants.java.in
@@ -0,0 +1,11 @@
+#filter substitution
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.gecko;
+
+public class TestConstants {
+    public static final String ANDROID_PACKAGE_NAME = "@ANDROID_PACKAGE_NAME@";
+}
rename from mobile/android/base/tests/testAboutPage.java.in
rename to mobile/android/base/tests/testAboutPage.java
--- a/mobile/android/base/tests/testAboutPage.java.in
+++ b/mobile/android/base/tests/testAboutPage.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /* Tests related to the about: page:
  *  - check that about: loads from the URL bar
  *  - check that about: loads from Settings/About...
  */
 public class testAboutPage extends PixelTest {
     @Override
     protected int getTestType() {
rename from mobile/android/base/tests/testAddSearchEngine.java.in
rename to mobile/android/base/tests/testAddSearchEngine.java
--- a/mobile/android/base/tests/testAddSearchEngine.java.in
+++ b/mobile/android/base/tests/testAddSearchEngine.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.view.View;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 import java.util.ArrayList;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
rename from mobile/android/base/tests/testAddonManager.java.in
rename to mobile/android/base/tests/testAddonManager.java
--- a/mobile/android/base/tests/testAddonManager.java.in
+++ b/mobile/android/base/tests/testAddonManager.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.util.DisplayMetrics;
 
 import org.json.JSONArray;
 import org.json.JSONObject;
 
 public class testAddonManager extends PixelTest  {
     @Override
     protected int getTestType() {
rename from mobile/android/base/tests/testAwesomebar.java.in
rename to mobile/android/base/tests/testAwesomebar.java
--- a/mobile/android/base/tests/testAwesomebar.java.in
+++ b/mobile/android/base/tests/testAwesomebar.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 public class testAwesomebar extends BaseTest {
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
     public void testAwesomebar() {
rename from mobile/android/base/tests/testAwesomebarSwipes.java.in
rename to mobile/android/base/tests/testAwesomebarSwipes.java
--- a/mobile/android/base/tests/testAwesomebarSwipes.java.in
+++ b/mobile/android/base/tests/testAwesomebarSwipes.java
@@ -1,18 +1,17 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import com.jayway.android.robotium.solo.Solo;
 
 import android.widget.ListView;
 import android.widget.TabWidget;
 import android.support.v4.view.ViewPager;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /* Tests swiping between tabs on the awesome bar and other basic
    awesome bar tab selections.
 */
 
 public class testAwesomebarSwipes extends BaseTest {
     @Override
     protected int getTestType() {
rename from mobile/android/base/tests/testAxisLocking.java.in
rename to mobile/android/base/tests/testAxisLocking.java
--- a/mobile/android/base/tests/testAxisLocking.java.in
+++ b/mobile/android/base/tests/testAxisLocking.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /**
  * Basic test for axis locking behaviour.
  * - Load page and verify it draws
  * - Drag page upwards 100 pixels at a 5-degree angle off the vertical axis
  * - Verify that the 5-degree angle was thrown out and it dragged vertically
  * - Drag page upwards at a 45-degree angle
  * - Verify that the 45-degree angle was not thrown out and it dragged diagonally
rename from mobile/android/base/tests/testBookmark.java.in
rename to mobile/android/base/tests/testBookmark.java
--- a/mobile/android/base/tests/testBookmark.java.in
+++ b/mobile/android/base/tests/testBookmark.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.view.View;
 import android.widget.ListView;
 
 import java.util.Arrays;
 import java.util.ArrayList;
 
 public class testBookmark extends AboutHomeTest {
rename from mobile/android/base/tests/testBookmarkKeyword.java.in
rename to mobile/android/base/tests/testBookmarkKeyword.java
--- a/mobile/android/base/tests/testBookmarkKeyword.java.in
+++ b/mobile/android/base/tests/testBookmarkKeyword.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 public class testBookmarkKeyword extends AboutHomeTest {
 
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
rename from mobile/android/base/tests/testBookmarklets.java.in
rename to mobile/android/base/tests/testBookmarklets.java
--- a/mobile/android/base/tests/testBookmarklets.java.in
+++ b/mobile/android/base/tests/testBookmarklets.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.database.Cursor;
 
 import android.widget.ListView;
 
 
 public class testBookmarklets extends AboutHomeTest {
     @Override
     protected int getTestType() {
rename from mobile/android/base/tests/testBrowserProvider.java.in
rename to mobile/android/base/tests/testBrowserProvider.java
--- a/mobile/android/base/tests/testBrowserProvider.java.in
+++ b/mobile/android/base/tests/testBrowserProvider.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.content.ContentValues;
 import android.content.ContentUris;
 import android.content.ContentProviderResult;
 import android.content.ContentProviderOperation;
 import android.content.OperationApplicationException;
 import android.database.Cursor;
 import android.net.Uri;
rename from mobile/android/base/tests/testBrowserProviderPerf.java.in
rename to mobile/android/base/tests/testBrowserProviderPerf.java
--- a/mobile/android/base/tests/testBrowserProviderPerf.java.in
+++ b/mobile/android/base/tests/testBrowserProviderPerf.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.content.ContentResolver;
 import android.content.ContentValues;
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.SystemClock;
 import java.lang.reflect.Method;
 import java.util.UUID;
rename from mobile/android/base/tests/testBrowserSearchVisibility.java.in
rename to mobile/android/base/tests/testBrowserSearchVisibility.java
--- a/mobile/android/base/tests/testBrowserSearchVisibility.java.in
+++ b/mobile/android/base/tests/testBrowserSearchVisibility.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Activity;
 import android.content.Context;
 import android.support.v4.app.Fragment;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.KeyEvent;
 import android.widget.TextView;
 import java.lang.reflect.Constructor;
rename from mobile/android/base/tests/testCheck.java.in
rename to mobile/android/base/tests/testCheck.java
--- a/mobile/android/base/tests/testCheck.java.in
+++ b/mobile/android/base/tests/testCheck.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 public class testCheck extends PixelTest {
     private void pause(int length) {
         try {
             Thread.sleep(length);
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
rename from mobile/android/base/tests/testCheck2.java.in
rename to mobile/android/base/tests/testCheck2.java
--- a/mobile/android/base/tests/testCheck2.java.in
+++ b/mobile/android/base/tests/testCheck2.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 public class testCheck2 extends PixelTest {
     @Override
     protected int getTestType() {
         return TEST_TALOS;
     }
 
     public void testCheck2() {
rename from mobile/android/base/tests/testClearPrivateData.java.in
rename to mobile/android/base/tests/testClearPrivateData.java
--- a/mobile/android/base/tests/testClearPrivateData.java.in
+++ b/mobile/android/base/tests/testClearPrivateData.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import java.util.ArrayList;
 
 public class testClearPrivateData extends PixelTest {
     private final int TEST_WAIT_MS = 10000;
 
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
rename from mobile/android/base/tests/testDeviceSearchEngine.java.in
rename to mobile/android/base/tests/testDeviceSearchEngine.java
--- a/mobile/android/base/tests/testDeviceSearchEngine.java.in
+++ b/mobile/android/base/tests/testDeviceSearchEngine.java
@@ -1,11 +1,10 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 
 public class testDeviceSearchEngine extends JavascriptTest {
     public testDeviceSearchEngine() {
         super("testDeviceSearchEngine.js");
     }
 }
rename from mobile/android/base/tests/testDistribution.java.in
rename to mobile/android/base/tests/testDistribution.java
--- a/mobile/android/base/tests/testDistribution.java.in
+++ b/mobile/android/base/tests/testDistribution.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.app.Activity;
 import android.content.Context;
 import android.content.SharedPreferences;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
rename from mobile/android/base/tests/testDoorHanger.java.in
rename to mobile/android/base/tests/testDoorHanger.java
--- a/mobile/android/base/tests/testDoorHanger.java.in
+++ b/mobile/android/base/tests/testDoorHanger.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.app.Activity;
 import android.content.SharedPreferences;
 import java.lang.reflect.Method;
 
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
rename from mobile/android/base/tests/testFindInPage.java.in
rename to mobile/android/base/tests/testFindInPage.java
--- a/mobile/android/base/tests/testFindInPage.java.in
+++ b/mobile/android/base/tests/testFindInPage.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Activity;
 import android.graphics.Color;
 
 public class testFindInPage extends PixelTest {
     private static final int WAIT_FOR_TEST = 3000;
     protected Element next, close;
     int height,width;
 
rename from mobile/android/base/tests/testFlingCorrectness.java.in
rename to mobile/android/base/tests/testFlingCorrectness.java
--- a/mobile/android/base/tests/testFlingCorrectness.java.in
+++ b/mobile/android/base/tests/testFlingCorrectness.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /**
  * Basic fling correctness test.
  * - Loads a page and verifies it draws
  * - Drags page upwards by 200 pixels to get ready for a fling
  * - Fling the page downwards so we get back to the top and verify.
  */
 public class testFlingCorrectness extends PixelTest {
rename from mobile/android/base/tests/testFormHistory.java.in
rename to mobile/android/base/tests/testFormHistory.java
--- a/mobile/android/base/tests/testFormHistory.java.in
+++ b/mobile/android/base/tests/testFormHistory.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.content.ContentValues;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.net.Uri;
 import java.io.File;
 import java.lang.ClassLoader;
 
rename from mobile/android/base/tests/testHistory.java.in
rename to mobile/android/base/tests/testHistory.java
--- a/mobile/android/base/tests/testHistory.java.in
+++ b/mobile/android/base/tests/testHistory.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.widget.ListView;
 import android.app.Activity;
 import java.util.ArrayList;
 import android.view.View;
 import android.view.ViewGroup;
 
 public class testHistory extends AboutHomeTest {
     private View mFirstChild;
rename from mobile/android/base/tests/testImportFromAndroid.java.in
rename to mobile/android/base/tests/testImportFromAndroid.java
--- a/mobile/android/base/tests/testImportFromAndroid.java.in
+++ b/mobile/android/base/tests/testImportFromAndroid.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Activity;
 import android.provider.Browser;
 import android.content.ContentValues;
 import android.content.ContentResolver;
 import android.database.Cursor;
 import android.net.Uri;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -112,17 +111,17 @@ public class testImportFromAndroid exten
             // Add every 3rd bookmark to Firefox Mobile
             if ((androidBookmarks.indexOf(url) % 3) == 0) {
                 mDatabaseHelper.addOrUpdateMobileBookmark("Bookmark Number" + String.valueOf(androidBookmarks.indexOf(url)), url);
             }
         }
 
         // Add a few history items in Firefox Mobile
         ContentResolver resolver = getActivity().getContentResolver();
-        Uri uri = Uri.parse("content://@ANDROID_PACKAGE_NAME@.db.browser/history");
+        Uri uri = Uri.parse("content://" + TestConstants.ANDROID_PACKAGE_NAME + ".db.browser/history");
         uri = uri.buildUpon().appendQueryParameter("profile", "default")
                              .appendQueryParameter("sync", "true").build();
         for (String url:androidData) {
             // Add every 3rd website from Android History to Firefox Mobile
             if ((androidData.indexOf(url) % 3) == 0) {
                  ContentValues values = new ContentValues();
                  values.put("title", "Page" + url);
                  values.put("url", url);
rename from mobile/android/base/tests/testInputUrlBar.java.in
rename to mobile/android/base/tests/testInputUrlBar.java
--- a/mobile/android/base/tests/testInputUrlBar.java.in
+++ b/mobile/android/base/tests/testInputUrlBar.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.app.Activity;
 import android.view.View;
 import android.widget.EditText;
 
 /**
  * Basic test of text editing within the editing mode.
  * - Enter some text, move the cursor around, and modifying some text.
rename from mobile/android/base/tests/testJNI.java.in
rename to mobile/android/base/tests/testJNI.java
--- a/mobile/android/base/tests/testJNI.java.in
+++ b/mobile/android/base/tests/testJNI.java
@@ -1,11 +1,10 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 
 public class testJNI extends JavascriptTest {
     public testJNI() {
         super("testJNI.js");
     }
 }
rename from mobile/android/base/tests/testJarReader.java.in
rename to mobile/android/base/tests/testJarReader.java
--- a/mobile/android/base/tests/testJarReader.java.in
+++ b/mobile/android/base/tests/testJarReader.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import java.lang.ClassLoader;
 import java.io.InputStream;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
 /**
  * A basic jar reader test. Tests reading a png from fennec's apk, as well
rename from mobile/android/base/tests/testLinkContextMenu.java.in
rename to mobile/android/base/tests/testLinkContextMenu.java
--- a/mobile/android/base/tests/testLinkContextMenu.java.in
+++ b/mobile/android/base/tests/testLinkContextMenu.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 public class testLinkContextMenu extends ContentContextMenuTest {
 
     // Test website strings
     private static String LINK_PAGE_URL;
     private static String BLANK_PAGE_URL;
     private static final String LINK_PAGE_TITLE = "Big Link";
     private static final String linkMenuItems [] = { "Open Link in New Tab", "Open Link in Private Tab", "Copy Link", "Share Link", "Bookmark Link"};
rename from mobile/android/base/tests/testLoad.java.in
rename to mobile/android/base/tests/testLoad.java
--- a/mobile/android/base/tests/testLoad.java.in
+++ b/mobile/android/base/tests/testLoad.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 /**
  * A basic page load test.
  * - loads a page
  * - verifies it rendered properly
  * - verifies the displayed url is correct
  */
 public class testLoad extends PixelTest {
rename from mobile/android/base/tests/testMailToContextMenu.java.in
rename to mobile/android/base/tests/testMailToContextMenu.java
--- a/mobile/android/base/tests/testMailToContextMenu.java.in
+++ b/mobile/android/base/tests/testMailToContextMenu.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 public class testMailToContextMenu extends ContentContextMenuTest {
 
     // Test website strings
     private static String MAILTO_PAGE_URL;
     private static final String MAILTO_PAGE_TITLE = "Big Mailto";
     private static final String mailtoMenuItems [] = {"Copy Email Address", "Share Email Address"};
 
rename from mobile/android/base/tests/testMasterPassword.java.in
rename to mobile/android/base/tests/testMasterPassword.java
--- a/mobile/android/base/tests/testMasterPassword.java.in
+++ b/mobile/android/base/tests/testMasterPassword.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /* This patch tests the Master Password feature first by enabling the password,
 then testing it on a login page and finally disabling the password */
 public class testMasterPassword extends PixelTest {
     Device dev;
 
     @Override
     protected int getTestType() {
rename from mobile/android/base/tests/testNewTab.java.in
rename to mobile/android/base/tests/testNewTab.java
--- a/mobile/android/base/tests/testNewTab.java.in
+++ b/mobile/android/base/tests/testNewTab.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Activity;
 import android.view.View;
 
 /* A simple test that creates 2 new tabs and checks that the tab count increases. */
 public class testNewTab extends BaseTest {
     private Element tabCount = null;
     private Element tabs = null;
     private Element addTab = null;
rename from mobile/android/base/tests/testOrderedBroadcast.java.in
rename to mobile/android/base/tests/testOrderedBroadcast.java
--- a/mobile/android/base/tests/testOrderedBroadcast.java.in
+++ b/mobile/android/base/tests/testOrderedBroadcast.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
 import android.app.Activity;
 
 import android.content.BroadcastReceiver;
rename from mobile/android/base/tests/testOverscroll.java.in
rename to mobile/android/base/tests/testOverscroll.java
--- a/mobile/android/base/tests/testOverscroll.java.in
+++ b/mobile/android/base/tests/testOverscroll.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /**
  * Basic test to check bounce-back from overscroll.
  * - Load the page and verify it draws
  * - Drag page downwards by 100 pixels into overscroll, verify it snaps back.
  * - Drag page rightwards by 100 pixels into overscroll, verify it snaps back.
  */
 public class testOverscroll extends PixelTest {
rename from mobile/android/base/tests/testPan.java.in
rename to mobile/android/base/tests/testPan.java
--- a/mobile/android/base/tests/testPan.java.in
+++ b/mobile/android/base/tests/testPan.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 /**
  * A panning performance test.
  * Drags the page a bunch of times and measures the frames per second
  * that fennec draws at.
  */
 public class testPan extends PixelTest {
     @Override
rename from mobile/android/base/tests/testPanCorrectness.java.in
rename to mobile/android/base/tests/testPanCorrectness.java
--- a/mobile/android/base/tests/testPanCorrectness.java.in
+++ b/mobile/android/base/tests/testPanCorrectness.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /**
  * A basic panning correctness test.
  * - Loads a page and verifies it draws
  * - drags page upwards by 100 pixels and verifies it draws
  * - drags page leftwards by 100 pixels and verifies it draws
  */
 public class testPanCorrectness extends PixelTest {
rename from mobile/android/base/tests/testPasswordEncrypt.java.in
rename to mobile/android/base/tests/testPasswordEncrypt.java
--- a/mobile/android/base/tests/testPasswordEncrypt.java.in
+++ b/mobile/android/base/tests/testPasswordEncrypt.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.content.ContentValues;
 import android.content.ContentResolver;
 import android.database.Cursor;
 import android.content.Context;
 import android.net.Uri;
 import java.io.File;
 import java.lang.reflect.Method;
 
rename from mobile/android/base/tests/testPasswordProvider.java.in
rename to mobile/android/base/tests/testPasswordProvider.java
--- a/mobile/android/base/tests/testPasswordProvider.java.in
+++ b/mobile/android/base/tests/testPasswordProvider.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.content.ContentValues;
 import android.content.ContentResolver;
 import android.database.Cursor;
 import android.content.Context;
 import android.net.Uri;
 import java.io.File;
 
rename from mobile/android/base/tests/testPermissions.java.in
rename to mobile/android/base/tests/testPermissions.java
--- a/mobile/android/base/tests/testPermissions.java.in
+++ b/mobile/android/base/tests/testPermissions.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.widget.CheckBox;
 import java.util.ArrayList;
 
 public class testPermissions extends PixelTest {
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
rename from mobile/android/base/tests/testPictureLinkContextMenu.java.in
rename to mobile/android/base/tests/testPictureLinkContextMenu.java
--- a/mobile/android/base/tests/testPictureLinkContextMenu.java.in
+++ b/mobile/android/base/tests/testPictureLinkContextMenu.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 public class testPictureLinkContextMenu extends ContentContextMenuTest {
 
     // Test website strings
     private static String PICTURE_PAGE_URL;
     private static String BLANK_PAGE_URL;
     private static final String PICTURE_PAGE_TITLE = "Picture Link";
     private static final String photoMenuItems [] = { "Copy Image Location", "Share Image", "Set Image As", "Save Image", "Open Link in New Tab", "Open Link in Private Tab", "Copy Link", "Share Link", "Bookmark Link"};
rename from mobile/android/base/tests/testPrefsObserver.java.in
rename to mobile/android/base/tests/testPrefsObserver.java
--- a/mobile/android/base/tests/testPrefsObserver.java.in
+++ b/mobile/android/base/tests/testPrefsObserver.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Instrumentation;
 
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
 /**
  * Basic test to check bounce-back from overscroll.
rename from mobile/android/base/tests/testPrivateBrowsing.java.in
rename to mobile/android/base/tests/testPrivateBrowsing.java
--- a/mobile/android/base/tests/testPrivateBrowsing.java.in
+++ b/mobile/android/base/tests/testPrivateBrowsing.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import java.util.ArrayList;
 
 import org.json.JSONException;
 import org.json.JSONObject;
 
 /**
  * The test loads a new private tab and loads a page with a big link on it
rename from mobile/android/base/tests/testPromptGridInput.java.in
rename to mobile/android/base/tests/testPromptGridInput.java
--- a/mobile/android/base/tests/testPromptGridInput.java.in
+++ b/mobile/android/base/tests/testPromptGridInput.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import android.graphics.drawable.Drawable;
 import android.widget.EditText;
 import android.widget.CheckedTextView;
 import android.widget.TextView;
 import android.text.InputType;
 import android.util.DisplayMetrics;
 import android.view.View;
rename from mobile/android/base/tests/testReaderMode.java.in
rename to mobile/android/base/tests/testReaderMode.java
--- a/mobile/android/base/tests/testReaderMode.java.in
+++ b/mobile/android/base/tests/testReaderMode.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import com.jayway.android.robotium.solo.Solo;
 import android.widget.ListView;
 import android.view.View;
 import java.util.ArrayList;
 import android.view.ViewGroup;
 import org.json.JSONException;
 import org.json.JSONObject;
 
rename from mobile/android/base/tests/testSearchSuggestions.java.in
rename to mobile/android/base/tests/testSearchSuggestions.java
--- a/mobile/android/base/tests/testSearchSuggestions.java.in
+++ b/mobile/android/base/tests/testSearchSuggestions.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Activity;
 import android.content.Context;
 import android.support.v4.app.Fragment;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.TextView;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
rename from mobile/android/base/tests/testSettingsMenuItems.java.in
rename to mobile/android/base/tests/testSettingsMenuItems.java
--- a/mobile/android/base/tests/testSettingsMenuItems.java.in
+++ b/mobile/android/base/tests/testSettingsMenuItems.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 import java.lang.reflect.Field;
 import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.HashMap;
rename from mobile/android/base/tests/testShareLink.java.in
rename to mobile/android/base/tests/testShareLink.java
--- a/mobile/android/base/tests/testShareLink.java.in
+++ b/mobile/android/base/tests/testShareLink.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.app.Activity;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.os.Build;
 import android.util.DisplayMetrics;
 import android.view.View;
 import android.view.ViewGroup;
rename from mobile/android/base/tests/testSharedPreferences.java.in
rename to mobile/android/base/tests/testSharedPreferences.java
--- a/mobile/android/base/tests/testSharedPreferences.java.in
+++ b/mobile/android/base/tests/testSharedPreferences.java
@@ -1,11 +1,10 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 
 public class testSharedPreferences extends JavascriptTest {
     public testSharedPreferences() {
         super("testSharedPreferences.js");
     }
 }
rename from mobile/android/base/tests/testSystemPages.java.in
rename to mobile/android/base/tests/testSystemPages.java
--- a/mobile/android/base/tests/testSystemPages.java.in
+++ b/mobile/android/base/tests/testSystemPages.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 /** This patch tests the System Pages first by loading system pages from
  *  the awesome bar and then from Firefox menu 
  */
 public class testSystemPages extends PixelTest {
     final int mExpectedTabCount = 1;
     private static final int AFTER_BACK_SLEEP_MS = 500;
 
rename from mobile/android/base/tests/testTabHistory.java.in
rename to mobile/android/base/tests/testTabHistory.java
--- a/mobile/android/base/tests/testTabHistory.java.in
+++ b/mobile/android/base/tests/testTabHistory.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 public class testTabHistory extends BaseTest {
 
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
rename from mobile/android/base/tests/testThumbnails.java.in
rename to mobile/android/base/tests/testThumbnails.java
--- a/mobile/android/base/tests/testThumbnails.java.in
+++ b/mobile/android/base/tests/testThumbnails.java
@@ -1,10 +1,9 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
 import android.content.ContentResolver;
 import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
rename from mobile/android/base/tests/testVkbOverlap.java.in
rename to mobile/android/base/tests/testVkbOverlap.java
--- a/mobile/android/base/tests/testVkbOverlap.java.in
+++ b/mobile/android/base/tests/testVkbOverlap.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 import android.net.Uri;
 
 /**
  * A test to ensure that when an input field is focused, it is not obscured by the VKB.
  * - Loads a page with an input field past the bottom of the visible area.
  * - scrolls down to make the input field visible at the bottom of the screen.
  * - taps on the input field to bring up the VKB
  * - verifies that the input field is still visible.
rename from mobile/android/base/tests/test_bug720538.java.in
rename to mobile/android/base/tests/test_bug720538.java
--- a/mobile/android/base/tests/test_bug720538.java.in
+++ b/mobile/android/base/tests/test_bug720538.java
@@ -1,12 +1,11 @@
-#filter substitution
-package @ANDROID_PACKAGE_NAME@.tests;
+package org.mozilla.gecko.tests;
 
-import @ANDROID_PACKAGE_NAME@.*;
+import org.mozilla.gecko.*;
 
 public class test_bug720538 extends PixelTest {
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
     public void test_bug720538() {
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -640,18 +640,18 @@ def main():
             if mochitest.localProfile:
                 options.profilePath = mochitest.localProfile
                 os.system("rm -Rf %s" % options.profilePath)
                 options.profilePath = tempfile.mkdtemp()
                 mochitest.localProfile = options.profilePath
 
             options.app = "am"
             options.browserArgs = ["instrument", "-w", "-e", "deviceroot", deviceRoot, "-e", "class"]
-            options.browserArgs.append("%s.tests.%s" % (options.remoteappname, test['name']))
-            options.browserArgs.append("org.mozilla.roboexample.test/%s.FennecInstrumentationTestRunner" % options.remoteappname)
+            options.browserArgs.append("org.mozilla.gecko.tests.%s" % test['name'])
+            options.browserArgs.append("org.mozilla.roboexample.test/org.mozilla.gecko.FennecInstrumentationTestRunner")
 
             # If the test is for checking the import from bookmarks then make sure there is data to import
             if test['name'] == "testImportFromAndroid":
                 
                 # Get the OS so we can run the insert in the apropriate database and following the correct table schema
                 osInfo = dm.getInfo("os")
                 devOS = " ".join(osInfo['os'])