| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "ppapi/tests/testing_instance.h" | 5 #include "ppapi/tests/testing_instance.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 pp::Var window = GetWindowObject(); | 105 pp::Var window = GetWindowObject(); |
| 106 window.GetProperty("document"). | 106 window.GetProperty("document"). |
| 107 Call("getElementById", "console").SetProperty("innerHTML", ""); | 107 Call("getElementById", "console").SetProperty("innerHTML", ""); |
| 108 | 108 |
| 109 if (!errors_.empty()) { | 109 if (!errors_.empty()) { |
| 110 // Catch initialization errors and output the current error string to | 110 // Catch initialization errors and output the current error string to |
| 111 // the console. | 111 // the console. |
| 112 LogError("Plugin initialization failed: " + errors_); | 112 LogError("Plugin initialization failed: " + errors_); |
| 113 } else if (!current_case_) { | 113 } else if (!current_case_) { |
| 114 LogAvailableTests(); | 114 LogAvailableTests(); |
| 115 errors_.append("FAIL: Only listed tests"); |
| 115 } else { | 116 } else { |
| 116 current_case_->RunTest(); | 117 current_case_->RunTest(); |
| 117 } | 118 } |
| 118 | 119 |
| 119 // Declare we're done by setting a cookie to either "PASS" or the errors. | 120 // Declare we're done by setting a cookie to either "PASS" or the errors. |
| 120 SetCookie("COMPLETION_COOKIE", errors_.empty() ? "PASS" : errors_); | 121 SetCookie("COMPLETION_COOKIE", errors_.empty() ? "PASS" : errors_); |
| 121 | 122 |
| 122 window.Call("DidExecuteTests"); | 123 window.Call("DidExecuteTests"); |
| 123 } | 124 } |
| 124 | 125 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 193 } |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 namespace pp { | 196 namespace pp { |
| 196 | 197 |
| 197 Module* CreateModule() { | 198 Module* CreateModule() { |
| 198 return new ::Module(); | 199 return new ::Module(); |
| 199 } | 200 } |
| 200 | 201 |
| 201 } // namespace pp | 202 } // namespace pp |
| OLD | NEW |