| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |