| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 void RegisterMockedFileURLLoad(const KURL& url, | 177 void RegisterMockedFileURLLoad(const KURL& url, |
| 178 const String& file_path, | 178 const String& file_path, |
| 179 const String& mime_type = "image/png") { | 179 const String& mime_type = "image/png") { |
| 180 URLTestHelpers::RegisterMockedURLLoad( | 180 URLTestHelpers::RegisterMockedURLLoad( |
| 181 url, testing::WebTestDataPath(file_path.Utf8().data()), mime_type); | 181 url, testing::WebTestDataPath(file_path.Utf8().data()), mime_type); |
| 182 } | 182 } |
| 183 | 183 |
| 184 WebViewBase* WebView() { return helper_.WebView(); } | 184 WebViewBase* WebView() { return helper_.WebView(); } |
| 185 | 185 |
| 186 WebLocalFrameBase* MainFrameImpl() { | 186 WebLocalFrameBase* MainFrameImpl() { return helper_.LocalMainFrame(); } |
| 187 return helper_.WebView()->MainFrameImpl(); | |
| 188 } | |
| 189 | 187 |
| 190 HistogramTester histogram_tester_; | 188 HistogramTester histogram_tester_; |
| 191 | 189 |
| 192 private: | 190 private: |
| 193 FrameTestHelpers::WebViewHelper helper_; | 191 FrameTestHelpers::WebViewHelper helper_; |
| 194 SimpleMHTMLPartsGenerationDelegate mhtml_delegate_; | 192 SimpleMHTMLPartsGenerationDelegate mhtml_delegate_; |
| 195 }; | 193 }; |
| 196 | 194 |
| 197 TEST_F(WebFrameSerializerSanitizationTest, RemoveInlineScriptInAttributes) { | 195 TEST_F(WebFrameSerializerSanitizationTest, RemoveInlineScriptInAttributes) { |
| 198 String mhtml = | 196 String mhtml = |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 EXPECT_NE(WTF::kNotFound, | 380 EXPECT_NE(WTF::kNotFound, |
| 383 mhtml.Find("<template shadowmode=3D\"open\" shadowdelegatesfocus")); | 381 mhtml.Find("<template shadowmode=3D\"open\" shadowdelegatesfocus")); |
| 384 EXPECT_NE(WTF::kNotFound, mhtml.Find("<template shadowmode=3D\"closed\">")); | 382 EXPECT_NE(WTF::kNotFound, mhtml.Find("<template shadowmode=3D\"closed\">")); |
| 385 | 383 |
| 386 // The special attribute present in the original page should be removed. | 384 // The special attribute present in the original page should be removed. |
| 387 EXPECT_EQ(WTF::kNotFound, mhtml.Find("shadowmode=3D\"foo\">")); | 385 EXPECT_EQ(WTF::kNotFound, mhtml.Find("shadowmode=3D\"foo\">")); |
| 388 EXPECT_EQ(WTF::kNotFound, mhtml.Find("shadowdelegatesfocus=3D\"bar\">")); | 386 EXPECT_EQ(WTF::kNotFound, mhtml.Find("shadowdelegatesfocus=3D\"bar\">")); |
| 389 } | 387 } |
| 390 | 388 |
| 391 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |