Changeset 155345 in webkit


Ignore:
Timestamp:
Sep 9, 2013 6:05:26 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][WK2] Update ContextMenu Download API
https://bugs.webkit.org/show_bug.cgi?id=120763

Patch by Brian Holt <brian.holt@samsung.com> on 2013-09-09
Reviewed by Carlos Garcia Campos.

Mark the new Download items in the Context Menu with the Since
tag, and include a unit test for Context Menu audio.

  • UIProcess/API/gtk/WebKitContextMenuActions.h:
  • UIProcess/API/gtk/tests/TestContextMenu.cpp:

(testContextMenuDefaultMenu):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r155321 r155345  
     12013-09-09  Brian Holt  <brian.holt@samsung.com>
     2
     3        [GTK][WK2] Update ContextMenu Download API
     4        https://bugs.webkit.org/show_bug.cgi?id=120763
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Mark the new Download items in the Context Menu with the Since
     9        tag, and include a unit test for Context Menu audio.
     10
     11        * UIProcess/API/gtk/WebKitContextMenuActions.h:
     12        * UIProcess/API/gtk/tests/TestContextMenu.cpp:
     13        (testContextMenuDefaultMenu):
     14
    1152013-09-08  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h

    r154987 r155345  
    7373 * @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE: Pause current media element.
    7474 * @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE: Mute current media element.
    75  * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK: Download video to disk.
    76  * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK: Download audio to disk.
     75 * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK: Download video to disk. Since 2.2
     76 * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK: Download audio to disk. Since 2.2
    7777 * @WEBKIT_CONTEXT_MENU_ACTION_CUSTOM: Custom action defined by applications.
    7878 *
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp

    r154987 r155345  
    239239        LinkImage,
    240240        Video,
     241        Audio,
    241242        Editable
    242243    };
     
    312313            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK, Visible | Enabled);
    313314            break;
     315        case Audio:
     316            g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
     317            g_assert(!webkit_hit_test_result_context_is_image(hitTestResult));
     318            g_assert(webkit_hit_test_result_context_is_media(hitTestResult));
     319            g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult));
     320            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY, Visible | Enabled);
     321            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE, Visible);
     322            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS, Visible | Enabled | Checked);
     323            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_LOOP, Visible | Enabled);
     324            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_ENTER_VIDEO_FULLSCREEN, Visible);
     325            iter = checkCurrentItemIsSeparatorAndGetNext(iter);
     326            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_AUDIO_LINK_TO_CLIPBOARD, Visible | Enabled);
     327            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_AUDIO_IN_NEW_WINDOW, Visible | Enabled);
     328            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK, Visible | Enabled);
     329            break;
    314330        case Editable:
    315331            g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
     
    358374        " <input style='position:absolute; left:1; top:30' size='10'></input>"
    359375        " <video style='position:absolute; left:1; top:50' width='300' height='300' controls='controls' preload='none'><source src='movie.ogg' type='video/ogg' /></video>"
     376        " <audio style='position:absolute; left:1; top:60' width='50' height='20' controls='controls' preload='none'><source src='track.mp3' type='audio/mp3' /></audio>"
    360377        "</body></html>";
    361378    test->loadHtml(linksHTML, "file:///");
     
    382399    test->showContextMenuAtPositionAndWaitUntilFinished(1, 20);
    383400
    384     // Context menu for image video.
     401    // Context menu for video.
    385402    test->m_expectedMenuType = ContextMenuDefaultTest::Video;
    386403    test->showContextMenuAtPositionAndWaitUntilFinished(1, 50);
     404
     405    // Context menu for audio.
     406    test->m_expectedMenuType = ContextMenuDefaultTest::Audio;
     407    test->showContextMenuAtPositionAndWaitUntilFinished(1, 60);
    387408
    388409    // Context menu for editable.
Note: See TracChangeset for help on using the changeset viewer.