OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Tests behavior when quitting apps with app shims. | 5 // Tests behavior when quitting apps with app shims. |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/switches.h" | 10 #include "apps/switches.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 APP_SHIM_LAUNCH_REGISTER_ONLY, | 78 APP_SHIM_LAUNCH_REGISTER_ONLY, |
79 std::vector<base::FilePath>()); | 79 std::vector<base::FilePath>()); |
80 EXPECT_EQ(host_.get(), handler_->FindHost(profile(), extension_id_)); | 80 EXPECT_EQ(host_.get(), handler_->FindHost(profile(), extension_id_)); |
81 | 81 |
82 // Focus the app window. | 82 // Focus the app window. |
83 NSWindow* window = [[NSApp windows] objectAtIndex:0]; | 83 NSWindow* window = [[NSApp windows] objectAtIndex:0]; |
84 EXPECT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(window)); | 84 EXPECT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(window)); |
85 content::RunAllPendingInMessageLoop(); | 85 content::RunAllPendingInMessageLoop(); |
86 } | 86 } |
87 | 87 |
88 void SetUpCommandLine(CommandLine* command_line) override { | 88 void SetUpCommandLine(base::CommandLine* command_line) override { |
89 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 89 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
90 // Simulate an app shim initiated launch, i.e. launch app but not browser. | 90 // Simulate an app shim initiated launch, i.e. launch app but not browser. |
91 app_path_ = test_data_dir_ | 91 app_path_ = test_data_dir_ |
92 .AppendASCII("platform_apps") | 92 .AppendASCII("platform_apps") |
93 .AppendASCII("minimal"); | 93 .AppendASCII("minimal"); |
94 command_line->AppendSwitchNative(apps::kLoadAndLaunchApp, | 94 command_line->AppendSwitchNative(apps::kLoadAndLaunchApp, |
95 app_path_.value()); | 95 app_path_.value()); |
96 command_line->AppendSwitch(switches::kSilentLaunch); | 96 command_line->AppendSwitch(switches::kSilentLaunch); |
97 } | 97 } |
98 | 98 |
(...skipping 20 matching lines...) Expand all Loading... |
119 atStart:NO]; | 119 atStart:NO]; |
120 | 120 |
121 // This will time out if the event above does not terminate Chrome. | 121 // This will time out if the event above does not terminate Chrome. |
122 content::RunMessageLoop(); | 122 content::RunMessageLoop(); |
123 | 123 |
124 EXPECT_FALSE(handler_->FindHost(profile(), extension_id_)); | 124 EXPECT_FALSE(handler_->FindHost(profile(), extension_id_)); |
125 EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); | 125 EXPECT_TRUE(browser_shutdown::IsTryingToQuit()); |
126 } | 126 } |
127 | 127 |
128 } // namespace apps | 128 } // namespace apps |
OLD | NEW |