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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 "PRE_", base::CompareCase::SENSITIVE)) { | 419 "PRE_", base::CompareCase::SENSITIVE)) { |
420 AppControllerOpenShortcutBrowserTest::SetUpInProcessBrowserTestFixture(); | 420 AppControllerOpenShortcutBrowserTest::SetUpInProcessBrowserTestFixture(); |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 void SetUpOnMainThread() override { | 424 void SetUpOnMainThread() override { |
425 ASSERT_TRUE(embedded_test_server()->Start()); | 425 ASSERT_TRUE(embedded_test_server()->Start()); |
426 SessionStartupPref pref(GetParam()); | 426 SessionStartupPref pref(GetParam()); |
427 pref.urls.push_back(GURL(kPresetURL)); | 427 pref.urls.push_back(GURL(kPresetURL)); |
428 SessionStartupPref::SetStartupPref(browser()->profile(), pref); | 428 SessionStartupPref::SetStartupPref(browser()->profile(), pref); |
429 InProcessBrowserTest::SetUpOnMainThread(); | |
430 } | 429 } |
431 | 430 |
432 protected: | 431 protected: |
433 void SetUpCommandLine(base::CommandLine* command_line) override { | 432 void SetUpCommandLine(base::CommandLine* command_line) override { |
434 set_open_about_blank_on_browser_launch(false); | 433 set_open_about_blank_on_browser_launch(false); |
435 // Skip AppControllerOpenShortcutBrowserTest::SetUpCommandLine, which adds | 434 // Skip AppControllerOpenShortcutBrowserTest::SetUpCommandLine, which adds |
436 // startup URL. | 435 // startup URL. |
437 InProcessBrowserTest::SetUpCommandLine(command_line); | 436 InProcessBrowserTest::SetUpCommandLine(command_line); |
438 } | 437 } |
439 | 438 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 496 |
498 protected: | 497 protected: |
499 SessionStartupPref::Type GetSessionStartupPref() { | 498 SessionStartupPref::Type GetSessionStartupPref() { |
500 return session_startup_pref_; | 499 return session_startup_pref_; |
501 } | 500 } |
502 | 501 |
503 void SetUpOnMainThread() override { | 502 void SetUpOnMainThread() override { |
504 SessionStartupPref pref(session_startup_pref_); | 503 SessionStartupPref pref(session_startup_pref_); |
505 pref.urls.push_back(GURL(kPresetURL)); | 504 pref.urls.push_back(GURL(kPresetURL)); |
506 SessionStartupPref::SetStartupPref(browser()->profile(), pref); | 505 SessionStartupPref::SetStartupPref(browser()->profile(), pref); |
507 InProcessBrowserTest::SetUpOnMainThread(); | |
508 } | 506 } |
509 | 507 |
510 void SetUpCommandLine(base::CommandLine* command_line) override { | 508 void SetUpCommandLine(base::CommandLine* command_line) override { |
511 set_open_about_blank_on_browser_launch(false); | 509 set_open_about_blank_on_browser_launch(false); |
512 } | 510 } |
513 | 511 |
514 private: | 512 private: |
515 SessionStartupPref::Type session_startup_pref_; | 513 SessionStartupPref::Type session_startup_pref_; |
516 | 514 |
517 DISALLOW_COPY_AND_ASSIGN(AppControllerOpenShortcutInBrowserTest); | 515 DISALLOW_COPY_AND_ASSIGN(AppControllerOpenShortcutInBrowserTest); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 ui_test_utils::NavigateToURL(browser3, test_url1); | 908 ui_test_utils::NavigateToURL(browser3, test_url1); |
911 EXPECT_EQ(g_handoff_url, GURL()); | 909 EXPECT_EQ(g_handoff_url, GURL()); |
912 | 910 |
913 // Activate the original browser window. | 911 // Activate the original browser window. |
914 Browser* browser1 = active_browser_list->get(0); | 912 Browser* browser1 = active_browser_list->get(0); |
915 browser1->window()->Show(); | 913 browser1->window()->Show(); |
916 EXPECT_EQ(g_handoff_url, test_url2); | 914 EXPECT_EQ(g_handoff_url, test_url2); |
917 } | 915 } |
918 | 916 |
919 } // namespace | 917 } // namespace |
OLD | NEW |