| 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 "webkit/glue/webappcachecontext.h" | 
| 9 #include "net/base/load_flags.h" | 10 #include "net/base/load_flags.h" | 
| 10 #include "net/url_request/url_request_unittest.h" | 11 #include "net/url_request/url_request_unittest.h" | 
| 11 | 12 | 
| 12 using webkit_glue::ResourceLoaderBridge; | 13 using webkit_glue::ResourceLoaderBridge; | 
| 13 | 14 | 
| 14 // We need to use ResourceLoaderBridge to communicate with the testserver | 15 // We need to use ResourceLoaderBridge to communicate with the testserver | 
| 15 // instead of using URLRequest directly because URLRequests need to be run on | 16 // instead of using URLRequest directly because URLRequests need to be run on | 
| 16 // the test_shell's IO thread. | 17 // the test_shell's IO thread. | 
| 17 class UnittestTestServer : public HTTPTestServer { | 18 class UnittestTestServer : public HTTPTestServer { | 
| 18  protected: | 19  protected: | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 42                                    url, | 43                                    url, | 
| 43                                    url,            // policy_url | 44                                    url,            // policy_url | 
| 44                                    GURL(),         // no referrer | 45                                    GURL(),         // no referrer | 
| 45                                    "null",         // frame_origin | 46                                    "null",         // frame_origin | 
| 46                                    "null",         // main_frame_origin | 47                                    "null",         // main_frame_origin | 
| 47                                    std::string(),  // no extra headers | 48                                    std::string(),  // no extra headers | 
| 48                                    "",             // default_mime_type | 49                                    "",             // default_mime_type | 
| 49                                    net::LOAD_NORMAL, | 50                                    net::LOAD_NORMAL, | 
| 50                                    0, | 51                                    0, | 
| 51                                    ResourceType::SUB_RESOURCE, | 52                                    ResourceType::SUB_RESOURCE, | 
|  | 53                                    WebAppCacheContext::kNoAppCacheContextId, | 
| 52                                    0)); | 54                                    0)); | 
| 53     EXPECT_TRUE(loader.get()); | 55     EXPECT_TRUE(loader.get()); | 
| 54 | 56 | 
| 55     ResourceLoaderBridge::SyncLoadResponse resp; | 57     ResourceLoaderBridge::SyncLoadResponse resp; | 
| 56     loader->SyncLoad(&resp); | 58     loader->SyncLoad(&resp); | 
| 57     return resp.status.is_success(); | 59     return resp.status.is_success(); | 
| 58   } | 60   } | 
| 59 }; | 61 }; | 
| 60 | 62 | 
| 61 #endif  // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ | 63 #endif  // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ | 
| OLD | NEW | 
|---|