Modified: releases/WebKitGTK/webkit-2.2/Source/WebKit2/ChangeLog (155437 => 155438)
--- releases/WebKitGTK/webkit-2.2/Source/WebKit2/ChangeLog 2013-09-10 13:39:52 UTC (rev 155437)
+++ releases/WebKitGTK/webkit-2.2/Source/WebKit2/ChangeLog 2013-09-10 13:51:24 UTC (rev 155438)
@@ -1,3 +1,17 @@
+2013-09-09 Brian Holt <[email protected]>
+
+ [GTK][WK2] Update ContextMenu Download API
+ https://bugs.webkit.org/show_bug.cgi?id=120763
+
+ 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):
+
2013-09-03 Brian Holt <[email protected]>
[GTK] [WK2] TestContextMenu default-menu fails
Modified: releases/WebKitGTK/webkit-2.2/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h (155437 => 155438)
--- releases/WebKitGTK/webkit-2.2/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h 2013-09-10 13:39:52 UTC (rev 155437)
+++ releases/WebKitGTK/webkit-2.2/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h 2013-09-10 13:51:24 UTC (rev 155438)
@@ -72,8 +72,8 @@
* @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY: Play current media element.
* @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE: Pause current media element.
* @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE: Mute current media element.
- * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK: Download video to disk.
- * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK: Download audio to disk.
+ * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK: Download video to disk. Since 2.2
+ * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK: Download audio to disk. Since 2.2
* @WEBKIT_CONTEXT_MENU_ACTION_CUSTOM: Custom action defined by applications.
*
* Enum values used to denote the stock actions for
Modified: releases/WebKitGTK/webkit-2.2/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp (155437 => 155438)
--- releases/WebKitGTK/webkit-2.2/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp 2013-09-10 13:39:52 UTC (rev 155437)
+++ releases/WebKitGTK/webkit-2.2/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp 2013-09-10 13:51:24 UTC (rev 155438)
@@ -238,6 +238,7 @@
Image,
LinkImage,
Video,
+ Audio,
Editable
};
@@ -311,6 +312,21 @@
iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_VIDEO_IN_NEW_WINDOW, Visible | Enabled);
iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK, Visible | Enabled);
break;
+ case Audio:
+ g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_image(hitTestResult));
+ g_assert(webkit_hit_test_result_context_is_media(hitTestResult));
+ g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult));
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY, Visible | Enabled);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE, Visible);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS, Visible | Enabled | Checked);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_LOOP, Visible | Enabled);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_ENTER_VIDEO_FULLSCREEN, Visible);
+ iter = checkCurrentItemIsSeparatorAndGetNext(iter);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_AUDIO_LINK_TO_CLIPBOARD, Visible | Enabled);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_AUDIO_IN_NEW_WINDOW, Visible | Enabled);
+ iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK, Visible | Enabled);
+ break;
case Editable:
g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
g_assert(!webkit_hit_test_result_context_is_image(hitTestResult));
@@ -356,6 +372,7 @@
" <a style='position:absolute; left:1; top:20' href='' title='WebKitGTK+ Logo'><img src='' width=5 height=5></img></a>"
" <input style='position:absolute; left:1; top:30' size='10'></input>"
" <video style='position:absolute; left:1; top:50' width='300' height='300' controls='controls' preload='none'><source src='' type='video/ogg' /></video>"
+ " <audio style='position:absolute; left:1; top:60' width='50' height='20' controls='controls' preload='none'><source src='' type='audio/mp3' /></audio>"
"</body></html>";
test->loadHtml(linksHTML, "file:///");
test->waitUntilLoadFinished();
@@ -380,10 +397,14 @@
test->m_expectedMenuType = ContextMenuDefaultTest::LinkImage;
test->showContextMenuAtPositionAndWaitUntilFinished(1, 20);
- // Context menu for image video.
+ // Context menu for video.
test->m_expectedMenuType = ContextMenuDefaultTest::Video;
test->showContextMenuAtPositionAndWaitUntilFinished(1, 50);
+ // Context menu for audio.
+ test->m_expectedMenuType = ContextMenuDefaultTest::Audio;
+ test->showContextMenuAtPositionAndWaitUntilFinished(1, 60);
+
// Context menu for editable.
test->m_expectedMenuType = ContextMenuDefaultTest::Editable;
test->showContextMenuAtPositionAndWaitUntilFinished(5, 35);