OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/message_loop.h" |
| 6 #include "remoting/jingle_glue/jingle_thread.h" |
| 7 #include "testing/gmock/include/gmock/gmock.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace remoting { |
| 11 |
| 12 class MockTask : public Task { |
| 13 public: |
| 14 MOCK_METHOD0(Run, void()); |
| 15 }; |
| 16 |
| 17 TEST(JingleThreadTest, PostTask) { |
| 18 JingleThread thread; |
| 19 MockTask* task = new MockTask(); |
| 20 EXPECT_CALL(*task, Run()); |
| 21 |
| 22 thread.Start(); |
| 23 thread.message_loop()->PostTask(FROM_HERE, task); |
| 24 thread.Stop(); |
| 25 } |
| 26 |
| 27 } // namespace remoting |
OLD | NEW |