| Index: ceee/ie/broker/broker_rpc_unittest.cc | 
| =================================================================== | 
| --- ceee/ie/broker/broker_rpc_unittest.cc	(revision 0) | 
| +++ ceee/ie/broker/broker_rpc_unittest.cc	(revision 0) | 
| @@ -0,0 +1,64 @@ | 
| + // 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 "ceee/ie/broker/broker_rpc_client.h" | 
| +#include "ceee/ie/broker/broker_rpc_server.h" | 
| + | 
| +#include "ceee/ie/broker/broker_rpc_utils.h" | 
| +#include "ceee/ie/common/ceee_module_util.h" | 
| +#include "ceee/testing/utils/mock_static.h" | 
| +#include "testing/gmock/include/gmock/gmock.h" | 
| +#include "testing/gtest/include/gtest/gtest.h" | 
| + | 
| +using testing::_; | 
| +using testing::DoAll; | 
| +using testing::NotNull; | 
| +using testing::SetArgumentPointee; | 
| +using testing::StrictMock; | 
| +using testing::Return; | 
| + | 
| +namespace { | 
| +using testing::_; | 
| + | 
| +MOCK_STATIC_CLASS_BEGIN(BrokerRpcMock) | 
| +  MOCK_STATIC_INIT_BEGIN(BrokerRpcMock) | 
| +    MOCK_STATIC_INIT(GetRpcEndPointAddress); | 
| +  MOCK_STATIC_INIT_END() | 
| + | 
| +    MOCK_STATIC0(std::wstring, , GetRpcEndPointAddress); | 
| +MOCK_STATIC_CLASS_END(BrokerRpcMock) | 
| + | 
| + | 
| +class BrokerRpcTest : public testing::Test { | 
| + protected: | 
| +  virtual void SetUp() { | 
| +    EXPECT_CALL(broker_rpc_mock_, GetRpcEndPointAddress()) | 
| +        .WillRepeatedly(Return(L"BrokerRpcTestEP")); | 
| +  } | 
| + | 
| +  virtual void TearDown() { | 
| + | 
| +  } | 
| + | 
| +  BrokerRpcMock broker_rpc_mock_; | 
| +}; | 
| + | 
| +TEST_F(BrokerRpcTest, ConnectNoServer) { | 
| +  BrokerRpcClient client; | 
| +  ASSERT_FALSE(client.is_connected()); | 
| +  ASSERT_FALSE(client.Connect()); | 
| +  ASSERT_FALSE(client.is_connected()); | 
| +} | 
| + | 
| +TEST_F(BrokerRpcTest, Connect) { | 
| +  BrokerRpcServer server; | 
| +  ASSERT_FALSE(server.is_started()); | 
| +  ASSERT_TRUE(server.Start()); | 
| +  ASSERT_TRUE(server.is_started()); | 
| +  BrokerRpcClient client; | 
| +  ASSERT_TRUE(client.Connect()); | 
| +  ASSERT_TRUE(client.is_connected()); | 
| +} | 
| + | 
| +} | 
|  | 
| Property changes on: ceee\ie\broker\broker_rpc_unittest.cc | 
| ___________________________________________________________________ | 
| Added: svn:eol-style | 
| + LF | 
|  | 
|  |