| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test_case.h" | 5 #include "ppapi/tests/test_case.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool TestCase::Init() { | 95 bool TestCase::Init() { |
| 96 return true; | 96 return true; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // static | 99 // static |
| 100 std::string TestCase::MakeFailureMessage(const char* file, | 100 std::string TestCase::MakeFailureMessage(const char* file, |
| 101 int line, | 101 int line, |
| 102 const char* cmd) { | 102 const char* cmd) { |
| 103 // The mere presence of this local variable works around a gcc-4.2.4 | |
| 104 // compiler bug in official Chrome Linux builds. If you remove it, | |
| 105 // confirm this compile command still works: | |
| 106 // GYP_DEFINES='branding=Chrome buildtype=Official target_arch=x64' | |
| 107 // gclient runhooks | |
| 108 // make -k -j4 BUILDTYPE=Release ppapi_tests | |
| 109 | |
| 110 std::ostringstream output; | 103 std::ostringstream output; |
| 111 output << "Failure in " << file << "(" << line << "): " << cmd; | 104 output << "Failure in " << file << "(" << line << "): " << cmd; |
| 112 return output.str(); | 105 return output.str(); |
| 113 } | 106 } |
| 114 | 107 |
| 115 #if !(defined __native_client__) | 108 #if !(defined __native_client__) |
| 116 pp::VarPrivate TestCase::GetTestObject() { | 109 pp::VarPrivate TestCase::GetTestObject() { |
| 117 if (test_object_.is_undefined()) { | 110 if (test_object_.is_undefined()) { |
| 118 pp::deprecated::ScriptableObject* so = CreateTestObject(); | 111 pp::deprecated::ScriptableObject* so = CreateTestObject(); |
| 119 if (so) { | 112 if (so) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 void (*thread_func)(void*), | 251 void (*thread_func)(void*), |
| 259 void* thread_param, | 252 void* thread_param, |
| 260 const PPB_Testing_Private* testing_interface) { | 253 const PPB_Testing_Private* testing_interface) { |
| 261 PP_ThreadType thread; | 254 PP_ThreadType thread; |
| 262 PP_CreateThread(&thread, thread_func, thread_param); | 255 PP_CreateThread(&thread, thread_func, thread_param); |
| 263 // Run a message loop so pepper calls can be dispatched. The background | 256 // Run a message loop so pepper calls can be dispatched. The background |
| 264 // thread will set result_ and make us Quit when it's done. | 257 // thread will set result_ and make us Quit when it's done. |
| 265 testing_interface->RunMessageLoop(instance_->pp_instance()); | 258 testing_interface->RunMessageLoop(instance_->pp_instance()); |
| 266 PP_JoinThread(thread); | 259 PP_JoinThread(thread); |
| 267 } | 260 } |
| OLD | NEW |