| 1 | /* |
| 2 | * Copyright (C) 2013 Igalia S.L. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2,1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "config.h" |
| 21 | |
| 22 | #include "WebViewTest.h" |
| 23 | #include <gtk/gtk.h> |
| 24 | #include <webkit2/webkit2.h> |
| 25 | |
| 26 | static void testWebKitDOMNodeHierarchyNavigation(WebViewTest* test, gconstpointer) |
| 27 | { |
| 28 | static const char* testHTML = "<html><head><title>This is the title</title></head><body><p>1</p><p>2</p><p>3</p></body></html>" ; |
| 29 | g_assert_true(test->runWebProcessTest("WebKitDOMNode" , "hierarchy-navigation" , testHTML)); |
| 30 | } |
| 31 | |
| 32 | static void testWebKitDOMNodeInsertion(WebViewTest* test, gconstpointer) |
| 33 | { |
| 34 | g_assert_true(test->runWebProcessTest("WebKitDOMNode" , "insertion" )); |
| 35 | } |
| 36 | |
| 37 | static const char* tagNamesTestHTML = "<html><head></head><body>" |
| 38 | "<video id='video' preload='none'>" |
| 39 | " <source src='movie.ogg' type='video/ogg'>" |
| 40 | " Your browser does not support the video tag." |
| 41 | "</video>" |
| 42 | "<video id='video2' preload='none'>" |
| 43 | " <source src='movie.ogg' type='video/ogg'>" |
| 44 | " Your browser does not support the video tag." |
| 45 | "</video>" |
| 46 | "<input type='hidden' id='test' name='finish' value='false'></body></html>" ; |
| 47 | |
| 48 | static void testWebKitDOMNodeTagNamesNodeList(WebViewTest* test, gconstpointer) |
| 49 | { |
| 50 | g_assert_true(test->runWebProcessTest("WebKitDOMNode" , "tag-names-node-list" , tagNamesTestHTML)); |
| 51 | } |
| 52 | |
| 53 | static void testWebKitDOMNodeTagNamesHTMLCollection(WebViewTest* test, gconstpointer) |
| 54 | { |
| 55 | g_assert_true(test->runWebProcessTest("WebKitDOMNode" , "tag-names-html-collection" , tagNamesTestHTML)); |
| 56 | } |
| 57 | |
| 58 | static void testWebKitDOMObjectCache(WebViewTest* test, gconstpointer) |
| 59 | { |
| 60 | static const char* testHTML = "<html><body><div id='container'><p>DOM Cache test</p><a id='link href='#'>link</a></div></body></html>" ; |
| 61 | g_assert_true(test->runWebProcessTest("WebKitDOMNode" , "dom-cache" , testHTML)); |
| 62 | } |
| 63 | |
| 64 | |
| 65 | void beforeAll() |
| 66 | { |
| 67 | WebViewTest::add("WebKitDOMNode" , "hierarchy-navigation" , testWebKitDOMNodeHierarchyNavigation); |
| 68 | WebViewTest::add("WebKitDOMNode" , "insertion" , testWebKitDOMNodeInsertion); |
| 69 | WebViewTest::add("WebKitDOMNode" , "tag-names-node-list" , testWebKitDOMNodeTagNamesNodeList); |
| 70 | WebViewTest::add("WebKitDOMNode" , "tag-names-html-collection" , testWebKitDOMNodeTagNamesHTMLCollection); |
| 71 | WebViewTest::add("WebKitDOMNode" , "dom-cache" , testWebKitDOMObjectCache); |
| 72 | } |
| 73 | |
| 74 | void afterAll() |
| 75 | { |
| 76 | } |
| 77 | |