| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/runner/shell_test_base.h" | 5 #include "mojo/shell/standalone/shell_test_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "mojo/public/cpp/bindings/interface_ptr.h" | 15 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 16 #include "mojo/public/cpp/system/core.h" | 16 #include "mojo/public/cpp/system/core.h" |
| 17 #include "mojo/services/test_service/test_request_tracker.mojom.h" | 17 #include "mojo/services/test_service/test_request_tracker.mojom.h" |
| 18 #include "mojo/services/test_service/test_service.mojom.h" | 18 #include "mojo/services/test_service/test_service.mojom.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 21 | 21 |
| 22 using mojo::test::ServiceReport; | 22 using mojo::test::ServiceReport; |
| 23 using mojo::test::ServiceReportPtr; | 23 using mojo::test::ServiceReportPtr; |
| 24 using mojo::test::TestService; | 24 using mojo::test::TestService; |
| 25 using mojo::test::TestTimeService; | 25 using mojo::test::TestTimeService; |
| 26 using mojo::test::TestServicePtr; | 26 using mojo::test::TestServicePtr; |
| 27 using mojo::test::TestTimeServicePtr; | 27 using mojo::test::TestTimeServicePtr; |
| 28 using mojo::test::TestTrackedRequestService; | 28 using mojo::test::TestTrackedRequestService; |
| 29 using mojo::test::TestTrackedRequestServicePtr; | 29 using mojo::test::TestTrackedRequestServicePtr; |
| 30 | 30 |
| 31 namespace mojo { | 31 namespace mojo { |
| 32 namespace runner { | 32 namespace shell { |
| 33 namespace test { | 33 namespace test { |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 void GetReportCallback(base::MessageLoop* loop, | 36 void GetReportCallback(base::MessageLoop* loop, |
| 37 std::vector<ServiceReport>* reports_out, | 37 std::vector<ServiceReport>* reports_out, |
| 38 Array<ServiceReportPtr> report) { | 38 Array<ServiceReportPtr> report) { |
| 39 for (size_t i = 0; i < report.size(); i++) | 39 for (size_t i = 0; i < report.size(); i++) |
| 40 reports_out->push_back(*report[i]); | 40 reports_out->push_back(*report[i]); |
| 41 loop->QuitWhenIdle(); | 41 loop->QuitWhenIdle(); |
| 42 } | 42 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 EXPECT_EQ(TestService::Name_, reports[0].service_name); | 286 EXPECT_EQ(TestService::Name_, reports[0].service_name); |
| 287 EXPECT_EQ(6U, reports[0].total_requests); | 287 EXPECT_EQ(6U, reports[0].total_requests); |
| 288 EXPECT_EQ(TestTimeService::Name_, reports[1].service_name); | 288 EXPECT_EQ(TestTimeService::Name_, reports[1].service_name); |
| 289 EXPECT_EQ(1U, reports[1].total_requests); | 289 EXPECT_EQ(1U, reports[1].total_requests); |
| 290 EXPECT_EQ(TestTimeService::Name_, reports[2].service_name); | 290 EXPECT_EQ(TestTimeService::Name_, reports[2].service_name); |
| 291 EXPECT_EQ(20U, reports[2].total_requests); | 291 EXPECT_EQ(20U, reports[2].total_requests); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace | 294 } // namespace |
| 295 } // namespace test | 295 } // namespace test |
| 296 } // namespace runner | 296 } // namespace shell |
| 297 } // namespace mojo | 297 } // namespace mojo |
| OLD | NEW |