Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.cc

Issue 1676913002: [mojo] Delete third_party/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: let's try that again Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.cc
diff --git a/third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.cc b/third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.cc
deleted file mode 100644
index fc60cb3cca16457f2a6b586942ad91f343f0e583..0000000000000000000000000000000000000000
--- a/third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2015 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 "third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.h"
-
-#include "base/synchronization/waitable_event.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/mojo/src/mojo/edk/system/message_in_transit.h"
-
-namespace mojo {
-namespace system {
-namespace test {
-
-TestChannelEndpointClient::TestChannelEndpointClient()
- : port_(0), read_event_(nullptr) {
-}
-
-void TestChannelEndpointClient::Init(unsigned port, ChannelEndpoint* endpoint) {
- MutexLocker locker(&mutex_);
- ASSERT_EQ(0u, port_);
- ASSERT_FALSE(endpoint_);
- port_ = port;
- endpoint_ = endpoint;
-}
-
-bool TestChannelEndpointClient::IsDetached() const {
- MutexLocker locker(&mutex_);
- return !endpoint_;
-}
-
-size_t TestChannelEndpointClient::NumMessages() const {
- MutexLocker locker(&mutex_);
- return messages_.Size();
-}
-
-scoped_ptr<MessageInTransit> TestChannelEndpointClient::PopMessage() {
- MutexLocker locker(&mutex_);
- if (messages_.IsEmpty())
- return nullptr;
- return messages_.GetMessage();
-}
-
-void TestChannelEndpointClient::SetReadEvent(base::WaitableEvent* read_event) {
- MutexLocker locker(&mutex_);
- read_event_ = read_event;
-}
-
-bool TestChannelEndpointClient::OnReadMessage(unsigned port,
- MessageInTransit* message) {
- MutexLocker locker(&mutex_);
-
- EXPECT_EQ(port_, port);
- EXPECT_TRUE(endpoint_);
- messages_.AddMessage(make_scoped_ptr(message));
-
- if (read_event_)
- read_event_->Signal();
-
- return true;
-}
-
-void TestChannelEndpointClient::OnDetachFromChannel(unsigned port) {
- MutexLocker locker(&mutex_);
-
- EXPECT_EQ(port_, port);
- ASSERT_TRUE(endpoint_);
- endpoint_->DetachFromClient();
- endpoint_ = nullptr;
-}
-
-TestChannelEndpointClient::~TestChannelEndpointClient() {
- EXPECT_FALSE(endpoint_);
-}
-
-} // namespace test
-} // namespace system
-} // namespace mojo
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/test_channel_endpoint_client.h ('k') | third_party/mojo/src/mojo/edk/system/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698