| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 WebUIMessageHandler* WebUIBrowserTest::GetMockMessageHandler() { | 426 WebUIMessageHandler* WebUIBrowserTest::GetMockMessageHandler() { |
| 427 return NULL; | 427 return NULL; |
| 428 } | 428 } |
| 429 | 429 |
| 430 GURL WebUIBrowserTest::WebUITestDataPathToURL( | 430 GURL WebUIBrowserTest::WebUITestDataPathToURL( |
| 431 const base::FilePath::StringType& path) { | 431 const base::FilePath::StringType& path) { |
| 432 base::FilePath dir_test_data; | 432 base::FilePath dir_test_data; |
| 433 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); | 433 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); |
| 434 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); | 434 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); |
| 435 EXPECT_TRUE(file_util::PathExists(test_path)); | 435 EXPECT_TRUE(base::PathExists(test_path)); |
| 436 return net::FilePathToFileURL(test_path); | 436 return net::FilePathToFileURL(test_path); |
| 437 } | 437 } |
| 438 | 438 |
| 439 void WebUIBrowserTest::OnJsInjectionReady(RenderViewHost* render_view_host) { | 439 void WebUIBrowserTest::OnJsInjectionReady(RenderViewHost* render_view_host) { |
| 440 PreLoadJavascriptLibraries(preload_test_fixture_, preload_test_name_, | 440 PreLoadJavascriptLibraries(preload_test_fixture_, preload_test_name_, |
| 441 render_view_host); | 441 render_view_host); |
| 442 } | 442 } |
| 443 | 443 |
| 444 void WebUIBrowserTest::BuildJavascriptLibraries(string16* content) { | 444 void WebUIBrowserTest::BuildJavascriptLibraries(string16* content) { |
| 445 ASSERT_TRUE(content != NULL); | 445 ASSERT_TRUE(content != NULL); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 // testDone directly and expect pass result. | 769 // testDone directly and expect pass result. |
| 770 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { | 770 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPassesAsync) { |
| 771 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); | 771 ASSERT_TRUE(RunJavascriptAsyncTest("testDone")); |
| 772 } | 772 } |
| 773 | 773 |
| 774 // Test that calling testDone during RunJavascriptTest still completes when | 774 // Test that calling testDone during RunJavascriptTest still completes when |
| 775 // waiting for async result. | 775 // waiting for async result. |
| 776 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { | 776 IN_PROC_BROWSER_TEST_F(WebUIBrowserAsyncTest, TestTestDoneEarlyPasses) { |
| 777 ASSERT_TRUE(RunJavascriptTest("testDone")); | 777 ASSERT_TRUE(RunJavascriptTest("testDone")); |
| 778 } | 778 } |
| OLD | NEW |