| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This class sets up the environment for running the content browser tests | 5 // This class sets up the environment for running the content browser tests |
| 6 // inside an android application. | 6 // inside an android application. |
| 7 | 7 |
| 8 #include <android/log.h> | 8 #include <android/log.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Specify a socket name to not conflict with the default one used | 80 // Specify a socket name to not conflict with the default one used |
| 81 // in content_shell. | 81 // in content_shell. |
| 82 command_line->AppendSwitchASCII(switches::kRemoteDebuggingSocketName, | 82 command_line->AppendSwitchASCII(switches::kRemoteDebuggingSocketName, |
| 83 "content_browsertests_devtools_remote"); | 83 "content_browsertests_devtools_remote"); |
| 84 | 84 |
| 85 // Create fifo and redirect stdout and stderr to it. | 85 // Create fifo and redirect stdout and stderr to it. |
| 86 base::FilePath files_dir( | 86 base::FilePath files_dir( |
| 87 base::android::ConvertJavaStringToUTF8(env, jfiles_dir)); | 87 base::android::ConvertJavaStringToUTF8(env, jfiles_dir)); |
| 88 base::FilePath fifo_path(files_dir.Append(base::FilePath("test.fifo"))); | 88 base::FilePath fifo_path(files_dir.Append(base::FilePath("test.fifo"))); |
| 89 base::android::CreateFIFO(fifo_path, 0666); | 89 base::android::CreateFIFO(fifo_path, 0666); |
| 90 base::android::RedirectStream(stdout, fifo_path, "w"); | 90 base::android::RedirectStream(stdout, fifo_path, "w+"); |
| 91 dup2(STDOUT_FILENO, STDERR_FILENO); | 91 dup2(STDOUT_FILENO, STDERR_FILENO); |
| 92 | 92 |
| 93 ScopedMainEntryLogger scoped_main_entry_logger; | 93 ScopedMainEntryLogger scoped_main_entry_logger; |
| 94 main(argc, &argv[0]); | 94 main(argc, &argv[0]); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool RegisterContentBrowserTestsAndroid(JNIEnv* env) { | 97 bool RegisterContentBrowserTestsAndroid(JNIEnv* env) { |
| 98 return RegisterNativesImpl(env); | 98 return RegisterNativesImpl(env); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace content | 101 } // namespace content |
| OLD | NEW |