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

Side by Side Diff: webkit/glue/unittest_test_server.h

Issue 16207: Make ssl_client_socket_unittest use a local server (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ 5 #ifndef WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
6 #define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ 6 #define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
7 7
8 #include "webkit/glue/resource_loader_bridge.h" 8 #include "webkit/glue/resource_loader_bridge.h"
9 #include "net/base/load_flags.h" 9 #include "net/base/load_flags.h"
10 #include "net/url_request/url_request_unittest.h" 10 #include "net/url_request/url_request_unittest.h"
11 11
12 using webkit_glue::ResourceLoaderBridge; 12 using webkit_glue::ResourceLoaderBridge;
13 13
14 // We need to use ResourceLoaderBridge to communicate with the testserver 14 // We need to use ResourceLoaderBridge to communicate with the testserver
15 // instead of using URLRequest directly because URLRequests need to be run on 15 // instead of using URLRequest directly because URLRequests need to be run on
16 // the test_shell's IO thread. 16 // the test_shell's IO thread.
17 class UnittestTestServer : public HTTPTestServer { 17 class UnittestTestServer : public HTTPTestServer {
18 protected: 18 protected:
19 UnittestTestServer() { 19 UnittestTestServer() {
20 } 20 }
21 21
22 public: 22 public:
23 static UnittestTestServer* CreateServer() { 23 static UnittestTestServer* CreateServer() {
24 UnittestTestServer* test_server = new UnittestTestServer(); 24 UnittestTestServer* test_server = new UnittestTestServer();
25 if (!test_server->Init("localhost", 1337, L"webkit/data")) { 25 FilePath no_cert;
26 FilePath docroot = FilePath::FromWStringHack(L"webkit/data");
27 if (!test_server->Start(net::TestServerLauncher::ProtoHTTP,
28 "localhost", 1337, docroot, no_cert)) {
26 delete test_server; 29 delete test_server;
27 return NULL; 30 return NULL;
28 } 31 }
29 return test_server; 32 return test_server;
30 } 33 }
31 34
32 virtual ~UnittestTestServer() { 35 virtual ~UnittestTestServer() {
33 } 36 }
34 37
35 virtual bool MakeGETRequest(const std::string& page_name) { 38 virtual bool MakeGETRequest(const std::string& page_name) {
(...skipping 11 matching lines...) Expand all
47 EXPECT_TRUE(loader.get()); 50 EXPECT_TRUE(loader.get());
48 51
49 ResourceLoaderBridge::SyncLoadResponse resp; 52 ResourceLoaderBridge::SyncLoadResponse resp;
50 loader->SyncLoad(&resp); 53 loader->SyncLoad(&resp);
51 return resp.status.is_success(); 54 return resp.status.is_success();
52 } 55 }
53 }; 56 };
54 57
55 #endif // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ 58 #endif // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
56 59
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698