Changeset 64615 in webkit


Ignore:
Timestamp:
Aug 3, 2010 6:53:29 PM (14 years ago)
Author:
tkent@chromium.org
Message:

2010-08-03 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

[DRT/Chromium] Implement --testshell-startup-dialog
https://bugs.webkit.org/show_bug.cgi?id=40616

  • DumpRenderTree/chromium/DumpRenderTree.cpp: (main): Check --testshell-startup-dialog, and call openStartUpDialog() if it is specfied.
  • DumpRenderTree/chromium/TestShell.h: Declare openStartUpDialog().
  • DumpRenderTree/chromium/TestShellGtk.cpp: (openStartupDialog):
  • DumpRenderTree/chromium/TestShellMac.mm: (openStartupDialog):
  • DumpRenderTree/chromium/TestShellWin.cpp: (openStartupDialog):
Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r64614 r64615  
     12010-08-03  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        [DRT/Chromium] Implement --testshell-startup-dialog
     6        https://bugs.webkit.org/show_bug.cgi?id=40616
     7
     8        * DumpRenderTree/chromium/DumpRenderTree.cpp:
     9        (main): Check --testshell-startup-dialog, and call openStartUpDialog()
     10        if it is specfied.
     11        * DumpRenderTree/chromium/TestShell.h:
     12          Declare openStartUpDialog().
     13        * DumpRenderTree/chromium/TestShellGtk.cpp:
     14        (openStartupDialog):
     15        * DumpRenderTree/chromium/TestShellMac.mm:
     16        (openStartupDialog):
     17        * DumpRenderTree/chromium/TestShellWin.cpp:
     18        (openStartupDialog):
     19
    1202010-08-03  Kent Tamura  <tkent@chromium.org>
    221
  • trunk/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp

    r64463 r64615  
    3737using namespace std;
    3838
    39 void platformInit();
    40 
    4139static const char optionComplexText[] = "--complex-text";
    4240static const char optionDumpAllPixels[] = "--dump-all-pixels";
     
    4947static const char optionTestShell[] = "--test-shell";
    5048static const char optionAllowExternalPages[] = "--allow-external-pages";
     49static const char optionStartupDialog[] = "--testshell-startup-dialog";
    5150
    5251static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
     
    9291    bool testShellMode = false;
    9392    bool allowExternalPages = false;
     93    bool startupDialog = false;
    9494    for (int i = 1; i < argc; ++i) {
    9595        string argument(argv[i]);
     
    108108        } else if (argument == optionAllowExternalPages)
    109109            allowExternalPages = true;
     110        else if (argument == optionStartupDialog)
     111            startupDialog = true;
    110112        else if (argument.size() && argument[0] == '-')
    111113            fprintf(stderr, "Unknown option: %s\n", argv[i]);
     
    117119        return EXIT_FAILURE;
    118120    }
     121
     122    if (startupDialog)
     123        openStartupDialog();
    119124
    120125    { // Explicit scope for the TestShell instance.
  • trunk/WebKitTools/DumpRenderTree/chromium/TestShell.h

    r64463 r64615  
    186186
    187187void platformInit(int*, char***);
     188void openStartupDialog();
    188189
    189190#endif // TestShell_h
  • trunk/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp

    r64463 r64615  
    195195    setupFontconfig();
    196196}
     197
     198void openStartupDialog()
     199{
     200    GtkWidget* dialog = gtk_message_dialog_new(
     201        0, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Attach to me?");
     202    gtk_window_set_title(GTK_WINDOW(dialog), "DumpRenderTree");
     203    gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop.
     204    gtk_widget_destroy(dialog);
     205}
  • trunk/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm

    r64463 r64615  
    128128{
    129129}
     130
     131void openStartupDialog()
     132{
     133    // FIXME: This code doesn't work. Need NSApplication event loop?
     134    NSAlert* alert = [[[NSAlert alloc] init] autorelease];
     135    alert.messageText = @"Attach to me?";
     136    alert.informativeText = @"This would probably be a good time to attach your debugger.";
     137    [alert addButtonWithTitle:@"OK"];
     138    [alert runModal];
     139}
  • trunk/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp

    r64463 r64615  
    150150    // We don't need to release the font explicitly.
    151151}
     152
     153void openStartupDialog()
     154{
     155    ::MessageBox(0, L"Attach to me?", L"DumpRenderTree", MB_OK);
     156}
Note: See TracChangeset for help on using the changeset viewer.