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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #ifdef SIMULATE_RUN | 85 #ifdef SIMULATE_RUN |
86 *total = L"100"; | 86 *total = L"100"; |
87 const wchar_t* kBogusFailures[] = { | 87 const wchar_t* kBogusFailures[] = { |
88 L"5.selectFrame,6.click,24.selectAndWait,24.verifyTitle", | 88 L"5.selectFrame,6.click,24.selectAndWait,24.verifyTitle", |
89 L"5.selectFrame,6.click,13.verifyLocation,13.verifyLocation,13.click," | 89 L"5.selectFrame,6.click,13.verifyLocation,13.verifyLocation,13.click," |
90 L"24.selectAndWait,24.verifyTitle", | 90 L"24.selectAndWait,24.verifyTitle", |
91 L"5.selectFrame,6.click,24.selectAndWait" | 91 L"5.selectFrame,6.click,24.selectAndWait" |
92 }; | 92 }; |
93 *failed = kBogusFailures[base::RandInt(0, 2)]; | 93 *failed = kBogusFailures[base::RandInt(0, 2)]; |
94 #else | 94 #else |
95 std::wstring test_path; | 95 FilePath test_path; |
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 test_path = test_path.DirName(); |
98 file_util::UpOneDirectory(&test_path); | 98 test_path = test_path.DirName(); |
99 file_util::UpOneDirectory(&test_path); | 99 test_path = test_path.DirName(); |
100 file_util::AppendToPath(&test_path, L"data"); | 100 test_path = test_path.AppendASCII("data"); |
101 file_util::AppendToPath(&test_path, L"selenium_core"); | 101 test_path = test_path.AppendASCII("selenium_core"); |
102 file_util::AppendToPath(&test_path, L"core"); | 102 test_path = test_path.AppendASCII("core"); |
103 file_util::AppendToPath(&test_path, L"TestRunner.html"); | 103 test_path = test_path.AppendASCII("TestRunner.html"); |
104 | 104 |
105 GURL test_url(net::FilePathToFileURL(FilePath::FromWStringHack(test_path))); | 105 GURL test_url(net::FilePathToFileURL(test_path)); |
106 scoped_refptr<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)); |
(...skipping 48 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 |