Index: chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.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/LogcatExtractionCallableUnitTest.java |
index 95facbcccc7e7b7fb5f4a7f90343fdeca8d410ea..73198af26dbb49556a757a07e9c4ceb45b80e50b 100644 |
--- a/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.java |
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.java |
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.crash; |
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.junit.Assert.assertArrayEquals; |
import static org.junit.Assert.assertEquals; |
import static org.junit.Assert.fail; |
@@ -149,46 +150,57 @@ public class LogcatExtractionCallableUnitTest { |
@Test |
public void testLogcatWithoutBeginOrEnd_largeLogcat() { |
- final List<String> original = Arrays.asList("Line 1", "Line 2", "Line 3", "Line 4", |
- "Line 5", "Redundant Line 1", "Redundant Line 2"); |
- final List<String> expected = Arrays.asList("Line 1", "Line 2", "Line 3", "Line 4", |
- "Line 5"); |
+ final List<String> original = Arrays.asList("Trimmed Line 1", "Trimmed Line 2", "Line 3", |
+ "Line 4", "Line 5", "Line 6", "Line 7"); |
+ final List<String> expected = |
+ Arrays.asList("Line 3", "Line 4", "Line 5", "Line 6", "Line 7"); |
assertLogcatLists(expected, original); |
} |
@Test |
public void testLogcatBeginsWithBegin() { |
final List<String> original = Arrays.asList(BEGIN_MICRODUMP, "a", "b", "c", "d", "e"); |
- assertLogcatLists(new LinkedList<String>(), original); |
+ final List<String> expected = Arrays.asList(SNIPPED_MICRODUMP); |
+ assertLogcatLists(expected, original); |
} |
@Test |
public void testLogcatWithBegin() { |
final List<String> original = Arrays.asList("Line 1", "Line 2", BEGIN_MICRODUMP, "a", |
"b", "c", "d", "e"); |
- final List<String> expected = Arrays.asList("Line 1", "Line 2"); |
+ final List<String> expected = Arrays.asList("Line 1", "Line 2", SNIPPED_MICRODUMP); |
assertLogcatLists(expected, original); |
} |
@Test |
public void testLogcatWithEnd() { |
final List<String> original = Arrays.asList("Line 1", "Line 2", END_MICRODUMP); |
- assertLogcatLists(new LinkedList<String>(), original); |
+ assertLogcatLists(original, original); |
} |
@Test |
public void testLogcatWithBeginAndEnd_smallLogcat() { |
final List<String> original = Arrays.asList("Line 1", "Line 2", BEGIN_MICRODUMP, "a", "b", |
"c", "d", "e", END_MICRODUMP); |
- final List<String> expected = Arrays.asList("Line 1", "Line 2"); |
+ final List<String> expected = Arrays.asList("Line 1", "Line 2", SNIPPED_MICRODUMP); |
assertLogcatLists(expected, original); |
} |
@Test |
- public void testLogcatWithBeginAndEnd_largeLogcat() { |
+ public void testLogcatWithBeginAndEnd_splitLogcat() { |
final List<String> original = Arrays.asList("Line 1", "Line 2", BEGIN_MICRODUMP, "a", "b", |
- "c", "d", "e", END_MICRODUMP, "Line 3", "Line 4"); |
- final List<String> expected = Arrays.asList("Line 1", "Line 2", "Line 3", "Line 4"); |
+ "c", "d", "e", END_MICRODUMP, "Trimmed Line 3", "Trimmed Line 4"); |
+ final List<String> expected = Arrays.asList("Line 1", "Line 2", SNIPPED_MICRODUMP); |
+ assertLogcatLists(expected, original); |
+ } |
+ |
+ @Test |
+ public void testLogcatWithBeginAndEnd_largeLogcat() { |
+ final List<String> original = Arrays.asList("Trimmed Line 1", "Trimmed Line 2", "Line 3", |
+ "Line 4", "Line 5", "Line 6", BEGIN_MICRODUMP, "a", "b", "c", "d", "e", |
+ END_MICRODUMP, "Trimmed Line 7", "Trimmed Line 8"); |
+ final List<String> expected = |
+ Arrays.asList("Line 3", "Line 4", "Line 5", "Line 6", SNIPPED_MICRODUMP); |
assertLogcatLists(expected, original); |
} |
@@ -196,15 +208,18 @@ public class LogcatExtractionCallableUnitTest { |
public void testLogcatWithEndAndBegin_smallLogcat() { |
final List<String> original = Arrays.asList(END_MICRODUMP, "Line 1", "Line 2", |
BEGIN_MICRODUMP, "a", "b", "c", "d", "e"); |
- final List<String> expected = Arrays.asList("Line 1", "Line 2"); |
+ final List<String> expected = |
+ Arrays.asList(END_MICRODUMP, "Line 1", "Line 2", SNIPPED_MICRODUMP); |
assertLogcatLists(expected, original); |
} |
@Test |
public void testLogcatWithEndAndBegin_largeLogcat() { |
- final List<String> original = Arrays.asList(END_MICRODUMP, "Line 1", "Line 2", |
- BEGIN_MICRODUMP, "a", "b", "c", "d", "e", END_MICRODUMP, "Line 3", "Line 4"); |
- final List<String> expected = Arrays.asList("Line 1", "Line 2", "Line 3", "Line 4"); |
+ final List<String> original = |
+ Arrays.asList(END_MICRODUMP, "Line 1", "Line 2", BEGIN_MICRODUMP, "a", "b", "c", |
+ "d", "e", END_MICRODUMP, "Trimmed Line 3", "Trimmed Line 4"); |
+ final List<String> expected = |
+ Arrays.asList(END_MICRODUMP, "Line 1", "Line 2", SNIPPED_MICRODUMP); |
assertLogcatLists(expected, original); |
} |