| 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/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 &gen_test_data_directory)); | 128 &gen_test_data_directory)); |
| 129 | 129 |
| 130 FilePath mockPath; | 130 FilePath mockPath; |
| 131 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath)); | 131 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath)); |
| 132 mockPath = mockPath.AppendASCII("chrome"); | 132 mockPath = mockPath.AppendASCII("chrome"); |
| 133 mockPath = mockPath.AppendASCII("third_party"); | 133 mockPath = mockPath.AppendASCII("third_party"); |
| 134 mockPath = mockPath.AppendASCII("mock4js"); | 134 mockPath = mockPath.AppendASCII("mock4js"); |
| 135 mockPath = mockPath.AppendASCII("mock4js.js"); | 135 mockPath = mockPath.AppendASCII("mock4js.js"); |
| 136 AddLibrary(mockPath); | 136 AddLibrary(mockPath); |
| 137 | 137 |
| 138 FilePath accessibilityAuditPath; |
| 139 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &accessibilityAuditPath)); |
| 140 accessibilityAuditPath = accessibilityAuditPath.AppendASCII("third_party"); |
| 141 accessibilityAuditPath = |
| 142 accessibilityAuditPath.AppendASCII("accessibility-developer-tools"); |
| 143 accessibilityAuditPath = accessibilityAuditPath.AppendASCII("gen"); |
| 144 accessibilityAuditPath = accessibilityAuditPath.AppendASCII("axs_testing.js"); |
| 145 AddLibrary(accessibilityAuditPath); |
| 146 |
| 138 FilePath testApiPath; | 147 FilePath testApiPath; |
| 139 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &testApiPath)); | 148 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &testApiPath)); |
| 140 testApiPath = testApiPath.AppendASCII("webui"); | 149 testApiPath = testApiPath.AppendASCII("webui"); |
| 141 testApiPath = testApiPath.AppendASCII("test_api.js"); | 150 testApiPath = testApiPath.AppendASCII("test_api.js"); |
| 142 AddLibrary(testApiPath); | 151 AddLibrary(testApiPath); |
| 143 } | 152 } |
| 144 | 153 |
| 145 void V8UnitTest::SetUp() { | 154 void V8UnitTest::SetUp() { |
| 146 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); | 155 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); |
| 147 v8::Handle<v8::String> logString = v8::String::New("log"); | 156 v8::Handle<v8::String> logString = v8::String::New("log"); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 EXPECT_EQ(2U, testResult->Length()); | 272 EXPECT_EQ(2U, testResult->Length()); |
| 264 if (::testing::Test::HasNonfatalFailure()) | 273 if (::testing::Test::HasNonfatalFailure()) |
| 265 return v8::Undefined(); | 274 return v8::Undefined(); |
| 266 testResult_ok = testResult->Get(0)->BooleanValue(); | 275 testResult_ok = testResult->Get(0)->BooleanValue(); |
| 267 if (!testResult_ok) { | 276 if (!testResult_ok) { |
| 268 v8::String::Utf8Value message(testResult->Get(1)); | 277 v8::String::Utf8Value message(testResult->Get(1)); |
| 269 LOG(ERROR) << *message; | 278 LOG(ERROR) << *message; |
| 270 } | 279 } |
| 271 return v8::Undefined(); | 280 return v8::Undefined(); |
| 272 } | 281 } |
| OLD | NEW |