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

Unified Diff: content/shell/browser/layout_test/scoped_android_configuration.h

Issue 2540603004: [Android] Redirect std{in,out,err} to sockets for layout tests. (Closed)
Patch Set: rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/layout_test/scoped_android_configuration.h
diff --git a/content/shell/browser/layout_test/scoped_android_configuration.h b/content/shell/browser/layout_test/scoped_android_configuration.h
new file mode 100644
index 0000000000000000000000000000000000000000..37a6d3ad7ef82a66f0b5719b7c5270d1b4ab37f7
--- /dev/null
+++ b/content/shell/browser/layout_test/scoped_android_configuration.h
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_SCOPED_ANDROID_CONFIGURATION_H_
+#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_SCOPED_ANDROID_CONFIGURATION_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+
+namespace net {
+class SocketPosix;
+}
+
+namespace content {
+
+class ScopedAndroidConfiguration {
+ public:
+ ScopedAndroidConfiguration();
+ ~ScopedAndroidConfiguration();
+
+ // Redirects stdin, stdout, and stderr to the ports specified on the command
+ // line.
+ void RedirectStreams();
+
+ private:
+ // Adds |socket| to |sockets_|.
+ void AddSocket(std::unique_ptr<net::SocketPosix> socket);
+
+ // The sockets to which the IO streams are being redirected.
+ std::vector<std::unique_ptr<net::SocketPosix>> sockets_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedAndroidConfiguration);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_SCOPED_ANDROID_CONFIGURATION_H_

Powered by Google App Engine
This is Rietveld 408576698