| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H__ | 5 #ifndef WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H__ |
| 6 #define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H__ | 6 #define WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 err.append(val2); | 70 err.append(val2); |
| 71 err.append("'"); | 71 err.append("'"); |
| 72 SetError(err); | 72 SetError(err); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 // Expect two integer values are equal, and if not, logs an | 75 // Expect two integer values are equal, and if not, logs an |
| 76 // appropriate error about it. | 76 // appropriate error about it. |
| 77 void ExpectIntegerEqual(int val1, int val2) { | 77 void ExpectIntegerEqual(int val1, int val2) { |
| 78 if (val1 != val2) { | 78 if (val1 != val2) { |
| 79 std::string err; | 79 std::string err; |
| 80 char buf[64]; // what's the right size? | |
| 81 err = "Expected Equal for '"; | 80 err = "Expected Equal for '"; |
| 82 sprintf_s(buf, "%d", val1); | 81 err.append(IntToString(val1)); |
| 83 err.append(buf); | |
| 84 err.append("' and '"); | 82 err.append("' and '"); |
| 85 sprintf_s(buf, "%d", val2); | 83 err.append(IntToString(val2)); |
| 86 err.append(buf); | |
| 87 err.append("'"); | 84 err.append("'"); |
| 88 SetError(err); | 85 SetError(err); |
| 89 } | 86 } |
| 90 } | 87 } |
| 91 | 88 |
| 92 | 89 |
| 93 protected: | 90 protected: |
| 94 // Signals to the Test that invoked us that the test is | 91 // Signals to the Test that invoked us that the test is |
| 95 // completed. This is done by forcing the plugin to | 92 // completed. This is done by forcing the plugin to |
| 96 // set a cookie in the browser window, which the test program | 93 // set a cookie in the browser window, which the test program |
| (...skipping 23 matching lines...) Expand all Loading... |
| 120 std::string test_name_; | 117 std::string test_name_; |
| 121 std::string test_id_; | 118 std::string test_id_; |
| 122 std::string test_status_; | 119 std::string test_status_; |
| 123 }; | 120 }; |
| 124 | 121 |
| 125 } // namespace NPAPIClient | 122 } // namespace NPAPIClient |
| 126 | 123 |
| 127 #endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H__ | 124 #endif // WEBKIT_PORT_PLUGINS_TEST_PLUGIN_TEST_H__ |
| 128 | 125 |
| 129 | 126 |
| OLD | NEW |