| 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? | 99 BrowserInit::IsFirstRun first_run = FirstRun::IsChromeFirstRun() ? |
| 100 BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; | 100 BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
| 101 BrowserInit::LaunchWithProfile launch(FilePath(), dummy, first_run); | 101 BrowserInit::LaunchWithProfile launch(FilePath(), dummy, first_run); |
| 102 // This should create a new window, but re-use the profile from |popup|. If | 102 // This should create a new window, but re-use the profile from |popup|. If |
| 103 // it used a NULL or invalid profile, it would crash. | 103 // it used a NULL or invalid profile, it would crash. |
| 104 launch.OpenURLsInBrowser(popup, false, urls); | 104 launch.OpenURLsInBrowser(popup, false, urls); |
| 105 ASSERT_NE(popup, observer.added_browser_); | 105 ASSERT_NE(popup, observer.added_browser_); |
| 106 BrowserList::RemoveObserver(&observer); | 106 BrowserList::RemoveObserver(&observer); |
| 107 } | 107 } |
| 108 | 108 |
| 109 #if defined(USE_AURA) |
| 110 // Fails on aura. See crbug.com/106248. |
| 111 #define MAYBE_StartupURLsOnNewWindowWithNoTabbedBrowsers DISABLED_StartupURLsOnN
ewWindowWithNoTabbedBrowsers |
| 112 #else |
| 113 #define MAYBE_StartupURLsOnNewWindowWithNoTabbedBrowsers StartupURLsOnNewWindowW
ithNoTabbedBrowsers |
| 114 #endif |
| 115 |
| 109 // Verify that startup URLs are honored when the process already exists but has | 116 // Verify that startup URLs are honored when the process already exists but has |
| 110 // no tabbed browser windows (eg. as if the process is running only due to a | 117 // no tabbed browser windows (eg. as if the process is running only due to a |
| 111 // background application. | 118 // background application. |
| 112 IN_PROC_BROWSER_TEST_F(BrowserInitTest, | 119 IN_PROC_BROWSER_TEST_F(BrowserInitTest, |
| 113 StartupURLsOnNewWindowWithNoTabbedBrowsers) { | 120 MAYBE_StartupURLsOnNewWindowWithNoTabbedBrowsers) { |
| 114 // Use a couple arbitrary URLs. | 121 // Use a couple arbitrary URLs. |
| 115 std::vector<GURL> urls; | 122 std::vector<GURL> urls; |
| 116 urls.push_back(ui_test_utils::GetTestUrl( | 123 urls.push_back(ui_test_utils::GetTestUrl( |
| 117 FilePath(FilePath::kCurrentDirectory), | 124 FilePath(FilePath::kCurrentDirectory), |
| 118 FilePath(FILE_PATH_LITERAL("title1.html")))); | 125 FilePath(FILE_PATH_LITERAL("title1.html")))); |
| 119 urls.push_back(ui_test_utils::GetTestUrl( | 126 urls.push_back(ui_test_utils::GetTestUrl( |
| 120 FilePath(FilePath::kCurrentDirectory), | 127 FilePath(FilePath::kCurrentDirectory), |
| 121 FilePath(FILE_PATH_LITERAL("title2.html")))); | 128 FilePath(FILE_PATH_LITERAL("title2.html")))); |
| 122 | 129 |
| 123 // Set the startup preference to open these URLs. | 130 // Set the startup preference to open these URLs. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // Expect an app panel. | 298 // Expect an app panel. |
| 292 EXPECT_TRUE(new_browser->is_type_panel() && new_browser->is_app()); | 299 EXPECT_TRUE(new_browser->is_type_panel() && new_browser->is_app()); |
| 293 | 300 |
| 294 // The new browser's app_name should include the app's ID. | 301 // The new browser's app_name should include the app's ID. |
| 295 EXPECT_NE( | 302 EXPECT_NE( |
| 296 new_browser->app_name_.find(extension_app->id()), | 303 new_browser->app_name_.find(extension_app->id()), |
| 297 std::string::npos) << new_browser->app_name_; | 304 std::string::npos) << new_browser->app_name_; |
| 298 } | 305 } |
| 299 | 306 |
| 300 #endif // !defined(OS_MACOSX) | 307 #endif // !defined(OS_MACOSX) |
| OLD | NEW |