| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 virtual void OnTestProgramEnd(const ::testing::UnitTest&) { | 54 virtual void OnTestProgramEnd(const ::testing::UnitTest&) { |
| 55 pp::Instance(PSGetInstanceId()).PostMessage("testend"); | 55 pp::Instance(PSGetInstanceId()).PostMessage("testend"); |
| 56 } | 56 } |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 int example_main(int argc, char* argv[]) { | 59 int example_main(int argc, char* argv[]) { |
| 60 ::testing::InitGoogleTest(&argc, argv); | 60 ::testing::InitGoogleTest(&argc, argv); |
| 61 ::testing::UnitTest::GetInstance()->listeners() | 61 ::testing::UnitTest::GetInstance()->listeners() |
| 62 .Append(new GTestEventListener()); | 62 .Append(new GTestEventListener()); |
| 63 return RUN_ALL_TESTS(); | 63 int result = RUN_ALL_TESTS(); |
| 64 |
| 65 // When running as an automated test, we don't want the final message |
| 66 // ("testend") to be dropped, so don't exit. The web page will kill the |
| 67 // plugin if it needs to. |
| 68 while(1); |
| 69 |
| 70 // Silence the warning. |
| 71 return result; |
| 64 } | 72 } |
| 65 | 73 |
| 66 // Register the function to call once the Instance Object is initialized. | 74 // Register the function to call once the Instance Object is initialized. |
| 67 // see: pappi_simple/ps_main.h | 75 // see: pappi_simple/ps_main.h |
| 68 PPAPI_SIMPLE_REGISTER_MAIN(example_main); | 76 PPAPI_SIMPLE_REGISTER_MAIN(example_main); |
| 69 | 77 |
| 70 #endif | 78 #endif |
| OLD | NEW |