diff options
Diffstat (limited to 'remoting/jingle_glue/jingle_thread_unittest.cc')
-rw-r--r-- | remoting/jingle_glue/jingle_thread_unittest.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/remoting/jingle_glue/jingle_thread_unittest.cc b/remoting/jingle_glue/jingle_thread_unittest.cc new file mode 100644 index 0000000..a29b69c --- /dev/null +++ b/remoting/jingle_glue/jingle_thread_unittest.cc @@ -0,0 +1,27 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/message_loop.h" +#include "remoting/jingle_glue/jingle_thread.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace remoting { + +class MockTask : public Task { + public: + MOCK_METHOD0(Run, void()); +}; + +TEST(JingleThreadTest, PostTask) { + JingleThread thread; + MockTask* task = new MockTask(); + EXPECT_CALL(*task, Run()); + + thread.Start(); + thread.message_loop()->PostTask(FROM_HERE, task); + thread.Stop(); +} + +} // namespace remoting |