Changeset 54942 in webkit


Ignore:
Timestamp:
Feb 18, 2010 12:17:39 AM (14 years ago)
Author:
hamaji@chromium.org
Message:

2010-02-16 Chris Jerdonek <Chris Jerdonek>

Reviewed by Shinichiro Hamaji.

Refactored check-webkit-style's ProcessorOptions class into two
classes. This revision contains no new functionality.

https://bugs.webkit.org/show_bug.cgi?id=34674

Divided the ProcessorOptions class into a CommandOptionValues
class (the result of parsing the command-line options) and
a StyleCheckerConfiguration class (which configures the main
StyleChecker).

  • Scripts/check-webkit-style:
    • Updated main() to convert the parsed command option values to a StyleCheckConfiguration instance prior to constructing a StyleChecker.
  • Scripts/webkitpy/style/checker.py:
    • Added check_webkit_style_configuration() to convert a CommandOptionValues instance into a StyleCheckerConfiguration instance.
    • Renamed the ProcessorOptions class to CommandOptionValues.
    • In the CommandOptionValues class--
      • Replaced the filter_configuration attribute with the simpler filter_rules attribute.
      • Removed the max_reports_per_error attribute.
      • Moved the is_reportable() method to the new StyleCheckerConfiguration class.
    • Removed the base_filter_rules attribute from the DefaultCommandOptionValues class.
    • In the ArgumentParser class--
      • Added base_filter_rules to the constructor.
      • Changed the parse() method to return a CommandOptionValues instance instead of a ProcessorOptions instance.
    • Created a StyleCheckerConfiguration class.
      • Added the data attributes max_reports_per_category, stderr_write, and verbosity.
      • Added is_reportable() (moved from the ProcessorOptions class) and write_style_error() (moved from the DefaultStyleErrorHandler class).
    • In the StyleChecker class--
      • Replaced the ProcessorOptions options attribute with the StyleCheckerConfiguration _configuration attribute.
      • Removed the _stderr_write attribute.
  • Scripts/webkitpy/style/checker_unittest.py:
    • Updated the existing unit test classes as necessary.
    • Added a StyleCheckerConfigurationTest class.
  • Scripts/webkitpy/style/error_handlers.py:
    • Updated the DefaultStyleErrorHandler class to accept a StyleCheckerConfiguration instance instead of a ProcessorOptions instance and an stderr_write method.
  • Scripts/webkitpy/style/error_handlers_unittest.py:
    • Updated the unit test classes as necessary.
  • Scripts/webkitpy/style/filter.py:
    • Addressed the FIXME in the FilterConfiguration class to change the user_rules attribute to _user_rules (since it is now accessed only internally).
  • Scripts/webkitpy/style/filter_unittest.py:
    • Updated to reflect the change from user_rules to _user_rules.
Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r54934 r54942  
    6565        * Scripts/webkitpy/style/filter_unittest.py:
    6666          - Updated to reflect the change from user_rules to _user_rules.
     67
     682010-02-17  Shinichiro Hamaji  <hamaji@chromium.org>
     69
     70        Reviewed by Eric Seidel.
     71
     72        Share the DRT values maxViewWidth/Height among ports
     73        https://bugs.webkit.org/show_bug.cgi?id=34474
     74
     75        * DumpRenderTree/LayoutTestController.cpp:
     76        (pageNumberForElementByIdCallback):
     77        * DumpRenderTree/LayoutTestController.h:
     78        (LayoutTestController::maxViewWidth):
     79        (LayoutTestController::maxViewHeight):
     80        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     81        (runTest):
     82        * DumpRenderTree/mac/DumpRenderTree.mm:
     83        (createWebViewAndOffscreenWindow):
     84        (sizeWebViewForCurrentTest):
     85        * DumpRenderTree/win/DumpRenderTree.cpp:
     86        (dump):
     87        (createWebViewAndOffscreenWindow):
    6788
    68892010-02-17  Shinichiro Hamaji  <hamaji@chromium.org>
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp

    r54873 r54942  
    468468static bool parsePageParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, float& pageWidthInPixels, float& pageHeightInPixels)
    469469{
    470     // FIXME: These values should sync with maxViewWidth/Height in
    471     //        DumpRenderTree.mm. Factor these values out to somewhere.
    472     pageWidthInPixels = 800;
    473     pageHeightInPixels = 600;
     470    pageWidthInPixels = LayoutTestController::maxViewWidth;
     471    pageHeightInPixels = LayoutTestController::maxViewHeight;
    474472    switch (argumentCount) {
    475473    case 2:
     
    15061504    setlocale(LC_ALL, localeBuf);
    15071505}
     1506
     1507const unsigned LayoutTestController::maxViewWidth = 800;
     1508const unsigned LayoutTestController::maxViewHeight = 600;
  • trunk/WebKitTools/DumpRenderTree/LayoutTestController.h

    r54873 r54942  
    235235    void setPOSIXLocale(JSStringRef locale);
    236236
     237    static const unsigned maxViewWidth;
     238    static const unsigned maxViewHeight;
     239
    237240private:
    238241    bool m_dumpAsPDF;
  • trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r54900 r54942  
    9595static WebKitWebHistoryItem* prevTestBFItem = NULL;
    9696
    97 const unsigned maxViewHeight = 600;
    98 const unsigned maxViewWidth = 800;
    9997const unsigned historyItemIndent = 8;
    10098
     
    480478    GtkAllocation size;
    481479    size.x = size.y = 0;
    482     size.width = isSVGW3CTest ? 480 : maxViewWidth;
    483     size.height = isSVGW3CTest ? 360 : maxViewHeight;
     480    size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth;
     481    size.height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight;
    484482    gtk_window_resize(GTK_WINDOW(window), size.width, size.height);
    485483    gtk_widget_size_allocate(container, &size);
  • trunk/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm

    r54873 r54942  
    135135static WebHistoryItem *prevTestBFItem = nil;  // current b/f item at the end of the previous test
    136136
    137 const unsigned maxViewHeight = 600;
    138 const unsigned maxViewWidth = 800;
    139 
    140137#if __OBJC2__
    141138static void swizzleAllMethods(Class imposter, Class original)
     
    280277WebView *createWebViewAndOffscreenWindow()
    281278{
    282     NSRect rect = NSMakeRect(0, 0, maxViewWidth, maxViewHeight);
     279    NSRect rect = NSMakeRect(0, 0, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight);
    283280    WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"];
    284281       
     
    10221019        [[mainFrame webView] setFrameSize:NSMakeSize(480, 360)];
    10231020    else
    1024         [[mainFrame webView] setFrameSize:NSMakeSize(maxViewWidth, maxViewHeight)];
     1021        [[mainFrame webView] setFrameSize:NSMakeSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)];
    10251022}
    10261023
  • trunk/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp

    r54873 r54942  
    107107
    108108UINT_PTR waitToDumpWatchdog = 0;
    109 
    110 const unsigned maxViewWidth = 800;
    111 const unsigned maxViewHeight = 600;
    112109
    113110void setPersistentUserStyleSheetLocation(CFStringRef url)
     
    668665                height = 360;
    669666            } else {
    670                 width = maxViewWidth;
    671                 height = maxViewHeight;
     667                width = LayoutTestController::maxViewWidth;
     668                height = LayoutTestController::maxViewHeight;
    672669            }
    673670
     
    10991096IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
    11001097{
     1098    unsigned maxViewWidth = LayoutTestController::maxViewWidth;
     1099    unsigned maxViewHeight = LayoutTestController::maxViewHeight;
    11011100    HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT("DumpRenderTree"), WS_POPUP,
    11021101      -maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0);
Note: See TracChangeset for help on using the changeset viewer.