OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/shell/browser/shell_layout_tests_android.h" | 5 #include "content/shell/browser/shell_layout_tests_android.h" |
6 | 6 |
7 #include "base/android/fifo_utils.h" | 7 #include "base/android/fifo_utils.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 env, base::android::GetApplicationContext()); | 30 env, base::android::GetApplicationContext()); |
31 return base::FilePath(ConvertJavaStringToUTF8(directory)); | 31 return base::FilePath(ConvertJavaStringToUTF8(directory)); |
32 } | 32 } |
33 | 33 |
34 void EnsureCreateFIFO(const base::FilePath& path) { | 34 void EnsureCreateFIFO(const base::FilePath& path) { |
35 unlink(path.value().c_str()); | 35 unlink(path.value().c_str()); |
36 CHECK(base::android::CreateFIFO(path, 0666)) | 36 CHECK(base::android::CreateFIFO(path, 0666)) |
37 << "Unable to create the Android's FIFO: " << path.value().c_str(); | 37 << "Unable to create the Android's FIFO: " << path.value().c_str(); |
38 } | 38 } |
39 | 39 |
40 base::MessagePump* CreateMessagePumpForUI() { | 40 scoped_ptr<base::MessagePump> CreateMessagePumpForUI() { |
41 return new content::NestedMessagePumpAndroid(); | 41 return scoped_ptr<base::MessagePump>(new content::NestedMessagePumpAndroid()); |
42 } | 42 } |
43 | 43 |
44 } // namespace | 44 } // namespace |
45 | 45 |
46 namespace content { | 46 namespace content { |
47 | 47 |
48 bool GetTestUrlForAndroid(std::string& path_or_url, GURL* url) { | 48 bool GetTestUrlForAndroid(std::string& path_or_url, GURL* url) { |
49 if (path_or_url.find(kAndroidLayoutTestPath) == std::string::npos) | 49 if (path_or_url.find(kAndroidLayoutTestPath) == std::string::npos) |
50 return false; | 50 return false; |
51 | 51 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Redirecting stdout needs to happen before redirecting stdin, which needs | 84 // Redirecting stdout needs to happen before redirecting stdin, which needs |
85 // to happen before redirecting stderr. | 85 // to happen before redirecting stderr. |
86 success = base::android::RedirectStream(stdout, stdout_fifo, "w") && | 86 success = base::android::RedirectStream(stdout, stdout_fifo, "w") && |
87 base::android::RedirectStream(stdin, stdin_fifo, "r") && | 87 base::android::RedirectStream(stdin, stdin_fifo, "r") && |
88 base::android::RedirectStream(stderr, stderr_fifo, "w"); | 88 base::android::RedirectStream(stderr, stderr_fifo, "w"); |
89 | 89 |
90 CHECK(success) << "Unable to initialize the Android FIFOs."; | 90 CHECK(success) << "Unable to initialize the Android FIFOs."; |
91 } | 91 } |
92 | 92 |
93 } // namespace content | 93 } // namespace content |
OLD | NEW |