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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 class WebFrameSerializerTest : public testing::Test { | 66 class WebFrameSerializerTest : public testing::Test { |
67 protected: | 67 protected: |
68 WebFrameSerializerTest() { m_helper.initialize(); } | 68 WebFrameSerializerTest() { m_helper.initialize(); } |
69 | 69 |
70 ~WebFrameSerializerTest() override { | 70 ~WebFrameSerializerTest() override { |
71 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 71 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
72 WebCache::clear(); | 72 WebCache::clear(); |
73 } | 73 } |
74 | 74 |
75 void registerMockedImageURL(const String& url) { | 75 void registerMockedImageURL(const String& url) { |
76 // Image resources need to be mocked, but irrelevant here what image they ma
p to. | 76 // Image resources need to be mocked, but irrelevant here what image they |
| 77 // map to. |
77 URLTestHelpers::registerMockedURLLoad(KURL(ParsedURLString, url), | 78 URLTestHelpers::registerMockedURLLoad(KURL(ParsedURLString, url), |
78 "frameserialization/awesome.png"); | 79 "frameserialization/awesome.png"); |
79 } | 80 } |
80 | 81 |
81 class SingleLinkRewritingDelegate | 82 class SingleLinkRewritingDelegate |
82 : public WebFrameSerializer::LinkRewritingDelegate { | 83 : public WebFrameSerializer::LinkRewritingDelegate { |
83 public: | 84 public: |
84 SingleLinkRewritingDelegate(const WebURL& url, const WebString& localPath) | 85 SingleLinkRewritingDelegate(const WebURL& url, const WebString& localPath) |
85 : m_url(url), m_localPath(localPath) {} | 86 : m_url(url), m_localPath(localPath) {} |
86 | 87 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 158 } |
158 | 159 |
159 TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus) { | 160 TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus) { |
160 String actualHTML = | 161 String actualHTML = |
161 serializeFile("http://www.test.com?--x--", "text_only_page.html"); | 162 serializeFile("http://www.test.com?--x--", "text_only_page.html"); |
162 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", | 163 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", |
163 actualHTML.substring(1, 60)); | 164 actualHTML.substring(1, 60)); |
164 } | 165 } |
165 | 166 |
166 } // namespace blink | 167 } // namespace blink |
OLD | NEW |