OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 android.content.Context; | 7 import android.content.Context; |
8 import android.os.Bundle; | 8 import android.os.Bundle; |
9 import android.support.test.filters.MediumTest; | 9 import android.support.test.filters.MediumTest; |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 @Rule | 36 @Rule |
37 public final ContentShellActivityTestRule mActivityTestRule = | 37 public final ContentShellActivityTestRule mActivityTestRule = |
38 new ContentShellActivityTestRule(); | 38 new ContentShellActivityTestRule(); |
39 | 39 |
40 private static class TestChildProcessConnectionFactory | 40 private static class TestChildProcessConnectionFactory |
41 implements ChildConnectionAllocator.ConnectionFactory { | 41 implements ChildConnectionAllocator.ConnectionFactory { |
42 private final List<TestChildProcessConnection> mConnections = new ArrayL
ist<>(); | 42 private final List<TestChildProcessConnection> mConnections = new ArrayL
ist<>(); |
43 | 43 |
44 @Override | 44 @Override |
45 public ChildProcessConnection createConnection(ChildSpawnData spawnData, | 45 public ChildProcessConnection createConnection(ChildSpawnData spawnData, |
46 ChildProcessConnection.DeathCallback deathCallback, | 46 ChildProcessConnection.DeathCallback deathCallback, String servi
ceClassName) { |
47 Bundle childProcessCommonParameters, String serviceClassName) { | |
48 TestChildProcessConnection connection = new TestChildProcessConnecti
on( | 47 TestChildProcessConnection connection = new TestChildProcessConnecti
on( |
49 spawnData.getContext(), deathCallback, serviceClassName, | 48 spawnData.getContext(), deathCallback, serviceClassName, |
50 childProcessCommonParameters, spawnData.getCreationParams())
; | 49 spawnData.getServiceBundle(), spawnData.getCreationParams())
; |
51 mConnections.add(connection); | 50 mConnections.add(connection); |
52 return connection; | 51 return connection; |
53 } | 52 } |
54 | 53 |
55 public List<TestChildProcessConnection> getConnections() { | 54 public List<TestChildProcessConnection> getConnections() { |
56 return mConnections; | 55 return mConnections; |
57 } | 56 } |
58 } | 57 } |
59 | 58 |
60 private static class TestChildProcessConnection extends ChildProcessConnecti
on { | 59 private static class TestChildProcessConnection extends ChildProcessConnecti
on { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ChildProcessLauncherTestUtils.runOnLauncherThreadBlocking(new Runnable()
{ | 136 ChildProcessLauncherTestUtils.runOnLauncherThreadBlocking(new Runnable()
{ |
138 @Override | 137 @Override |
139 public void run() { | 138 public void run() { |
140 Assert.assertEquals(2, connections.size()); | 139 Assert.assertEquals(2, connections.size()); |
141 // connections.get(0).didDropBothInitialAndImportantBindings(); | 140 // connections.get(0).didDropBothInitialAndImportantBindings(); |
142 connections.get(1).throwIfDroppedBothInitialAndStrongBinding(); | 141 connections.get(1).throwIfDroppedBothInitialAndStrongBinding(); |
143 } | 142 } |
144 }); | 143 }); |
145 } | 144 } |
146 } | 145 } |
OLD | NEW |