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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameSerializerTest.cpp

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 FrameTestHelpers::loadFrame(mainFrameImpl(), url.utf8().data()); 116 FrameTestHelpers::loadFrame(mainFrameImpl(), url.utf8().data());
117 SingleLinkRewritingDelegate delegate(parsedURL, WebString("local")); 117 SingleLinkRewritingDelegate delegate(parsedURL, WebString("local"));
118 SimpleWebFrameSerializerClient serializerClient; 118 SimpleWebFrameSerializerClient serializerClient;
119 WebFrameSerializer::serialize( 119 WebFrameSerializer::serialize(
120 mainFrameImpl(), &serializerClient, &delegate); 120 mainFrameImpl(), &serializerClient, &delegate);
121 return serializerClient.toString(); 121 return serializerClient.toString();
122 } 122 }
123 123
124 WebLocalFrameImpl* mainFrameImpl() 124 WebLocalFrameImpl* mainFrameImpl()
125 { 125 {
126 return m_helper.webViewImpl()->mainFrameImpl(); 126 return m_helper.webView()->mainFrameImpl();
127 } 127 }
128 128
129 private: 129 private:
130 FrameTestHelpers::WebViewHelper m_helper; 130 FrameTestHelpers::WebViewHelper m_helper;
131 }; 131 };
132 132
133 TEST_F(WebFrameSerializerTest, URLAttributeValues) 133 TEST_F(WebFrameSerializerTest, URLAttributeValues)
134 { 134 {
135 registerMockedImageURL("javascript:\""); 135 registerMockedImageURL("javascript:\"");
136 136
(...skipping 22 matching lines...) Expand all
159 EXPECT_EQ(expectedHTML, actualHTML); 159 EXPECT_EQ(expectedHTML, actualHTML);
160 } 160 }
161 161
162 TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus) 162 TEST_F(WebFrameSerializerTest, FromUrlWithMinusMinus)
163 { 163 {
164 String actualHTML = serializeFile("http://www.test.com?--x--", "text_only_pa ge.html"); 164 String actualHTML = serializeFile("http://www.test.com?--x--", "text_only_pa ge.html");
165 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", ac tualHTML.substring(1, 60)); 165 EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", ac tualHTML.substring(1, 60));
166 } 166 }
167 167
168 } // namespace blink 168 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698