diff --git a/extensions/spellcheck/moz.build b/extensions/spellcheck/moz.build index 5d28969f70f..a6ad5b7f398 100644 --- a/extensions/spellcheck/moz.build +++ b/extensions/spellcheck/moz.build @@ -7,3 +7,4 @@ DIRS += ['idl', 'locales', 'hunspell', 'src'] MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini'] +MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini'] diff --git a/extensions/spellcheck/tests/mochitest/helper_bug1170484.js b/extensions/spellcheck/tests/mochitest/helper_bug1170484.js new file mode 100644 index 00000000000..689c2c0746f --- /dev/null +++ b/extensions/spellcheck/tests/mochitest/helper_bug1170484.js @@ -0,0 +1,15 @@ +const Cu = Components.utils; +const Ci = Components.interfaces; + +Cu.import("resource://gre/modules/Services.jsm"); + +// Chrome scripts are run with synchronous messages, so make sure we're completely +// decoupled from the content process before doing this work. +Cu.dispatch(function() { + let chromeWin = Services.ww.activeWindow.QueryInterface(Ci.nsIDOMChromeWindow); + contextMenu = chromeWin.document.getElementById("contentAreaContextMenu"); + var suggestion = contextMenu.querySelector(".spell-suggestion"); + suggestion.doCommand(); + contextMenu.hidePopup(); + sendAsyncMessage("spellingCorrected"); +}); diff --git a/extensions/spellcheck/tests/mochitest/mochitest.ini b/extensions/spellcheck/tests/mochitest/mochitest.ini new file mode 100644 index 00000000000..232d905b9ec --- /dev/null +++ b/extensions/spellcheck/tests/mochitest/mochitest.ini @@ -0,0 +1,7 @@ +[DEFAULT] +skip-if = buildapp == 'b2g' || os == 'android' + +[test_bug1170484.html] + +support-files = + helper_bug1170484.js diff --git a/extensions/spellcheck/tests/mochitest/test_bug1170484.html b/extensions/spellcheck/tests/mochitest/test_bug1170484.html new file mode 100644 index 00000000000..bdfb39f18f3 --- /dev/null +++ b/extensions/spellcheck/tests/mochitest/test_bug1170484.html @@ -0,0 +1,56 @@ + + + + + + Test for Bug 1170484 + + + + + + +Mozilla Bug 1170484 +

+ +
+  
testing spellechek
+
+ +