Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2762)

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionRunnableUnitTest.java

Issue 2727573004: [Android Crash Reporting] Simplify crash report upload code. (Closed)
Patch Set: Fix up a comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionRunnableUnitTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionRunnableUnitTest.java
similarity index 86%
rename from chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.java
rename to chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionRunnableUnitTest.java
index c816e83d8c1a2b43547e9ea49671ffeaa036b946..00dbe0f8f31e8a4802c11c8d4413139942e9f050 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionRunnableUnitTest.java
@@ -7,9 +7,9 @@ package org.chromium.chrome.browser.crash;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
-import static org.chromium.chrome.browser.crash.LogcatExtractionCallable.BEGIN_MICRODUMP;
-import static org.chromium.chrome.browser.crash.LogcatExtractionCallable.END_MICRODUMP;
-import static org.chromium.chrome.browser.crash.LogcatExtractionCallable.SNIPPED_MICRODUMP;
+import static org.chromium.chrome.browser.crash.LogcatExtractionRunnable.BEGIN_MICRODUMP;
+import static org.chromium.chrome.browser.crash.LogcatExtractionRunnable.END_MICRODUMP;
+import static org.chromium.chrome.browser.crash.LogcatExtractionRunnable.SNIPPED_MICRODUMP;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -22,106 +22,106 @@ import java.util.LinkedList;
import java.util.List;
/**
- * junit tests for {@link LogcatExtractionCallable}.
+ * junit tests for {@link LogcatExtractionRunnable}.
*/
@RunWith(LocalRobolectricTestRunner.class)
@Config(manifest = Config.NONE)
-public class LogcatExtractionCallableUnitTest {
+public class LogcatExtractionRunnableUnitTest {
private static final int MAX_LINES = 5;
@Test
public void testElideEmail() {
String original = "email me at someguy@mailservice.com";
String expected = "email me at XXX@EMAIL.ELIDED";
- assertEquals(expected, LogcatExtractionCallable.elideEmail(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideEmail(original));
}
@Test
public void testElideUrl() {
String original = "file bugs at crbug.com";
String expected = "file bugs at HTTP://WEBADDRESS.ELIDED";
- assertEquals(expected, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideUrl2() {
String original =
- "exception at org.chromium.chrome.browser.crash.LogcatExtractionCallableUnitTest";
- assertEquals(original, LogcatExtractionCallable.elideUrl(original));
+ "exception at org.chromium.chrome.browser.crash.LogcatExtractionRunnableUnitTest";
+ assertEquals(original, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideUrl3() {
String original = "file bugs at crbug.com or code.google.com";
String expected = "file bugs at HTTP://WEBADDRESS.ELIDED or HTTP://WEBADDRESS.ELIDED";
- assertEquals(expected, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideUrl4() {
String original = "test shorturl.com !!!";
String expected = "test HTTP://WEBADDRESS.ELIDED !!!";
- assertEquals(expected, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideUrl5() {
String original = "test just.the.perfect.len.url !!!";
String expected = "test HTTP://WEBADDRESS.ELIDED !!!";
- assertEquals(expected, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideUrl6() {
String original = "test a.very.very.very.very.very.long.url !!!";
String expected = "test HTTP://WEBADDRESS.ELIDED !!!";
- assertEquals(expected, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideUrl7() {
String original = " at android.content.Intent \n at java.util.ArrayList";
- assertEquals(original, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(original, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testDontElideFileSuffixes() {
String original = "chromium_android_linker.so";
- assertEquals(original, LogcatExtractionCallable.elideUrl(original));
+ assertEquals(original, LogcatExtractionRunnable.elideUrl(original));
}
@Test
public void testElideIp() {
String original = "traceroute 127.0.0.1";
String expected = "traceroute 1.2.3.4";
- assertEquals(expected, LogcatExtractionCallable.elideIp(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideIp(original));
}
@Test
public void testElideMac1() {
String original = "MAC: AB-AB-AB-AB-AB-AB";
String expected = "MAC: 01:23:45:67:89:AB";
- assertEquals(expected, LogcatExtractionCallable.elideMac(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideMac(original));
}
@Test
public void testElideMac2() {
String original = "MAC: AB:AB:AB:AB:AB:AB";
String expected = "MAC: 01:23:45:67:89:AB";
- assertEquals(expected, LogcatExtractionCallable.elideMac(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideMac(original));
}
@Test
public void testElideConsole() {
String original = "I/chromium(123): [INFO:CONSOLE(2)] hello!";
String expected = "I/chromium(123): [ELIDED:CONSOLE(0)] ELIDED CONSOLE MESSAGE";
- assertEquals(expected, LogcatExtractionCallable.elideConsole(original));
+ assertEquals(expected, LogcatExtractionRunnable.elideConsole(original));
}
@Test
public void testLogTagNotElided() {
List<String> original = Arrays.asList(new String[] {"I/cr_FooBar(123): Some message"});
- assertEquals(original, LogcatExtractionCallable.processLogcat(original));
+ assertEquals(original, LogcatExtractionRunnable.elideLogcat(original));
}
@Test
@@ -215,7 +215,7 @@ public class LogcatExtractionCallableUnitTest {
private void assertLogcatLists(List<String> expected, List<String> original) {
// trimLogcat() expects a modifiable list as input.
LinkedList<String> rawLogcat = new LinkedList<String>(original);
- List<String> actualLogcat = LogcatExtractionCallable.trimLogcat(rawLogcat, MAX_LINES);
+ List<String> actualLogcat = LogcatExtractionRunnable.trimLogcat(rawLogcat, MAX_LINES);
assertArrayEquals(expected.toArray(), actualLogcat.toArray());
}
}

Powered by Google App Engine
This is Rietveld 408576698