Skip to content
Permalink
Browse files
2011-01-26 Maciej Stachowiak <mjs@apple.com>
        Reviewed by Dan Bernstein.

        WebKitTestRunner needs to support layoutTestController.evaluateInWebInspector
        https://bugs.webkit.org/show_bug.cgi?id=42319

        Unskip inspector tests (except the few that mysteriously fail).

        * platform/mac-wk2/Skipped:
2011-01-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        WebKitTestRunner needs to support layoutTestController.evaluateInWebInspector
        https://bugs.webkit.org/show_bug.cgi?id=42319

        Add evaluateInWebInspector and other APIs needed for inspector tests to run.

        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
        (WTR::LayoutTestController::showWebInspector):
        (WTR::LayoutTestController::closeWebInspector):
        (WTR::LayoutTestController::evaluateInWebInspector):
        (WTR::LayoutTestController::setTimelineProfilingEnabled):
        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
        * WebKitTestRunner/TestInvocation.cpp:
        (WTR::shouldOpenWebInspector):
        (WTR::TestInvocation::invoke):
        * WebKitTestRunner/WebKitTestRunnerPrefix.h:
2011-01-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        WebKitTestRunner needs to support layoutTestController.evaluateInWebInspector
        https://bugs.webkit.org/show_bug.cgi?id=42319

        Add WKBundleInspector and APIs needed to implement WebKitTestRunner APIs.

        * GNUmakefile.am:
        * Shared/API/c/WKBase.h:
        * Shared/APIObject.h:
        * WebKit2.pro:
        * WebKit2.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
        * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: Added.
        (WKBundleInspectorGetTypeID):
        (WKBundleInspectorShow):
        (WKBundleInspectorClose):
        (WKBundleInspectorEvaluateScriptForTest):
        (WKBundleInspectorSetPageProfilingEnabled):
        * WebProcess/InjectedBundle/API/c/WKBundleInspector.h: Added.
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageGetInspector):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::create):
        (WebKit::WebInspector::evaluateScriptForTest):
        * WebProcess/WebPage/WebInspector.h:
        (WebKit::WebInspector::type):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::inspector):
        * WebProcess/WebPage/WebPage.h:
        * win/WebKit2.vcproj:
        * win/WebKit2Generated.make:


Canonical link: https://commits.webkit.org/66987@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
othermaciej committed Jan 27, 2011
1 parent 03eb918 commit c19186397df1004189065c7d81657db572a2ba87
Showing 25 changed files with 308 additions and 27 deletions.
@@ -1,3 +1,14 @@
2011-01-26 Maciej Stachowiak <mjs@apple.com>

Reviewed by Dan Bernstein.

WebKitTestRunner needs to support layoutTestController.evaluateInWebInspector
https://bugs.webkit.org/show_bug.cgi?id=42319

Unskip inspector tests (except the few that mysteriously fail).

* platform/mac-wk2/Skipped:

2011-01-27 Yuzo Fujishima <yuzo@google.com>

Unreviewed Chromium test expectation change.
@@ -56,6 +56,7 @@ compositing/iframes/iframe-src-change.html

# WebKitTestRunner needs an implementation of eventSender
# <https://bugs.webkit.org/show_bug.cgi?id=42194>
inspector/timeline-event-dispatch.html
fast/text/offsetForPosition-complex-fallback.html
svg/animations/animate-path-to-animation.html
fast/forms/input-number-change-type-on-focus.html
@@ -1254,12 +1255,6 @@ editing/undo/undo-typing-001.html
# <rdar://problem/8867804>
svg/css/cursor-replace.svg

# WebKitTestRunner needs to support evaluateInWebInspector
# <https://bugs.webkit.org/show_bug.cgi?id=42319>
http/tests/inspector-enabled
http/tests/inspector
inspector

# WebKitTestRunner needs to support layoutTestController.dumpDOMAsWebArchive
# <https://bugs.webkit.org/show_bug.cgi?id=42324>
http/tests/webarchive/cross-origin-stylesheet-crash.html
@@ -2283,6 +2278,10 @@ fast/workers/storage/open-database-inputs-sync.html
fast/workers/storage/sql-exception-codes-sync.html
storage/multiple-databases-garbage-collection.html

# Unknown failures after enabling inspector tests
inspector/timeline-paint.html
inspector/timeline-script-tag-1.html

### END OF (3) Unclassified failures
########################################

