Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: Source/web/tests/PageSerializerTest.cpp

Issue 1165093002: Merge page serializers [1/12] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebPageNewSerializerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11 matching lines...) Expand all
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 * OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/page/PageSerializer.h"
32 33
33 #include "bindings/core/v8/V8Binding.h" 34 #include "bindings/core/v8/V8Binding.h"
34 #include "bindings/core/v8/V8BindingForTesting.h" 35 #include "bindings/core/v8/V8BindingForTesting.h"
35 #include "core/page/Page.h" 36 #include "core/page/Page.h"
36 #include "core/page/PageSerializer.h"
37 #include "platform/SerializedResource.h" 37 #include "platform/SerializedResource.h"
38 #include "platform/testing/URLTestHelpers.h" 38 #include "platform/testing/URLTestHelpers.h"
39 #include "public/platform/Platform.h" 39 #include "public/platform/Platform.h"
40 #include "public/platform/WebString.h" 40 #include "public/platform/WebString.h"
41 #include "public/platform/WebThread.h" 41 #include "public/platform/WebThread.h"
42 #include "public/platform/WebURL.h" 42 #include "public/platform/WebURL.h"
43 #include "public/platform/WebURLRequest.h" 43 #include "public/platform/WebURLRequest.h"
44 #include "public/platform/WebURLResponse.h" 44 #include "public/platform/WebURLResponse.h"
45 #include "public/platform/WebUnitTestSupport.h" 45 #include "public/platform/WebUnitTestSupport.h"
46 #include "public/web/WebSettings.h" 46 #include "public/web/WebSettings.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 setBaseFolder("pageserializer/font/"); 213 setBaseFolder("pageserializer/font/");
214 214
215 registerURL("font.html", "text/html"); 215 registerURL("font.html", "text/html");
216 registerURL("font.ttf", "application/octet-stream"); 216 registerURL("font.ttf", "application/octet-stream");
217 217
218 serialize("font.html"); 218 serialize("font.html");
219 219
220 EXPECT_TRUE(isSerialized("font.ttf", "application/octet-stream")); 220 EXPECT_TRUE(isSerialized("font.ttf", "application/octet-stream"));
221 } 221 }
222 222
223 TEST_F(PageSerializerTest, DontIncludeErrorImage)
224 {
225 setBaseFolder("pageserializer/image/");
226
227 registerURL("page_with_img_error.html", "text/html");
228 registerURL("error_image.png", "image/png");
229
230 serialize("page_with_img_error.html");
231
232 EXPECT_EQ(1U, getResources().size());
233 EXPECT_TRUE(isSerialized("page_with_img_error.html", "text/html"));
234 EXPECT_FALSE(isSerialized("error_image.png", "image/png"));
223 } 235 }
236
237 }
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebPageNewSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698