haikuwebkit/Tools/TestRunnerShared/ReftestFunctions.h

36 lines
1.5 KiB
C
Raw Permalink Normal View History

Send TestRendered event after running a test but before dumping https://bugs.webkit.org/show_bug.cgi?id=216428 Reviewed by Sam Weinig. Tools: * DumpRenderTree/CMakeLists.txt: Added the new files and directories. * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Ditto. * DumpRenderTree/PlatformWin.cmake: Temporarily disable precompiled headers on WinCairo since they were not working properly with JSBasics.cpp. * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate readyToDumpState]): Added. Calls sendTestRenderedEvent. (-[FrameLoadDelegate processWork:]): Call readyToDumpState. (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): Ditto. * DumpRenderTree/win/FrameLoadDelegate.cpp: (readyToDumpState): Added. Calls sendTestRenderedEvent. (FrameLoadDelegate::processWork): Call readyToDumpState. (FrameLoadDelegate::locationChangeDone): Ditto. * TestRunnerShared/Bindings/JSBasics.cpp: Added. (WTR::JSValueMakeBooleanOrNull): Moved from JSWrappable.h. (WTR::JSValueToNullableBoolean): Ditto. (WTR::JSValueMakeStringOrNull): Ditto. (WTR::createJSString): Ditto. (WTR::makeValue): Ditto. (WTR::objectProperty): Ditto. (WTR::setProperty): Added. Sets a named property value to a boolean. (WTR::call): Moved from JSWrappable.h. (WTR::callConstructor): Added. Gets a global constructor and calls it. * TestRunnerShared/Bindings/JSBasics.h: Added. Declares the above functions. * TestRunnerShared/Bindings/JSWrappable.h: (WTR::JSValueMakeBooleanOrNull): Deleted. (WTR::JSValueToNullableBoolean): Deleted. (WTR::JSValueMakeStringOrNull): Deleted. (WTR::createJSString): Deleted. (WTR::makeValue): Deleted. (WTR::objectProperty): Deleted. (WTR::call): Deleted. (WTR::hasRefTestWaitAttribute): Deleted. * TestRunnerShared/Bindings/JSWrapper.h: Updated includes. * TestRunnerShared/ReftestFunctions.cpp: Added. (WTR::sendTestRenderedEvent): Added. Creates and dispatches a TestRendered event. (WTR::hasReftestWaitAttribute): Moved from JSWrappable.h and renamed to use a lowercase T since that's how web-platform-tests names things. * TestRunnerShared/ReftestFunctions.h: Added. Declares the above functions. * WebKitTestRunner/CMakeLists.txt: Added the new files and directories. * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::frameDidChangeLocation): Call sendTestRenderedEvent before calling dumpAfterWaitAttributeIsRemoved. * WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm: Added a missing include of "config.h" to fix build failures I was seeing. An alternative, since this is a Cocoa-only source file, would be to put config.h into a precompiled prefix header. * WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm: Ditto. * WebKitTestRunner/PlatformWin.cmake: Temporarily disable precompiled headers on WinCairo since they were not working properly with JSBasics.cpp. * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Added the new files and directories. LayoutTests: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: Unskip two tests that no longer time out since we are sending this event. * platform/win/TestExpectations: Add a failure expectation for a test that has a couple non-green pixels. Canonical link: https://commits.webkit.org/229278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-13 06:21:39 +00:00
/*
* Copyright (C) 2020 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.
*/
#pragma once
typedef struct OpaqueJSContext* JSGlobalContextRef;
namespace WTR {
void sendTestRenderedEvent(JSGlobalContextRef);
bool hasReftestWaitAttribute(JSGlobalContextRef);
}