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/test_case.h" | 5 #include "ppapi/tests/test_case.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "ppapi/tests/test_utils.h" | 9 #include "ppapi/tests/test_utils.h" |
10 #include "ppapi/tests/testing_instance.h" | 10 #include "ppapi/tests/testing_instance.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Don't count test_object_ as a leak. | 119 // Don't count test_object_ as a leak. |
120 if (test_object_.pp_var().type > PP_VARTYPE_DOUBLE) | 120 if (test_object_.pp_var().type > PP_VARTYPE_DOUBLE) |
121 --leaked_vars; | 121 --leaked_vars; |
122 #endif | 122 #endif |
123 if (leaked_vars) { | 123 if (leaked_vars) { |
124 std::ostringstream output; | 124 std::ostringstream output; |
125 output << "Test leaked " << leaked_vars << " vars (printing at most " | 125 output << "Test leaked " << leaked_vars << " vars (printing at most " |
126 << kVarsToPrint <<"):<p>"; | 126 << kVarsToPrint <<"):<p>"; |
127 errors += output.str(); | 127 errors += output.str(); |
128 for (uint32_t i = 0; i < std::min(tracked_vars, kVarsToPrint); ++i) { | 128 for (uint32_t i = 0; i < std::min(tracked_vars, kVarsToPrint); ++i) { |
129 pp::Var leaked_var(pp::Var::PassRef(), vars[i]); | 129 pp::Var leaked_var(pp::PASS_REF, vars[i]); |
130 #if (defined __native_client__) | 130 #if (defined __native_client__) |
131 errors += leaked_var.DebugString() + "<p>"; | 131 errors += leaked_var.DebugString() + "<p>"; |
132 #else | 132 #else |
133 if (!(leaked_var == test_object_)) | 133 if (!(leaked_var == test_object_)) |
134 errors += leaked_var.DebugString() + "<p>"; | 134 errors += leaked_var.DebugString() + "<p>"; |
135 #endif | 135 #endif |
136 } | 136 } |
137 } | 137 } |
138 } | 138 } |
139 return errors; | 139 return errors; |
140 } | 140 } |
141 | 141 |
OLD | NEW |