@@ -1,3 +1,39 @@
2011-01-26 Maciej Stachowiak <mjs@apple.com>

Reviewed by Dan Bernstein.

WebKitTestRunner needs to support layoutTestController.evaluateInWebInspector
https://bugs.webkit.org/show_bug.cgi?id=42319

Add WKBundleInspector and APIs needed to implement WebKitTestRunner APIs.

* GNUmakefile.am:
* Shared/API/c/WKBase.h:
* Shared/APIObject.h:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: Added.
(WKBundleInspectorGetTypeID):
(WKBundleInspectorShow):
(WKBundleInspectorClose):
(WKBundleInspectorEvaluateScriptForTest):
(WKBundleInspectorSetPageProfilingEnabled):
* WebProcess/InjectedBundle/API/c/WKBundleInspector.h: Added.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageGetInspector):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::create):
(WebKit::WebInspector::evaluateScriptForTest):
* WebProcess/WebPage/WebInspector.h:
(WebKit::WebInspector::type):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::inspector):
* WebProcess/WebPage/WebPage.h:
* win/WebKit2.vcproj:
* win/WebKit2Generated.make:

2011-01-26 David Kilzer <ddkilzer@apple.com>

<http://webkit.org/b/53192> Add experimental support for HTTP pipelining in CFNetwork
@@ -433,6 +433,8 @@ libWebKit2_la_SOURCES = \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInitialize.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
@@ -92,6 +92,7 @@ typedef const struct OpaqueWKBundleBackForwardListItem* WKBundleBackForwardListI
typedef const struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
typedef const struct OpaqueWKBundleInspector* WKBundleInspectorRef;
typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
typedef const struct OpaqueWKBundlePage* WKBundlePageRef;
typedef const struct OpaqueWKBundlePageGroup* WKBundlePageGroupRef;
@@ -85,6 +85,7 @@ class APIObject : public RefCounted<APIObject> {
TypeBundleBackForwardListItem,
TypeBundleFrame,
TypeBundleHitTestResult,
TypeBundleInspector,
TypeBundleNodeHandle,
TypeBundlePage,
TypeBundlePageGroup,
@@ -620,6 +620,7 @@ SOURCES += \
WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp \
WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp \
WebProcess/InjectedBundle/API/c/WKBundlePage.cpp \
WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp \
@@ -286,6 +286,8 @@
51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; };
51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */; };
51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */; };
6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; };
65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Public, ); }; };
6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; };
762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
@@ -1035,6 +1037,8 @@
51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageProxyCF.cpp; path = cf/WebPageProxyCF.cpp; sourceTree = "<group>"; };
5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; };
5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleInspector.cpp; sourceTree = "<group>"; };
65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleInspector.h; sourceTree = "<group>"; };
6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb; path = WebProcess/com.apple.WebProcess.sb; sourceTree = "<group>"; };
762B7481120BBA0100819339 /* FontSmoothingLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingLevel.h; sourceTree = "<group>"; };
762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; };
@@ -2443,6 +2447,8 @@
BC49862E124D18C100D834E1 /* WKBundleHitTestResult.cpp */,
BC49862D124D18C100D834E1 /* WKBundleHitTestResult.h */,
BC204EED11C83EC8008F3375 /* WKBundleInitialize.h */,
65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */,
65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */,
BC4BEFE0120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp */,
BC4BEFDF120A1A4C00FBA0C7 /* WKBundleNodeHandle.h */,
BC57450B1263B155006F0F12 /* WKBundleNodeHandlePrivate.h */,
@@ -2839,6 +2845,7 @@
BC204EF011C83EC8008F3375 /* WKBundleAPICast.h in Headers */,
BCD25F1711D6BDE100169B0E /* WKBundleFrame.h in Headers */,
BC204EF211C83EC8008F3375 /* WKBundleInitialize.h in Headers */,
65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */,
BC20528111C94284008F3375 /* WKBundlePage.h in Headers */,
BC1B419811D41D570011E8DD /* WKBundlePagePrivate.h in Headers */,
BCB9E24B1120E15C00A137E0 /* WKContext.h in Headers */,
@@ -3556,6 +3563,7 @@
BC9585C812F095B800755821 /* WebGestureEvent.cpp in Sources */,
1A186EEB12EF7618008E5F37 /* LayerTreeHost.cpp in Sources */,
1A18718512EF9877008E5F37 /* LayerTreeHostMac.mm in Sources */,
6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -50,6 +50,7 @@ class InjectedBundleRangeHandle;
class InjectedBundleScriptWorld;
class PageOverlay;
class WebFrame;
class WebInspector;
class WebPage;
class WebPageGroupProxy;

