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

Side by Side Diff: content/shell/android/browsertests_apk/content_browser_tests_android.cc

Issue 1003073002: Create non-blocked fifo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698