Bug 744094 - Shorten enum value identifiers to be less redundant. r=jmaher

This commit is contained in:
Kartikaya Gupta 2012-04-10 14:20:46 -05:00
Родитель 63b74ed81b
Коммит 26b3d342e4
5 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -63,12 +63,12 @@ public class FennecMochitestAssert implements Assert {
/** Write information to a logfile and logcat */
public void dumpLog(String message) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_INFO, message);
FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message);
}
/** Write information to a logfile and logcat */
public void dumpLog(String message, Throwable t) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_INFO, message, t);
FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message, t);
}
/** Set the filename used for dumpLog. */

Просмотреть файл

@ -137,7 +137,7 @@ public class FennecNativeActions implements Actions {
if(methodName.equals("hashCode")) {
return 314;
}
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_DEBUG,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.DEBUG,
"Waking up on "+methodName);
mEventExpecter.notifyOfEvent();
return null;
@ -163,7 +163,7 @@ public class FennecNativeActions implements Actions {
break;
}
}
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_DEBUG,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.DEBUG,
"unblocked on expecter for " + mGeckoEvent);
}
@ -179,7 +179,7 @@ public class FennecNativeActions implements Actions {
} catch (InvocationTargetException e) {
e.printStackTrace();
}
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_DEBUG,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.DEBUG,
"received event " + mGeckoEvent);
synchronized (this) {
mEventReceived = true;
@ -189,7 +189,7 @@ public class FennecNativeActions implements Actions {
}
public EventExpecter expectGeckoEvent(String geckoEvent) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_DEBUG,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.DEBUG,
"waiting for "+geckoEvent);
try {
Class [] interfaces = new Class[1];
@ -222,7 +222,7 @@ public class FennecNativeActions implements Actions {
public Object invoke(Object proxy, Method method, Object[] args) {
String methodName = method.getName();
if ("drawFinished".equals(methodName)) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_DEBUG,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.DEBUG,
"Received drawFinished notification");
mPaintExpecter.notifyOfEvent();
} else if ("toString".equals(methodName)) {

Просмотреть файл

@ -78,7 +78,7 @@ public class FennecNativeDriver implements Driver {
private Solo mSolo;
private static String mLogFile = null;
private static LogLevel mLogLevel = LogLevel.LOG_LEVEL_INFO;
private static LogLevel mLogLevel = LogLevel.INFO;
// Objects for reflexive access of fennec classes.
private ClassLoader mClassLoader;
@ -95,10 +95,10 @@ public class FennecNativeDriver implements Driver {
private Method _getPixels;
public enum LogLevel {
LOG_LEVEL_DEBUG(1),
LOG_LEVEL_INFO(2),
LOG_LEVEL_WARN(3),
LOG_LEVEL_ERROR(4);
DEBUG(1),
INFO(2),
WARN(3),
ERROR(4);
private int mValue;
LogLevel(int value) {
@ -366,7 +366,7 @@ public class FennecNativeDriver implements Driver {
}
} catch( Throwable e) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_WARN,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.WARN,
"WARNING: ScrollReceived, but read wrong!");
}
return null;
@ -493,13 +493,13 @@ public class FennecNativeDriver implements Driver {
}
}
if (level == LogLevel.LOG_LEVEL_INFO) {
if (level == LogLevel.INFO) {
Log.i("Robocop", message, t);
} else if (level == LogLevel.LOG_LEVEL_DEBUG) {
} else if (level == LogLevel.DEBUG) {
Log.d("Robocop", message, t);
} else if (level == LogLevel.LOG_LEVEL_WARN) {
} else if (level == LogLevel.WARN) {
Log.w("Robocop", message, t);
} else if (level == LogLevel.LOG_LEVEL_ERROR) {
} else if (level == LogLevel.ERROR) {
Log.e("Robocop", message, t);
}
}

Просмотреть файл

@ -76,7 +76,7 @@ public class FennecNativeElement implements Element {
View view = (View)mActivity.findViewById(mId);
if(view != null) {
if (!view.performClick()) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_WARN,
FennecNativeDriver.log(FennecNativeDriver.LogLevel.WARN,
"Robocop called click on an element with no listener");
}
} else {

Просмотреть файл

@ -46,12 +46,12 @@ public class FennecTalosAssert implements Assert {
* Write information to a logfile and logcat
*/
public void dumpLog(String message) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_INFO, message);
FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message);
}
/** Write information to a logfile and logcat */
public void dumpLog(String message, Throwable t) {
FennecNativeDriver.log(FennecNativeDriver.LogLevel.LOG_LEVEL_INFO, message, t);
FennecNativeDriver.log(FennecNativeDriver.LogLevel.INFO, message, t);
}
/**