Index: ppapi/tests/testing_instance.cc |
=================================================================== |
--- ppapi/tests/testing_instance.cc (revision 77426) |
+++ ppapi/tests/testing_instance.cc (working copy) |
@@ -1,11 +1,12 @@ |
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
#include "ppapi/tests/testing_instance.h" |
#include <algorithm> |
-#include <string.h> |
+#include <cstring> |
+#include <vector> |
#include "ppapi/cpp/module.h" |
#include "ppapi/cpp/var.h" |
@@ -27,15 +28,15 @@ |
const char* argn[], |
const char* argv[]) { |
for (uint32_t i = 0; i < argc; i++) { |
- if (strcmp(argn[i], "mode") == 0) { |
- if (strcmp(argv[i], "nacl") == 0) |
+ if (std::strcmp(argn[i], "mode") == 0) { |
+ if (std::strcmp(argv[i], "nacl") == 0) |
nacl_mode_ = true; |
break; |
} |
} |
// Create the proper test case from the argument. |
for (uint32_t i = 0; i < argc; i++) { |
- if (strcmp(argn[i], "testcase") == 0) { |
+ if (std::strcmp(argn[i], "testcase") == 0) { |
if (argv[i][0] == '\0') |
break; |
current_case_ = CaseForTestName(argv[i]); |
@@ -55,6 +56,10 @@ |
return current_case_->GetTestObject(); |
} |
+void TestingInstance::HandleMessage(const pp::Var& message_data) { |
+ current_case_->HandleMessage(message_data); |
+} |
+ |
void TestingInstance::DidChangeView(const pp::Rect& position, |
const pp::Rect& clip) { |
if (!executed_tests_) { |
@@ -66,7 +71,7 @@ |
} |
void TestingInstance::LogTest(const std::string& test_name, |
- const std::string& error_message) { |
+ const std::string& error_message) { |
std::string html; |
html.append("<div class=\"test_line\"><span class=\"test_name\">"); |
html.append(test_name); |
@@ -120,7 +125,7 @@ |
TestCase* TestingInstance::CaseForTestName(const char* name) { |
TestCaseFactory* iter = TestCaseFactory::head_; |
while (iter != NULL) { |
- if (strcmp(name, iter->name_) == 0) |
+ if (std::strcmp(name, iter->name_) == 0) |
return iter->method_(this); |
iter = iter->next_; |
} |