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 "chrome/test/base/v8_unit_test.h" | 5 #include "chrome/test/base/v8_unit_test.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stringprintf.h" | |
11 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| 11 #include "base/strings/stringprintf.h" |
12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // |args| are passed through the various JavaScript logging functions such as | 16 // |args| are passed through the various JavaScript logging functions such as |
17 // console.log. Returns a string appropriate for logging with LOG(severity). | 17 // console.log. Returns a string appropriate for logging with LOG(severity). |
18 std::string LogArgs2String(const v8::Arguments& args) { | 18 std::string LogArgs2String(const v8::Arguments& args) { |
19 std::string message; | 19 std::string message; |
20 bool first = true; | 20 bool first = true; |
21 for (int i = 0; i < args.Length(); i++) { | 21 for (int i = 0; i < args.Length(); i++) { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 EXPECT_EQ(2U, testResult->Length()); | 276 EXPECT_EQ(2U, testResult->Length()); |
277 if (::testing::Test::HasNonfatalFailure()) | 277 if (::testing::Test::HasNonfatalFailure()) |
278 return v8::Undefined(); | 278 return v8::Undefined(); |
279 testResult_ok = testResult->Get(0)->BooleanValue(); | 279 testResult_ok = testResult->Get(0)->BooleanValue(); |
280 if (!testResult_ok) { | 280 if (!testResult_ok) { |
281 v8::String::Utf8Value message(testResult->Get(1)); | 281 v8::String::Utf8Value message(testResult->Get(1)); |
282 LOG(ERROR) << *message; | 282 LOG(ERROR) << *message; |
283 } | 283 } |
284 return v8::Undefined(); | 284 return v8::Undefined(); |
285 } | 285 } |
OLD | NEW |