| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 // These non-scripting attributes should remain intact. | 214 // These non-scripting attributes should remain intact. |
| 215 EXPECT_NE(WTF::kNotFound, mhtml.find("class=")); | 215 EXPECT_NE(WTF::kNotFound, mhtml.find("class=")); |
| 216 EXPECT_NE(WTF::kNotFound, mhtml.find("id=")); | 216 EXPECT_NE(WTF::kNotFound, mhtml.find("id=")); |
| 217 | 217 |
| 218 // srcdoc attribute of frame element should be replaced with src attribute. | 218 // srcdoc attribute of frame element should be replaced with src attribute. |
| 219 EXPECT_EQ(WTF::kNotFound, mhtml.find("srcdoc=")); | 219 EXPECT_EQ(WTF::kNotFound, mhtml.find("srcdoc=")); |
| 220 EXPECT_NE(WTF::kNotFound, mhtml.find("src=")); | 220 EXPECT_NE(WTF::kNotFound, mhtml.find("src=")); |
| 221 } | 221 } |
| 222 | 222 |
| 223 TEST_F(WebFrameSerializerSanitizationTest, DisableFormElements) { |
| 224 String mhtml = generateMHTMLParts("http://www.test.com", "form.html"); |
| 225 |
| 226 int matches = 0; |
| 227 size_t start = 0; |
| 228 while (true) { |
| 229 const char kDisabledAttr[] = "disabled=3D\"\""; |
| 230 size_t pos = mhtml.find(kDisabledAttr, start); |
| 231 if (pos == WTF::kNotFound) |
| 232 break; |
| 233 matches++; |
| 234 start = pos + arraysize(kDisabledAttr) - 1; |
| 235 } |
| 236 EXPECT_EQ(21, matches); |
| 237 } |
| 238 |
| 223 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |