| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/utility/completion_callback_factory.h" | 10 #include "ppapi/utility/completion_callback_factory.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Sets the given cookie in the current document. | 92 // Sets the given cookie in the current document. |
| 93 void SetCookie(const std::string& name, const std::string& value); | 93 void SetCookie(const std::string& name, const std::string& value); |
| 94 | 94 |
| 95 void ReportProgress(const std::string& progress_value); | 95 void ReportProgress(const std::string& progress_value); |
| 96 | 96 |
| 97 // Add a post-condition to the JavaScript on the test_case.html page. This | 97 // Add a post-condition to the JavaScript on the test_case.html page. This |
| 98 // JavaScript code will be run after the instance is shut down and must | 98 // JavaScript code will be run after the instance is shut down and must |
| 99 // evaluate to |true| or the test will fail. | 99 // evaluate to |true| or the test will fail. |
| 100 void AddPostCondition(const std::string& script); | 100 void AddPostCondition(const std::string& script); |
| 101 | 101 |
| 102 // See doc for |remove_plugin_|. |
| 103 void set_remove_plugin(bool remove) { remove_plugin_ = remove; } |
| 104 |
| 102 private: | 105 private: |
| 103 void ExecuteTests(int32_t unused); | 106 void ExecuteTests(int32_t unused); |
| 104 | 107 |
| 105 // Creates a new TestCase for the give test name, or NULL if there is no such | 108 // Creates a new TestCase for the give test name, or NULL if there is no such |
| 106 // test. Ownership is passed to the caller. The given string is split by '_'. | 109 // test. Ownership is passed to the caller. The given string is split by '_'. |
| 107 // The test case name is the first part. | 110 // The test case name is the first part. |
| 108 TestCase* CaseForTestName(const std::string& name); | 111 TestCase* CaseForTestName(const std::string& name); |
| 109 // Returns the filter (second part) of the given string. If there is no '_', | 112 // Returns the filter (second part) of the given string. If there is no '_', |
| 110 // returns the empty string, which means 'run all tests for this test case'. | 113 // returns the empty string, which means 'run all tests for this test case'. |
| 111 // E.g.: | 114 // E.g.: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 155 |
| 153 // String representing the protocol. Used for detecting whether we're running | 156 // String representing the protocol. Used for detecting whether we're running |
| 154 // with http. | 157 // with http. |
| 155 std::string protocol_; | 158 std::string protocol_; |
| 156 | 159 |
| 157 // SSL server port. | 160 // SSL server port. |
| 158 int ssl_server_port_; | 161 int ssl_server_port_; |
| 159 | 162 |
| 160 // WebSocket port. | 163 // WebSocket port. |
| 161 int websocket_port_; | 164 int websocket_port_; |
| 165 |
| 166 // At the end of each set of tests, the plugin is removed from the web-page. |
| 167 // However, for some tests, it is desirable to not remove the plguin from the |
| 168 // page. |
| 169 bool remove_plugin_; |
| 162 }; | 170 }; |
| 163 | 171 |
| 164 #endif // PPAPI_TESTS_TESTING_INSTANCE_H_ | 172 #endif // PPAPI_TESTS_TESTING_INSTANCE_H_ |
| OLD | NEW |