OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This is a gTest-based test that runs the Selenium Core testsuite in Chrome | 5 // This is a gTest-based test that runs the Selenium Core testsuite in Chrome |
6 // using the UITest automation. The number of total and failed tests are | 6 // using the UITest automation. The number of total and failed tests are |
7 // written to stdout. | 7 // written to stdout. |
8 // | 8 // |
9 // TODO(darin): output the names of the failed tests so we can easily track | 9 // TODO(darin): output the names of the failed tests so we can easily track |
10 // deviations from the expected output. | 10 // deviations from the expected output. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 PathService::Get(chrome::DIR_TEST_DATA, &test_path); | 96 PathService::Get(chrome::DIR_TEST_DATA, &test_path); |
97 file_util::UpOneDirectory(&test_path); | 97 file_util::UpOneDirectory(&test_path); |
98 file_util::UpOneDirectory(&test_path); | 98 file_util::UpOneDirectory(&test_path); |
99 file_util::UpOneDirectory(&test_path); | 99 file_util::UpOneDirectory(&test_path); |
100 file_util::AppendToPath(&test_path, L"data"); | 100 file_util::AppendToPath(&test_path, L"data"); |
101 file_util::AppendToPath(&test_path, L"selenium_core"); | 101 file_util::AppendToPath(&test_path, L"selenium_core"); |
102 file_util::AppendToPath(&test_path, L"core"); | 102 file_util::AppendToPath(&test_path, L"core"); |
103 file_util::AppendToPath(&test_path, L"TestRunner.html"); | 103 file_util::AppendToPath(&test_path, L"TestRunner.html"); |
104 | 104 |
105 GURL test_url(net::FilePathToFileURL(FilePath::FromWStringHack(test_path))); | 105 GURL test_url(net::FilePathToFileURL(FilePath::FromWStringHack(test_path))); |
106 scoped_ptr<TabProxy> tab(GetActiveTab()); | 106 scoped_refptr<TabProxy> tab(GetActiveTab()); |
107 tab->NavigateToURL(test_url); | 107 tab->NavigateToURL(test_url); |
108 | 108 |
109 // Wait for the test to finish. | 109 // Wait for the test to finish. |
110 ASSERT_TRUE(WaitUntilCookieValue(tab.get(), test_url, "__tests_finished", | 110 ASSERT_TRUE(WaitUntilCookieValue(tab.get(), test_url, "__tests_finished", |
111 3000, UITest::test_timeout_ms(), "1")); | 111 3000, UITest::test_timeout_ms(), "1")); |
112 | 112 |
113 std::string cookie; | 113 std::string cookie; |
114 ASSERT_TRUE(tab->GetCookieByName(test_url, "__num_tests_total", &cookie)); | 114 ASSERT_TRUE(tab->GetCookieByName(test_url, "__num_tests_total", &cookie)); |
115 total->swap(UTF8ToWide(cookie)); | 115 total->swap(UTF8ToWide(cookie)); |
116 ASSERT_FALSE(total->empty()); | 116 ASSERT_FALSE(total->empty()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 if (!new_passes_list.empty()) { | 166 if (!new_passes_list.empty()) { |
167 printf("new tests passing:\n"); | 167 printf("new tests passing:\n"); |
168 ResultsList::const_iterator it = new_passes_list.begin(); | 168 ResultsList::const_iterator it = new_passes_list.begin(); |
169 for (; it != new_passes_list.end(); ++it) | 169 for (; it != new_passes_list.end(); ++it) |
170 printf(" %s\n", it->c_str()); | 170 printf(" %s\n", it->c_str()); |
171 printf("\n"); | 171 printf("\n"); |
172 } | 172 } |
173 } | 173 } |
OLD | NEW |