| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_TESTS_TESTING_INSTANCE_H_ | 5 #ifndef PPAPI_TESTS_TESTING_INSTANCE_H_ |
| 6 #define PPAPI_TESTS_TESTING_INSTANCE_H_ | 6 #define PPAPI_TESTS_TESTING_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/cpp/completion_callback.h" | 10 #include "ppapi/cpp/completion_callback.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void AppendError(const std::string& message); | 76 void AppendError(const std::string& message); |
| 77 | 77 |
| 78 // Passes the message_data through to the HandleMessage method on the | 78 // Passes the message_data through to the HandleMessage method on the |
| 79 // TestClass object that's associated with this instance. | 79 // TestClass object that's associated with this instance. |
| 80 virtual void HandleMessage(const pp::Var& message_data); | 80 virtual void HandleMessage(const pp::Var& message_data); |
| 81 | 81 |
| 82 const std::string& protocol() { | 82 const std::string& protocol() { |
| 83 return protocol_; | 83 return protocol_; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // Posts a message to the test page to eval() the script. |
| 87 void EvalScript(const std::string& script); |
| 88 |
| 86 private: | 89 private: |
| 87 void ExecuteTests(int32_t unused); | 90 void ExecuteTests(int32_t unused); |
| 88 | 91 |
| 89 // Creates a new TestCase for the give test name, or NULL if there is no such | 92 // Creates a new TestCase for the give test name, or NULL if there is no such |
| 90 // test. Ownership is passed to the caller. The given string is split by '_'. | 93 // test. Ownership is passed to the caller. The given string is split by '_'. |
| 91 // The test case name is the first part. | 94 // The test case name is the first part. |
| 92 TestCase* CaseForTestName(const std::string& name); | 95 TestCase* CaseForTestName(const std::string& name); |
| 93 // Returns the filter (second part) of the given string. If there is no '_', | 96 // Returns the filter (second part) of the given string. If there is no '_', |
| 94 // returns the empty string, which means 'run all tests for this test case'. | 97 // returns the empty string, which means 'run all tests for this test case'. |
| 95 // E.g.: | 98 // E.g.: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 138 |
| 136 // True if running in Native Client. | 139 // True if running in Native Client. |
| 137 bool nacl_mode_; | 140 bool nacl_mode_; |
| 138 | 141 |
| 139 // String representing the protocol. Used for detecting whether we're running | 142 // String representing the protocol. Used for detecting whether we're running |
| 140 // with http. | 143 // with http. |
| 141 std::string protocol_; | 144 std::string protocol_; |
| 142 }; | 145 }; |
| 143 | 146 |
| 144 #endif // PPAPI_TESTS_TESTING_INSTANCE_H_ | 147 #endif // PPAPI_TESTS_TESTING_INSTANCE_H_ |
| OLD | NEW |