35 var sbClipboard =
Cc[
"@songbirdnest.com/moz/clipboard/helper;1"]
36 .createInstance(
Ci.sbIClipboardHelper);
40 var imageFile = testFolder.clone();
41 imageFile.append(
"test.png");
43 var mimeType =
Cc[
"@mozilla.org/mime;1"]
44 .getService(
Ci.nsIMIMEService)
45 .getTypeFromFile(imageFile);
46 var inputStream =
Cc[
"@mozilla.org/network/file-input-stream;1"]
47 .createInstance(
Ci.nsIFileInputStream);
48 inputStream.init(imageFile, 0x01, 0600, 0);
51 var bis =
Cc[
"@mozilla.org/binaryinputstream;1"].
53 bis.setInputStream(inputStream);
54 var imageData= bis.readByteArray(imageSize);
56 sbClipboard.pasteImageToClipboard(mimeType, imageData, imageSize);
58 log(
"Failed: " + err);
function newAppRelativeFile(path)
var gFileLocation
test the clipboard helper
function runTest()
Advanced DataRemote unit tests.
function getCopyOfFolder(folder, tempName)
Copy the given folder to tempName, returning an nsIFile for the new location.