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

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

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « chrome/test/base/v8_unit_test.cc ('k') | chrome/test/chromedriver/chrome_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/test/base/web_ui_browsertest.h" 5 #include "chrome/test/base/web_ui_browsertest.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 void WebUIBrowserTest::BuildJavascriptLibraries(string16* content) { 451 void WebUIBrowserTest::BuildJavascriptLibraries(string16* content) {
452 ASSERT_TRUE(content != NULL); 452 ASSERT_TRUE(content != NULL);
453 std::string utf8_content; 453 std::string utf8_content;
454 std::vector<base::FilePath>::iterator user_libraries_iterator; 454 std::vector<base::FilePath>::iterator user_libraries_iterator;
455 for (user_libraries_iterator = user_libraries_.begin(); 455 for (user_libraries_iterator = user_libraries_.begin();
456 user_libraries_iterator != user_libraries_.end(); 456 user_libraries_iterator != user_libraries_.end();
457 ++user_libraries_iterator) { 457 ++user_libraries_iterator) {
458 std::string library_content; 458 std::string library_content;
459 if (user_libraries_iterator->IsAbsolute()) { 459 if (user_libraries_iterator->IsAbsolute()) {
460 ASSERT_TRUE(file_util::ReadFileToString(*user_libraries_iterator, 460 ASSERT_TRUE(base::ReadFileToString(*user_libraries_iterator,
461 &library_content)) 461 &library_content))
462 << user_libraries_iterator->value(); 462 << user_libraries_iterator->value();
463 } else { 463 } else {
464 bool ok = file_util::ReadFileToString( 464 bool ok = base::ReadFileToString(
465 gen_test_data_directory_.Append(*user_libraries_iterator), 465 gen_test_data_directory_.Append(*user_libraries_iterator),
466 &library_content); 466 &library_content);
467 if (!ok) { 467 if (!ok) {
468 ok = file_util::ReadFileToString( 468 ok = base::ReadFileToString(
469 test_data_directory_.Append(*user_libraries_iterator), 469 test_data_directory_.Append(*user_libraries_iterator),
470 &library_content); 470 &library_content);
471 } 471 }
472 ASSERT_TRUE(ok) << user_libraries_iterator->value(); 472 ASSERT_TRUE(ok) << user_libraries_iterator->value();
473 } 473 }
474 utf8_content.append(library_content); 474 utf8_content.append(library_content);
475 utf8_content.append(";\n"); 475 utf8_content.append(";\n");
476 } 476 }
477 content->append(UTF8ToUTF16(utf8_content)); 477 content->append(UTF8ToUTF16(utf8_content));
478 } 478 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 // testDone directly and expect pass result. 776 // testDone directly and expect pass result.
777 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { 777 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) {
778 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); 778 ASSERT_TRUE(RunJavascriptAsyncTest("testDone"));
779 } 779 }
780 780
781 // Test that calling testDone during RunJavascriptTest still completes when 781 // Test that calling testDone during RunJavascriptTest still completes when
782 // waiting for async result. 782 // waiting for async result.
783 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { 783 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) {
784 ASSERT_TRUE(RunJavascriptTest("testDone")); 784 ASSERT_TRUE(RunJavascriptTest("testDone"));
785 } 785 }
OLDNEW
« no previous file with comments | « chrome/test/base/v8_unit_test.cc ('k') | chrome/test/chromedriver/chrome_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698