Changeset 182821 in webkit


Ignore:
Timestamp:
Apr 14, 2015 4:48:00 PM (9 years ago)
Author:
Brent Fulgham
Message:

Correct layering violation in DumpRenderTree Build
https://bugs.webkit.org/show_bug.cgi?id=143732

Reviewed by Simon Fraser.

Source/WebCore:

  • testing/js/WebCoreTestSupport.cpp:

(WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
the internal WebCore objects needed to implement this function.
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.

  • testing/js/WebCoreTestSupport.h:

Tools:

Correct a layering violation in DumpRenderTree by calling functions on the
WebCoreTestSupport library, rather than attempting to work with WebCore
types directly.

  • DumpRenderTree/mac/EventSendingController.mm:

(-[EventSendingController monitorWheelEvents]): Call methods on WebCoreTestSupport, rather
than WebCore itself.,
(-[EventSendingController callAfterScrollingCompletes:]): Ditto.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r182820 r182821  
     12015-04-14  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Correct layering violation in DumpRenderTree Build
     4        https://bugs.webkit.org/show_bug.cgi?id=143732
     5
     6        Reviewed by Simon Fraser.
     7
     8        * testing/js/WebCoreTestSupport.cpp:
     9        (WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
     10        the internal WebCore objects needed to implement this function.
     11        (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
     12        * testing/js/WebCoreTestSupport.h:
     13
    1142015-04-14  Brady Eidson  <beidson@apple.com>
    215
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp

    r182205 r182821  
    3232#include "JSDocument.h"
    3333#include "JSInternals.h"
     34#include "MainFrame.h"
     35#include "WheelEventTestTrigger.h"
    3436#include <JavaScriptCore/APICast.h>
     37#include <JavaScriptCore/JSValueRef.h>
    3538#include <JavaScriptCore/Profile.h>
    3639#include <interpreter/CallFrame.h>
     
    6366}
    6467
     68void monitorWheelEvents(WebCore::Frame& frame)
     69{
     70    frame.mainFrame().ensureTestTrigger();
    6571}
     72
     73void setTestCallbackAndStartNotificationTimer(WebCore::Frame& frame, JSContextRef context, JSObjectRef jsCallbackFunction)
     74{
     75    WheelEventTestTrigger* trigger = frame.mainFrame().ensureTestTrigger();
     76    JSValueProtect(context, jsCallbackFunction);
     77   
     78    trigger->setTestCallbackAndStartNotificationTimer([=](void) {
     79        JSObjectCallAsFunction(context, jsCallbackFunction, nullptr, 0, nullptr, nullptr);
     80        JSValueUnprotect(context, jsCallbackFunction);
     81    });
     82}
     83
     84}
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.h

    r163725 r182821  
    2828
    2929typedef const struct OpaqueJSContext* JSContextRef;
     30typedef struct OpaqueJSValue* JSObjectRef;
    3031
    3132#if PLATFORM(COCOA)
     
    3536#endif
    3637
     38namespace WebCore {
     39class Frame;
     40}
     41
    3742namespace WebCoreTestSupport {
    3843
    3944void injectInternalsObject(JSContextRef) TEST_SUPPORT_EXPORT;
    4045void resetInternalsObject(JSContextRef) TEST_SUPPORT_EXPORT;
     46void monitorWheelEvents(WebCore::Frame&) TEST_SUPPORT_EXPORT;
     47void setTestCallbackAndStartNotificationTimer(WebCore::Frame&, JSContextRef, JSObjectRef) TEST_SUPPORT_EXPORT;
    4148
    4249} // namespace WebCore
  • trunk/Tools/ChangeLog

    r182808 r182821  
     12015-04-14  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Correct layering violation in DumpRenderTree Build
     4        https://bugs.webkit.org/show_bug.cgi?id=143732
     5
     6        Reviewed by Simon Fraser.
     7
     8        Correct a layering violation in DumpRenderTree by calling functions on the
     9        WebCoreTestSupport library, rather than attempting to work with WebCore
     10        types directly.
     11
     12        * DumpRenderTree/mac/EventSendingController.mm:
     13        (-[EventSendingController monitorWheelEvents]): Call methods on WebCoreTestSupport, rather
     14        than WebCore itself.,
     15        (-[EventSendingController callAfterScrollingCompletes:]): Ditto.
     16
    1172015-04-14  Benjamin Poulain  <benjamin@webkit.org>
    218
  • trunk/Tools/DumpRenderTree/mac/EventSendingController.mm

    r182768 r182821  
    3636#import "DumpRenderTreeDraggingInfo.h"
    3737#import "DumpRenderTreeFileDraggingSource.h"
     38#import "WebCoreTestSupport.h"
    3839#import <WebKit/DOMPrivate.h>
    3940#import <WebKit/WebKit.h>
     
    4344#if !PLATFORM(IOS)
    4445#import <Carbon/Carbon.h> // for GetCurrentEventTime()
    45 #import <JavaScriptCore/JSRetainPtr.h>
    46 #import <WebCore/MainFrame.h>
    47 #import <WebCore/Page.h>
    48 #import <WebCore/WheelEventTestTrigger.h>
    4946#endif
    5047
     
    12681265    if (!frame)
    12691266        return;
    1270    
    1271     frame->mainFrame().ensureTestTrigger();
     1267
     1268    WebCoreTestSupport::monitorWheelEvents(*frame);
    12721269#endif
    12731270}
     
    12841281        return;
    12851282
    1286     WebCore::WheelEventTestTrigger* trigger = frame->mainFrame().ensureTestTrigger();
    12871283    JSGlobalContextRef globalContext = [mainFrame globalContext];
    1288     JSValueProtect(globalContext, jsCallbackFunction);
    1289 
    1290     trigger->setTestCallbackAndStartNotificationTimer([=](void) {
    1291         JSObjectCallAsFunction(globalContext, jsCallbackFunction, nullptr, 0, nullptr, nullptr);
    1292         JSValueUnprotect(globalContext, jsCallbackFunction);
    1293     });
     1284    WebCoreTestSupport::setTestCallbackAndStartNotificationTimer(*frame, globalContext, jsCallbackFunction);
    12941285#endif
    12951286}
Note: See TracChangeset for help on using the changeset viewer.