| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 | 6 |
| 7 #include "gtest/gtest.h" | 7 #include "gtest/gtest.h" |
| 8 | 8 |
| 9 #if defined(SEL_LDR) | 9 #if defined(SEL_LDR) |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 pp::Instance(PSGetInstanceId()).PostMessage(msg.str()); | 43 pp::Instance(PSGetInstanceId()).PostMessage(msg.str()); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void OnTestEnd(const ::testing::TestInfo& test_info) { | 47 virtual void OnTestEnd(const ::testing::TestInfo& test_info) { |
| 48 std::stringstream msg; | 48 std::stringstream msg; |
| 49 msg << "end:" << test_info.test_case_name() << "." << test_info.name() | 49 msg << "end:" << test_info.test_case_name() << "." << test_info.name() |
| 50 << "," << (test_info.result()->Failed() ? "failed" : "ok"); | 50 << "," << (test_info.result()->Failed() ? "failed" : "ok"); |
| 51 pp::Instance(PSGetInstanceId()).PostMessage(msg.str()); | 51 pp::Instance(PSGetInstanceId()).PostMessage(msg.str()); |
| 52 } | 52 } |
| 53 |
| 54 virtual void OnTestProgramEnd(const ::testing::UnitTest&) { |
| 55 pp::Instance(PSGetInstanceId()).PostMessage("testend"); |
| 56 } |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 int example_main(int argc, char* argv[]) { | 59 int example_main(int argc, char* argv[]) { |
| 56 ::testing::InitGoogleTest(&argc, argv); | 60 ::testing::InitGoogleTest(&argc, argv); |
| 57 ::testing::UnitTest::GetInstance()->listeners() | 61 ::testing::UnitTest::GetInstance()->listeners() |
| 58 .Append(new GTestEventListener()); | 62 .Append(new GTestEventListener()); |
| 59 return RUN_ALL_TESTS(); | 63 return RUN_ALL_TESTS(); |
| 60 } | 64 } |
| 61 | 65 |
| 62 // Register the function to call once the Instance Object is initialized. | 66 // Register the function to call once the Instance Object is initialized. |
| 63 // see: pappi_simple/ps_main.h | 67 // see: pappi_simple/ps_main.h |
| 64 PPAPI_SIMPLE_REGISTER_MAIN(example_main); | 68 PPAPI_SIMPLE_REGISTER_MAIN(example_main); |
| 65 | 69 |
| 66 #endif | 70 #endif |
| OLD | NEW |