| 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 #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 <sstream> | 9 #include <sstream> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if (current_case_) | 94 if (current_case_) |
| 95 current_case_->DidChangeView(position, clip); | 95 current_case_->DidChangeView(position, clip); |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool TestingInstance::HandleInputEvent(const pp::InputEvent& event) { | 98 bool TestingInstance::HandleInputEvent(const pp::InputEvent& event) { |
| 99 if (current_case_) | 99 if (current_case_) |
| 100 return current_case_->HandleInputEvent(event); | 100 return current_case_->HandleInputEvent(event); |
| 101 return false; | 101 return false; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void TestingInstance::EvalScript(const std::string& script) { |
| 105 std::string message("TESTING_MESSAGE:EvalScript:"); |
| 106 message.append(script); |
| 107 PostMessage(pp::Var(message)); |
| 108 } |
| 109 |
| 104 void TestingInstance::LogTest(const std::string& test_name, | 110 void TestingInstance::LogTest(const std::string& test_name, |
| 105 const std::string& error_message) { | 111 const std::string& error_message) { |
| 106 // Tell the browser we're still working. | 112 // Tell the browser we're still working. |
| 107 ReportProgress(kProgressSignal); | 113 ReportProgress(kProgressSignal); |
| 108 | 114 |
| 109 std::string html; | 115 std::string html; |
| 110 html.append("<div class=\"test_line\"><span class=\"test_name\">"); | 116 html.append("<div class=\"test_line\"><span class=\"test_name\">"); |
| 111 html.append(test_name); | 117 html.append(test_name); |
| 112 html.append("</span> "); | 118 html.append("</span> "); |
| 113 if (error_message.empty()) { | 119 if (error_message.empty()) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 249 } |
| 244 }; | 250 }; |
| 245 | 251 |
| 246 namespace pp { | 252 namespace pp { |
| 247 | 253 |
| 248 Module* CreateModule() { | 254 Module* CreateModule() { |
| 249 return new ::Module(); | 255 return new ::Module(); |
| 250 } | 256 } |
| 251 | 257 |
| 252 } // namespace pp | 258 } // namespace pp |
| OLD | NEW |