• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 package org.chromium.native_test;
6 
7 import org.chromium.base.annotations.JNINamespace;
8 import org.chromium.base.annotations.NativeMethods;
9 
10 /**
11  * This class provides a way to run the native main method.
12  * It is used in the multi-process test case, so that the child process can call
13  * the main method without //base/test:test_support's linkage requiring the
14  * main() symbol.
15  */
16 @JNINamespace("testing::android")
17 public final class MainRunner {
18     // Prevents instantiation.
MainRunner()19     private MainRunner() {
20     }
21 
22     // Maps the file descriptors and executes the main method with the passed in command line.
runMain(String[] commandLine)23     public static int runMain(String[] commandLine) {
24         return MainRunnerJni.get().runMain(commandLine);
25     }
26 
27     @NativeMethods
28     interface Natives {
runMain(String[] commandLine)29         int runMain(String[] commandLine);
30     }
31 }