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

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

Issue 12316077: 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, 10 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/file_path.h" 9 #include "base/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_launch_manifest_handler.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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 WebContents* app_window = chrome::OpenApplication( 1100 WebContents* app_window = chrome::OpenApplication(
1100 chrome::AppLaunchParams(browser()->profile(), extension_app, 1101 chrome::AppLaunchParams(browser()->profile(), extension_app,
1101 extension_misc::LAUNCH_WINDOW, NEW_WINDOW)); 1102 extension_misc::LAUNCH_WINDOW, NEW_WINDOW));
1102 ASSERT_TRUE(app_window); 1103 ASSERT_TRUE(app_window);
1103 1104
1104 // Apps launched in a window from the NTP have an extensions tab helper but 1105 // Apps launched in a window from the NTP have an extensions tab helper but
1105 // do not have extension_app set in it. 1106 // do not have extension_app set in it.
1106 ASSERT_TRUE(extensions::TabHelper::FromWebContents(app_window)); 1107 ASSERT_TRUE(extensions::TabHelper::FromWebContents(app_window));
1107 EXPECT_FALSE( 1108 EXPECT_FALSE(
1108 extensions::TabHelper::FromWebContents(app_window)->extension_app()); 1109 extensions::TabHelper::FromWebContents(app_window)->extension_app());
1109 EXPECT_EQ(extension_app->GetFullLaunchURL(), app_window->GetURL()); 1110 EXPECT_EQ(extensions::AppLaunchInfo::GetFullLaunchURL(extension_app),
1111 app_window->GetURL());
1110 1112
1111 // The launch should have created a new browser. 1113 // The launch should have created a new browser.
1112 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile())); 1114 ASSERT_EQ(2u, chrome::GetBrowserCount(browser()->profile()));
1113 1115
1114 // Find the new browser. 1116 // Find the new browser.
1115 Browser* new_browser = NULL; 1117 Browser* new_browser = NULL;
1116 for (chrome::BrowserIterator it; !it.done() && !new_browser; it.Next()) { 1118 for (chrome::BrowserIterator it; !it.done() && !new_browser; it.Next()) {
1117 if (*it != browser()) 1119 if (*it != browser())
1118 new_browser = *it; 1120 new_browser = *it;
1119 } 1121 }
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); 2023 RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
2022 } 2024 }
2023 2025
2024 // Shift-middle-clicks open in a foreground tab. 2026 // Shift-middle-clicks open in a foreground tab.
2025 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { 2027 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) {
2026 int modifiers = WebKit::WebInputEvent::ShiftKey; 2028 int modifiers = WebKit::WebInputEvent::ShiftKey;
2027 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; 2029 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle;
2028 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; 2030 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB;
2029 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); 2031 RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
2030 } 2032 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698