| 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 | |
| 24 | static void testWebKitFrameMainFrame(WebViewTest* test, gconstpointer) |
| 25 | { |
| 26 | g_assert_true(test->runWebProcessTest("WebKitFrame" , "main-frame" )); |
| 27 | } |
| 28 | |
| 29 | static void testWebKitFrameURI(WebViewTest* test, gconstpointer) |
| 30 | { |
| 31 | g_assert_true(test->runWebProcessTest("WebKitFrame" , "uri" )); |
| 32 | } |
| 33 | |
| 34 | static void testWebKitFrameJavaScriptContext(WebViewTest* test, gconstpointer) |
| 35 | { |
| 36 | g_assert_true(test->runWebProcessTest("WebKitFrame" , "javascript-context" )); |
| 37 | } |
| 38 | |
| 39 | static void testWebKitFrameJavaScriptValues(WebViewTest* test, gconstpointer) |
| 40 | { |
| 41 | static const char* testHTML = "<html><body><p id='paragraph'>This is a test</p><img id='image' src='foo.png'></body></html>" ; |
| 42 | g_assert_true(test->runWebProcessTest("WebKitFrame" , "javascript-values" , testHTML)); |
| 43 | } |
| 44 | |
| 45 | static void testWebKitFrameSubframe(WebViewTest* test, gconstpointer) |
| 46 | { |
| 47 | static const char* testHTML = "<html><body><iframe src='resource:///org/webkit/glib/tests/form-in-frame.html' id='frame'></iframe></body></html>" ; |
| 48 | g_assert_true(test->runWebProcessTest("WebKitFrame" , "subframe" , testHTML)); |
| 49 | } |
| 50 | |
| 51 | void beforeAll() |
| 52 | { |
| 53 | WebViewTest::add("WebKitFrame" , "main-frame" , testWebKitFrameMainFrame); |
| 54 | WebViewTest::add("WebKitFrame" , "uri" , testWebKitFrameURI); |
| 55 | WebViewTest::add("WebKitFrame" , "javascript-context" , testWebKitFrameJavaScriptContext); |
| 56 | WebViewTest::add("WebKitFrame" , "javascript-values" , testWebKitFrameJavaScriptValues); |
| 57 | WebViewTest::add("WebKitFrame" , "subframe" , testWebKitFrameSubframe); |
| 58 | } |
| 59 | |
| 60 | void afterAll() |
| 61 | { |
| 62 | } |
| 63 | |