#include <string>
#include <vector>
+#include "atom/common/native_mate_converters/string16_converter.h"
#include "native_mate/dictionary.h"
#include "ui/base/clipboard/clipboard.h"
return data;
}
-std::string ReadText() {
+string16 ReadText() {
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
- std::string data;
- clipboard->ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &data);
+ string16 data;
+ clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &data);
return data;
}
--- /dev/null
+assert = require 'assert'
+clipboard = require 'clipboard'
+
+describe 'clipboard module', ->
+ describe 'clipboard.readText()', ->
+ it 'returns unicode string correctly', ->
+ text = '千江有水千江月,万里无云万里天'
+ clipboard.writeText text
+ assert.equal clipboard.readText(), text