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

Unified Diff: net/test/embedded_test_server/embedded_test_server.h

Issue 83633004: Do not spawn a thread in browser/interactive ui tests before spawning sandbox host process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/embedded_test_server.h
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index d5300b4fe215c160c0df11639e80864bd727e82c..68da865c27467be95a84c451c83704b1dc121d92 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -39,6 +39,10 @@ class HttpListenSocket : public TCPListenSocket {
virtual void Listen();
private:
+ friend class EmbeddedTestServer;
+
+ // Detaches the current from |thread_checker_|.
+ void DetachFromThread();
base::ThreadChecker thread_checker_;
};
@@ -48,7 +52,7 @@ class HttpListenSocket : public TCPListenSocket {
// it assumes that the request syntax is correct. It *does not* support
// a Chunked Transfer Encoding.
//
-// The common use case is below:
+// The common use case for unit tests is below:
oshima 2013/11/26 02:26:02 Forgot to mention. I'll update the comment and add
//
// base::Thread io_thread_;
// scoped_ptr<EmbeddedTestServer> test_server_;
@@ -122,6 +126,10 @@ class EmbeddedTestServer : public StreamListenSocket::Delegate {
// on UI thread.
void RegisterRequestHandler(const HandleRequestCallback& callback);
+ // Starts/Stops IO thread that handles http requests.
+ void StartThread();
+ void StopThread();
+
private:
// Initializes and starts the server. If initialization succeeds, Starts()
// will return true.
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698