Bug 1283529 - Add tests for new View Citation context menu item draft
authorIan Moody <moz-ian@perix.co.uk>
Fri, 17 Jun 2016 09:53:58 +0100
changeset 382821 ca2fad37e9f8e3556e3e650013f73acb035356b2
parent 382820 98e3c7c9cf73d72a91517b63ed01d716e9961123
child 524304 e9695c2ba6173f97414ae6a9042078cd45f6cae8
push id21839
push usermoz-ian@perix.co.uk
push dateThu, 30 Jun 2016 16:19:29 +0000
bugs1283529
milestone50.0a1
Bug 1283529 - Add tests for new View Citation context menu item Also remove errant </embed> MozReview-Commit-ID: 6tazNgCL6Ob
browser/base/content/test/general/browser_contextmenu.js
browser/base/content/test/general/subtst_contextmenu.html
--- a/browser/base/content/test/general/browser_contextmenu.js
+++ b/browser/base/content/test/general/browser_contextmenu.js
@@ -847,16 +847,65 @@ add_task(function* test_input_spell_fals
      "---",                 null,
      "context-selectall",   true,
      "---",                 null,
      "spell-add-dictionaries-main",  true,
     ]
   );
 });
 
+add_task(function* test_blockquote_citation() {
+  yield test_contextmenu("#test-cite-blockquote",
+    ["context-view-cite-url", true,
+     "---",                   null,
+     "context-savepage",      true,
+     ...(hasPocket ? ["context-pocket", true] : []),
+     "---",                   null,
+     "context-viewbgimage",   false,
+     "context-selectall",     true,
+     "---",                   null,
+     "context-viewsource",    true,
+     "context-viewinfo",      true
+    ]
+  );
+});
+
+add_task(function* test_insert_citation() {
+  yield test_contextmenu("#test-cite-mod",
+    ["context-view-cite-url", true,
+     "---",                   null,
+     "context-savepage",      true,
+     ...(hasPocket ? ["context-pocket", true] : []),
+     "---",                   null,
+     "context-viewbgimage",   false,
+     "context-selectall",     true,
+     "---",                   null,
+     "context-viewsource",    true,
+     "context-viewinfo",      true
+    ]
+  );
+});
+
+add_task(function* test_quote_citation_in_link() {
+  yield test_contextmenu("#test-cite-quote-in-link",
+    ["context-openlinkintab",   true,
+     "context-openlink",        true,
+     "context-openlinkprivate", true,
+     "---",                     null,
+     "context-view-cite-url",   true,
+     "---",                     null,
+     "context-bookmarklink",    true,
+     "context-savelink",        true,
+     ...(hasPocket ? ["context-savelinktopocket", true] : []),
+     "context-copylink",        true,
+     "context-searchselect",    true
+    ]
+  );
+});
+
 add_task(function* test_cleanup() {
   gBrowser.removeCurrentTab();
 });
 
 /**
  * Selects the text of the element that matches the provided `selector`
  *
  * @param {String} selector
--- a/browser/base/content/test/general/subtst_contextmenu.html
+++ b/browser/base/content/test/general/subtst_contextmenu.html
@@ -62,12 +62,17 @@ Browser context menu subtest.
   </menu>
 </div>
 <div id="test-select-text">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
 <div id="test-select-text-link">http://mozilla.com</div>
 <a id="test-image-link" href="#"><img src="ctxmenu-image.png"></a>
 <input id="test-select-input-text" type="text" value="input">
 <input id="test-select-input-text-type-password" type="password" value="password">
 <embed id="test-plugin" style="width: 200px; height: 200px;" type="application/x-test"></embed>
-<img id="test-longdesc" src="ctxmenu-image.png" longdesc="http://www.mozilla.org"></embed>
+<img id="test-longdesc" src="ctxmenu-image.png" longdesc="http://www.mozilla.org">
 <iframe id="test-srcdoc" width="98"  height="98" srcdoc="Hello World" style="border: 1px solid black"></iframe>
+<blockquote id="test-cite-blockquote" cite="http://www.mozilla.org">Committed to you, your privacy and an open Web</blockquote>
+<ins id="test-cite-mod" cite="http://www.mozilla.org">Inserted text</ins>
+<a href="https://www.mozilla.org/firefox/">Firefox
+  <q id="test-cite-quote-in-link" cite="http://www.mozilla.org">Committed to you, your privacy and an open Web</q>
+</a>
 </body>
 </html>