| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 void UITest::NavigateToURLAsync(const GURL& url) { | 569 void UITest::NavigateToURLAsync(const GURL& url) { |
| 570 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 570 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 571 ASSERT_TRUE(tab_proxy.get()); | 571 ASSERT_TRUE(tab_proxy.get()); |
| 572 if (!tab_proxy.get()) | 572 if (!tab_proxy.get()) |
| 573 return; | 573 return; |
| 574 | 574 |
| 575 tab_proxy->NavigateToURLAsync(url); | 575 tab_proxy->NavigateToURLAsync(url); |
| 576 } | 576 } |
| 577 | 577 |
| 578 void UITest::NavigateToURL(const GURL& url) { | 578 void UITest::NavigateToURL(const GURL& url) { |
| 579 NavigateToURLBlockUntilNavigationsComplete(url, 1); |
| 580 } |
| 581 |
| 582 void UITest::NavigateToURLBlockUntilNavigationsComplete( |
| 583 const GURL& url, int number_of_navigations) { |
| 579 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); | 584 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 580 ASSERT_TRUE(tab_proxy.get()); | 585 ASSERT_TRUE(tab_proxy.get()); |
| 581 if (!tab_proxy.get()) | 586 if (!tab_proxy.get()) |
| 582 return; | 587 return; |
| 583 | 588 |
| 584 bool is_timeout = true; | 589 bool is_timeout = true; |
| 585 ASSERT_TRUE(tab_proxy->NavigateToURLWithTimeout( | 590 ASSERT_TRUE(tab_proxy->NavigateToURLWithTimeout( |
| 586 url, command_execution_timeout_ms(), &is_timeout)) << url.spec(); | 591 url, number_of_navigations, command_execution_timeout_ms(), |
| 592 &is_timeout)) << url.spec(); |
| 587 ASSERT_FALSE(is_timeout) << url.spec(); | 593 ASSERT_FALSE(is_timeout) << url.spec(); |
| 588 } | 594 } |
| 589 | 595 |
| 590 bool UITest::WaitForDownloadShelfVisible(BrowserProxy* browser) { | 596 bool UITest::WaitForDownloadShelfVisible(BrowserProxy* browser) { |
| 591 return WaitForDownloadShelfVisibilityChange(browser, true); | 597 return WaitForDownloadShelfVisibilityChange(browser, true); |
| 592 } | 598 } |
| 593 | 599 |
| 594 bool UITest::WaitForDownloadShelfInvisible(BrowserProxy* browser) { | 600 bool UITest::WaitForDownloadShelfInvisible(BrowserProxy* browser) { |
| 595 return WaitForDownloadShelfVisibilityChange(browser, false); | 601 return WaitForDownloadShelfVisibilityChange(browser, false); |
| 596 } | 602 } |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 } else if (profile_type == UITest::NATIVE_THEME) { | 1022 } else if (profile_type == UITest::NATIVE_THEME) { |
| 1017 source_history_file = source_history_file.AppendASCII("profiles") | 1023 source_history_file = source_history_file.AppendASCII("profiles") |
| 1018 .AppendASCII("gtk_theme"); | 1024 .AppendASCII("gtk_theme"); |
| 1019 } else { | 1025 } else { |
| 1020 NOTREACHED(); | 1026 NOTREACHED(); |
| 1021 } | 1027 } |
| 1022 return source_history_file; | 1028 return source_history_file; |
| 1023 } | 1029 } |
| 1024 | 1030 |
| 1025 | 1031 |
| OLD | NEW |