Skip to content

Instantly share code, notes, and snippets.

@zpao
Created June 2, 2010 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zpao/423003 to your computer and use it in GitHub Desktop.
Save zpao/423003 to your computer and use it in GitHub Desktop.
function test() {
waitForExplicitFinish();
// the value we expect to be on the clipboard
const EXPECTED_VAL = "foo";
// function that will setup the clipboard
function setup() {
Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper).
copyString(EXPECTED_VAL);
}
function nextTest() {
// Do something else here
ok(true);
finish();
}
waitForClipboard(EXPECTED_VAL, setup, nextTest, finish);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment