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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java

Issue 2795113003: Factor out inner-classes out of ChildProcessLauncher. (Closed)
Patch Set: Addressed boliu@'s comments. 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 android.content.ComponentName; 7 import android.content.ComponentName;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.ServiceConnection; 10 import android.content.ServiceConnection;
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 @Override 399 @Override
400 public boolean isSatisfied() { 400 public boolean isSatisfied() {
401 return conn.getService() != null; 401 return conn.getService() != null;
402 } 402 }
403 }); 403 });
404 404
405 assertEquals(0, conn.getServiceNumber()); 405 assertEquals(0, conn.getServiceNumber());
406 406
407 final ChildProcessConnection[] sandboxedConnections = 407 final ChildProcessConnection[] sandboxedConnections =
408 ChildProcessLauncher.getSandboxedConnectionArrayForTesting( 408 ChildProcessLauncher.getSandboxedConnectionArrayForTesting(
409 context.getPackageName()); 409 context, context.getPackageName());
410 410
411 // Wait for the retry to succeed. 411 // Wait for the retry to succeed.
412 CriteriaHelper.pollInstrumentationThread( 412 CriteriaHelper.pollInstrumentationThread(
413 new Criteria("Failed waiting for both child process services") { 413 new Criteria("Failed waiting for both child process services") {
414 @Override 414 @Override
415 public boolean isSatisfied() { 415 public boolean isSatisfied() {
416 boolean allChildrenConnected = true; 416 boolean allChildrenConnected = true;
417 for (int i = 0; i <= 1; ++i) { 417 for (int i = 0; i <= 1; ++i) {
418 ChildProcessConnection conn = sandboxedConnections[i ]; 418 ChildProcessConnection conn = sandboxedConnections[i ];
419 allChildrenConnected &= conn != null && conn.getServ ice() != null; 419 allChildrenConnected &= conn != null && conn.getServ ice() != null;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 return new ChildProcessCreationParams(packageName, false /* isExternalSe rvice */, 575 return new ChildProcessCreationParams(packageName, false /* isExternalSe rvice */,
576 LibraryProcessType.PROCESS_CHILD, false /* bindToCallerCheck */) ; 576 LibraryProcessType.PROCESS_CHILD, false /* bindToCallerCheck */) ;
577 } 577 }
578 578
579 private void triggerConnectionSetup(ChildProcessConnectionImpl connection) { 579 private void triggerConnectionSetup(ChildProcessConnectionImpl connection) {
580 ChildProcessLauncher.triggerConnectionSetup(connection, sProcessWaitArgu ments, 580 ChildProcessLauncher.triggerConnectionSetup(connection, sProcessWaitArgu ments,
581 1 /* childProcessId */, new FileDescriptorInfo[0], null /* launc hCallback */, 581 1 /* childProcessId */, new FileDescriptorInfo[0], null /* launc hCallback */,
582 null /* childProcessCallback */); 582 null /* childProcessCallback */);
583 } 583 }
584 } 584 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698