Bug 711591 - make the robotium test driver a bit more driver like. r=ctalbert
authorJoel Maher <jmaher@mozilla.com>
Fri, 30 Dec 2011 15:57:34 -0500
changeset 83590 632f07583bd8aae01cef0faaf6d3f8afd5c33ceb
parent 83589 495160d5047a9cc963548057c6d7af31fcbe0f9b
child 83591 04ef7f5644504e96208a12e50d1a39471b7c4441
push idunknown
push userunknown
push dateunknown
reviewersctalbert
bugs711591
milestone12.0a1
Bug 711591 - make the robotium test driver a bit more driver like. r=ctalbert
build/mobile/robocop/Assert.java.in
build/mobile/robocop/FennecNativeAssert.java.in
build/mobile/robocop/Makefile.in
mobile/android/base/tests/robocop.ini
mobile/android/base/tests/robocop_blank_01.html
mobile/android/base/tests/robocop_blank_02.html
mobile/android/base/tests/robocop_blank_03.html
mobile/android/base/tests/testAwesomebar.java.in
mobile/android/base/tests/testBookmark.java.in
mobile/android/base/tests/testLoad.java.in
mobile/android/base/tests/testNewTab.java.in
mobile/android/base/tests/testPan.java.in
new file mode 100644
--- /dev/null
+++ b/build/mobile/robocop/Assert.java.in
@@ -0,0 +1,53 @@
+#filter substitution
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Firefox Mobile Test Framework.
+ *
+ * The Initial Developer of the Original Code is Mozilla.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Trevor Fairey <tnfairey@gmail.com>
+ * David Burns <dburns@mozilla.com>
+ * Joel Maher <joel.maher@gmail.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package @ANDROID_PACKAGE_NAME@;
+
+public interface Assert {
+  void dumpLog(String message);
+  void setLogFile(String filename);
+
+  void ok(boolean condition, String name, String diag);
+  void is(Object a, Object b, String name);
+  void isnot(Object a, Object b, String name);
+  void todo(boolean condition, String name, String diag);
+  void todo_is(Object a, Object b, String name);
+  void todo_isnot(Object a, Object b, String name);
+  void info(String name, String message);
+}
new file mode 100644
--- /dev/null
+++ b/build/mobile/robocop/FennecNativeAssert.java.in
@@ -0,0 +1,212 @@
+#filter substitution
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Firefox Mobile Test Framework.
+ *
+ * The Initial Developer of the Original Code is Mozilla.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Trevor Fairey <tnfairey@gmail.com>
+ * David Burns <dburns@mozilla.com>
+ * Joel Maher <joel.maher@gmail.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package @ANDROID_PACKAGE_NAME@;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.HashMap;
+import java.util.List;
+
+import java.lang.Class;
+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 android.app.Activity;
+import android.util.Log;
+import android.view.View;
+
+import org.json.*;
+
+import com.jayway.android.robotium.solo.Solo;
+
+public class FennecNativeAssert implements Assert {
+  // Map of IDs to element names.
+  private HashMap locators = null;
+  private String logFile = null;
+  
+  // Objects for reflexive access of fennec classes.
+
+  private LinkedList<testInfo> testList = new LinkedList<testInfo>();
+
+  // If waiting for an event.
+  private boolean asleep = false;
+
+  public FennecNativeAssert(){
+  }
+
+  // Write information to a logfile and logcat
+  public void dumpLog(String message)
+  {
+    File file = new File(logFile);
+    BufferedWriter bw = null;
+
+    try {
+      bw = new BufferedWriter(new FileWriter(logFile, true));
+      bw.write(message);
+      bw.newLine();
+    } catch(IOException e) {
+      Log.e("Robocop", "exception with file writer on: " + logFile);
+    } finally {
+      try {
+        if (bw != null) {
+          bw.flush();
+          bw.close();
+        }
+      } catch (IOException ex) {
+        ex.printStackTrace();
+      }
+    }
+
+    Log.i("Robocop", message);
+  }
+
+  // Set the filename used for dumpLog.
+  public void setLogFile(String filename)
+  {
+    logFile = filename;
+  }
+
+
+  class testInfo {
+    public boolean result;
+    public String name;
+    public String diag;
+    public boolean todo;
+    public testInfo(boolean r, String n, String d, boolean t) {
+      result = r;
+      name = n;
+      diag = d;
+      todo = t;
+    }
+
+  }
+
+
+  private void _logResult(testInfo test, String passString, String failString)
+  {
+    boolean isError = true;
+    String resultString = failString;
+    if(test.result || test.todo){
+      isError = false;
+    }
+    if(test.result)
+    {
+      resultString = passString;
+    }
+    String diag= test.name;
+    if(test.diag!=null) diag+= " - " + test.diag;
+
+    String message = resultString + " | " + "ROBOCOP" + " | " + diag;
+    if(isError) {
+      if(logFile == null)
+      {
+        assert(false);
+      }
+      else {
+        dumpLog(message);
+      }
+    }
+    else {
+      dumpLog(message);
+    }
+  }
+
+  public void ok(boolean condition, String name, String diag) {
+    testInfo test = new testInfo(condition, name, diag, false);
+    _logResult(test, "TEST-PASS", "TEST-UNEXPECTED-FAIL");
+    testList.add(test);
+  }
+
+  public void is(Object a, Object b, String name) {
+    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 = !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 todo(boolean condition, String name, String diag) {
+    testInfo test = new testInfo(condition, name, diag, true);
+    _logResult(test, "TEST-UNEXPECTED-PASS", "TEST-KNOWN-FAIL");
+    testList.add(test);
+  }
+
+  public void todo_is(Object a, Object b, String name) {
+    boolean pass = a.equals(b);
+    String diag = "got " + a.toString() + ", expected " + b.toString();
+    if(pass) {
+      diag = a.toString() + " should equal " + b.toString();
+    }
+    todo(pass, name, diag);
+  }
+  
+  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) {
+      diag = a.toString() + " should not equal " + b.toString();
+    }
+    todo(pass, name, diag);
+  }
+
+  public void info(String name, String message) {
+    testInfo test = new testInfo(true, name, message, false);
+    _logResult(test, "TEST-INFO", "INFO FAILED?");
+  }
+}
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -46,26 +46,35 @@ include $(DEPTH)/config/autoconf.mk
 MODULE = robocop
 
 ROBOTIUM_PATH = $(srcdir)/robotium-solo-3.0.jar
 
 JAVAFILES = \
   R.java \
 
 _JAVA_HARNESS = \
