2012-02-02 07:09:26 -08:00
|
|
|
#filter substitution
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2012-02-02 07:09:26 -08:00
|
|
|
|
|
|
|
package @ANDROID_PACKAGE_NAME@;
|
|
|
|
|
|
|
|
|
|
|
|
public class FennecTalosAssert implements Assert {
|
2012-02-15 06:56:20 -08:00
|
|
|
|
|
|
|
public FennecTalosAssert() { }
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-02-15 06:56:20 -08:00
|
|
|
/**
|
|
|
|
* Write information to a logfile and logcat
|
|
|
|
*/
|
|
|
|
public void dumpLog(String message) {
|
2012-04-10 12:20:46 -07:00
|
|
|
FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message);
|
2012-02-15 06:56:20 -08:00
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-03-27 13:16:13 -07:00
|
|
|
/** Write information to a logfile and logcat */
|
|
|
|
public void dumpLog(String message, Throwable t) {
|
2012-04-10 12:20:46 -07:00
|
|
|
FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message, t);
|
2012-03-27 13:16:13 -07:00
|
|
|
}
|
|
|
|
|
2012-02-15 06:56:20 -08:00
|
|
|
/**
|
|
|
|
* Set the filename used for dumpLog.
|
|
|
|
*/
|
|
|
|
public void setLogFile(String filename) {
|
|
|
|
FennecNativeDriver.setLogFile(filename);
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-02-15 06:56:20 -08:00
|
|
|
public void setTestName(String testName) { }
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-02-15 06:56:20 -08:00
|
|
|
public void finalize() { }
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void ok(boolean condition, String name, String diag) {
|
|
|
|
if (!condition) {
|
|
|
|
dumpLog("__FAIL" + name + ": " + diag + "__FAIL");
|
|
|
|
}
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void is(Object a, Object b, String name) {
|
|
|
|
boolean pass = (a == null ? b == null : a.equals(b));
|
|
|
|
ok(pass, name, "got " + a + ", expected " + b);
|
|
|
|
}
|
2012-02-15 06:56:20 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void isnot(Object a, Object b, String name) {
|
|
|
|
boolean fail = (a == null ? b == null : a.equals(b));
|
|
|
|
ok(!fail, name, "got " + a + ", expected not " + b);
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void ispixel(int actual, int r, int g, int b, String name) {
|
|
|
|
throw new UnsupportedOperationException();
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void todo(boolean condition, String name, String diag) {
|
|
|
|
throw new UnsupportedOperationException();
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void todo_is(Object a, Object b, String name) {
|
|
|
|
throw new UnsupportedOperationException();
|
|
|
|
}
|
2012-02-15 06:56:20 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void todo_isnot(Object a, Object b, String name) {
|
|
|
|
throw new UnsupportedOperationException();
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
|
2012-07-19 11:18:36 -07:00
|
|
|
public void info(String name, String message) {
|
|
|
|
dumpLog(name + ": " + message);
|
|
|
|
}
|
2012-02-02 07:09:26 -08:00
|
|
|
}
|