OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 SessionRestoreUITest() : UITest() { | 25 SessionRestoreUITest() : UITest() { |
26 FilePath path_prefix = test_data_directory_.AppendASCII("session_history"); | 26 FilePath path_prefix = test_data_directory_.AppendASCII("session_history"); |
27 | 27 |
28 url1_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html")); | 28 url1_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot1.html")); |
29 url2_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot2.html")); | 29 url2_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot2.html")); |
30 url3_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot3.html")); | 30 url3_ = net::FilePathToFileURL(path_prefix.AppendASCII("bot3.html")); |
31 } | 31 } |
32 | 32 |
33 virtual void QuitBrowserAndRestore(int expected_tab_count) { | 33 virtual void QuitBrowserAndRestore(int expected_tab_count) { |
34 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
35 shutdown_type_ = UITestBase::USER_QUIT; | 35 shutdown_type_ = ProxyLauncher::USER_QUIT; |
36 #endif | 36 #endif |
37 UITest::TearDown(); | 37 UITest::TearDown(); |
38 | 38 |
39 clear_profile_ = false; | 39 clear_profile_ = false; |
40 | 40 |
41 launch_arguments_.AppendSwitchASCII(switches::kRestoreLastSession, | 41 launch_arguments_.AppendSwitchASCII(switches::kRestoreLastSession, |
42 base::IntToString(expected_tab_count)); | 42 base::IntToString(expected_tab_count)); |
43 UITest::SetUp(); | 43 UITest::SetUp(); |
44 } | 44 } |
45 | 45 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 437 } |
438 | 438 |
439 // Make sure after a restore the number of processes matches that of the number | 439 // Make sure after a restore the number of processes matches that of the number |
440 // of processes running before the restore. This creates a new tab so that | 440 // of processes running before the restore. This creates a new tab so that |
441 // we should have two new tabs running. (This test will pass in both | 441 // we should have two new tabs running. (This test will pass in both |
442 // process-per-site and process-per-site-instance, because we treat the new tab | 442 // process-per-site and process-per-site-instance, because we treat the new tab |
443 // as a special case in process-per-site-instance so that it only ever uses one | 443 // as a special case in process-per-site-instance so that it only ever uses one |
444 // process.) | 444 // process.) |
445 // Flaky as per http://crbug.com/52022 | 445 // Flaky as per http://crbug.com/52022 |
446 TEST_F(SessionRestoreUITest, FLAKY_ShareProcessesOnRestore) { | 446 TEST_F(SessionRestoreUITest, FLAKY_ShareProcessesOnRestore) { |
447 if (in_process_renderer()) { | 447 if (ProxyLauncher::in_process_renderer()) { |
448 // No point in running this test in single process mode. | 448 // No point in running this test in single process mode. |
449 return; | 449 return; |
450 } | 450 } |
451 | 451 |
452 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 452 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
453 ASSERT_TRUE(browser_proxy.get() != NULL); | 453 ASSERT_TRUE(browser_proxy.get() != NULL); |
454 int tab_count; | 454 int tab_count; |
455 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 455 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
456 | 456 |
457 // Create two new tabs. | 457 // Create two new tabs. |
(...skipping 21 matching lines...) Expand all Loading... |
479 ASSERT_TRUE(tab_proxy.get() != NULL); | 479 ASSERT_TRUE(tab_proxy.get() != NULL); |
480 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); | 480 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); |
481 tab_proxy = browser_proxy->GetTab(tab_count - 1); | 481 tab_proxy = browser_proxy->GetTab(tab_count - 1); |
482 ASSERT_TRUE(tab_proxy.get() != NULL); | 482 ASSERT_TRUE(tab_proxy.get() != NULL); |
483 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); | 483 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); |
484 | 484 |
485 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); | 485 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); |
486 } | 486 } |
487 | 487 |
488 } // namespace | 488 } // namespace |
OLD | NEW |