Bug 1014332 fix context menu tests to handle share, r=jaws
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 15 Aug 2014 14:23:24 -0700
changeset 199883 93cd3fc35cfcd249d080ec106028ae9236a7266c
parent 199882 6aee7a646f7e6217b22af4e0a47dcb7df352ba94
child 199884 bfe0d5c41edd3a56b5d8f5e3d5a2f5963bd7f203
push id27324
push userryanvm@gmail.com
push dateSat, 16 Aug 2014 21:18:56 +0000
treeherdermozilla-central@9a2152d29d8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1014332
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1014332 fix context menu tests to handle share, r=jaws
browser/base/content/nsContextMenu.js
browser/base/content/test/general/test_contextmenu.html
browser/base/content/test/general/test_contextmenu_input.html
browser/locales/en-US/chrome/browser/browser.dtd
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -329,17 +329,17 @@ nsContextMenu.prototype = {
     linkmenus = document.getElementsByClassName("context-marklink");
     [m.hidden = !enableLinkMarkItems for (m of linkmenus)];
 
     // SocialShare
     let shareButton = SocialShare.shareButton;
     let shareEnabled = shareButton && !shareButton.disabled && !this.onSocial;
     let pageShare = shareEnabled && !(this.isContentSelected ||
                             this.onTextInput || this.onLink || this.onImage ||
-                            this.onVideo || this.onAudio);
+                            this.onVideo || this.onAudio || this.onCanvas);
     this.showItem("context-sharepage", pageShare);
     this.showItem("context-shareselect", shareEnabled && this.isContentSelected);
     this.showItem("context-sharelink", shareEnabled && (this.onLink || this.onPlainTextLink) && !this.onMailtoLink);
     this.showItem("context-shareimage", shareEnabled && this.onImage);
     this.showItem("context-sharevideo", shareEnabled && this.onVideo);
     this.setItemAttr("context-sharevideo", "disabled", !this.mediaURL);
   },
 
