OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const std::string& GetConnectionURL() override { | 30 const std::string& GetConnectionURL() override { |
31 static std::string kConnectionURL = "mojo:log"; | 31 static std::string kConnectionURL = "mojo:log"; |
32 return kConnectionURL; | 32 return kConnectionURL; |
33 } | 33 } |
34 | 34 |
35 const std::string& GetRemoteApplicationURL() override { | 35 const std::string& GetRemoteApplicationURL() override { |
36 static std::string kRemoteApplicationURL = "mojo:log_impl_unittest"; | 36 static std::string kRemoteApplicationURL = "mojo:log_impl_unittest"; |
37 return kRemoteApplicationURL; | 37 return kRemoteApplicationURL; |
38 } | 38 } |
39 | 39 |
40 ServiceProvider* GetServiceProvider() override { return nullptr; } | |
41 void SetServiceConnectorForName(ServiceConnector* service_connector, | 40 void SetServiceConnectorForName(ServiceConnector* service_connector, |
42 const std::string& name) override {} | 41 const std::string& name) override {} |
43 }; | 42 }; |
44 | 43 |
45 // Tests the Log service implementation by calling its AddEntry and verifying | 44 // Tests the Log service implementation by calling its AddEntry and verifying |
46 // the log message that it "prints". | 45 // the log message that it "prints". |
47 TEST_F(LogImplTest, AddEntryOutput) { | 46 TEST_F(LogImplTest, AddEntryOutput) { |
48 std::vector<std::string> messages; | 47 std::vector<std::string> messages; |
49 | 48 |
50 LogPtr log; | 49 LogPtr log; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 "<mojo:log_impl_unittest> [INFO] file.ext:1: 1234567890", | 82 "<mojo:log_impl_unittest> [INFO] file.ext:1: 1234567890", |
84 "<mojo:log_impl_unittest> [INFO] 1234567890", | 83 "<mojo:log_impl_unittest> [INFO] 1234567890", |
85 "<mojo:log_impl_unittest> [INFO] <no message>", | 84 "<mojo:log_impl_unittest> [INFO] <no message>", |
86 }; | 85 }; |
87 EXPECT_EQ(kExpectedMessages, messages); | 86 EXPECT_EQ(kExpectedMessages, messages); |
88 } | 87 } |
89 | 88 |
90 } // namespace | 89 } // namespace |
91 } // namespace log | 90 } // namespace log |
92 } // namespace mojo | 91 } // namespace mojo |
OLD | NEW |