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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 @Override | 70 @Override |
71 public JobInfo getPendingJob(int jobId) { | 71 public JobInfo getPendingJob(int jobId) { |
72 return null; | 72 return null; |
73 } | 73 } |
74 | 74 |
75 @Override | 75 @Override |
76 public int schedule(JobInfo job) { | 76 public int schedule(JobInfo job) { |
77 assertEquals(TaskIds.CHROME_MINIDUMP_UPLOADING_JOB_ID, job.getId()); | 77 assertEquals(TaskIds.CHROME_MINIDUMP_UPLOADING_JOB_ID, job.getId()); |
78 assertEquals(ChromeMinidumpUploadJobService.class.getName(), | 78 assertEquals(ChromeMinidumpUploadJobService.class.getName(), |
79 job.getService().getClassName()); | 79 job.getService().getClassName()); |
80 return 0; | 80 return JobScheduler.RESULT_SUCCESS; |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 // Responsible for verifying that the correct intent is fired after the logc
at is extracted. | 84 // Responsible for verifying that the correct intent is fired after the logc
at is extracted. |
85 private class TestContext extends AdvancedMockContext { | 85 private class TestContext extends AdvancedMockContext { |
86 int mNumServiceStarts; | 86 int mNumServiceStarts; |
87 | 87 |
88 TestContext(Context realContext) { | 88 TestContext(Context realContext) { |
89 super(realContext); | 89 super(realContext); |
90 } | 90 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 setJobSchedulerEnabled(true); | 208 setJobSchedulerEnabled(true); |
209 final File minidump = createMinidump("test.dmp"); | 209 final File minidump = createMinidump("test.dmp"); |
210 Context testContext = new TestContext(getInstrumentation().getTargetCont
ext()); | 210 Context testContext = new TestContext(getInstrumentation().getTargetCont
ext()); |
211 | 211 |
212 LogcatExtractionRunnable runnable = new TestLogcatExtractionRunnable(tes
tContext, minidump); | 212 LogcatExtractionRunnable runnable = new TestLogcatExtractionRunnable(tes
tContext, minidump); |
213 runnable.run(); | 213 runnable.run(); |
214 | 214 |
215 verifyMinidumpWithLogcat("test.dmp.try0"); | 215 verifyMinidumpWithLogcat("test.dmp.try0"); |
216 } | 216 } |
217 } | 217 } |
OLD | NEW |