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

Side by Side Diff: chrome/browser/net/connection_tester_unittest.cc

Issue 12210088: Make the TestServer use an absolute document root path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testserver uses absolute docroot path Created 7 years, 10 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 | Annotate | Revision Log
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 #include "chrome/browser/net/connection_tester.h" 5 #include "chrome/browser/net/connection_tester.h"
6 6
7 #include "chrome/test/base/testing_pref_service.h" 7 #include "chrome/test/base/testing_pref_service.h"
8 #include "content/public/test/test_browser_thread.h" 8 #include "content/public/test/test_browser_thread.h"
9 #include "net/base/mock_cert_verifier.h" 9 #include "net/base/mock_cert_verifier.h"
10 #include "net/base/mock_host_resolver.h" 10 #include "net/base/mock_host_resolver.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // - Catching any host resolve requests and mapping them to localhost 85 // - Catching any host resolve requests and mapping them to localhost
86 // (so the test doesn't use any external network dependencies). 86 // (so the test doesn't use any external network dependencies).
87 class ConnectionTesterTest : public PlatformTest { 87 class ConnectionTesterTest : public PlatformTest {
88 public: 88 public:
89 ConnectionTesterTest() 89 ConnectionTesterTest()
90 : message_loop_(MessageLoop::TYPE_IO), 90 : message_loop_(MessageLoop::TYPE_IO),
91 io_thread_(BrowserThread::IO, &message_loop_), 91 io_thread_(BrowserThread::IO, &message_loop_),
92 test_server_(net::TestServer::TYPE_HTTP, 92 test_server_(net::TestServer::TYPE_HTTP,
93 net::TestServer::kLocalhost, 93 net::TestServer::kLocalhost,
94 // Nothing is read in this directory. 94 // Nothing is read in this directory.
95 base::FilePath(FILE_PATH_LITERAL("chrome"))), 95 net::TestServer::GetSourceRelativePath(
96 base::FilePath(FILE_PATH_LITERAL("chrome")))),
96 proxy_script_fetcher_context_(new net::URLRequestContext) { 97 proxy_script_fetcher_context_(new net::URLRequestContext) {
97 InitializeRequestContext(); 98 InitializeRequestContext();
98 } 99 }
99 100
100 protected: 101 protected:
101 // Destroy last the MessageLoop last to give a chance for objects like 102 // Destroy last the MessageLoop last to give a chance for objects like
102 // ObserverListThreadSave to shut down properly. For example, 103 // ObserverListThreadSave to shut down properly. For example,
103 // SSLClientAuthCache calls RemoveObserver when destroyed, but if the 104 // SSLClientAuthCache calls RemoveObserver when destroyed, but if the
104 // MessageLoop is already destroyed, then the RemoveObserver will be a 105 // MessageLoop is already destroyed, then the RemoveObserver will be a
105 // no-op, and the ObserverList will contain invalid entries. 106 // no-op, and the ObserverList will contain invalid entries.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // any pending tasks instead of running them. This causes a problem with 202 // any pending tasks instead of running them. This causes a problem with
202 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer 203 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer
203 // |backup_task| that it will try to deref during the destructor, but 204 // |backup_task| that it will try to deref during the destructor, but
204 // depending on the order that pending tasks were deleted in, it might 205 // depending on the order that pending tasks were deleted in, it might
205 // already be invalid! See http://crbug.com/43291. 206 // already be invalid! See http://crbug.com/43291.
206 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 207 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
207 MessageLoop::current()->Run(); 208 MessageLoop::current()->Run();
208 } 209 }
209 210
210 } // namespace 211 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698