summaryrefslogtreecommitdiffstats
path: root/remoting/jingle_glue/jingle_thread_unittest.cc
blob: a29b69c28d2f6efe9c09fbcd12f9f7915447d861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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