+  Actions.java \
+  Assert.java \
   Driver.java \
   Element.java \
-  Actions.java \
+  FennecNativeActions.java \
+  FennecNativeAssert.java \
+  FennecNativeDriver.java \
   FennecNativeElement.java \
   RoboCopException.java \
-  FennecNativeDriver.java \
-  FennecNativeActions.java \
+  $(NULL)
 
 _JAVA_TESTS = $(patsubst $(TESTPATH)/%.in,%,$(wildcard $(TESTPATH)/*.java.in))
 
+_TEST_FILES = \
+  $(TESTPATH)/robocop_blank_01.html \
+  $(TESTPATH)/robocop_blank_02.html \
+  $(TESTPATH)/robocop_blank_03.html \
+  $(NULL)
+
 _ROBOCOP_TOOLS = \
   $(TESTPATH)/robocop.ini \
   parse_ids.py \
   $(NULL)
 
 GARBAGE += \
   AndroidManifest.xml \
   _JAVA_TESTS \
@@ -99,23 +108,26 @@ AndroidManifest.xml: % : %.in
 $(_JAVA_TESTS): % : $(TESTPATH)/%.in
 	$(NSINSTALL) -D $(DEPTH)/mobile/android/base/tests
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $< > $(DEPTH)/mobile/android/base/tests/$@
 
 $(_ROBOCOP_TOOLS):
 	cp $(TESTPATH)/robocop.ini robocop.ini
 	cp $(srcdir)/parse_ids.txt parse_ids.txt
 
+libs:: $(_TEST_FILES)
+	$(NSINSTALL) -D $(DEPTH)/_tests/testing/mochitest/tests/robocop
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/robocop/
+
 tools:: robocop.apk
 
 classes.dex: robocop.ap_
 classes.dex: $(_ROBOCOP_TOOLS)
 classes.dex: $(_JAVA_HARNESS)
 classes.dex: $(_JAVA_TESTS)
-classes.dex: $(TEST_FILES)
 	$(NSINSTALL) -D classes
 	$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(addprefix $(DEPTH)/mobile/android/base/tests/,$(_JAVA_TESTS))
 	$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH)
 
 robocop.ap_: AndroidManifest.xml
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -I . -S res -F $@ -J ./
 
 robocop-unsigned-unaligned.apk: robocop.ap_ classes.dex
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/robocop.ini
@@ -0,0 +1,7 @@
+[testAwesomebar]
+[testBookmark]
+[testLoad]
+[testNewTab]
+
+# Used for Talos, please don't use in mochitest
+#[testPan]
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/robocop_blank_01.html
@@ -0,0 +1,6 @@
+<html>
+<title>Browser Blank Page 01</title>
+<body>
+<p>Browser Blank Page 01</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/robocop_blank_02.html
@@ -0,0 +1,7 @@
+<html>
+<title>Browser Blank Page 02</title>
+<link rel="shortcut icon" href="data:image/gif;base64,R0lGODlhCwALAIAAAAAA3pn/ZiH5BAEAAAEALAAAAAALAAsAAAIUhA+hkcuO4lmNVindo7qyrIXiGBYAOw==" />
+<body>
+<p>Browser Blank Page 02</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/robocop_blank_03.html
@@ -0,0 +1,6 @@
+<html>
+<title>Browser Blank Page 03</title>
+<body>
+<p>Browser Blank Page 03</p>
+</body>
+</html>
--- a/mobile/android/base/tests/testAwesomebar.java.in
+++ b/mobile/android/base/tests/testAwesomebar.java.in
@@ -20,16 +20,17 @@ public class testAwesomebar extends Acti
     super(activityClass);
     // TODO Auto-generated constructor stub
   }
   private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";	
   private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME="@ANDROID_PACKAGE_NAME@.App";
   private Solo solo;    
   private Activity activity;
   private Driver driver;
+  private Assert asserter;
   private Actions actions;
   private static Class<?> launcherActivityClass;
 
   static{
     try{
       launcherActivityClass = Class.forName(LAUNCH_ACTIVITY_FULL_CLASSNAME);	
     } catch (ClassNotFoundException e){
       throw new RuntimeException(e);	
@@ -57,49 +58,53 @@ public class testAwesomebar extends Acti
     setActivityIntent(i);
     activity = getActivity();
 
     //Set up Robotium.solo and Driver objects
     solo = new Solo(getInstrumentation(), getActivity());
     driver = new FennecNativeDriver(activity, solo);
     actions = new FennecNativeActions(activity, solo, getInstrumentation());
     driver.setLogFile((String)config.get("logfile"));
+    
+    asserter = new FennecNativeAssert();
+    asserter.setLogFile((String)config.get("logfile"));
   }
 
   public void testAwesomebar() {
-    // TODO: find a better way to not hardcode this url
-    String url = "http://mochi.test:8888/tests/robocop/robocop.html";
+    String url = "http://mochi.test:8888/tests/robocop/robocop_blank_01.html";
     actions.waitForGeckoEvent("Gecko:Ready");
     Element awesomebar = driver.findElement("awesome_bar");
     awesomebar.click();
 
     Element urlbar = driver.findElement("awesomebar_text");
     getInstrumentation().waitForIdleSync();
     actions.sendKeys(url);
-    driver.is(urlbar.getText(), url, "Awesomebar URL Typed Properly");
+    asserter.is(urlbar.getText(), url, "Awesomebar URL Typed Properly");
+
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);
     //wait for screen to load
     actions.waitForGeckoEvent("DOMContentLoaded");
     driver.setupScrollHandling();
+
     //Calculate where we should be dragging.
     int midX = driver.getGeckoLeft() + driver.getGeckoWidth()/2;
     int midY = driver.getGeckoTop() + driver.getGeckoHeight()/2;
     int endY = driver.getGeckoTop() + driver.getGeckoHeight()/10;
     for(int i = 0; i < 10; i++) {
       actions.drag(midX,midX,midY,endY);
       try {
         Thread.sleep(200);
       } catch (InterruptedException e) {
         e.printStackTrace();
       }
     }
     //Click the awesomebar again 
     awesomebar.click();
     getInstrumentation().waitForIdleSync();
-    driver.is(urlbar.getText(), url, "Aweosmebar URL stayed the same");
+    asserter.is(urlbar.getText(), url, "Awesomebar URL stayed the same");
   }	
   
   @Override	
   public void tearDown() throws Exception {	
     try	{
       solo.finalize();	
     }catch (Throwable e){	
       e.printStackTrace();	
--- a/mobile/android/base/tests/testBookmark.java.in
+++ b/mobile/android/base/tests/testBookmark.java.in
@@ -20,16 +20,17 @@ public class testBookmark extends Activi
     super(activityClass);
     // TODO Auto-generated constructor stub
   }
   private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";	
   private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME="@ANDROID_PACKAGE_NAME@.App";
   private Solo solo;    
   private Activity activity;
   private Driver driver;
+  private Assert asserter;
   private Actions actions;
   private static Class<?> launcherActivityClass;
 
   static{
     try{
       launcherActivityClass = Class.forName(LAUNCH_ACTIVITY_FULL_CLASSNAME);	
     } catch (ClassNotFoundException e){
       throw new RuntimeException(e);	
@@ -57,55 +58,57 @@ public class testBookmark extends Activi
     setActivityIntent(i);
     activity = getActivity();
     
     //Set up Robotium.solo and Driver objects
     solo = new Solo(getInstrumentation(), getActivity());	
     driver = new FennecNativeDriver(activity, solo);
     actions = new FennecNativeActions(activity, solo, getInstrumentation());
     driver.setLogFile((String)config.get("logfile"));
+    
+    asserter = new FennecNativeAssert();
+    asserter.setLogFile((String)config.get("logfile"));
   } 	
 
   public void testBookmark(){
     // TODO: find a better way to not hardcode this url
-    String url = "http://mochi.test:8888/tests/robocop/robocop.html";
+    String url = "http://mochi.test:8888/tests/robocop/robocop_blank_02.html";
 
     actions.waitForGeckoEvent("Gecko:Ready");
     Element awesomebar = driver.findElement("awesome_bar");
     awesomebar.click();
 
     Element urlbar = driver.findElement("awesomebar_text");
     getInstrumentation().waitForIdleSync();
     actions.sendKeys(url);
-    driver.is(urlbar.getText(), url, "Awesomebar url typed properly");
+    asserter.is(urlbar.getText(), url, "Awesomebar url typed properly");
 
     //Click the top item in the list.
     actions.sendSpecialKey(Actions.SpecialKey.DOWN);
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);    
     actions.waitForGeckoEvent("DOMContentLoaded");
 
     getInstrumentation().waitForIdleSync();
     awesomebar.click();
-    driver.is(urlbar.getText(), url, "Awesomebar URL still on");
-    
+    asserter.is(urlbar.getText(), url, "Awesomebar URL still on");
 
     //Click the Top item in the history list.
     getInstrumentation().waitForIdleSync();
     actions.sendSpecialKey(Actions.SpecialKey.RIGHT);
     actions.sendSpecialKey(Actions.SpecialKey.RIGHT);
     getInstrumentation().waitForIdleSync();
     actions.sendSpecialKey(Actions.SpecialKey.DOWN);
     actions.sendSpecialKey(Actions.SpecialKey.DOWN);
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);
     actions.waitForGeckoEvent("DOMContentLoaded");
 
     getInstrumentation().waitForIdleSync();
     awesomebar.click();
     //Unfortunately, the item isn't constant so can't be tested.
-    //driver.is(url, urlbar.getText(),"Shouldn't this be the last url in the history?");
+    //asserter.is(url, urlbar.getText(),"Shouldn't this be the last url in the history?");
   }
   
   @Override	
   public void tearDown() throws Exception {	
     try	{
       solo.finalize();	
     }catch (Throwable e){	
       e.printStackTrace();	
--- a/mobile/android/base/tests/testLoad.java.in
+++ b/mobile/android/base/tests/testLoad.java.in
@@ -20,16 +20,17 @@ public class testLoad extends ActivityIn
     super(activityClass);
     // TODO Auto-generated constructor stub
   }
   private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";	
   private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME="@ANDROID_PACKAGE_NAME@.App";
   private Solo solo;    
   private Activity activity;
   private Driver driver;
+  private Assert asserter;
   private Actions actions;
   private static Class<?> launcherActivityClass;
 
   static{
     try{
       launcherActivityClass = Class.forName(LAUNCH_ACTIVITY_FULL_CLASSNAME);	
     } catch (ClassNotFoundException e){
       throw new RuntimeException(e);	
@@ -57,40 +58,43 @@ public class testLoad extends ActivityIn
     setActivityIntent(i);
     activity = getActivity();
 
     //Set up Robotium.solo and Driver objects
     solo = new Solo(getInstrumentation(), getActivity());	
     driver = new FennecNativeDriver(activity, solo);
     actions = new FennecNativeActions(activity, solo, getInstrumentation());
     driver.setLogFile((String)config.get("logfile"));
+    
+    asserter = new FennecNativeAssert();
+    asserter.setLogFile((String)config.get("logfile"));
   } 	
 
   public void testLoad(){
     // TODO: find a better way to not hardcode this url
-    String url = "http://mochi.test:8888/tests/robocop/robocop.html";
+    String url = "http://mochi.test:8888/tests/robocop/robocop_blank_03.html";
 
     actions.waitForGeckoEvent("Gecko:Ready");
     Element awesomebar = driver.findElement("awesome_bar");
     awesomebar.click();
 
     Element urlbar = driver.findElement("awesomebar_text");
     getInstrumentation().waitForIdleSync();
     actions.sendKeys(url);
     getInstrumentation().waitForIdleSync();
-    driver.is(urlbar.getText(), url, "Awesomebar URL Correct");
+    asserter.is(urlbar.getText(), url, "Awesomebar URL Correct");
 
     //Select top item in the list.
     actions.sendSpecialKey(Actions.SpecialKey.DOWN);
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);
     actions.waitForGeckoEvent("DOMContentLoaded");
 
     awesomebar.click();
     getInstrumentation().waitForIdleSync();
-    driver.is(urlbar.getText(), url, "Awesomebar URL is still correct");
+    asserter.is(urlbar.getText(), url, "Awesomebar URL is still correct");
   }
 
   @Override	
   public void tearDown() throws Exception {	
     try	{
       solo.finalize();	
     }catch (Throwable e){	
       e.printStackTrace();	
--- a/mobile/android/base/tests/testNewTab.java.in
+++ b/mobile/android/base/tests/testNewTab.java.in
@@ -21,16 +21,17 @@ public class testNewTab extends Activity
     // TODO Auto-generated constructor stub
   }
   private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";	
   private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME="@ANDROID_PACKAGE_NAME@.App";
   private Solo solo;    
   private Activity activity;
   private Actions actions;
   private Driver driver;
+  private Assert asserter;
   private static Class<?> launcherActivityClass;
 
   static{
     try{
       launcherActivityClass = Class.forName(LAUNCH_ACTIVITY_FULL_CLASSNAME);	
     } catch (ClassNotFoundException e){
       throw new RuntimeException(e);	
     }	
@@ -57,53 +58,57 @@ public class testNewTab extends Activity
     setActivityIntent(i);
     activity = getActivity();
 
     //Set up Robotium.solo and Driver objects
     solo = new Solo(getInstrumentation(), getActivity());
     driver = new FennecNativeDriver(activity, solo);
     actions = new FennecNativeActions(activity, solo, getInstrumentation());
     driver.setLogFile((String)config.get("logfile"));
+    
+    asserter = new FennecNativeAssert();
+    asserter.setLogFile((String)config.get("logfile"));
   }
 
   public void testNewTab(){
     // TODO: find a better way to not hardcode this url
-    String url = "http://mochi.test:8888/tests/robocop/robocop.html";
+    String url = "http://mochi.test:8888/tests/robocop/robocop_blank_01.html";
+    String url2 = "http://mochi.test:8888/tests/robocop/robocop_blank_02.html";
     actions.waitForGeckoEvent("Gecko:Ready");
     Element tabs = driver.findElement("tabs");
     //Add one tab
     tabs.click();
 
     Element urlbar = driver.findElement("awesomebar_text");
     getInstrumentation().waitForIdleSync();
     actions.sendKeys(url);
-    driver.is(urlbar.getText(), url, "Awesomebar url is fine");
+    asserter.is(urlbar.getText(), url, "Awesomebar url is fine");
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);
     actions.waitForGeckoEvent("DOMContentLoaded");
 
     try{Thread.sleep(5000);}catch(Throwable e){};
     //See tab count
     Element tabCount = driver.findElement("tabs_count");
-    driver.is(tabCount.getText(), "2", "Number of tabs has increased");
+    asserter.is(tabCount.getText(), "2", "Number of tabs has increased");
 
     //Click tab list
     tabs.click();
     Element addTab = driver.findElement("add_tab");
 
     //Add another tab
     addTab.click();
     getInstrumentation().waitForIdleSync();
-    actions.sendKeys(url);
+    actions.sendKeys(url2);
     getInstrumentation().waitForIdleSync();
-    driver.is(urlbar.getText(), url, "URL is still fine");
+    asserter.is(urlbar.getText(), url2, "URL is still fine");
 
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);
     actions.waitForGeckoEvent("DOMContentLoaded");
     //Check tab count another time.
-    driver.is(tabCount.getText(), "3", "Number of tabs has increased");
+    asserter.is(tabCount.getText(), "3", "Number of tabs has increased");
 
   }
 
   @Override	
   public void tearDown() throws Exception {	
     try	{
       solo.finalize();	
     }catch (Throwable e){	
--- a/mobile/android/base/tests/testPan.java.in
+++ b/mobile/android/base/tests/testPan.java.in
@@ -23,16 +23,17 @@ public class testPan extends ActivityIns
     // TODO Auto-generated constructor stub
   }
   private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";	
   private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME="@ANDROID_PACKAGE_NAME@.App";
   private Solo solo;    
   private Activity activity;
   private Driver driver;
   private Actions actions;
+  private Assert asserter;
   private static Class<?> launcherActivityClass;
 
   static{
     try{
       launcherActivityClass = Class.forName(LAUNCH_ACTIVITY_FULL_CLASSNAME);	
     } catch (ClassNotFoundException e){
       throw new RuntimeException(e);	
     }	
@@ -59,29 +60,32 @@ public class testPan extends ActivityIns
     setActivityIntent(i);
     activity = getActivity();
 
     //Set up Robotium.solo and Driver objects
     solo = new Solo(getInstrumentation(), getActivity());
     driver = new FennecNativeDriver(activity, solo);
     actions = new FennecNativeActions(activity, solo, getInstrumentation());
     driver.setLogFile((String)config.get("logfile"));
+
+    asserter = new FennecNativeAssert();
+    asserter.setLogFile((String)config.get("logfile"));
   }
 
   public void testPan() {
     // TODO: find a better way to not hardcode this url
-    String url = "http://mochi.test:8888/tests/robocop/pantest.html";
+    String url = "http://mochi.test:8888/startup_test/fenncmark/wikipedia.html";
     actions.waitForGeckoEvent("Gecko:Ready");
     Element awesomebar = driver.findElement("awesome_bar");
     awesomebar.click();
 
     Element urlbar = driver.findElement("awesomebar_text");
     getInstrumentation().waitForIdleSync();
     actions.sendKeys(url);
-    driver.is(url, urlbar.getText(),"Asserting Awesomebar typing works");
+    asserter.is(url, urlbar.getText(),"Asserting Awesomebar typing works");
 
     actions.sendSpecialKey(Actions.SpecialKey.ENTER);
     actions.waitForGeckoEvent("DOMContentLoaded");
     driver.setupScrollHandling();
 
     // Setup scrolling coordinates.
     int midX = driver.getGeckoLeft() + driver.getGeckoWidth()/2;
     int midY = driver.getGeckoTop() + driver.getGeckoHeight()/2;
@@ -96,17 +100,17 @@ public class testPan extends ActivityIns
       try {
         Thread.sleep(200);
       }
       catch (InterruptedException e) {
         e.printStackTrace();
       }
       i++;
     } while( i < 1000 && driver.getScrollHeight() + 2*driver.getHeight() < driver.getPageHeight() );
-    driver.ok(i < 1000, "Less than 1000", "Should take less than 1000 drags to get to bottom of the page.");
+//    asserter.ok(i < 1000, "Less than 1000", "Should take less than 1000 drags to get to bottom of the page.");
 
     int frames = driver.stopFrameRecording();
     driver.dumpLog("__start_report" + Integer.toString(frames) + "__end_report");
     Long msecs = System.currentTimeMillis();
     driver.dumpLog("__startTimestamp" + msecs.toString() + "__endTimestamp");
   }	
 
   @Override