OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.crash; | 5 package org.chromium.chrome.browser.crash; |
6 | 6 |
7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.app.job.JobInfo; | 8 import android.app.job.JobInfo; |
9 import android.app.job.JobScheduler; | 9 import android.app.job.JobScheduler; |
10 import android.content.ComponentName; | 10 import android.content.ComponentName; |
(...skipping 22 matching lines...) Expand all Loading... |
33 public class LogcatExtractionRunnableTest extends CrashTestCase { | 33 public class LogcatExtractionRunnableTest extends CrashTestCase { |
34 private File mCrashDir; | 34 private File mCrashDir; |
35 | 35 |
36 private static final String BOUNDARY = "boundary"; | 36 private static final String BOUNDARY = "boundary"; |
37 private static final String MINIDUMP_CONTENTS = "important minidump contents
"; | 37 private static final String MINIDUMP_CONTENTS = "important minidump contents
"; |
38 private static final List<String> LOGCAT = | 38 private static final List<String> LOGCAT = |
39 Arrays.asList("some random log content", "some more deterministic lo
g content"); | 39 Arrays.asList("some random log content", "some more deterministic lo
g content"); |
40 | 40 |
41 private static class TestLogcatExtractionRunnable extends LogcatExtractionRu
nnable { | 41 private static class TestLogcatExtractionRunnable extends LogcatExtractionRu
nnable { |
42 TestLogcatExtractionRunnable(Context context, File minidump) { | 42 TestLogcatExtractionRunnable(Context context, File minidump) { |
43 super(context, minidump); | 43 super(minidump); |
44 } | 44 } |
45 | 45 |
46 @Override | 46 @Override |
47 protected List<String> getLogcat() { | 47 protected List<String> getLogcat() { |
48 return LOGCAT; | 48 return LOGCAT; |
49 } | 49 } |
50 }; | 50 }; |
51 | 51 |
52 @TargetApi(Build.VERSION_CODES.M) | 52 @TargetApi(Build.VERSION_CODES.M) |
53 private static class TestJobScheduler extends JobScheduler { | 53 private static class TestJobScheduler extends JobScheduler { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 final File minidump = createMinidump("test.dmp"); | 184 final File minidump = createMinidump("test.dmp"); |
185 Context testContext = new TestContext(getInstrumentation().getTargetCont
ext()); | 185 Context testContext = new TestContext(getInstrumentation().getTargetCont
ext()); |
186 | 186 |
187 LogcatExtractionRunnable runnable = new TestLogcatExtractionRunnable(tes
tContext, minidump); | 187 LogcatExtractionRunnable runnable = new TestLogcatExtractionRunnable(tes
tContext, minidump); |
188 runnable.run(); | 188 runnable.run(); |
189 | 189 |
190 verifyMinidumpWithLogcat("test.dmp.try0"); | 190 verifyMinidumpWithLogcat("test.dmp.try0"); |
191 } | 191 } |
192 } | 192 } |
OLD | NEW |