| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 // Load an app | 1056 // Load an app |
| 1057 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 1057 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
| 1058 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); | 1058 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); |
| 1059 const Extension* extension_app = GetExtension(); | 1059 const Extension* extension_app = GetExtension(); |
| 1060 | 1060 |
| 1061 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. | 1061 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. |
| 1062 TabContents* app_window = | 1062 TabContents* app_window = |
| 1063 Browser::OpenApplication(browser()->profile(), | 1063 Browser::OpenApplication(browser()->profile(), |
| 1064 extension_app, | 1064 extension_app, |
| 1065 extension_misc::LAUNCH_WINDOW, | 1065 extension_misc::LAUNCH_WINDOW, |
| 1066 GURL(), |
| 1066 NEW_WINDOW); | 1067 NEW_WINDOW); |
| 1067 ASSERT_TRUE(app_window); | 1068 ASSERT_TRUE(app_window); |
| 1068 | 1069 |
| 1069 // Apps launched in a window from the NTP do not have extension_app set in | 1070 // Apps launched in a window from the NTP do not have extension_app set in |
| 1070 // tab contents. | 1071 // tab contents. |
| 1071 TabContentsWrapper* wrapper = | 1072 TabContentsWrapper* wrapper = |
| 1072 TabContentsWrapper::GetCurrentWrapperForContents(app_window); | 1073 TabContentsWrapper::GetCurrentWrapperForContents(app_window); |
| 1073 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app()); | 1074 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app()); |
| 1074 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); | 1075 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); |
| 1075 | 1076 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 | 1349 |
| 1349 // The normal browser should now have four. | 1350 // The normal browser should now have four. |
| 1350 EXPECT_EQ(4, browser()->tab_count()); | 1351 EXPECT_EQ(4, browser()->tab_count()); |
| 1351 | 1352 |
| 1352 // Close the additional browsers. | 1353 // Close the additional browsers. |
| 1353 popup_browser->CloseAllTabs(); | 1354 popup_browser->CloseAllTabs(); |
| 1354 app_browser->CloseAllTabs(); | 1355 app_browser->CloseAllTabs(); |
| 1355 app_popup_browser->CloseAllTabs(); | 1356 app_popup_browser->CloseAllTabs(); |
| 1356 } | 1357 } |
| 1357 #endif | 1358 #endif |
| OLD | NEW |