Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: ppapi/tests/testing_instance.cc

Issue 8920005: Add TestingInstance::EvalScript method which posts a message that the test page can eval(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/testing_instance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/tests/testing_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698