diff options
author | Steve Block <steveblock@google.com> | 2009-11-05 09:23:40 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-11-10 22:41:12 +0000 |
commit | cac0f67c402d107cdb10971b95719e2ff9c7c76b (patch) | |
tree | d182c7f87211c6f201a5f038e332336493ebdbe7 /WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp | |
parent | 4b2ef0f288e7c6c4602f621b7a0e9feed304b70e (diff) | |
download | external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.zip external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.gz external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.bz2 |
Merge webkit.org at r50258 : Initial merge by git.
Change-Id: I1a9e1dc4ed654b69174ad52a4f031a07240f37b0
Diffstat (limited to 'WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index 0b4a38f..631fc31 100644 --- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -3,6 +3,7 @@ * Copyright (C) 2007 Eric Seidel <eric@webkit.org> * Copyright (C) 2008 Nuanti Ltd. * Copyright (C) 2009 Jan Michael Alonzo <jmalonzo@gmail.com> + * Copyright (C) 2009 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -52,6 +53,8 @@ unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame) void webkit_application_cache_set_maximum_size(unsigned long long size); unsigned int webkit_worker_thread_count(void); void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains); +gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, const gchar* id); +void webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script); } static gchar* copyWebSettingKey(gchar* preferenceKey) @@ -118,6 +121,17 @@ void LayoutTestController::display() displayWebView(); } +JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id) +{ + gchar* idGChar = JSStringCopyUTF8CString(id); + gchar* counterValueGChar = webkit_web_frame_counter_value_for_element_by_id(mainFrame, idGChar); + g_free(idGChar); + if (!counterValueGChar) + return 0; + JSRetainPtr<JSStringRef> counterValue(Adopt, JSStringCreateWithUTF8CString(counterValueGChar)); + return counterValue; +} + void LayoutTestController::keepWebHistory() { // FIXME: implement @@ -474,15 +488,40 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source) void LayoutTestController::showWebInspector() { - // FIXME: Implement this. + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView); + WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); + + g_object_set(webSettings, "enable-developer-extras", TRUE, NULL); + webkit_web_inspector_inspect_coordinates(inspector, 0, 0); } void LayoutTestController::closeWebInspector() { - // FIXME: Implement this. + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView); + WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); + + webkit_web_inspector_close(inspector); + g_object_set(webSettings, "enable-developer-extras", FALSE, NULL); } void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) { + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); + char* scriptString = JSStringCopyUTF8CString(script); + + webkit_web_inspector_execute_script(inspector, callId, scriptString); + g_free(scriptString); +} + +void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +{ + // FIXME: Implement this. +} + +void LayoutTestController::removeAllVisitedLinks() +{ // FIXME: Implement this. } |