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

Side by Side Diff: services/catalog/entry_unittest.cc

Issue 2440203002: Mojo: removing support for process-group. (Closed)
Patch Set: Synced Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « services/catalog/entry.cc ('k') | services/catalog/store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/catalog/entry.h" 5 #include "services/catalog/entry.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 private: 49 private:
50 void SetUp() override {} 50 void SetUp() override {}
51 void TearDown() override {} 51 void TearDown() override {}
52 52
53 DISALLOW_COPY_AND_ASSIGN(EntryTest); 53 DISALLOW_COPY_AND_ASSIGN(EntryTest);
54 }; 54 };
55 55
56 TEST_F(EntryTest, Simple) { 56 TEST_F(EntryTest, Simple) {
57 std::unique_ptr<Entry> entry = ReadEntry("simple", nullptr); 57 std::unique_ptr<Entry> entry = ReadEntry("simple", nullptr);
58 EXPECT_EQ("service:foo", entry->name()); 58 EXPECT_EQ("service:foo", entry->name());
59 EXPECT_EQ(service_manager::GetNamePath(entry->name()), entry->qualifier());
60 EXPECT_EQ("Foo", entry->display_name()); 59 EXPECT_EQ("Foo", entry->display_name());
61 } 60 }
62 61
63 TEST_F(EntryTest, Instance) { 62 TEST_F(EntryTest, Instance) {
64 std::unique_ptr<Entry> entry = ReadEntry("instance", nullptr); 63 std::unique_ptr<Entry> entry = ReadEntry("instance", nullptr);
65 EXPECT_EQ("service:foo", entry->name()); 64 EXPECT_EQ("service:foo", entry->name());
66 EXPECT_EQ("bar", entry->qualifier());
67 EXPECT_EQ("Foo", entry->display_name()); 65 EXPECT_EQ("Foo", entry->display_name());
68 } 66 }
69 67
70 TEST_F(EntryTest, ConnectionSpec) { 68 TEST_F(EntryTest, ConnectionSpec) {
71 std::unique_ptr<Entry> entry = ReadEntry("connection_spec", nullptr); 69 std::unique_ptr<Entry> entry = ReadEntry("connection_spec", nullptr);
72 70
73 EXPECT_EQ("service:foo", entry->name()); 71 EXPECT_EQ("service:foo", entry->name());
74 EXPECT_EQ("bar", entry->qualifier());
75 EXPECT_EQ("Foo", entry->display_name()); 72 EXPECT_EQ("Foo", entry->display_name());
76 service_manager::InterfaceProviderSpec spec; 73 service_manager::InterfaceProviderSpec spec;
77 service_manager::CapabilitySet capabilities; 74 service_manager::CapabilitySet capabilities;
78 capabilities.insert("bar:bar"); 75 capabilities.insert("bar:bar");
79 spec.requires["service:bar"] = capabilities; 76 spec.requires["service:bar"] = capabilities;
80 service_manager::InterfaceProviderSpecMap specs; 77 service_manager::InterfaceProviderSpecMap specs;
81 specs[service_manager::mojom::kServiceManager_ConnectorSpec] = spec; 78 specs[service_manager::mojom::kServiceManager_ConnectorSpec] = spec;
82 EXPECT_EQ(specs, entry->interface_provider_specs()); 79 EXPECT_EQ(specs, entry->interface_provider_specs());
83 } 80 }
84 81
(...skipping 10 matching lines...) Expand all
95 EXPECT_EQ(*entry, *reconstituted); 92 EXPECT_EQ(*entry, *reconstituted);
96 } 93 }
97 94
98 TEST_F(EntryTest, Malformed) { 95 TEST_F(EntryTest, Malformed) {
99 std::unique_ptr<base::Value> value = ReadManifest("malformed"); 96 std::unique_ptr<base::Value> value = ReadManifest("malformed");
100 EXPECT_FALSE(value.get()); 97 EXPECT_FALSE(value.get());
101 } 98 }
102 99
103 100
104 } // namespace catalog 101 } // namespace catalog
OLDNEW
« no previous file with comments | « services/catalog/entry.cc ('k') | services/catalog/store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698