Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: content/public/android/junit/src/org/chromium/content/browser/BindingManagerImplTest.java

Issue 2777013005: Moving IChildProcessService to base/ (Closed)
Patch Set: Moving IChildProcessService to base/ Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 import android.app.Activity; 11 import android.app.Activity;
12 import android.app.Application; 12 import android.app.Application;
13 import android.os.IBinder; 13 import android.os.IBinder;
14 import android.util.Pair; 14 import android.util.Pair;
15 15
16 import org.junit.Assert; 16 import org.junit.Assert;
17 import org.junit.Before; 17 import org.junit.Before;
18 import org.junit.Test; 18 import org.junit.Test;
19 import org.junit.runner.RunWith; 19 import org.junit.runner.RunWith;
20 20
21 import org.robolectric.Robolectric; 21 import org.robolectric.Robolectric;
22 import org.robolectric.annotation.Config; 22 import org.robolectric.annotation.Config;
23 import org.robolectric.shadows.ShadowLooper; 23 import org.robolectric.shadows.ShadowLooper;
24 24
25 import org.chromium.base.process_launcher.ChildProcessCreationParams; 25 import org.chromium.base.process_launcher.ChildProcessCreationParams;
26 import org.chromium.base.process_launcher.FileDescriptorInfo; 26 import org.chromium.base.process_launcher.FileDescriptorInfo;
27 import org.chromium.base.process_launcher.IChildProcessService;
27 import org.chromium.base.test.util.Feature; 28 import org.chromium.base.test.util.Feature;
28 import org.chromium.content.common.IChildProcessService;
29 import org.chromium.testing.local.LocalRobolectricTestRunner; 29 import org.chromium.testing.local.LocalRobolectricTestRunner;
30 30
31 import java.util.ArrayList; 31 import java.util.ArrayList;
32 32
33 /** 33 /**
34 * Unit tests for BindingManagerImpl. The tests run agains mock ChildProcessConn ection 34 * Unit tests for BindingManagerImpl. The tests run agains mock ChildProcessConn ection
35 * implementation, thus testing only the BindingManagerImpl itself. 35 * implementation, thus testing only the BindingManagerImpl itself.
36 * 36 *
37 * Default property of being low-end device is overriden, so that both low-end a nd high-end policies 37 * Default property of being low-end device is overriden, so that both low-end a nd high-end policies
38 * are tested. 38 * are tested.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 696
697 manager.onSentToBackground(); 697 manager.onSentToBackground();
698 ShadowLooper.runUiThreadTasksIncludingDelayedTasks(); 698 ShadowLooper.runUiThreadTasksIncludingDelayedTasks();
699 Assert.assertFalse(connection.isModerateBindingBound()); 699 Assert.assertFalse(connection.isModerateBindingBound());
700 700
701 // Bringing Chrome to the foreground should not re-add the moderate bind ings. 701 // Bringing Chrome to the foreground should not re-add the moderate bind ings.
702 manager.onBroughtToForeground(); 702 manager.onBroughtToForeground();
703 Assert.assertFalse(connection.isModerateBindingBound()); 703 Assert.assertFalse(connection.isModerateBindingBound());
704 } 704 }
705 } 705 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698