summaryrefslogtreecommitdiffstats
path: root/base/clipboard_unittest.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-31 01:19:57 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-31 01:19:57 +0000
commita92d2fd9d1fe0e74f6ca7d540858a4711b46367e (patch)
tree3ec4bb1ee681af04ee6757fa65e47b2abd5dff04 /base/clipboard_unittest.cc
parent69b43bdc17d84729fca4e34595e51a88cec099af (diff)
downloadchromium_src-a92d2fd9d1fe0e74f6ca7d540858a4711b46367e.zip
chromium_src-a92d2fd9d1fe0e74f6ca7d540858a4711b46367e.tar.gz
chromium_src-a92d2fd9d1fe0e74f6ca7d540858a4711b46367e.tar.bz2
Make sure that Clipboard operations that require dispatching
of windows messages are performed on the UI thread. SetClipboardData requires the clipboard to be open with a handle to a window that will be notified when the contents are going to change again. If Windows messages are not processed, any other app writing to the clipboard will be locked while we acknowledge their request (by processing the message). The IO thread doesn't pump windows messages anymore so write clipboard operations cannot be performed from that thread and have to be posted to another thread. BUG=5823 Review URL: http://codereview.chromium.org/19733 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard_unittest.cc')
-rw-r--r--base/clipboard_unittest.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/base/clipboard_unittest.cc b/base/clipboard_unittest.cc
index c752b4c..18f5fbc 100644
--- a/base/clipboard_unittest.cc
+++ b/base/clipboard_unittest.cc
@@ -6,12 +6,27 @@
#include "base/basictypes.h"
#include "base/clipboard.h"
+#include "base/message_loop.h"
#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+#if defined(OS_WIN)
+class ClipboardTest : public PlatformTest {
+ protected:
+ virtual void SetUp() {
+ message_loop_.reset(new MessageLoopForUI());
+ }
+ virtual void TearDown() {
+ }
+
+ private:
+ scoped_ptr<MessageLoop> message_loop_;
+};
+#elif defined(OS_POSIX)
typedef PlatformTest ClipboardTest;
+#endif // defined(OS_WIN)
TEST_F(ClipboardTest, ClearTest) {
Clipboard clipboard;