OLD | NEW |
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" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 return test_server; | 32 return test_server; |
33 } | 33 } |
34 | 34 |
35 virtual ~UnittestTestServer() { | 35 virtual ~UnittestTestServer() { |
36 } | 36 } |
37 | 37 |
38 virtual bool MakeGETRequest(const std::string& page_name) { | 38 virtual bool MakeGETRequest(const std::string& page_name) { |
39 GURL url(TestServerPage(page_name)); | 39 GURL url(TestServerPage(page_name)); |
40 scoped_ptr<ResourceLoaderBridge> loader( | 40 scoped_ptr<ResourceLoaderBridge> loader( |
41 ResourceLoaderBridge::Create(NULL, "GET", | 41 ResourceLoaderBridge::Create("GET", |
42 url, | 42 url, |
43 url, // policy_url | 43 url, // policy_url |
44 GURL(), // no referrer | 44 GURL(), // no referrer |
45 std::string(), // no extra headers | 45 std::string(), // no extra headers |
46 net::LOAD_NORMAL, | 46 net::LOAD_NORMAL, |
47 0, | 47 0, |
48 ResourceType::SUB_RESOURCE, | 48 ResourceType::SUB_RESOURCE, |
49 false)); | 49 false, |
| 50 0)); |
50 EXPECT_TRUE(loader.get()); | 51 EXPECT_TRUE(loader.get()); |
51 | 52 |
52 ResourceLoaderBridge::SyncLoadResponse resp; | 53 ResourceLoaderBridge::SyncLoadResponse resp; |
53 loader->SyncLoad(&resp); | 54 loader->SyncLoad(&resp); |
54 return resp.status.is_success(); | 55 return resp.status.is_success(); |
55 } | 56 } |
56 }; | 57 }; |
57 | 58 |
58 #endif // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ | 59 #endif // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ |
OLD | NEW |