OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL; | 7 import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL; |
8 import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW; | 8 import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW; |
9 import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE; | 9 import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE; |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 @Override | 135 @Override |
136 public void removeModerateBinding() { | 136 public void removeModerateBinding() { |
137 mModerateBindingBound = false; | 137 mModerateBindingBound = false; |
138 } | 138 } |
139 | 139 |
140 @Override | 140 @Override |
141 public boolean isModerateBindingBound() { | 141 public boolean isModerateBindingBound() { |
142 return mModerateBindingBound; | 142 return mModerateBindingBound; |
143 } | 143 } |
| 144 |
| 145 @Override |
| 146 public String getPackageName() { |
| 147 return null; |
| 148 } |
144 } | 149 } |
145 | 150 |
146 /** | 151 /** |
147 * Helper class that stores a manager along with its text label. This is use
d for tests that | 152 * Helper class that stores a manager along with its text label. This is use
d for tests that |
148 * iterate over all managers to indicate which manager was being tested when
an assertion | 153 * iterate over all managers to indicate which manager was being tested when
an assertion |
149 * failed. | 154 * failed. |
150 */ | 155 */ |
151 private static class ManagerEntry { | 156 private static class ManagerEntry { |
152 BindingManagerImpl mManager; | 157 BindingManagerImpl mManager; |
153 String mLabel; // Name of the manager. | 158 String mLabel; // Name of the manager. |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 | 711 |
707 manager.onSentToBackground(); | 712 manager.onSentToBackground(); |
708 Robolectric.runUiThreadTasksIncludingDelayedTasks(); | 713 Robolectric.runUiThreadTasksIncludingDelayedTasks(); |
709 Assert.assertFalse(connection.isModerateBindingBound()); | 714 Assert.assertFalse(connection.isModerateBindingBound()); |
710 | 715 |
711 // Bringing Chrome to the foreground should not re-add the moderate bind
ings. | 716 // Bringing Chrome to the foreground should not re-add the moderate bind
ings. |
712 manager.onBroughtToForeground(); | 717 manager.onBroughtToForeground(); |
713 Assert.assertFalse(connection.isModerateBindingBound()); | 718 Assert.assertFalse(connection.isModerateBindingBound()); |
714 } | 719 } |
715 } | 720 } |
OLD | NEW |