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

Side by Side Diff: chrome/browser/extensions/platform_app_browsertest.cc

Issue 10409023: Remove extension application launch code from Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
« no previous file with comments | « chrome/browser/extensions/extension_management_api.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/automation/automation_util.h" 9 #include "chrome/browser/automation/automation_util.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
11 #include "chrome/browser/extensions/extension_browsertest.h" 11 #include "chrome/browser/extensions/extension_browsertest.h"
12 #include "chrome/browser/extensions/extension_function_test_utils.h" 12 #include "chrome/browser/extensions/extension_function_test_utils.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/extension_tabs_module.h" 14 #include "chrome/browser/extensions/extension_tabs_module.h"
15 #include "chrome/browser/extensions/extension_test_message_listener.h" 15 #include "chrome/browser/extensions/extension_test_message_listener.h"
16 #include "chrome/browser/extensions/shell_window_registry.h" 16 #include "chrome/browser/extensions/shell_window_registry.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/tab_contents/render_view_context_menu.h" 18 #include "chrome/browser/tab_contents/render_view_context_menu.h"
19 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
20 #include "chrome/browser/ui/browser_list.h" 20 #include "chrome/browser/ui/browser_list.h"
21 #include "chrome/browser/ui/extensions/application_launch.h"
21 #include "chrome/browser/ui/extensions/shell_window.h" 22 #include "chrome/browser/ui/extensions/shell_window.h"
22 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
23 #include "chrome/common/extensions/extension_constants.h" 24 #include "chrome/common/extensions/extension_constants.h"
24 #include "chrome/test/base/ui_test_utils.h" 25 #include "chrome/test/base/ui_test_utils.h"
25 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
26 #include "content/public/common/context_menu_params.h" 27 #include "content/public/common/context_menu_params.h"
27 #include "testing/gtest/include/gtest/gtest.h" 28 #include "testing/gtest/include/gtest/gtest.h"
28 #include "ui/base/models/menu_model.h" 29 #include "ui/base/models/menu_model.h"
29 30
30 using content::WebContents; 31 using content::WebContents;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 protected: 65 protected:
65 const Extension* LoadAndLaunchPlatformApp(const char* name) { 66 const Extension* LoadAndLaunchPlatformApp(const char* name) {
66 ui_test_utils::WindowedNotificationObserver app_loaded_observer( 67 ui_test_utils::WindowedNotificationObserver app_loaded_observer(
67 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 68 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
68 content::NotificationService::AllSources()); 69 content::NotificationService::AllSources());
69 70
70 const Extension* extension = LoadExtension( 71 const Extension* extension = LoadExtension(
71 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name)); 72 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name));
72 EXPECT_TRUE(extension); 73 EXPECT_TRUE(extension);
73 74
74 Browser::OpenApplication( 75 application_launch::OpenApplication(
75 browser()->profile(), 76 browser()->profile(),
76 extension, 77 extension,
77 extension_misc::LAUNCH_NONE, 78 extension_misc::LAUNCH_NONE,
78 GURL(), 79 GURL(),
79 NEW_WINDOW); 80 NEW_WINDOW);
80 81
81 app_loaded_observer.Wait(); 82 app_loaded_observer.Wait();
82 83
83 return extension; 84 return extension;
84 } 85 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Launch another platform app that also shows a window. 265 // Launch another platform app that also shows a window.
265 ExtensionTestMessageListener launched_listener2("Launched", false); 266 ExtensionTestMessageListener launched_listener2("Launched", false);
266 const Extension* platform_app2 = LoadAndLaunchPlatformApp("context_menu"); 267 const Extension* platform_app2 = LoadAndLaunchPlatformApp("context_menu");
267 ASSERT_TRUE(launched_listener2.WaitUntilSatisfied()); 268 ASSERT_TRUE(launched_listener2.WaitUntilSatisfied());
268 269
269 // There are two total shell windows, but each app can only see its own. 270 // There are two total shell windows, but each app can only see its own.
270 ASSERT_EQ(2U, GetShellWindowCount()); 271 ASSERT_EQ(2U, GetShellWindowCount());
271 ASSERT_EQ(1U, RunGetWindowsFunctionForExtension(platform_app)); 272 ASSERT_EQ(1U, RunGetWindowsFunctionForExtension(platform_app));
272 ASSERT_EQ(1U, RunGetWindowsFunctionForExtension(platform_app2)); 273 ASSERT_EQ(1U, RunGetWindowsFunctionForExtension(platform_app2));
273 } 274 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_management_api.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698