Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/common/chrome_constants.h" | |
| 6 #include "chrome/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 7 | 6 |
| 7 #include "base/command_line.h" | |
| 8 #include "base/file_path.h" | |
| 9 #include "base/file_util.h" | |
| 10 #include "net/base/net_util.h" | |
| 11 | |
| 8 typedef UITest ChromeMainTest; | 12 typedef UITest ChromeMainTest; |
| 9 | 13 |
| 10 // Launch the app, then close the app. | 14 // Launch the app, then close the app. |
| 11 TEST_F(ChromeMainTest, AppLaunch) { | 15 TEST_F(ChromeMainTest, AppLaunch) { |
| 12 // If we make it here at all, we've succeeded in retrieving the app window | 16 // If we make it here at all, we've succeeded in retrieving the app window |
| 13 // in UITest::SetUp()--otherwise we'd fail with an exception in SetUp(). | 17 // in UITest::SetUp()--otherwise we'd fail with an exception in SetUp(). |
| 14 | 18 |
| 15 if (UITest::in_process_renderer()) { | 19 if (UITest::in_process_renderer()) { |
| 16 EXPECT_EQ(1, UITest::GetBrowserProcessCount()); | 20 EXPECT_EQ(1, UITest::GetBrowserProcessCount()); |
| 17 } else { | 21 } else { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 37 use_existing_browser_ = true; | 41 use_existing_browser_ = true; |
| 38 | 42 |
| 39 LaunchBrowser(CommandLine(L""), false); | 43 LaunchBrowser(CommandLine(L""), false); |
| 40 | 44 |
| 41 int window_count; | 45 int window_count; |
| 42 ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count, | 46 ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count, |
| 43 action_timeout_ms())); | 47 action_timeout_ms())); |
| 44 ASSERT_EQ(2, window_count); | 48 ASSERT_EQ(2, window_count); |
| 45 } | 49 } |
| 46 | 50 |
| 51 TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { | |
| 52 include_testing_id_ = false; | |
| 53 use_existing_browser_ = true; | |
| 54 | |
| 55 std::wstring test_file = test_data_directory_; | |
| 56 file_util::AppendToPath(&test_file, L"empty.html"); | |
| 57 | |
| 58 CommandLine command_line(L""); | |
| 59 command_line.AppendLooseValue(test_file); | |
| 60 | |
| 61 LaunchBrowser(command_line, false); | |
| 62 | |
| 63 FilePath test_file_path(FilePath::FromWStringHack(test_file)); | |
| 64 | |
| 65 ASSERT_TRUE(automation()->WaitForURLDisplayed( | |
| 66 net::FilePathToFileURL(test_file_path), action_timeout_ms())); | |
|
Nicolas Sylvain
2009/03/06 20:50:46
did we understand why it's creating a window inste
| |
| 67 } | |
| OLD | NEW |