@@ -58,6 +59,7 @@ WK_ADD_API_MAPPING(WKBundleBackForwardListRef, InjectedBundleBackForwardList)
WK_ADD_API_MAPPING(WKBundleCSSStyleDeclarationRef, WebCore::CSSStyleDeclaration)
WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame)
WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector)
WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
WK_ADD_API_MAPPING(WKBundlePageGroupRef, WebPageGroupProxy)
WK_ADD_API_MAPPING(WKBundlePageOverlayRef, PageOverlay)
@@ -0,0 +1,65 @@
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "WKBundleInspector.h"

#if ENABLE(INSPECTOR)

#include "WKAPICast.h"
#include "WKBundleAPICast.h"
#include "WebInspector.h"

using namespace WebCore;
using namespace WebKit;

WKTypeID WKBundleInspectorGetTypeID()
{
return toAPI(WebInspector::APIType);
}

void WKBundleInspectorShow(WKBundleInspectorRef inspectorRef)
{
return toImpl(inspectorRef)->show();
}

void WKBundleInspectorClose(WKBundleInspectorRef inspectorRef)
{
return toImpl(inspectorRef)->close();
}

void WKBundleInspectorEvaluateScriptForTest(WKBundleInspectorRef inspectorRef, long callID, WKStringRef script)
{
return toImpl(inspectorRef)->evaluateScriptForTest(callID, toImpl(script)->string());
}

void WKBundleInspectorSetPageProfilingEnabled(WKBundleInspectorRef inspectorRef, bool enabled)
{
if (enabled)
toImpl(inspectorRef)->startPageProfiling();
else
toImpl(inspectorRef)->stopPageProfiling();
}

#endif // ENABLE(INSPECTOR)
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WKBundleInspector_h
#define WKBundleInspector_h

#include <WebKit2/WKBase.h>

#if ENABLE(INSPECTOR)

#ifndef __cplusplus
#include <stdbool.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

WK_EXPORT WKTypeID WKBundleInspectorGetTypeID();

WK_EXPORT void WKBundleInspectorShow(WKBundleInspectorRef inspector);
WK_EXPORT void WKBundleInspectorClose(WKBundleInspectorRef inspector);

WK_EXPORT void WKBundleInspectorEvaluateScriptForTest(WKBundleInspectorRef inspector, long callID, WKStringRef script);
WK_EXPORT void WKBundleInspectorSetPageProfilingEnabled(WKBundleInspectorRef inspector, bool enabled);

#ifdef __cplusplus
}
#endif

#endif // ENABLE(INSPECTOR)

#endif // WKBundleInspector_h

@@ -184,3 +184,10 @@ WKImageRef WKBundlePageCreateSnapshotInDocumentCoordinates(WKBundlePageRef pageR
RefPtr<WebImage> webImage = toImpl(pageRef)->snapshotInDocumentCoordinates(toIntRect(rect), toImageOptions(options));
return toAPI(webImage.release().leakRef());
}

#if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR
WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef pageRef)
{
return toAPI(toImpl(pageRef)->inspector());
}
#endif
@@ -220,6 +220,10 @@ WK_EXPORT bool WKBundlePageFindString(WKBundlePageRef page, WKStringRef target,
WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInViewCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options);
WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options);

#if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR
WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page);
#endif

#ifdef __cplusplus
}
#endif
@@ -38,6 +38,11 @@ using namespace WebCore;

namespace WebKit {

PassRefPtr<WebInspector> WebInspector::create(WebPage* page)
{
return adoptRef(new WebInspector(page));
}

WebInspector::WebInspector(WebPage* page)
: m_page(page)
, m_inspectorPage(0)
@@ -91,6 +96,11 @@ void WebInspector::close()
m_page->corePage()->inspectorController()->close();
}

void WebInspector::evaluateScriptForTest(long callID, const String& script)
{
m_page->corePage()->inspectorController()->evaluateForTestInFrontend(callID, script);
}

void WebInspector::showConsole()
{
m_page->corePage()->inspectorController()->showPanel(InspectorController::ConsolePanel);

0 comments on commit c191863

Please sign in to comment.