--- a/browser/base/content/test/general/test_contextmenu.html
+++ b/browser/base/content/test/general/test_contextmenu.html
@@ -84,121 +84,133 @@ function runTest(testNum) {
 
   var tests = [
     function () {
         // Invoke context menu for next test.
         openContextMenuFor(text);
     },
 
     function () {
+        info("context menu for text");
         // Context menu for plain text
         plainTextItems = ["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    true,
                           "---",                  null,
                           "context-viewsource",   true,
                           "context-viewinfo",     true
                          ].concat(inspectItems);
         checkContextMenu(plainTextItems);
         closeContextMenu();
         openContextMenuFor(link); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for text link");
         // Context menu for text link
         if (perWindowPrivateBrowsing) {
           checkContextMenu(["context-openlinkintab", true,
                             "context-openlink",      true,
                             "context-openlinkprivate", true,
                             "---",                   null,
                             "context-bookmarklink",  true,
+                            "context-sharelink",     true,
                             "context-savelink",      true,
                             "context-copylink",      true,
                             "context-searchselect",  true
                            ].concat(inspectItems));
         } else {
           checkContextMenu(["context-openlinkintab", true,
                             "context-openlink",      true,
                             "---",                   null,
                             "context-bookmarklink",  true,
+                            "context-sharelink",     true,
                             "context-savelink",      true,
                             "context-copylink",      true,
                             "context-searchselect",  true
                            ].concat(inspectItems));
         }
         closeContextMenu();
         openContextMenuFor(mailto); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for mailto link");
         // Context menu for text mailto-link
         checkContextMenu(["context-copyemail", true,
                           "context-searchselect", true
                         ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(img); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for image");
         // Context menu for an image
         checkContextMenu(["context-viewimage",            true,
                           "context-copyimage-contents",   true,
                           "context-copyimage",            true,
                           "---",                          null,
                           "context-saveimage",            true,
+                          "context-shareimage",           true,
                           "context-sendimage",            true,
                           "context-setDesktopBackground", true,
                           "context-viewimageinfo",        true
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(canvas); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for canvas");
         // Context menu for a canvas
         checkContextMenu(["context-viewimage",    true,
                           "context-saveimage",    true,
                           "context-selectall",    true
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(video_ok); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for video_ok");
         // Context menu for a video (with a VALID media source)
         checkContextMenu(["context-media-play",         true,
                           "context-media-mute",         true,
                           "context-media-playbackrate", null,
                               ["context-media-playbackrate-050x", true,
                                "context-media-playbackrate-100x", true,
                                "context-media-playbackrate-150x", true,
                                "context-media-playbackrate-200x", true], null,
                           "context-media-hidecontrols", true,
                           "context-video-showstats",    true,
                           "context-video-fullscreen",   true,
                           "---",                        null,
                           "context-viewvideo",          true,
                           "context-copyvideourl",       true,
                           "---",                        null,
                           "context-savevideo",          true,
+                          "context-sharevideo",         true,
                           "context-video-saveimage",    true,
                           "context-sendvideo",          true
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(audio_in_video); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for audio_in_video");
         // Context menu for a video (with an audio-only file)
           checkContextMenu(["context-media-play",         true,
                             "context-media-mute",         true,
                             "context-media-playbackrate", null,
                                 ["context-media-playbackrate-050x", true,
                                  "context-media-playbackrate-100x", true,
                                  "context-media-playbackrate-150x", true,
                                  "context-media-playbackrate-200x", true], null,
@@ -209,71 +221,77 @@ function runTest(testNum) {
                             "context-saveaudio",          true,
                             "context-sendaudio",          true
                            ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(video_bad); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for video_bad");
         // Context menu for a video (with an INVALID media source)
         checkContextMenu(["context-media-play",         false,
                           "context-media-mute",         false,
                           "context-media-playbackrate", null,
                               ["context-media-playbackrate-050x", false,
                                "context-media-playbackrate-100x", false,
                                "context-media-playbackrate-150x", false,
                                "context-media-playbackrate-200x", false], null,
                           "context-media-hidecontrols", false,
                           "context-video-showstats",    false,
                           "context-video-fullscreen",   false,
                           "---",                        null,
                           "context-viewvideo",          true,
                           "context-copyvideourl",       true,
                           "---",                        null,
                           "context-savevideo",          true,
+                          "context-sharevideo",         true,
                           "context-video-saveimage",    false,
                           "context-sendvideo",          true
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(video_bad2); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for video_bad2");
         // Context menu for a video (with an INVALID media source)
         checkContextMenu(["context-media-play",         false,
                           "context-media-mute",         false,
                           "context-media-playbackrate", null,
                               ["context-media-playbackrate-050x", false,
                                "context-media-playbackrate-100x", false,
                                "context-media-playbackrate-150x", false,
                                "context-media-playbackrate-200x", false], null,
                           "context-media-hidecontrols", false,
                           "context-video-showstats",    false,
                           "context-video-fullscreen",   false,
                           "---",                        null,
                           "context-viewvideo",          false,
                           "context-copyvideourl",       false,
                           "---",                        null,
                           "context-savevideo",          false,
+                          "context-sharevideo",         false,
                           "context-video-saveimage",    false,
                           "context-sendvideo",          false
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(iframe); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for iframe");
         // Context menu for an iframe
         checkContextMenu(["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    true,
                           "frame",                null,
                               ["context-showonlythisframe", true,
                                "context-openframeintab",    true,
                                "context-openframe",         true,
@@ -291,32 +309,34 @@ function runTest(testNum) {
                           "context-viewsource",   true,
                           "context-viewinfo",     true
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(video_in_iframe); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for video_in_iframe");
         // Context menu for a video in an iframe
         checkContextMenu(["context-media-play",         true,
                           "context-media-mute",         true,
                           "context-media-playbackrate", null,
                               ["context-media-playbackrate-050x", true,
                                "context-media-playbackrate-100x", true,
                                "context-media-playbackrate-150x", true,
                                "context-media-playbackrate-200x", true], null,
                           "context-media-hidecontrols", true,
                           "context-video-showstats",    true,
                           "context-video-fullscreen",   true,
                           "---",                        null,
                           "context-viewvideo",          true,
                           "context-copyvideourl",       true,
                           "---",                        null,
                           "context-savevideo",          true,
+                          "context-sharevideo",         true,
                           "context-video-saveimage",    true,
                           "context-sendvideo",          true,
                           "frame",                null,
                               ["context-showonlythisframe", true,
                                "context-openframeintab",    true,
                                "context-openframe",         true,
                                "---",                       null,
                                "context-reloadframe",       true,
@@ -327,22 +347,24 @@ function runTest(testNum) {
                                "context-printframe",        true,
                                "---",                       null,
                                "context-viewframeinfo",     true], null].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(image_in_iframe); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for image_in_iframe");
         // Context menu for an image in an iframe
         checkContextMenu(["context-viewimage",            true,
                           "context-copyimage-contents",   true,
                           "context-copyimage",            true,
                           "---",                          null,
                           "context-saveimage",            true,
+                          "context-shareimage",           true,
                           "context-sendimage",            true,
                           "context-setDesktopBackground", true,
                           "context-viewimageinfo",        true,
                           "frame",                null,
                               ["context-showonlythisframe", true,
                                "context-openframeintab",    true,
                                "context-openframe",         true,
                                "---",                       null,
@@ -354,16 +376,17 @@ function runTest(testNum) {
                                "context-printframe",        true,
                                "---",                       null,
                                "context-viewframeinfo",     true], null].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(textarea); // Invoke context menu for next test
     },
 
     function () {
+        info("context menu for textarea");
         // Context menu for textarea before spell check initialization finishes
         checkContextMenu(["context-undo",                false,
                           "---",                         null,
                           "context-cut",                 false,
                           "context-copy",                false,
                           "context-paste",               null,
                           "context-delete",              false,
                           "---",                         null,
@@ -371,16 +394,17 @@ function runTest(testNum) {
                           "---",                         null,
                           "spell-add-dictionaries-main", true,
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(textarea, false, true); // Invoke context menu for next test, but wait for the spellcheck.
     },
 
     function () {
+        info("context menu for textarea, wait for spell check");
         // Context menu for textarea after spell check initialization finishes
         checkContextMenu(["*chubbiness",         true, // spelling suggestion
                           "spell-add-to-dictionary", true,
                           "---",                 null,
                           "context-undo",        false,
                           "---",                 null,
                           "context-cut",         false,
                           "context-copy",        false,
@@ -396,23 +420,25 @@ function runTest(testNum) {
                                "spell-add-dictionaries",       true], null
                          ].concat(inspectItems));
         contextMenu.ownerDocument.getElementById("spell-add-to-dictionary").doCommand(); // Add to dictionary
         closeContextMenu();
         openContextMenuFor(text); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for text");
         // Re-check context menu for plain text to make sure it hasn't changed
         checkContextMenu(plainTextItems);
         closeContextMenu();
         openContextMenuFor(textarea, false, true); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for textarea after word added");
         // Context menu for textarea after a word has been added
         // to the dictionary
         checkContextMenu(["spell-undo-add-to-dictionary", true,
                           "---",                 null,
                           "context-undo",        false,
                           "---",                 null,
                           "context-cut",         false,
                           "context-copy",        false,
@@ -428,16 +454,17 @@ function runTest(testNum) {
                                "spell-add-dictionaries",       true], null
                          ].concat(inspectItems));
         contextMenu.ownerDocument.getElementById("spell-undo-add-to-dictionary").doCommand(); // Undo add to dictionary
         closeContextMenu();
         openContextMenuFor(contenteditable, false, true);
     },
 
     function () {
+        info("context menu for contenteditable");
         // Context menu for contenteditable
         checkContextMenu(["spell-no-suggestions", false,
                           "spell-add-to-dictionary", true,
                           "---",                 null,
                           "context-undo",        false,
                           "---",                 null,
                           "context-cut",         false,
                           "context-copy",        false,
@@ -453,22 +480,24 @@ function runTest(testNum) {
                                "spell-add-dictionaries",       true], null
                          ].concat(inspectItems));
 
         closeContextMenu();
         openContextMenuFor(link); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for link");
         executeCopyCommand("cmd_copyLink", "http://mozilla.com/");
         closeContextMenu();
         openContextMenuFor(pagemenu); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for pagemenu");
         // Context menu for element with assigned content context menu
         checkContextMenu(["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
                           "+Plain item",          {type: "", icon: "", checked: false, disabled: false},
@@ -486,16 +515,17 @@ function runTest(testNum) {
                           "---",                  null,
                           "generated-submenu-1",  true,
                               ["+Radio1",             {type: "checkbox", icon: "", checked: false, disabled: false},
                                "+Radio2",             {type: "checkbox", icon: "", checked: true, disabled: false},
                                "+Radio3",             {type: "checkbox", icon: "", checked: false, disabled: false},
                                "---",                 null,
                                "+Checkbox",           {type: "checkbox", icon: "", checked: false, disabled: false}], null,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    true,
                           "---",                  null,
                           "context-viewsource",   true,
                           "context-viewinfo",     true
                          ].concat(inspectItems));
@@ -511,25 +541,27 @@ function runTest(testNum) {
         }
         subwindow.addEventListener("mozfullscreenchange", openDomFullScreen, false);
         SpecialPowers.setBoolPref("full-screen-api.approval-required", false);
         SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
         full_screen_element.mozRequestFullScreen();
     },
 
     function () {
+        info("context menu for fullscreen mode");
         // Context menu for DOM Fullscreen mode (NOTE: this is *NOT* on an img)
         checkContextMenu(["context-navigation", null,
                               ["context-back",            false,
                                "context-forward",         false,
                                "context-reload",          true,
                                "context-bookmarkpage",    true], null,
                           "---",                          null,
                           "context-leave-dom-fullscreen", true,
                           "---",                          null,
+                          "context-sharepage",            true,
                           "context-savepage",             true,
                           "---",                          null,
                           "context-viewbgimage",          false,
                           "context-selectall",            true,
                           "---",                          null,
                           "context-viewsource",           true,
                           "context-viewinfo",             true
                          ].concat(inspectItems));
@@ -541,137 +573,152 @@ function runTest(testNum) {
             SpecialPowers.clearUserPref("full-screen-api.allow-trusted-requests-only");
             openContextMenuFor(pagemenu, true); // Invoke context menu for next test.
         }
         subwindow.addEventListener("mozfullscreenchange", openPagemenu, false);
         subwindow.document.mozCancelFullScreen();
     },
 
     function () {
+        info("context menu for element with assigned content context menu");
         // Context menu for element with assigned content context menu
         // The shift key should bypass content context menu processing
         checkContextMenu(["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    true,
                           "---",                  null,
                           "context-viewsource",   true,
                           "context-viewinfo",     true
                          ].concat(inspectItems));
         closeContextMenu();
         selectText(selecttext); // Select text prior to opening context menu.
         openContextMenuFor(selecttext); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for text selection");
         // Context menu for selected text
         if (SpecialPowers.Services.appinfo.OS == "Darwin") {
           // This test is only enabled on Mac due to bug 736399.
           checkContextMenu(["context-copy",                        true,
                             "context-selectall",                   true,
                             "---",                                 null,
                             "context-searchselect",                true,
+                            "context-shareselect",                 true,
                             "context-viewpartialsource-selection", true
                            ].concat(inspectItems));
         }
         closeContextMenu();
         selectText(selecttextlink); // Select text prior to opening context menu.
         openContextMenuFor(selecttextlink); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for text selection with url pattern");
         // Context menu for selected text which matches valid URL pattern
         if (SpecialPowers.Services.appinfo.OS == "Darwin") {
           // This test is only enabled on Mac due to bug 736399.
           if (perWindowPrivateBrowsing) {
             checkContextMenu(["context-openlinkincurrent",           true,
                               "context-openlinkintab",               true,
                               "context-openlink",                    true,
                               "context-openlinkprivate",             true,
                               "---",                                 null,
                               "context-bookmarklink",                true,
+                              "context-sharelink",                   true,
                               "context-savelink",                    true,
                               "context-copy",                        true,
                               "context-selectall",                   true,
                               "---",                                 null,
                               "context-searchselect",                true,
+                              "context-shareselect",                 true,
                               "context-viewpartialsource-selection", true
                              ].concat(inspectItems));
           } else {
             checkContextMenu(["context-openlinkincurrent",           true,
                               "context-openlinkintab",               true,
                               "context-openlink",                    true,
                               "---",                                 null,
                               "context-bookmarklink",                true,
+                              "context-sharelink",                   true,
                               "context-savelink",                    true,
                               "context-copy",                        true,
                               "context-selectall",                   true,
                               "---",                                 null,
                               "context-searchselect",                true,
+                              "context-shareselect",                 true,
                               "context-viewpartialsource-selection", true
                              ].concat(inspectItems));
           }
         }
         closeContextMenu();
         // clear the selection because following tests don't expect any selection
         subwindow.getSelection().removeAllRanges();
 
         openContextMenuFor(imagelink)
     },
 
     function () {
+        info("context menu for imagelink");
         // Context menu for image link
         if (perWindowPrivateBrowsing) {
           checkContextMenu(["context-openlinkintab", true,
                             "context-openlink",      true,
                             "context-openlinkprivate", true,
                             "---",                   null,
                             "context-bookmarklink",  true,
+                            "context-sharelink",     true,
                             "context-savelink",      true,
                             "context-copylink",      true,
                             "---",                   null,
                             "context-viewimage",            true,
                             "context-copyimage-contents",   true,
                             "context-copyimage",            true,
                             "---",                          null,
                             "context-saveimage",            true,
+                            "context-shareimage",           true,
                             "context-sendimage",            true,
                             "context-setDesktopBackground", true,
                             "context-viewimageinfo",        true
                            ].concat(inspectItems));
         } else {
           checkContextMenu(["context-openlinkintab", true,
                             "context-openlink",      true,
                             "---",                   null,
                             "context-bookmarklink",  true,
+                            "context-sharelink",     true,
                             "context-savelink",      true,
                             "context-copylink",      true,
                             "---",                   null,
                             "context-viewimage",            true,
                             "context-copyimage-contents",   true,
                             "context-copyimage",            true,
                             "---",                          null,
                             "context-saveimage",            true,
+                            "context-shareimage",           true,
                             "context-sendimage",            true,
                             "context-setDesktopBackground", true,
                             "context-viewimageinfo",        true
                            ].concat(inspectItems));
         }
         closeContextMenu();
         selectInputText(select_inputtext); // Select text prior to opening context menu.
         openContextMenuFor(select_inputtext); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for select_inputtext");
         // Context menu for selected text in input
         checkContextMenu(["context-undo",        false,
                           "---",                 null,
                           "context-cut",         true,
                           "context-copy",        true,
                           "context-paste",       null, // ignore clipboard state
                           "context-delete",      true,
                           "---",                 null,
@@ -681,16 +728,17 @@ function runTest(testNum) {
                           "spell-check-enabled", true
                          ].concat(inspectItems));
         closeContextMenu();
         selectInputText(select_inputtext_password); // Select text prior to opening context menu.
         openContextMenuFor(select_inputtext_password); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for selected text in input[type='password']");
         // Context menu for selected text in input[type="password"]
         checkContextMenu(["context-undo",        false,
                           "---",                 null,
                           "context-cut",         true,
                           "context-copy",        true,
                           "context-paste",       null, // ignore clipboard state
                           "context-delete",      true,
                           "---",                 null,
@@ -704,64 +752,70 @@ function runTest(testNum) {
                                "spell-add-dictionaries",       true], null
                          ].concat(inspectItems));
         closeContextMenu();
         subwindow.getSelection().removeAllRanges();
         openContextMenuFor(plugin);
     },
 
     function () {
+        info("context menu for click-to-play blocked plugin");
         // Context menu for click-to-play blocked plugin
         checkContextMenu(["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
                           "context-ctp-play",     true,
                           "context-ctp-hide",     true,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    true,
                           "---",                  null,
                           "context-viewsource",   true,
                           "context-viewinfo",     true
                          ].concat(inspectItems));
         closeContextMenu();
         SpecialPowers.clearUserPref("plugins.click_to_play");
         getTestPlugin().enabledState = Ci.nsIPluginTag.STATE_ENABLED;
         openContextMenuFor(longdesc);
     },
 
     function () {
+        info("context menu for image with longdesc");
         // Context menu for an image with longdesc
         checkContextMenu(["context-viewimage",            true,
                           "context-copyimage-contents",   true,
                           "context-copyimage",            true,
                           "---",                          null,
                           "context-saveimage",            true,
+                          "context-shareimage",           true,
                           "context-sendimage",            true,
                           "context-setDesktopBackground", true,
                           "context-viewimageinfo",        true,
                           "context-viewimagedesc",        true
                          ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(srcdoc);
     },
 
     function () {
+        info("context menu for iframe with srcdoc attribute set");
         // Context menu for an iframe with srcdoc attribute set
         checkContextMenu(["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    true,
                           "frame",                null,
                               ["context-reloadframe",       true,
                                "---",                       null,
                                "context-saveframe",         true,
@@ -774,16 +828,17 @@ function runTest(testNum) {
                           "context-viewsource",   true,
                           "context-viewinfo",     true
         ].concat(inspectItems));
         closeContextMenu();
         openContextMenuFor(inputspellfalse, false, true); // Invoke context menu for next test.
     },
 
     function () {
+        info("context menu for text input field with spellcheck=false");
         // Context menu for text input field with spellcheck=false
         checkContextMenu(["context-undo",        false,
                           "---",                 null,
                           "context-cut",         false,
                           "context-copy",        false,
                           "context-paste",       null, // ignore clipboard state
                           "context-delete",      false,
                           "---",                 null,
--- a/browser/base/content/test/general/test_contextmenu_input.html
+++ b/browser/base/content/test/general/test_contextmenu_input.html
@@ -193,16 +193,17 @@ function runTest(testNum) {
     case 14: // type='color'
     case 15: // type='range'
         checkContextMenu(["context-navigation", null,
                               ["context-back",         false,
                                "context-forward",      false,
                                "context-reload",       true,
                                "context-bookmarkpage", true], null,
                           "---",                  null,
+                          "context-sharepage",    true,
                           "context-savepage",     true,
                           "---",                  null,
                           "context-viewbgimage",  false,
                           "context-selectall",    null,
                           "---",                  null,
                           "context-viewsource",   true,
                           "context-viewinfo",     true,
                           "---",                 null,
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -140,23 +140,23 @@ These should match what Safari and other
 <!ENTITY editThisBookmarkCmd.label "Edit This Bookmark">
 <!ENTITY bookmarkThisPageCmd.commandkey "d">
 <!ENTITY markPageCmd.commandkey "l">
 <!ENTITY findShareServices.label "Find more Share services…">
 <!ENTITY sharePageCmd.label "Share This Page">
 <!ENTITY sharePageCmd.commandkey "S">
 <!ENTITY sharePageCmd.accesskey "s">
 <!ENTITY shareLinkCmd.label "Share This Link">
-<!ENTITY shareLinkCmd.accesskey "s">
+<!ENTITY shareLinkCmd.accesskey "h">
 <!ENTITY shareImageCmd.label "Share This Image">
-<!ENTITY shareImageCmd.accesskey "s">
+<!ENTITY shareImageCmd.accesskey "r">
 <!ENTITY shareSelectCmd.label "Share Selection">
-<!ENTITY shareSelectCmd.accesskey "s">
+<!ENTITY shareSelectCmd.accesskey "r">
 <!ENTITY shareVideoCmd.label "Share This Video">
-<!ENTITY shareVideoCmd.accesskey "s">
+<!ENTITY shareVideoCmd.accesskey "r">
 <!ENTITY feedsMenu.label "Subscribe">
 <!ENTITY subscribeToPageMenupopup.label "Subscribe to This Page">
 <!ENTITY subscribeToPageMenuitem.label "Subscribe to This Page…">
 <!ENTITY addCurPagesCmd.label "Bookmark All Tabs…">
 <!ENTITY showAllBookmarks2.label "Show All Bookmarks">
 <!ENTITY unsortedBookmarksCmd.label "Unsorted Bookmarks">
 <!ENTITY bookmarksToolbarChevron.tooltip "Show more bookmarks">