| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 EXPECT_TRUE(isSerialized("http://www.test.com/red_background.png", "image/pn
g")); | 247 EXPECT_TRUE(isSerialized("http://www.test.com/red_background.png", "image/pn
g")); |
| 248 EXPECT_TRUE(isSerialized("http://www.test.com/orange_background.png", "image
/png")); | 248 EXPECT_TRUE(isSerialized("http://www.test.com/orange_background.png", "image
/png")); |
| 249 EXPECT_TRUE(isSerialized("http://www.test.com/blue_background.png", "image/p
ng")); | 249 EXPECT_TRUE(isSerialized("http://www.test.com/blue_background.png", "image/p
ng")); |
| 250 // The blank frames should have got a magic URL. | 250 // The blank frames should have got a magic URL. |
| 251 EXPECT_TRUE(isSerialized("wyciwyg://frame/0", "text/html")); | 251 EXPECT_TRUE(isSerialized("wyciwyg://frame/0", "text/html")); |
| 252 EXPECT_TRUE(isSerialized("wyciwyg://frame/1", "text/html")); | 252 EXPECT_TRUE(isSerialized("wyciwyg://frame/1", "text/html")); |
| 253 EXPECT_TRUE(isSerialized("wyciwyg://frame/2", "text/html")); | 253 EXPECT_TRUE(isSerialized("wyciwyg://frame/2", "text/html")); |
| 254 } | 254 } |
| 255 | 255 |
| 256 TEST_F(PageSerializerTest, CSS) |
| 257 { |
| 258 setBaseFolder("pageserializer/css/"); |
| 259 |
| 260 registerURL("css_test_page.html", "text/html"); |
| 261 registerURL("link_styles.css", "text/css"); |
| 262 registerURL("import_style_from_link.css", "text/css"); |
| 263 registerURL("import_styles.css", "text/css"); |
| 264 registerURL("red_background.png", "image.png", "image/png"); |
| 265 registerURL("orange_background.png", "image.png", "image/png"); |
| 266 registerURL("yellow_background.png", "image.png", "image/png"); |
| 267 registerURL("green_background.png", "image.png", "image/png"); |
| 268 registerURL("blue_background.png", "image.png", "image/png"); |
| 269 registerURL("purple_background.png", "image.png", "image/png"); |
| 270 registerURL("ul-dot.png", "image.png", "image/png"); |
| 271 registerURL("ol-dot.png", "image.png", "image/png"); |
| 272 |
| 273 serialize("css_test_page.html"); |
| 274 |
| 275 EXPECT_EQ(12U, getResources().size()); |
| 276 |
| 277 EXPECT_TRUE(isSerialized("css_test_page.html", "text/html")); |
| 278 EXPECT_TRUE(isSerialized("link_styles.css", "text/css")); |
| 279 EXPECT_TRUE(isSerialized("import_styles.css", "text/css")); |
| 280 EXPECT_TRUE(isSerialized("import_style_from_link.css", "text/css")); |
| 281 EXPECT_TRUE(isSerialized("red_background.png", "image/png")); |
| 282 EXPECT_TRUE(isSerialized("orange_background.png", "image/png")); |
| 283 EXPECT_TRUE(isSerialized("yellow_background.png", "image/png")); |
| 284 EXPECT_TRUE(isSerialized("green_background.png", "image/png")); |
| 285 EXPECT_TRUE(isSerialized("blue_background.png", "image/png")); |
| 286 EXPECT_TRUE(isSerialized("purple_background.png", "image/png")); |
| 287 EXPECT_TRUE(isSerialized("ul-dot.png", "image/png")); |
| 288 EXPECT_TRUE(isSerialized("ol-dot.png", "image/png")); |
| 289 } |
| 290 |
| 256 TEST_F(PageSerializerTest, CSSImport) | 291 TEST_F(PageSerializerTest, CSSImport) |
| 257 { | 292 { |
| 258 setBaseFolder("pageserializer/css/"); | 293 setBaseFolder("pageserializer/css/"); |
| 259 | 294 |
| 260 registerURL("import.html", "text/html"); | 295 registerURL("import.html", "text/html"); |
| 261 registerURL("import/base.css", "text/css"); | 296 registerURL("import/base.css", "text/css"); |
| 262 registerURL("import/relative/red-background.css", "text/css"); | 297 registerURL("import/relative/red-background.css", "text/css"); |
| 263 registerURL("import/absolute/green-header.css", "text/css"); | 298 registerURL("import/absolute/green-header.css", "text/css"); |
| 264 | 299 |
| 265 serialize("import.html"); | 300 serialize("import.html"); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 registerURL("namespace_element.html", "text/html"); | 401 registerURL("namespace_element.html", "text/html"); |
| 367 | 402 |
| 368 serialize("namespace_element.html"); | 403 serialize("namespace_element.html"); |
| 369 | 404 |
| 370 EXPECT_EQ(1U, getResources().size()); | 405 EXPECT_EQ(1U, getResources().size()); |
| 371 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html")); | 406 EXPECT_TRUE(isSerialized("namespace_element.html", "text/html")); |
| 372 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(),
0U); | 407 EXPECT_GT(getSerializedData("namespace_element.html", "text/html").length(),
0U); |
| 373 } | 408 } |
| 374 | 409 |
| 375 } | 410 } |
| OLD | NEW |