Changes between Version 2 and Version 3 of Exposing WebKit internals for Layout Tests


Ignore:
Timestamp:
Jun 26, 2012 3:07:53 PM (12 years ago)
Author:
petewil@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Exposing WebKit internals for Layout Tests

    v2 v3  
    1515
    1616Here’s what you need to do (you can look at my change in webkit bug 88665 for an example).
    17 In Internals.cpp, I made a new function to return the data I needed.  I copied the list from the Document class into a DOMStringList.  This let me expose it to JavaScript as a return value.
    18 To generate a tie between Internals.cpp and the exposed JavaScript, I added the corresponding function in “internals.idl”.  (If you are an old school Windows programmer new to WebKit, note that this is WebKit idl, don’t confuse it with the idl used for RPC).
    19 Internals needed the functions that it calls in the document object to be exported so it can find them.  This means modifying Source/WebCore/WebCore.exp.in (for Mac), Source/WebKit2/win/WebKit2.def (for Windows), and Source/autotools/symbols.filter (for GTK+).  It needs a c++ decorated name for that platform.  The decorated name for the Mac and GTK+ look similar (one less leading underscore, otherwise the same).  Note that symbols.filter ends with a semicolon, and the others do not.  The files are sorted, so maintain the sort order when you add your symbol.
    20 In the javascript of the layout test, I call the new method as “window.internals.my-method().  I was able to check in JS that the data returned matched what the test expected, and print PASS or FAIL into the results.
     17
     18 - In Internals.cpp, I made a new function to return the data I needed.  I copied the list from the Document class into a DOMStringList.  This let me expose it to JavaScript as a return value.
     19
     20 - To generate a tie between Internals.cpp and the exposed JavaScript, I added the corresponding function in “internals.idl”.  (If you are an old school Windows programmer new to WebKit, note that this is WebKit idl, don’t confuse it with the idl used for RPC).
     21
     22 - Internals needed the functions that it calls in the document object to be exported so it can find them.  This means modifying Source/WebCore/WebCore.exp.in (for Mac), Source/WebKit2/win/WebKit2.def (for Windows), and Source/autotools/symbols.filter (for GTK+).  It needs a c++ decorated name for that platform.  The decorated name for the Mac and GTK+ look similar (one less leading underscore, otherwise the same).  Note that symbols.filter ends with a semicolon, and the others do not.  The files are sorted, so maintain the sort order when you add your symbol.
     23
     24 - In the javascript of the layout test, I call the new method as “window.internals.my-method().  I was able to check in JS that the data returned matched what the test expected, and print PASS or FAIL into the results.