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

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: Doh 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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 host_resolver()->AddRule("www.example.com", "127.0.0.1"); 1556 host_resolver()->AddRule("www.example.com", "127.0.0.1");
1557 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); 1557 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/")));
1558 const Extension* extension_app = GetExtension(); 1558 const Extension* extension_app = GetExtension();
1559 1559
1560 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. 1560 // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would.
1561 WebContents* app_window = 1561 WebContents* app_window =
1562 Browser::OpenApplication(browser()->profile(), 1562 Browser::OpenApplication(browser()->profile(),
1563 extension_app, 1563 extension_app,
1564 extension_misc::LAUNCH_WINDOW, 1564 extension_misc::LAUNCH_WINDOW,
1565 GURL(), 1565 GURL(),
1566 NEW_WINDOW); 1566 NEW_WINDOW,
1567 NULL);
1567 ASSERT_TRUE(app_window); 1568 ASSERT_TRUE(app_window);
1568 1569
1569 // Apps launched in a window from the NTP do not have extension_app set in 1570 // Apps launched in a window from the NTP do not have extension_app set in
1570 // tab contents. 1571 // tab contents.
1571 TabContentsWrapper* wrapper = 1572 TabContentsWrapper* wrapper =
1572 TabContentsWrapper::GetCurrentWrapperForContents(app_window); 1573 TabContentsWrapper::GetCurrentWrapperForContents(app_window);
1573 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app()); 1574 EXPECT_FALSE(wrapper->extension_tab_helper()->extension_app());
1574 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); 1575 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL());
1575 1576
1576 // The launch should have created a new browser. 1577 // The launch should have created a new browser.
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 command_line->AppendSwitchASCII(switches::kApp, url.spec()); 2139 command_line->AppendSwitchASCII(switches::kApp, url.spec());
2139 } 2140 }
2140 }; 2141 };
2141 2142
2142 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) { 2143 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) {
2143 // Test that an application browser window loads correctly. 2144 // Test that an application browser window loads correctly.
2144 2145
2145 // Verify the browser is in application mode. 2146 // Verify the browser is in application mode.
2146 EXPECT_TRUE(browser()->IsApplication()); 2147 EXPECT_TRUE(browser()->IsApplication());
2147 } 2148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698