| 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "public/web/WebFrameSerializer.h" | 31 #include "public/web/WebFrameSerializer.h" |
| 32 | 32 |
| 33 #include "platform/testing/URLTestHelpers.h" | 33 #include "platform/testing/URLTestHelpers.h" |
| 34 #include "platform/testing/UnitTestHelpers.h" | 34 #include "platform/testing/UnitTestHelpers.h" |
| 35 #include "platform/weborigin/KURL.h" | 35 #include "platform/weborigin/KURL.h" |
| 36 #include "platform/wtf/text/StringBuilder.h" |
| 36 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
| 37 #include "public/platform/WebCString.h" | 38 #include "public/platform/WebCString.h" |
| 38 #include "public/platform/WebCache.h" | 39 #include "public/platform/WebCache.h" |
| 39 #include "public/platform/WebString.h" | 40 #include "public/platform/WebString.h" |
| 40 #include "public/platform/WebURL.h" | 41 #include "public/platform/WebURL.h" |
| 41 #include "public/platform/WebURLLoaderMockFactory.h" | 42 #include "public/platform/WebURLLoaderMockFactory.h" |
| 42 #include "public/web/WebFrameSerializerClient.h" | 43 #include "public/web/WebFrameSerializerClient.h" |
| 43 #include "testing/gtest/include/gtest/gtest.h" | 44 #include "testing/gtest/include/gtest/gtest.h" |
| 44 #include "web/WebLocalFrameImpl.h" | 45 #include "web/WebLocalFrameImpl.h" |
| 45 #include "web/WebViewImpl.h" | 46 #include "web/WebViewImpl.h" |
| 46 #include "web/tests/FrameTestHelpers.h" | 47 #include "web/tests/FrameTestHelpers.h" |
| 47 #include "wtf/text/StringBuilder.h" | |
| 48 | 48 |
| 49 namespace blink { | 49 namespace blink { |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| 52 class SimpleWebFrameSerializerClient final : public WebFrameSerializerClient { | 52 class SimpleWebFrameSerializerClient final : public WebFrameSerializerClient { |
| 53 public: | 53 public: |
| 54 String toString() { return m_builder.toString(); } | 54 String toString() { return m_builder.toString(); } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 void didSerializeDataForFrame(const WebCString& data, | 57 void didSerializeDataForFrame(const WebCString& data, |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 mhtml.find("<meta http-equiv=3D\"Content-Security-Policy")); | 380 mhtml.find("<meta http-equiv=3D\"Content-Security-Policy")); |
| 381 EXPECT_NE(WTF::kNotFound, mhtml.find("<meta name=3D\"description")); | 381 EXPECT_NE(WTF::kNotFound, mhtml.find("<meta name=3D\"description")); |
| 382 EXPECT_NE(WTF::kNotFound, mhtml.find("<meta http-equiv=3D\"refresh")); | 382 EXPECT_NE(WTF::kNotFound, mhtml.find("<meta http-equiv=3D\"refresh")); |
| 383 | 383 |
| 384 // If an element is removed, its children should also be skipped. | 384 // If an element is removed, its children should also be skipped. |
| 385 EXPECT_EQ(WTF::kNotFound, mhtml.find("<select")); | 385 EXPECT_EQ(WTF::kNotFound, mhtml.find("<select")); |
| 386 EXPECT_EQ(WTF::kNotFound, mhtml.find("<option")); | 386 EXPECT_EQ(WTF::kNotFound, mhtml.find("<option")); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |