| 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/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 "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 NavigateToURL(url1_); | 345 NavigateToURL(url1_); |
| 346 | 346 |
| 347 // Make sure we have one window. | 347 // Make sure we have one window. |
| 348 int initial_window_count; | 348 int initial_window_count; |
| 349 ASSERT_TRUE(automation()->GetBrowserWindowCount(&initial_window_count)); | 349 ASSERT_TRUE(automation()->GetBrowserWindowCount(&initial_window_count)); |
| 350 ASSERT_EQ(1, initial_window_count); | 350 ASSERT_EQ(1, initial_window_count); |
| 351 | 351 |
| 352 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 352 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 353 ASSERT_TRUE(browser_proxy.get()); | 353 ASSERT_TRUE(browser_proxy.get()); |
| 354 | 354 |
| 355 // Create an off the record window. | 355 // Create an incognito window. |
| 356 ASSERT_TRUE(browser_proxy->RunCommand(IDC_NEW_INCOGNITO_WINDOW)); | 356 ASSERT_TRUE(browser_proxy->RunCommand(IDC_NEW_INCOGNITO_WINDOW)); |
| 357 int window_count; | 357 int window_count; |
| 358 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); | 358 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); |
| 359 ASSERT_EQ(2, window_count); | 359 ASSERT_EQ(2, window_count); |
| 360 | 360 |
| 361 // Close the first window. | 361 // Close the first window. |
| 362 CloseWindow(0, 2); | 362 CloseWindow(0, 2); |
| 363 browser_proxy = NULL; | 363 browser_proxy = NULL; |
| 364 | 364 |
| 365 // Launch the browser again. Note, this doesn't spawn a new process, instead | 365 // Launch the browser again. Note, this doesn't spawn a new process, instead |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored( | 489 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored( |
| 490 TestTimeouts::action_max_timeout_ms())); | 490 TestTimeouts::action_max_timeout_ms())); |
| 491 } | 491 } |
| 492 | 492 |
| 493 int process_count = 0; | 493 int process_count = 0; |
| 494 ASSERT_TRUE(GetBrowserProcessCount(&process_count)); | 494 ASSERT_TRUE(GetBrowserProcessCount(&process_count)); |
| 495 ASSERT_EQ(expected_process_count, process_count); | 495 ASSERT_EQ(expected_process_count, process_count); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace | 498 } // namespace |
| OLD | NEW |