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

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

Issue 14241002: Move the parsing of app.launch related keys out of Extension class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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
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/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 27 matching lines...) Expand all
38 #include "chrome/browser/ui/browser_ui_prefs.h" 38 #include "chrome/browser/ui/browser_ui_prefs.h"
39 #include "chrome/browser/ui/browser_window.h" 39 #include "chrome/browser/ui/browser_window.h"
40 #include "chrome/browser/ui/extensions/application_launch.h" 40 #include "chrome/browser/ui/extensions/application_launch.h"
41 #include "chrome/browser/ui/host_desktop.h" 41 #include "chrome/browser/ui/host_desktop.h"
42 #include "chrome/browser/ui/startup/startup_browser_creator.h" 42 #include "chrome/browser/ui/startup/startup_browser_creator.h"
43 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" 43 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
44 #include "chrome/browser/ui/tabs/pinned_tab_codec.h" 44 #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
45 #include "chrome/browser/ui/tabs/tab_strip_model.h" 45 #include "chrome/browser/ui/tabs/tab_strip_model.h"
46 #include "chrome/common/chrome_notification_types.h" 46 #include "chrome/common/chrome_notification_types.h"
47 #include "chrome/common/chrome_switches.h" 47 #include "chrome/common/chrome_switches.h"
48 #include "chrome/common/extensions/app_launcher_info.h"
48 #include "chrome/common/extensions/extension.h" 49 #include "chrome/common/extensions/extension.h"
49 #include "chrome/common/url_constants.h" 50 #include "chrome/common/url_constants.h"
50 #include "chrome/test/base/in_process_browser_test.h" 51 #include "chrome/test/base/in_process_browser_test.h"
51 #include "chrome/test/base/ui_test_utils.h" 52 #include "chrome/test/base/ui_test_utils.h"
52 #include "content/public/browser/favicon_status.h" 53 #include "content/public/browser/favicon_status.h"
53 #include "content/public/browser/host_zoom_map.h" 54 #include "content/public/browser/host_zoom_map.h"
54 #include "content/public/browser/interstitial_page.h" 55 #include "content/public/browser/interstitial_page.h"
55 #include "content/public/browser/interstitial_page_delegate.h" 56 #include "content/public/browser/interstitial_page_delegate.h"
56 #include "content/public/browser/navigation_entry.h" 57 #include "content/public/browser/navigation_entry.h"
57 #include "content/public/browser/render_process_host.h" 58 #include "content/public/browser/render_process_host.h"
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 WebContents* app_window = chrome::OpenApplication( 1136 WebContents* app_window = chrome::OpenApplication(
1136 chrome::AppLaunchParams(browser()->profile(), extension_app, 1137 chrome::AppLaunchParams(browser()->profile(), extension_app,
1137 extension_misc::LAUNCH_WINDOW, NEW_WINDOW)); 1138 extension_misc::LAUNCH_WINDOW, NEW_WINDOW));
1138 ASSERT_TRUE(app_window); 1139 ASSERT_TRUE(app_window);
1139 1140
1140 // Apps launched in a window from the NTP have an extensions tab helper but 1141 // Apps launched in a window from the NTP have an extensions tab helper but
1141 // do not have extension_app set in it. 1142 // do not have extension_app set in it.
1142 ASSERT_TRUE(extensions::TabHelper::FromWebContents(app_window)); 1143 ASSERT_TRUE(extensions::TabHelper::FromWebContents(app_window));
1143 EXPECT_FALSE( 1144 EXPECT_FALSE(
1144 extensions::TabHelper::FromWebContents(app_window)->extension_app()); 1145 extensions::TabHelper::FromWebContents(app_window)->extension_app());
1145 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); 1146 EXPECT_EQ(extensions::AppLauncherInfo::GetFullLaunchURL(extension_app),
1147 app_window->GetURL());
1146 1148
1147 // The launch should have created a new browser. 1149 // The launch should have created a new browser.
1148 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(), 1150 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile(),
1149 browser()->host_desktop_type())); 1151 browser()->host_desktop_type()));
1150 1152
1151 // Find the new browser. 1153 // Find the new browser.
1152 Browser* new_browser = NULL; 1154 Browser* new_browser = NULL;
1153 for (chrome::BrowserIterator it; !it.done() && !new_browser; it.Next()) { 1155 for (chrome::BrowserIterator it; !it.done() && !new_browser; it.Next()) {
1154 if (*it != browser()) 1156 if (*it != browser())
1155 new_browser = *it; 1157 new_browser = *it;
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); 2101 RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
2100 } 2102 }
2101 2103
2102 // Shift-middle-clicks open in a foreground tab. 2104 // Shift-middle-clicks open in a foreground tab.
2103 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { 2105 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) {
2104 int modifiers = WebKit::WebInputEvent::ShiftKey; 2106 int modifiers = WebKit::WebInputEvent::ShiftKey;
2105 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; 2107 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle;
2106 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; 2108 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB;
2107 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); 2109 RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
2108 } 2110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698