| 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 "chrome/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { | 61 TEST_F(ChromeMainTest, SecondLaunchFromIncognitoWithNormalUrl) { |
| 62 include_testing_id_ = false; | 62 include_testing_id_ = false; |
| 63 int num_normal_windows; | 63 int num_normal_windows; |
| 64 // We should start with one normal window. | 64 // We should start with one normal window. |
| 65 ASSERT_TRUE(automation()->GetNormalBrowserWindowCount(&num_normal_windows)); | 65 ASSERT_TRUE(automation()->GetNormalBrowserWindowCount(&num_normal_windows)); |
| 66 ASSERT_EQ(1, num_normal_windows); | 66 ASSERT_EQ(1, num_normal_windows); |
| 67 | 67 |
| 68 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 68 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 69 ASSERT_TRUE(browser_proxy.get()); | 69 ASSERT_TRUE(browser_proxy.get()); |
| 70 | 70 |
| 71 // Create an off the record window. | 71 // Create an incognito window. |
| 72 ASSERT_TRUE(browser_proxy->RunCommand(IDC_NEW_INCOGNITO_WINDOW)); | 72 ASSERT_TRUE(browser_proxy->RunCommand(IDC_NEW_INCOGNITO_WINDOW)); |
| 73 int window_count; | 73 int window_count; |
| 74 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); | 74 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); |
| 75 ASSERT_EQ(2, window_count); | 75 ASSERT_EQ(2, window_count); |
| 76 ASSERT_TRUE(automation()->GetNormalBrowserWindowCount(&num_normal_windows)); | 76 ASSERT_TRUE(automation()->GetNormalBrowserWindowCount(&num_normal_windows)); |
| 77 ASSERT_EQ(1, num_normal_windows); | 77 ASSERT_EQ(1, num_normal_windows); |
| 78 | 78 |
| 79 // Close the first window. | 79 // Close the first window. |
| 80 ASSERT_TRUE(browser_proxy->RunCommand(IDC_CLOSE_WINDOW)); | 80 ASSERT_TRUE(browser_proxy->RunCommand(IDC_CLOSE_WINDOW)); |
| 81 browser_proxy = NULL; | 81 browser_proxy = NULL; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 92 command_line.AppendArgPath(test_file); | 92 command_line.AppendArgPath(test_file); |
| 93 ASSERT_TRUE(LaunchAnotherBrowserBlockUntilClosed(command_line)); | 93 ASSERT_TRUE(LaunchAnotherBrowserBlockUntilClosed(command_line)); |
| 94 | 94 |
| 95 // There should be one normal and one incognito window now. | 95 // There should be one normal and one incognito window now. |
| 96 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2)); | 96 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2)); |
| 97 ASSERT_TRUE(automation()->GetNormalBrowserWindowCount(&num_normal_windows)); | 97 ASSERT_TRUE(automation()->GetNormalBrowserWindowCount(&num_normal_windows)); |
| 98 ASSERT_EQ(1, num_normal_windows); | 98 ASSERT_EQ(1, num_normal_windows); |
| 99 } | 99 } |
| 100 | 100 |
| 101 #endif // !OS_MACOSX | 101 #endif // !OS_MACOSX |
| OLD | NEW |