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

Side by Side Diff: chrome/browser/app_controller_mac_browsertest.mm

Issue 494033002: Move AppWindow to extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded include in chrome_shell_delegate.cc Created 6 years, 3 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/app_controller_mac.mm ('k') | chrome/browser/apps/app_browsertest.cc » ('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 #import <Carbon/Carbon.h> 5 #import <Carbon/Carbon.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #import <Foundation/NSAppleEventDescriptor.h> 8 #import <Foundation/NSAppleEventDescriptor.h>
9 #import <objc/message.h> 9 #import <objc/message.h>
10 #import <objc/runtime.h> 10 #import <objc/runtime.h>
11 11
12 #include "apps/app_window_registry.h"
13 #include "base/command_line.h" 12 #include "base/command_line.h"
14 #include "base/mac/foundation_util.h" 13 #include "base/mac/foundation_util.h"
15 #include "base/mac/scoped_nsobject.h" 14 #include "base/mac/scoped_nsobject.h"
16 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
17 #include "chrome/app/chrome_command_ids.h" 16 #include "chrome/app/chrome_command_ids.h"
18 #import "chrome/browser/app_controller_mac.h" 17 #import "chrome/browser/app_controller_mac.h"
19 #include "chrome/browser/apps/app_browsertest_util.h" 18 #include "chrome/browser/apps/app_browsertest_util.h"
20 #include "chrome/browser/browser_process.h" 19 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/extensions/extension_test_message_listener.h" 20 #include "chrome/browser/extensions/extension_test_message_listener.h"
22 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
24 #include "chrome/browser/ui/browser_list.h" 23 #include "chrome/browser/ui/browser_list.h"
25 #include "chrome/browser/ui/browser_window.h" 24 #include "chrome/browser/ui/browser_window.h"
26 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" 25 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
27 #include "chrome/browser/ui/host_desktop.h" 26 #include "chrome/browser/ui/host_desktop.h"
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model.h"
29 #include "chrome/common/chrome_constants.h" 28 #include "chrome/common/chrome_constants.h"
30 #include "chrome/common/chrome_switches.h" 29 #include "chrome/common/chrome_switches.h"
31 #include "chrome/common/pref_names.h" 30 #include "chrome/common/pref_names.h"
32 #include "chrome/common/url_constants.h" 31 #include "chrome/common/url_constants.h"
33 #include "chrome/test/base/in_process_browser_test.h" 32 #include "chrome/test/base/in_process_browser_test.h"
34 #include "chrome/test/base/ui_test_utils.h" 33 #include "chrome/test/base/ui_test_utils.h"
35 #include "components/signin/core/common/profile_management_switches.h" 34 #include "components/signin/core/common/profile_management_switches.h"
36 #include "content/public/browser/web_contents.h" 35 #include "content/public/browser/web_contents.h"
36 #include "extensions/browser/app_window/app_window_registry.h"
37 #include "extensions/common/extension.h" 37 #include "extensions/common/extension.h"
38 #include "net/test/embedded_test_server/embedded_test_server.h" 38 #include "net/test/embedded_test_server/embedded_test_server.h"
39 39
40 namespace { 40 namespace {
41 41
42 GURL g_open_shortcut_url = GURL::EmptyGURL(); 42 GURL g_open_shortcut_url = GURL::EmptyGURL();
43 43
44 } // namespace 44 } // namespace
45 45
46 @interface TestOpenShortcutOnStartup : NSObject 46 @interface TestOpenShortcutOnStartup : NSObject
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 IN_PROC_BROWSER_TEST_F(AppControllerPlatformAppBrowserTest, 117 IN_PROC_BROWSER_TEST_F(AppControllerPlatformAppBrowserTest,
118 ActivationFocusesBrowserWindow) { 118 ActivationFocusesBrowserWindow) {
119 base::scoped_nsobject<AppController> app_controller( 119 base::scoped_nsobject<AppController> app_controller(
120 [[AppController alloc] init]); 120 [[AppController alloc] init]);
121 121
122 ExtensionTestMessageListener listener("Launched", false); 122 ExtensionTestMessageListener listener("Launched", false);
123 const extensions::Extension* app = 123 const extensions::Extension* app =
124 InstallAndLaunchPlatformApp("minimal"); 124 InstallAndLaunchPlatformApp("minimal");
125 ASSERT_TRUE(listener.WaitUntilSatisfied()); 125 ASSERT_TRUE(listener.WaitUntilSatisfied());
126 126
127 NSWindow* app_window = apps::AppWindowRegistry::Get(profile()) 127 NSWindow* app_window = extensions::AppWindowRegistry::Get(profile())
128 ->GetAppWindowsForApp(app->id()) 128 ->GetAppWindowsForApp(app->id())
129 .front() 129 .front()
130 ->GetNativeWindow(); 130 ->GetNativeWindow();
131 NSWindow* browser_window = browser()->window()->GetNativeWindow(); 131 NSWindow* browser_window = browser()->window()->GetNativeWindow();
132 132
133 EXPECT_LE([[NSApp orderedWindows] indexOfObject:app_window], 133 EXPECT_LE([[NSApp orderedWindows] indexOfObject:app_window],
134 [[NSApp orderedWindows] indexOfObject:browser_window]); 134 [[NSApp orderedWindows] indexOfObject:browser_window]);
135 [app_controller applicationShouldHandleReopen:NSApp 135 [app_controller applicationShouldHandleReopen:NSApp
136 hasVisibleWindows:YES]; 136 hasVisibleWindows:YES];
137 EXPECT_LE([[NSApp orderedWindows] indexOfObject:browser_window], 137 EXPECT_LE([[NSApp orderedWindows] indexOfObject:browser_window],
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 IN_PROC_BROWSER_TEST_F(AppControllerOpenShortcutBrowserTest, 325 IN_PROC_BROWSER_TEST_F(AppControllerOpenShortcutBrowserTest,
326 OpenShortcutOnStartup) { 326 OpenShortcutOnStartup) {
327 EXPECT_EQ(1, browser()->tab_strip_model()->count()); 327 EXPECT_EQ(1, browser()->tab_strip_model()->count());
328 EXPECT_EQ(g_open_shortcut_url, 328 EXPECT_EQ(g_open_shortcut_url,
329 browser()->tab_strip_model()->GetActiveWebContents() 329 browser()->tab_strip_model()->GetActiveWebContents()
330 ->GetLastCommittedURL()); 330 ->GetLastCommittedURL());
331 } 331 }
332 332
333 } // namespace 333 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/apps/app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698