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 "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
10 | 10 |
11 typedef UITest ChromeMainTest; | 11 typedef UITest ChromeMainTest; |
12 | 12 |
13 #if !defined(OS_MACOSX) | 13 #if !defined(OS_MACOSX) |
14 // These tests don't apply to the Mac version; see | 14 // These tests don't apply to the Mac version; see |
15 // LaunchAnotherBrowserBlockUntilClosed for details. | 15 // LaunchAnotherBrowserBlockUntilClosed for details. |
16 | 16 |
17 // Make sure that the second invocation creates a new window. | 17 // Make sure that the second invocation creates a new window. |
18 TEST_F(ChromeMainTest, SecondLaunch) { | 18 TEST_F(ChromeMainTest, SecondLaunch) { |
19 include_testing_id_ = false; | 19 include_testing_id_ = false; |
20 | 20 |
21 ASSERT_TRUE(LaunchAnotherBrowserBlockUntilClosed( | 21 ASSERT_TRUE(LaunchAnotherBrowserBlockUntilClosed( |
22 CommandLine(CommandLine::ARGUMENTS_ONLY))); | 22 CommandLine(CommandLine::NO_PROGRAM))); |
23 | 23 |
24 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2)); | 24 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2)); |
25 } | 25 } |
26 | 26 |
27 TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { | 27 TEST_F(ChromeMainTest, ReuseBrowserInstanceWhenOpeningFile) { |
28 include_testing_id_ = false; | 28 include_testing_id_ = false; |
29 | 29 |
30 FilePath test_file = test_data_directory_.AppendASCII("empty.html"); | 30 FilePath test_file = test_data_directory_.AppendASCII("empty.html"); |
31 | 31 |
32 CommandLine command_line(CommandLine::ARGUMENTS_ONLY); | 32 CommandLine command_line(CommandLine::NO_PROGRAM); |
33 command_line.AppendArgPath(test_file); | 33 command_line.AppendArgPath(test_file); |
34 ASSERT_TRUE(LaunchAnotherBrowserBlockUntilClosed(command_line)); | 34 ASSERT_TRUE(LaunchAnotherBrowserBlockUntilClosed(command_line)); |
35 | 35 |
36 ASSERT_TRUE(automation()->IsURLDisplayed(net::FilePathToFileURL(test_file))); | 36 ASSERT_TRUE(automation()->IsURLDisplayed(net::FilePathToFileURL(test_file))); |
37 } | 37 } |
38 #endif // !OS_MACOSX | 38 #endif // !OS_MACOSX |
OLD | NEW |