| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2017 Google Inc. All rights reserved. | 2 * Copyright (C) 2017 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 String file_path("frameserialization/" + file_name); | 117 String file_path("frameserialization/" + file_name); |
| 118 RegisterMockedFileURLLoad(parsed_url, file_path, "text/html"); | 118 RegisterMockedFileURLLoad(parsed_url, file_path, "text/html"); |
| 119 FrameTestHelpers::LoadFrame(MainFrameImpl(), url.Utf8().data()); | 119 FrameTestHelpers::LoadFrame(MainFrameImpl(), url.Utf8().data()); |
| 120 SingleLinkRewritingDelegate delegate(parsed_url, WebString("local")); | 120 SingleLinkRewritingDelegate delegate(parsed_url, WebString("local")); |
| 121 SimpleWebFrameSerializerClient serializer_client; | 121 SimpleWebFrameSerializerClient serializer_client; |
| 122 WebFrameSerializer::Serialize(MainFrameImpl(), &serializer_client, | 122 WebFrameSerializer::Serialize(MainFrameImpl(), &serializer_client, |
| 123 &delegate); | 123 &delegate); |
| 124 return serializer_client.ToString(); | 124 return serializer_client.ToString(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 WebLocalFrameBase* MainFrameImpl() { | 127 WebLocalFrameBase* MainFrameImpl() { return helper_.LocalMainFrame(); } |
| 128 return helper_.WebView()->MainFrameImpl(); | |
| 129 } | |
| 130 | 128 |
| 131 private: | 129 private: |
| 132 FrameTestHelpers::WebViewHelper helper_; | 130 FrameTestHelpers::WebViewHelper helper_; |
| 133 }; | 131 }; |
| 134 | 132 |
| 135 TEST_F(WebFrameSerializerTest, URLAttributeValues) { | 133 TEST_F(WebFrameSerializerTest, URLAttributeValues) { |
| 136 RegisterMockedImageURLLoad("javascript:\""); | 134 RegisterMockedImageURLLoad("javascript:\""); |
| 137 | 135 |
| 138 const char* expected_html = | 136 const char* expected_html = |
| 139 "\n<!-- saved from url=(0020)http://www.test.com/ -->\n" | 137 "\n<!-- saved from url=(0020)http://www.test.com/ -->\n" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 167 } | 165 } |
| 168 | 166 |
| 169 TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus) { | 167 TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus) { |
| 170 String actual_html = | 168 String actual_html = |
| 171 SerializeFile("http://www.test.com?--x--", "text_only_page.html"); | 169 SerializeFile("http://www.test.com?--x--", "text_only_page.html"); |
| 172 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", | 170 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", |
| 173 actual_html.Substring(1, 60)); | 171 actual_html.Substring(1, 60)); |
| 174 } | 172 } |
| 175 | 173 |
| 176 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |