| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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("mojo:foo", entry->name()); | 58 EXPECT_EQ("mojo:foo", entry->name()); |
| 59 EXPECT_EQ(shell::GetNamePath(entry->name()), entry->qualifier()); | 59 EXPECT_EQ(shell::GetNamePath(entry->name()), entry->qualifier()); |
| 60 EXPECT_EQ("Foo", entry->display_name()); | 60 EXPECT_EQ("Foo", entry->display_name()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 TEST_F(EntryTest, NoWildcardInInterfaces) { |
| 64 std::unique_ptr<Entry> entry = ReadEntry("wildcard_interfaces", nullptr); |
| 65 EXPECT_EQ(nullptr, entry.get()); |
| 66 } |
| 67 |
| 63 TEST_F(EntryTest, Instance) { | 68 TEST_F(EntryTest, Instance) { |
| 64 std::unique_ptr<Entry> entry = ReadEntry("instance", nullptr); | 69 std::unique_ptr<Entry> entry = ReadEntry("instance", nullptr); |
| 65 EXPECT_EQ("mojo:foo", entry->name()); | 70 EXPECT_EQ("mojo:foo", entry->name()); |
| 66 EXPECT_EQ("bar", entry->qualifier()); | 71 EXPECT_EQ("bar", entry->qualifier()); |
| 67 EXPECT_EQ("Foo", entry->display_name()); | 72 EXPECT_EQ("Foo", entry->display_name()); |
| 68 } | 73 } |
| 69 | 74 |
| 70 TEST_F(EntryTest, Capabilities) { | 75 TEST_F(EntryTest, Capabilities) { |
| 71 std::unique_ptr<Entry> entry = ReadEntry("capabilities", nullptr); | 76 std::unique_ptr<Entry> entry = ReadEntry("capabilities", nullptr); |
| 72 | 77 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 93 EXPECT_EQ(*entry, *reconstituted); | 98 EXPECT_EQ(*entry, *reconstituted); |
| 94 } | 99 } |
| 95 | 100 |
| 96 TEST_F(EntryTest, Malformed) { | 101 TEST_F(EntryTest, Malformed) { |
| 97 std::unique_ptr<base::Value> value = ReadManifest("malformed"); | 102 std::unique_ptr<base::Value> value = ReadManifest("malformed"); |
| 98 EXPECT_FALSE(value.get()); | 103 EXPECT_FALSE(value.get()); |
| 99 } | 104 } |
| 100 | 105 |
| 101 | 106 |
| 102 } // namespace catalog | 107 } // namespace catalog |
| OLD | NEW |