| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #if defined(OS_MACOSX) | 10 #if defined(OS_MACOSX) |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 1319 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
| 1320 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); | 1320 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); |
| 1321 const Extension* extension_app = GetExtension(); | 1321 const Extension* extension_app = GetExtension(); |
| 1322 | 1322 |
| 1323 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. | 1323 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. |
| 1324 WebContents* app_window = | 1324 WebContents* app_window = |
| 1325 Browser::OpenApplication(browser()->profile(), | 1325 Browser::OpenApplication(browser()->profile(), |
| 1326 extension_app, | 1326 extension_app, |
| 1327 extension_misc::LAUNCH_WINDOW, | 1327 extension_misc::LAUNCH_WINDOW, |
| 1328 GURL(), | 1328 GURL(), |
| 1329 NEW_WINDOW); | 1329 NEW_WINDOW, |
| 1330 NULL); |
| 1330 ASSERT_TRUE(app_window); | 1331 ASSERT_TRUE(app_window); |
| 1331 | 1332 |
| 1332 // Apps launched in a window from the NTP do not have extension_app set in | 1333 // Apps launched in a window from the NTP do not have extension_app set in |
| 1333 // tab contents. | 1334 // tab contents. |
| 1334 TabContentsWrapper* wrapper = | 1335 TabContentsWrapper* wrapper = |
| 1335 TabContentsWrapper::GetCurrentWrapperForContents(app_window); | 1336 TabContentsWrapper::GetCurrentWrapperForContents(app_window); |
| 1336 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app()); | 1337 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app()); |
| 1337 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); | 1338 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); |
| 1338 | 1339 |
| 1339 // The launch should have created a new browser. | 1340 // The launch should have created a new browser. |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 command_line->AppendSwitchASCII(switches::kApp, url.spec()); | 1902 command_line->AppendSwitchASCII(switches::kApp, url.spec()); |
| 1902 } | 1903 } |
| 1903 }; | 1904 }; |
| 1904 | 1905 |
| 1905 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) { | 1906 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) { |
| 1906 // Test that an application browser window loads correctly. | 1907 // Test that an application browser window loads correctly. |
| 1907 | 1908 |
| 1908 // Verify the browser is in application mode. | 1909 // Verify the browser is in application mode. |
| 1909 EXPECT_TRUE(browser()->IsApplication()); | 1910 EXPECT_TRUE(browser()->IsApplication()); |
| 1910 } | 1911 } |
| OLD | NEW |