Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/test/base/v8_unit_test.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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" 10 #include "base/stringprintf.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 user_libraries_.begin(); 61 user_libraries_.begin();
62 user_libraries_iterator != user_libraries_.end(); 62 user_libraries_iterator != user_libraries_.end();
63 ++user_libraries_iterator) { 63 ++user_libraries_iterator) {
64 std::string library_content; 64 std::string library_content;
65 base::FilePath library_file(*user_libraries_iterator); 65 base::FilePath library_file(*user_libraries_iterator);
66 if (!user_libraries_iterator->IsAbsolute()) { 66 if (!user_libraries_iterator->IsAbsolute()) {
67 base::FilePath gen_file = gen_test_data_directory.Append(library_file); 67 base::FilePath gen_file = gen_test_data_directory.Append(library_file);
68 library_file = file_util::PathExists(gen_file) ? gen_file : 68 library_file = file_util::PathExists(gen_file) ? gen_file :
69 test_data_directory.Append(*user_libraries_iterator); 69 test_data_directory.Append(*user_libraries_iterator);
70 } 70 }
71 file_util::AbsolutePath(&library_file); 71 library_file = base::MakeAbsoluteFilePath(library_file);
72 if (!file_util::ReadFileToString(library_file, &library_content)) { 72 if (!file_util::ReadFileToString(library_file, &library_content)) {
73 ADD_FAILURE() << library_file.value(); 73 ADD_FAILURE() << library_file.value();
74 return false; 74 return false;
75 } 75 }
76 ExecuteScriptInContext(library_content, library_file.MaybeAsASCII()); 76 ExecuteScriptInContext(library_content, library_file.MaybeAsASCII());
77 if (::testing::Test::HasFatalFailure()) 77 if (::testing::Test::HasFatalFailure())
78 return false; 78 return false;
79 } 79 }
80 return true; 80 return true;
81 } 81 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 EXPECT_EQ(2U, testResult->Length()); 273 EXPECT_EQ(2U, testResult->Length());
274 if (::testing::Test::HasNonfatalFailure()) 274 if (::testing::Test::HasNonfatalFailure())
275 return v8::Undefined(); 275 return v8::Undefined();
276 testResult_ok = testResult->Get(0)->BooleanValue(); 276 testResult_ok = testResult->Get(0)->BooleanValue();
277 if (!testResult_ok) { 277 if (!testResult_ok) {
278 v8::String::Utf8Value message(testResult->Get(1)); 278 v8::String::Utf8Value message(testResult->Get(1));
279 LOG(ERROR) << *message; 279 LOG(ERROR) << *message;
280 } 280 }
281 return v8::Undefined(); 281 return v8::Undefined();
282 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698