| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 27 * OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/dom/DOMImplementation.h" | 30 #include "core/dom/DOMImplementation.h" |
| 31 | 31 |
| 32 #include "platform/wtf/text/WTFString.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 33 #include "wtf/text/WTFString.h" | |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 TEST(DOMImplementationTest, TextMIMEType) { | 37 TEST(DOMImplementationTest, TextMIMEType) { |
| 38 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("text/plain")); | 38 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("text/plain")); |
| 39 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("text/javascript")); | 39 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("text/javascript")); |
| 40 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("TEXT/JavaScript")); | 40 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("TEXT/JavaScript")); |
| 41 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("application/json")); | 41 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("application/json")); |
| 42 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("application/jSON")); | 42 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("application/jSON")); |
| 43 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("application/json;foo=2")); | 43 EXPECT_TRUE(DOMImplementation::IsTextMIMEType("application/json;foo=2")); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("text/html")); | 92 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("text/html")); |
| 93 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/xml;")); | 93 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/xml;")); |
| 94 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/xml ")); | 94 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/xml ")); |
| 95 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/x-what+xml;")); | 95 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/x-what+xml;")); |
| 96 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/x-tra+xML;a=2")); | 96 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/x-tra+xML;a=2")); |
| 97 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/+xML")); | 97 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/+xML")); |
| 98 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/+xml")); | 98 EXPECT_FALSE(DOMImplementation::IsXMLMIMEType("application/+xml")); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |