| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Get a handle to the restored tab. | 87 // Get a handle to the restored tab. |
| 88 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 88 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
| 89 ASSERT_GT(tab_count, expected_tabstrip_index); | 89 ASSERT_GT(tab_count, expected_tabstrip_index); |
| 90 scoped_refptr<TabProxy> restored_tab_proxy( | 90 scoped_refptr<TabProxy> restored_tab_proxy( |
| 91 browser_proxy->GetTab(expected_tabstrip_index)); | 91 browser_proxy->GetTab(expected_tabstrip_index)); |
| 92 ASSERT_TRUE(restored_tab_proxy.get()); | 92 ASSERT_TRUE(restored_tab_proxy.get()); |
| 93 // Wait for the restored tab to finish loading. | 93 // Wait for the restored tab to finish loading. |
| 94 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored( | 94 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored( |
| 95 action_max_timeout_ms())); | 95 TestTimeouts::action_max_timeout_ms())); |
| 96 | 96 |
| 97 // Ensure that the tab and window are active. | 97 // Ensure that the tab and window are active. |
| 98 CheckActiveWindow(browser_proxy.get()); | 98 CheckActiveWindow(browser_proxy.get()); |
| 99 EXPECT_EQ(expected_tabstrip_index, | 99 EXPECT_EQ(expected_tabstrip_index, |
| 100 GetActiveTabIndex(expected_window_index)); | 100 GetActiveTabIndex(expected_window_index)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Adds tabs to the given browser, all navigated to url1_. Returns | 103 // Adds tabs to the given browser, all navigated to url1_. Returns |
| 104 // the final number of tabs. | 104 // the final number of tabs. |
| 105 int AddSomeTabs(BrowserProxy* browser, int how_many) { | 105 int AddSomeTabs(BrowserProxy* browser, int how_many) { |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 ASSERT_TRUE(tab->WaitForTabToBeRestored(TestTimeouts::action_timeout_ms())); | 672 ASSERT_TRUE(tab->WaitForTabToBeRestored(TestTimeouts::action_timeout_ms())); |
| 673 GURL url; | 673 GURL url; |
| 674 ASSERT_TRUE(tab->GetCurrentURL(&url)); | 674 ASSERT_TRUE(tab->GetCurrentURL(&url)); |
| 675 ASSERT_EQ(http_url, url); | 675 ASSERT_EQ(http_url, url); |
| 676 | 676 |
| 677 // Go back, and see if content is as expected. | 677 // Go back, and see if content is as expected. |
| 678 ASSERT_TRUE(tab->GoBack()); | 678 ASSERT_TRUE(tab->GoBack()); |
| 679 EXPECT_TRUE(tab->FindInPage(std::wstring(L"webkit"), FWD, IGNORE_CASE, false, | 679 EXPECT_TRUE(tab->FindInPage(std::wstring(L"webkit"), FWD, IGNORE_CASE, false, |
| 680 NULL)); | 680 NULL)); |
| 681 } | 681 } |
| OLD | NEW |