OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_list.h" | 12 #include "chrome/browser/ui/browser_list.h" |
13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
19 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
20 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "net/base/net_util.h" | 22 #include "net/base/net_util.h" |
23 | 23 |
24 // These tests don't apply to the Mac version; see GetCommandLineForRelaunch | 24 // These tests don't apply to the Mac version; see GetCommandLineForRelaunch |
25 // for details. | 25 // for details. |
26 #if !defined(OS_MACOSX) | 26 #if !defined(OS_MACOSX) |
27 | 27 |
28 // These tests hang on the build/try bot but pass locally with chromeos=1 | |
29 // builds. jam is investigatin | |
30 #if !defined(OS_CHROMEOS) | |
31 | |
32 class ChromeMainTest : public InProcessBrowserTest { | 28 class ChromeMainTest : public InProcessBrowserTest { |
33 public: | 29 public: |
34 ChromeMainTest() {} | 30 ChromeMainTest() {} |
35 | 31 |
36 void Relaunch(const CommandLine& new_command_line) { | 32 void Relaunch(const CommandLine& new_command_line) { |
37 base::LaunchProcess(new_command_line, base::LaunchOptions(), NULL); | 33 base::LaunchProcess(new_command_line, base::LaunchOptions(), NULL); |
38 } | 34 } |
39 }; | 35 }; |
40 | 36 |
41 // Make sure that the second invocation creates a new window. | 37 // Make sure that the second invocation creates a new window. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 chrome::NOTIFICATION_TAB_ADDED, | 116 chrome::NOTIFICATION_TAB_ADDED, |
121 content::NotificationService::AllSources()); | 117 content::NotificationService::AllSources()); |
122 Relaunch(new_command_line); | 118 Relaunch(new_command_line); |
123 tab_observer.Wait(); | 119 tab_observer.Wait(); |
124 | 120 |
125 // There should be one normal and one incognito window now. | 121 // There should be one normal and one incognito window now. |
126 ASSERT_EQ(2u, BrowserList::size()); | 122 ASSERT_EQ(2u, BrowserList::size()); |
127 ASSERT_EQ(1u, BrowserList::GetBrowserCountForType(profile, true)); | 123 ASSERT_EQ(1u, BrowserList::GetBrowserCountForType(profile, true)); |
128 } | 124 } |
129 | 125 |
130 #endif // !OS_CHROMEOS | |
131 | |
132 #endif // !OS_MACOSX | 126 #endif // !OS_MACOSX |
OLD | NEW |