OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
6 | 6 |
7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #endif | 10 #endif |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 void UITestBase::NavigateToURLAsync(const GURL& url) { | 265 void UITestBase::NavigateToURLAsync(const GURL& url) { |
266 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 266 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
267 ASSERT_TRUE(tab_proxy.get()); | 267 ASSERT_TRUE(tab_proxy.get()); |
268 ASSERT_TRUE(tab_proxy->NavigateToURLAsync(url)); | 268 ASSERT_TRUE(tab_proxy->NavigateToURLAsync(url)); |
269 } | 269 } |
270 | 270 |
271 void UITestBase::NavigateToURL(const GURL& url) { | 271 void UITestBase::NavigateToURL(const GURL& url) { |
272 NavigateToURL(url, 0, GetActiveTabIndex(0)); | 272 NavigateToURL(url, 0, GetActiveTabIndex(0)); |
273 } | 273 } |
274 | 274 |
| 275 void UITestBase::NavigateToURL(const GURL& url, int window_index) { |
| 276 NavigateToURL(url, window_index, GetActiveTabIndex(window_index)); |
| 277 } |
| 278 |
275 void UITestBase::NavigateToURL(const GURL& url, int window_index, int | 279 void UITestBase::NavigateToURL(const GURL& url, int window_index, int |
276 tab_index) { | 280 tab_index) { |
277 NavigateToURLBlockUntilNavigationsComplete(url, 1, window_index, tab_index); | 281 NavigateToURLBlockUntilNavigationsComplete(url, 1, window_index, tab_index); |
278 } | 282 } |
279 | 283 |
280 void UITestBase::NavigateToURLBlockUntilNavigationsComplete( | 284 void UITestBase::NavigateToURLBlockUntilNavigationsComplete( |
281 const GURL& url, int number_of_navigations) { | 285 const GURL& url, int number_of_navigations) { |
282 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 286 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
283 ASSERT_TRUE(tab_proxy.get()); | 287 ASSERT_TRUE(tab_proxy.get()); |
284 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 288 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 incorrect_state_count++; | 851 incorrect_state_count++; |
848 } | 852 } |
849 | 853 |
850 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() | 854 LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF() |
851 << " seconds" | 855 << " seconds" |
852 << " call failed " << fail_count << " times" | 856 << " call failed " << fail_count << " times" |
853 << " state was incorrect " << incorrect_state_count << " times"; | 857 << " state was incorrect " << incorrect_state_count << " times"; |
854 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; | 858 ADD_FAILURE() << "Timeout reached in " << __FUNCTION__; |
855 return false; | 859 return false; |
856 } | 860 } |
OLD | NEW |