| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 settings->setLoadsImagesAutomatically(true); | 151 settings->setLoadsImagesAutomatically(true); |
| 152 settings->setJavaScriptEnabled(true); | 152 settings->setJavaScriptEnabled(true); |
| 153 } | 153 } |
| 154 | 154 |
| 155 FrameTestHelpers::WebViewHelper m_helper; | 155 FrameTestHelpers::WebViewHelper m_helper; |
| 156 WebString m_folder; | 156 WebString m_folder; |
| 157 KURL m_baseUrl; | 157 KURL m_baseUrl; |
| 158 Vector<SerializedResource> m_resources; | 158 Vector<SerializedResource> m_resources; |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 TEST_F(PageSerializerTest, InputImage) | 161 TEST_F(PageSerializerTest, HTMLElements) |
| 162 { | 162 { |
| 163 setBaseFolder("pageserializer/input-image/"); | 163 setBaseFolder("pageserializer/elements/"); |
| 164 | 164 |
| 165 registerURL("input-image.html", "text/html"); | 165 registerURL("elements.html", "text/html"); |
| 166 registerURL("button.png", "image/png"); | 166 registerURL("style.css", "style.css", "text/css"); |
| 167 registerErrorURL("non-existing-button.png", 404); | 167 registerURL("copyright.html", "empty.txt", "text/html"); |
| 168 registerURL("script.js", "empty.txt", "text/javascript"); |
| 168 | 169 |
| 169 serialize("input-image.html"); | 170 registerURL("bodyBackground.png", "image.png", "image/png"); |
| 170 | 171 |
| 171 EXPECT_TRUE(isSerialized("button.png", "image/png")); | 172 registerURL("imageSrc.png", "image.png", "image/png"); |
| 172 EXPECT_FALSE(isSerialized("non-existing-button.png", "image/png")); | 173 |
| 174 registerURL("inputImage.png", "image.png", "image/png"); |
| 175 |
| 176 registerURL("tableBackground.png", "image.png", "image/png"); |
| 177 registerURL("trBackground.png", "image.png", "image/png"); |
| 178 registerURL("tdBackground.png", "image.png", "image/png"); |
| 179 |
| 180 registerURL("blockquoteCite.html", "empty.txt", "text/html"); |
| 181 registerURL("qCite.html", "empty.txt", "text/html"); |
| 182 registerURL("delCite.html", "empty.txt", "text/html"); |
| 183 registerURL("insCite.html", "empty.txt", "text/html"); |
| 184 |
| 185 registerErrorURL("nonExisting.png", 404); |
| 186 |
| 187 serialize("elements.html"); |
| 188 |
| 189 EXPECT_EQ(8U, getResources().size()); |
| 190 |
| 191 EXPECT_TRUE(isSerialized("elements.html", "text/html")); |
| 192 EXPECT_TRUE(isSerialized("style.css", "text/css")); |
| 193 EXPECT_TRUE(isSerialized("bodyBackground.png", "image/png")); |
| 194 EXPECT_TRUE(isSerialized("imageSrc.png", "image/png")); |
| 195 EXPECT_TRUE(isSerialized("inputImage.png", "image/png")); |
| 196 EXPECT_TRUE(isSerialized("tableBackground.png", "image/png")); |
| 197 EXPECT_TRUE(isSerialized("trBackground.png", "image/png")); |
| 198 EXPECT_TRUE(isSerialized("tdBackground.png", "image/png")); |
| 199 EXPECT_FALSE(isSerialized("nonExisting.png", "image/png")); |
| 173 } | 200 } |
| 174 | 201 |
| 175 TEST_F(PageSerializerTest, Frames) | 202 TEST_F(PageSerializerTest, Frames) |
| 176 { | 203 { |
| 177 setBaseFolder("pageserializer/frames/"); | 204 setBaseFolder("pageserializer/frames/"); |
| 178 | 205 |
| 179 registerURL("simple_frames.html", "text/html"); | 206 registerURL("simple_frames.html", "text/html"); |
| 180 registerURL("simple_frames_top.html", "text/html"); | 207 registerURL("simple_frames_top.html", "text/html"); |
| 181 registerURL("simple_frames_1.html", "text/html"); | 208 registerURL("simple_frames_1.html", "text/html"); |
| 182 registerURL("simple_frames_3.html", "text/html"); | 209 registerURL("simple_frames_3.html", "text/html"); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 registerURL("namespace_element.html", "text/html"); | 428 registerURL("namespace_element.html", "text/html"); |
| 402 | 429 |
| 403 serialize("namespace_element.html"); | 430 serialize("namespace_element.html"); |
| 404 | 431 |
| 405 EXPECT_EQ(1U, getResources().size()); | 432 EXPECT_EQ(1U, getResources().size()); |
| 406 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html")); | 433 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html")); |
| 407 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(),
0U); | 434 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(),
0U); |
| 408 } | 435 } |
| 409 | 436 |
| 410 } | 437 } |
| OLD | NEW |