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

Unified Diff: chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm

Issue 2390953003: [Mac Fix-It] Changed OpenApplicationWithPath to use NSWorkspace. (Closed)
Patch Set: Addressed review comments Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app_shim/chrome_main_app_mode_mac.mm ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
diff --git a/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm b/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
index 82ed30d343eca4f3f6c3360e9ba1967e3b18f439..75b8134ab87e68f4e3a35bba1a57e1fdc2bcf015 100644
--- a/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
+++ b/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm
@@ -9,7 +9,7 @@
#include "apps/switches.h"
#include "base/auto_reset.h"
#include "base/mac/foundation_util.h"
-#include "base/mac/launch_services_util.h"
+#import "base/mac/launch_services_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsobject.h"
#include "base/macros.h"
@@ -330,21 +330,18 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_HostedAppLaunch) {
HostedAppBrowserListObserver listener(app->id());
base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
shim_cmdline.AppendSwitch(app_mode::kLaunchedForTest);
- ProcessSerialNumber shim_psn;
- ASSERT_TRUE(base::mac::OpenApplicationWithPath(
- shim_path_, shim_cmdline, kLSLaunchDefaults, &shim_psn));
+ base::Process shim_process = base::mac::OpenApplicationWithPath(
+ shim_path_, shim_cmdline, NSWorkspaceLaunchDefault);
+ ASSERT_TRUE(shim_process.IsValid());
listener.WaitUntilAdded();
ASSERT_TRUE(GetFirstHostedAppWindow());
EXPECT_TRUE(HasAppShimHost(profile(), app->id()));
// If the window is closed, the shim should quit.
- pid_t shim_pid;
- EXPECT_EQ(noErr, GetProcessPID(&shim_psn, &shim_pid));
GetFirstHostedAppWindow()->window()->Close();
// Wait for the window to be closed.
listener.WaitUntilRemoved();
- base::Process shim_process(shim_pid);
int exit_code;
ASSERT_TRUE(shim_process.WaitForExitWithTimeout(
TestTimeouts::action_timeout(), &exit_code));
@@ -402,19 +399,16 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_Launch) {
ExtensionTestMessageListener launched_listener("Launched", false);
base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
shim_cmdline.AppendSwitch(app_mode::kLaunchedForTest);
- ProcessSerialNumber shim_psn;
- ASSERT_TRUE(base::mac::OpenApplicationWithPath(
- shim_path_, shim_cmdline, kLSLaunchDefaults, &shim_psn));
+ base::Process shim_process = base::mac::OpenApplicationWithPath(
+ shim_path_, shim_cmdline, NSWorkspaceLaunchDefault);
+ ASSERT_TRUE(shim_process.IsValid());
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
ASSERT_TRUE(GetFirstAppWindow());
EXPECT_TRUE(HasAppShimHost(profile(), app->id()));
// If the window is closed, the shim should quit.
- pid_t shim_pid;
- EXPECT_EQ(noErr, GetProcessPID(&shim_psn, &shim_pid));
GetFirstAppWindow()->GetBaseWindow()->Close();
- base::Process shim_process(shim_pid);
int exit_code;
ASSERT_TRUE(shim_process.WaitForExitWithTimeout(
TestTimeouts::action_timeout(), &exit_code));
@@ -610,8 +604,9 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_RebuildShim) {
// behave normally.
ExtensionTestMessageListener launched_listener("Launched", false);
base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
- ASSERT_TRUE(base::mac::OpenApplicationWithPath(
- shim_path, shim_cmdline, kLSLaunchDefaults, NULL));
+ base::Process shim_process = base::mac::OpenApplicationWithPath(
+ shim_path, shim_cmdline, NSWorkspaceLaunchDefault);
+ ASSERT_TRUE(shim_process.IsValid());
// Wait for the app to start (1). At this point there is no shim host.
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
« no previous file with comments | « chrome/app_shim/chrome_main_app_mode_mac.mm ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698