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 static org.chromium.chrome.browser.crash.MinidumpUploadService.BROWSER; | 7 import static org.chromium.chrome.browser.crash.MinidumpUploadService.BROWSER; |
8 import static org.chromium.chrome.browser.crash.MinidumpUploadService.GPU; | 8 import static org.chromium.chrome.browser.crash.MinidumpUploadService.GPU; |
9 import static org.chromium.chrome.browser.crash.MinidumpUploadService.OTHER; | 9 import static org.chromium.chrome.browser.crash.MinidumpUploadService.OTHER; |
10 import static org.chromium.chrome.browser.crash.MinidumpUploadService.RENDERER; | 10 import static org.chromium.chrome.browser.crash.MinidumpUploadService.RENDERER; |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 @Override | 564 @Override |
565 public Object getSystemService(String name) { | 565 public Object getSystemService(String name) { |
566 if (Context.JOB_SCHEDULER_SERVICE.equals(name)) { | 566 if (Context.JOB_SCHEDULER_SERVICE.equals(name)) { |
567 return new TestJobScheduler(this); | 567 return new TestJobScheduler(this); |
568 } | 568 } |
569 | 569 |
570 return super.getSystemService(name); | 570 return super.getSystemService(name); |
571 } | 571 } |
572 } | 572 } |
573 | 573 |
| 574 // TODO(crbug/716236): Refer to this crbug for compilation error after the O
SDK is rolled. |
574 /** | 575 /** |
575 * A JobScheduler wrapper that verifies that the expected properties are set
correctly. | 576 * A JobScheduler wrapper that verifies that the expected properties are set
correctly. |
576 */ | 577 */ |
577 @TargetApi(Build.VERSION_CODES.M) | 578 @TargetApi(Build.VERSION_CODES.M) |
578 private static class TestJobScheduler extends JobScheduler { | 579 private static class TestJobScheduler extends JobScheduler { |
579 static final String SCHEDULE_JOB_FLAG = "scheduleJobFlag"; | 580 static final String SCHEDULE_JOB_FLAG = "scheduleJobFlag"; |
580 | 581 |
581 private final AdvancedMockContext mContext; | 582 private final AdvancedMockContext mContext; |
582 | 583 |
583 TestJobScheduler(AdvancedMockContext context) { | 584 TestJobScheduler(AdvancedMockContext context) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 this.mTriggerNetworkChange = networkChange; | 634 this.mTriggerNetworkChange = networkChange; |
634 } | 635 } |
635 | 636 |
636 @Override | 637 @Override |
637 public Integer call() { | 638 public Integer call() { |
638 ++mCalledCount; | 639 ++mCalledCount; |
639 return mResult; | 640 return mResult; |
640 } | 641 } |
641 } | 642 } |
642 } | 643 } |
OLD | NEW |