| OLD | NEW |
| 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> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/ui/user_manager.h" | 36 #include "chrome/browser/ui/user_manager.h" |
| 37 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
| 38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 41 #include "chrome/test/base/in_process_browser_test.h" | 41 #include "chrome/test/base/in_process_browser_test.h" |
| 42 #include "chrome/test/base/ui_test_utils.h" | 42 #include "chrome/test/base/ui_test_utils.h" |
| 43 #include "components/bookmarks/browser/bookmark_model.h" | 43 #include "components/bookmarks/browser/bookmark_model.h" |
| 44 #include "components/bookmarks/test/bookmark_test_helpers.h" | 44 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 45 #include "components/prefs/pref_service.h" | 45 #include "components/prefs/pref_service.h" |
| 46 #include "components/signin/core/common/profile_management_switches.h" | |
| 47 #include "content/public/browser/navigation_controller.h" | 46 #include "content/public/browser/navigation_controller.h" |
| 48 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
| 49 #include "content/public/test/browser_test_utils.h" | 48 #include "content/public/test/browser_test_utils.h" |
| 50 #include "content/public/test/test_navigation_observer.h" | 49 #include "content/public/test/test_navigation_observer.h" |
| 51 #include "extensions/browser/app_window/app_window_registry.h" | 50 #include "extensions/browser/app_window/app_window_registry.h" |
| 52 #include "extensions/common/extension.h" | 51 #include "extensions/common/extension.h" |
| 53 #include "extensions/test/extension_test_message_listener.h" | 52 #include "extensions/test/extension_test_message_listener.h" |
| 54 #include "net/test/embedded_test_server/embedded_test_server.h" | 53 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 55 | 54 |
| 56 namespace { | 55 namespace { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 std::string()); | 225 std::string()); |
| 227 base::RunLoop().Run(); | 226 base::RunLoop().Run(); |
| 228 } | 227 } |
| 229 | 228 |
| 230 class AppControllerNewProfileManagementBrowserTest | 229 class AppControllerNewProfileManagementBrowserTest |
| 231 : public InProcessBrowserTest { | 230 : public InProcessBrowserTest { |
| 232 protected: | 231 protected: |
| 233 AppControllerNewProfileManagementBrowserTest() | 232 AppControllerNewProfileManagementBrowserTest() |
| 234 : active_browser_list_(BrowserList::GetInstance()) {} | 233 : active_browser_list_(BrowserList::GetInstance()) {} |
| 235 | 234 |
| 236 void SetUpCommandLine(base::CommandLine* command_line) override { | |
| 237 switches::EnableNewProfileManagementForTesting(command_line); | |
| 238 } | |
| 239 | |
| 240 const BrowserList* active_browser_list_; | 235 const BrowserList* active_browser_list_; |
| 241 }; | 236 }; |
| 242 | 237 |
| 243 // Test that for a regular last profile, a reopen event opens a browser. | 238 // Test that for a regular last profile, a reopen event opens a browser. |
| 244 IN_PROC_BROWSER_TEST_F(AppControllerNewProfileManagementBrowserTest, | 239 IN_PROC_BROWSER_TEST_F(AppControllerNewProfileManagementBrowserTest, |
| 245 RegularProfileReopenWithNoWindows) { | 240 RegularProfileReopenWithNoWindows) { |
| 246 base::scoped_nsobject<AppController> ac([[AppController alloc] init]); | 241 base::scoped_nsobject<AppController> ac([[AppController alloc] init]); |
| 247 EXPECT_EQ(1u, active_browser_list_->size()); | 242 EXPECT_EQ(1u, active_browser_list_->size()); |
| 248 BOOL result = [ac applicationShouldHandleReopen:NSApp hasVisibleWindows:NO]; | 243 BOOL result = [ac applicationShouldHandleReopen:NSApp hasVisibleWindows:NO]; |
| 249 | 244 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 ui_test_utils::NavigateToURL(browser3, test_url1); | 706 ui_test_utils::NavigateToURL(browser3, test_url1); |
| 712 EXPECT_EQ(g_handoff_url, GURL()); | 707 EXPECT_EQ(g_handoff_url, GURL()); |
| 713 | 708 |
| 714 // Activate the original browser window. | 709 // Activate the original browser window. |
| 715 Browser* browser1 = active_browser_list->get(0); | 710 Browser* browser1 = active_browser_list->get(0); |
| 716 browser1->window()->Show(); | 711 browser1->window()->Show(); |
| 717 EXPECT_EQ(g_handoff_url, test_url2); | 712 EXPECT_EQ(g_handoff_url, test_url2); |
| 718 } | 713 } |
| 719 | 714 |
| 720 } // namespace | 715 } // namespace |
| OLD | NEW |