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

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: Self review 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
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..ad0f9bad639da230a0f5cf08f8adde7169f1ec2d 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,17 +330,15 @@ 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;
+ pid_t shim_pid = -1;
ASSERT_TRUE(base::mac::OpenApplicationWithPath(
- shim_path_, shim_cmdline, kLSLaunchDefaults, &shim_psn));
+ shim_path_, shim_cmdline, NSWorkspaceLaunchDefault, &shim_pid));
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();
@@ -402,17 +400,15 @@ 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;
+ pid_t shim_pid = -1;
ASSERT_TRUE(base::mac::OpenApplicationWithPath(
- shim_path_, shim_cmdline, kLSLaunchDefaults, &shim_psn));
+ shim_path_, shim_cmdline, NSWorkspaceLaunchDefault, &shim_pid));
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;
@@ -611,7 +607,7 @@ IN_PROC_BROWSER_TEST_F(AppShimInteractiveTest, MAYBE_RebuildShim) {
ExtensionTestMessageListener launched_listener("Launched", false);
base::CommandLine shim_cmdline(base::CommandLine::NO_PROGRAM);
ASSERT_TRUE(base::mac::OpenApplicationWithPath(
- shim_path, shim_cmdline, kLSLaunchDefaults, NULL));
+ shim_path, shim_cmdline, NSWorkspaceLaunchDefault, nullptr));
// Wait for the app to start (1). At this point there is no shim host.
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());

Powered by Google App Engine
This is Rietveld 408576698