Title: [155345] trunk/Source/WebKit2
Revision
155345
Author
[email protected]
Date
2013-09-09 06:05:26 -0700 (Mon, 09 Sep 2013)

Log Message

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

Patch by Brian Holt <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (155344 => 155345)


--- trunk/Source/WebKit2/ChangeLog	2013-09-09 10:37:34 UTC (rev 155344)
+++ trunk/Source/WebKit2/ChangeLog	2013-09-09 13:05:26 UTC (rev 155345)
@@ -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-08  Christophe Dumez  <[email protected]>
 
         [wk2] REGRESSION (r154673): PDF scrolling moves very slowly

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h (155344 => 155345)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h	2013-09-09 10:37:34 UTC (rev 155344)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h	2013-09-09 13:05:26 UTC (rev 155345)
@@ -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: trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp (155344 => 155345)


--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp	2013-09-09 10:37:34 UTC (rev 155344)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp	2013-09-09 13:05:26 UTC (rev 155345)
@@ -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));
@@ -357,6 +373,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();
@@ -381,10 +398,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);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to