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

Unified Diff: mojo/public/cpp/application/tests/service_registry_unittest.cc

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « mojo/public/cpp/application/tests/BUILD.gn ('k') | mojo/public/cpp/bindings/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/tests/service_registry_unittest.cc
diff --git a/mojo/public/cpp/application/tests/service_registry_unittest.cc b/mojo/public/cpp/application/tests/service_registry_unittest.cc
deleted file mode 100644
index 283bf144034028e66ea2ecd1ccbad197333be5af..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/application/tests/service_registry_unittest.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2014 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 "mojo/public/cpp/application/lib/service_registry.h"
-
-#include "mojo/public/cpp/application/lib/service_connector.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mojo {
-namespace internal {
-namespace {
-
-class TestConnector : public ServiceConnectorBase {
- public:
- TestConnector(const std::string& name, int* delete_count)
- : ServiceConnectorBase(name), delete_count_(delete_count) {}
- ~TestConnector() override { (*delete_count_)++; }
- void ConnectToService(const std::string& name,
- ScopedMessagePipeHandle client_handle) override {}
-
- private:
- int* delete_count_;
-};
-
-TEST(ServiceRegistryTest, Ownership) {
- int delete_count = 0;
-
- // Destruction.
- {
- ServiceRegistry registry;
- registry.AddServiceConnector(new TestConnector("TC1", &delete_count));
- }
- EXPECT_EQ(1, delete_count);
-
- // Removal.
- {
- ServiceRegistry registry;
- ServiceConnectorBase* c = new TestConnector("TC1", &delete_count);
- registry.AddServiceConnector(c);
- registry.RemoveServiceConnector(c);
- EXPECT_EQ(2, delete_count);
- }
-
- // Multiple.
- {
- ServiceRegistry registry;
- registry.AddServiceConnector(new TestConnector("TC1", &delete_count));
- registry.AddServiceConnector(new TestConnector("TC2", &delete_count));
- }
- EXPECT_EQ(4, delete_count);
-
- // Re-addition.
- {
- ServiceRegistry registry;
- registry.AddServiceConnector(new TestConnector("TC1", &delete_count));
- registry.AddServiceConnector(new TestConnector("TC1", &delete_count));
- EXPECT_EQ(5, delete_count);
- }
- EXPECT_EQ(6, delete_count);
-}
-
-} // namespace
-} // namespace internal
-} // namespace mojo
« no previous file with comments | « mojo/public/cpp/application/tests/BUILD.gn ('k') | mojo/public/cpp/bindings/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698