| 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_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
| 10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // First restore the settings so we can connect to the browser. | 431 // First restore the settings so we can connect to the browser. |
| 432 include_testing_id_ = include_testing_id_orig; | 432 include_testing_id_ = include_testing_id_orig; |
| 433 // Restore the session with 1 tab. | 433 // Restore the session with 1 tab. |
| 434 QuitBrowserAndRestore(1); | 434 QuitBrowserAndRestore(1); |
| 435 | 435 |
| 436 AssertOneWindowWithOneTab(); | 436 AssertOneWindowWithOneTab(); |
| 437 | 437 |
| 438 ASSERT_EQ(url1_, GetActiveTabURL()); | 438 ASSERT_EQ(url1_, GetActiveTabURL()); |
| 439 } | 439 } |
| 440 | 440 |
| 441 #if defined(OS_LINUX) || defined(OS_MACOSX) |
| 442 // Flaky, sometimes times out: http://crbug.com/52022 |
| 443 #define MAYBE_ShareProcessesOnRestore FLAKY_ShareProcessesOnRestore |
| 444 #else |
| 445 #define MAYBE_ShareProcessesOnRestore ShareProcessesOnRestore |
| 446 #endif |
| 441 // Make sure after a restore the number of processes matches that of the number | 447 // Make sure after a restore the number of processes matches that of the number |
| 442 // of processes running before the restore. This creates a new tab so that | 448 // of processes running before the restore. This creates a new tab so that |
| 443 // we should have two new tabs running. (This test will pass in both | 449 // we should have two new tabs running. (This test will pass in both |
| 444 // process-per-site and process-per-site-instance, because we treat the new tab | 450 // process-per-site and process-per-site-instance, because we treat the new tab |
| 445 // as a special case in process-per-site-instance so that it only ever uses one | 451 // as a special case in process-per-site-instance so that it only ever uses one |
| 446 // process.) | 452 // process.) |
| 447 TEST_F(SessionRestoreUITest, ShareProcessesOnRestore) { | 453 TEST_F(SessionRestoreUITest, MAYBE_ShareProcessesOnRestore) { |
| 448 if (in_process_renderer()) { | 454 if (in_process_renderer()) { |
| 449 // No point in running this test in single process mode. | 455 // No point in running this test in single process mode. |
| 450 return; | 456 return; |
| 451 } | 457 } |
| 452 | 458 |
| 453 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 459 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 454 ASSERT_TRUE(browser_proxy.get() != NULL); | 460 ASSERT_TRUE(browser_proxy.get() != NULL); |
| 455 int tab_count; | 461 int tab_count; |
| 456 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 462 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
| 457 | 463 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 480 ASSERT_TRUE(tab_proxy.get() != NULL); | 486 ASSERT_TRUE(tab_proxy.get() != NULL); |
| 481 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); | 487 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); |
| 482 tab_proxy = browser_proxy->GetTab(tab_count - 1); | 488 tab_proxy = browser_proxy->GetTab(tab_count - 1); |
| 483 ASSERT_TRUE(tab_proxy.get() != NULL); | 489 ASSERT_TRUE(tab_proxy.get() != NULL); |
| 484 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); | 490 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_max_timeout_ms())); |
| 485 | 491 |
| 486 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); | 492 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); |
| 487 } | 493 } |
| 488 | 494 |
| 489 } // namespace | 495 } // namespace |
| OLD | NEW |