Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 10332071: Pass command line arguments onto platform apps which provide the right intent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fixed, postResult added Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 host_resolver()->AddRule("www.example.com", "127.0.0.1"); 1320 host_resolver()->AddRule("www.example.com", "127.0.0.1");
1321 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); 1321 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/")));
1322 const Extension* extension_app = GetExtension(); 1322 const Extension* extension_app = GetExtension();
1323 1323
1324 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. 1324 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would.
1325 WebContents* app_window = 1325 WebContents* app_window =
1326 Browser::OpenApplication(browser()->profile(), 1326 Browser::OpenApplication(browser()->profile(),
1327 extension_app, 1327 extension_app,
1328 extension_misc::LAUNCH_WINDOW, 1328 extension_misc::LAUNCH_WINDOW,
1329 GURL(), 1329 GURL(),
1330 NEW_WINDOW); 1330 NEW_WINDOW,
1331 NULL);
1331 ASSERT_TRUE(app_window); 1332 ASSERT_TRUE(app_window);
1332 1333
1333 // Apps launched in a window from the NTP do not have extension_app set in 1334 // Apps launched in a window from the NTP do not have extension_app set in
1334 // tab contents. 1335 // tab contents.
1335 TabContentsWrapper* wrapper = 1336 TabContentsWrapper* wrapper =
1336 TabContentsWrapper::GetCurrentWrapperForContents(app_window); 1337 TabContentsWrapper::GetCurrentWrapperForContents(app_window);
1337 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app()); 1338 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app());
1338 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); 1339 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL());
1339 1340
1340 // The launch should have created a new browser. 1341 // The launch should have created a new browser.
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 command_line->AppendSwitchASCII(switches::kApp, url.spec()); 1903 command_line->AppendSwitchASCII(switches::kApp, url.spec());
1903 } 1904 }
1904 }; 1905 };
1905 1906
1906 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) { 1907 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) {
1907 // Test that an application browser window loads correctly. 1908 // Test that an application browser window loads correctly.
1908 1909
1909 // Verify the browser is in application mode. 1910 // Verify the browser is in application mode.
1910 EXPECT_TRUE(browser()->IsApplication()); 1911 EXPECT_TRUE(browser()->IsApplication());
1911 } 1912 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698