OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 class WebURL; | 39 class WebURL; |
40 class WebURLResponse; | 40 class WebURLResponse; |
41 | 41 |
42 namespace URLTestHelpers { | 42 namespace URLTestHelpers { |
43 | 43 |
44 inline blink::KURL toKURL(const std::string& url) { | 44 inline blink::KURL toKURL(const std::string& url) { |
45 WTF::String wtfString(url.c_str()); | 45 WTF::String wtfString(url.c_str()); |
46 return blink::KURL(blink::ParsedURLString, wtfString); | 46 return blink::KURL(blink::ParsedURLString, wtfString); |
47 } | 47 } |
48 | 48 |
49 // Helper functions for mock URLs. These functions set up the desired URL and mi
meType, with a 200 OK return status. | 49 // Helper functions for mock URLs. These functions set up the desired URL and |
| 50 // mimeType, with a 200 OK return status. |
50 // For the mock URL, fullURL == baseURL + fileName. | 51 // For the mock URL, fullURL == baseURL + fileName. |
51 // For the actual file path: <WebKit root directory> + relativeBaseDirectory +
fileName, | 52 // For the actual file path: |
52 // or, if the relative base directory is not specified: <WebKit root directory>
+ fileName. | 53 // <WebKit root directory> + relativeBaseDirectory + fileName, |
| 54 // or, if the relative base directory is not specified: |
| 55 // <WebKit root directory> + fileName. |
53 // | 56 // |
54 void registerMockedURLFromBaseURL( | 57 void registerMockedURLFromBaseURL( |
55 const WebString& baseURL, | 58 const WebString& baseURL, |
56 const WebString& fileName, | 59 const WebString& fileName, |
57 const WebString& mimeType = WebString::fromUTF8("text/html")); | 60 const WebString& mimeType = WebString::fromUTF8("text/html")); |
58 void registerMockedURLLoad( | 61 void registerMockedURLLoad( |
59 const WebURL& fullURL, | 62 const WebURL& fullURL, |
60 const WebString& fileName, | 63 const WebString& fileName, |
61 const WebString& mimeType = WebString::fromUTF8("text/html")); | 64 const WebString& mimeType = WebString::fromUTF8("text/html")); |
62 void registerMockedURLLoad(const WebURL& fullURL, | 65 void registerMockedURLLoad(const WebURL& fullURL, |
63 const WebString& fileName, | 66 const WebString& fileName, |
64 const WebString& relativeBaseDirectory, | 67 const WebString& relativeBaseDirectory, |
65 const WebString& mimeType); | 68 const WebString& mimeType); |
66 void registerMockedURLLoadWithCustomResponse( | 69 void registerMockedURLLoadWithCustomResponse( |
67 const WebURL& fullURL, | 70 const WebURL& fullURL, |
68 const WebString& fileName, | 71 const WebString& fileName, |
69 const WebString& relativeBaseDirectory, | 72 const WebString& relativeBaseDirectory, |
70 WebURLResponse); | 73 WebURLResponse); |
71 void registerMockedErrorURLLoad(const WebURL& fullURL); | 74 void registerMockedErrorURLLoad(const WebURL& fullURL); |
72 | 75 |
73 } // namespace URLTestHelpers | 76 } // namespace URLTestHelpers |
74 } // namespace blink | 77 } // namespace blink |
75 | 78 |
76 #endif | 79 #endif |
OLD | NEW |