OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 loadURLInTopFrame(topFrameURL); | 156 loadURLInTopFrame(topFrameURL); |
157 | 157 |
158 SimpleWebPageSerializerClient serializerClient; | 158 SimpleWebPageSerializerClient serializerClient; |
159 WebVector<WebURL> links(&topFrameURL, 1); | 159 WebVector<WebURL> links(&topFrameURL, 1); |
160 WebVector<WebString> localPaths(&"local", 1); | 160 WebVector<WebString> localPaths(&"local", 1); |
161 WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &ser
ializerClient, links, localPaths, ""); | 161 WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &ser
ializerClient, links, localPaths, ""); |
162 | 162 |
163 const char* expectedHTML = | 163 const char* expectedHTML = |
164 "<!DOCTYPE html>\n" | 164 "<!DOCTYPE html>\n" |
165 "<!-- saved from url=(0020)http://www.test.com/ -->\n" | 165 "<!-- saved from url=(0020)http://www.test.com/ -->\n" |
166 "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; char
set=EUC-KR\">\n" | 166 "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; char
set=UTF-8\">\n" |
167 "<title>Ensure NFC normalization is not performed by page serializer</ti
tle>\n" | 167 "<title>Ensure NFC normalization is not performed by page serializer</ti
tle>\n" |
168 "</head><body>\n" | 168 "</head><body>\n" |
169 "\xe4\xc5\xd1\xe2\n" | 169 "\xe6\xa8\x82\xef\xa4\x94\n" |
170 "\n</body></html>"; | 170 "\n</body></html>"; |
171 EXPECT_EQ(expectedHTML, serializerClient.toString()); | 171 EXPECT_EQ(expectedHTML, serializerClient.toString()); |
172 } | 172 } |
173 | 173 |
174 TEST_F(WebPageSerializerTest, fromUrlWithMinusMinus) | 174 TEST_F(WebPageSerializerTest, fromUrlWithMinusMinus) |
175 { | 175 { |
176 WebURL topFrameURL = toKURL("http://www.test.com?--x--"); | 176 WebURL topFrameURL = toKURL("http://www.test.com?--x--"); |
177 registerMockedURLLoad(topFrameURL.spec(), WebString::fromUTF8("text_only_pag
e.html")); | 177 registerMockedURLLoad(topFrameURL.spec(), WebString::fromUTF8("text_only_pag
e.html")); |
178 loadURLInTopFrame(topFrameURL); | 178 loadURLInTopFrame(topFrameURL); |
179 | 179 |
180 SimpleWebPageSerializerClient serializerClient; | 180 SimpleWebPageSerializerClient serializerClient; |
181 WebVector<WebURL> links(&topFrameURL, 1); | 181 WebVector<WebURL> links(&topFrameURL, 1); |
182 WebVector<WebString> localPaths(&"local", 1); | 182 WebVector<WebString> localPaths(&"local", 1); |
183 WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &ser
ializerClient, links, localPaths, ""); | 183 WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &ser
ializerClient, links, localPaths, ""); |
184 | 184 |
185 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", se
rializerClient.toString().substr(1, 60)); | 185 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", se
rializerClient.toString().substr(1, 60)); |
186 } | 186 } |
187 | 187 |
188 } // namespace blink | 188 } // namespace blink |
OLD | NEW |