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

Side by Side Diff: chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm

Issue 2765083002: Hardcode extensions::util::IsNewBookmarkAppsEnabled() to true, except on Mac. (Closed)
Patch Set: respond to comments Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 #include <vector> 6 #include <vector>
7 7
8 #include "apps/app_lifetime_monitor_factory.h" 8 #include "apps/app_lifetime_monitor_factory.h"
9 #include "apps/switches.h" 9 #include "apps/switches.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/mac/foundation_util.h" 11 #include "base/mac/foundation_util.h"
12 #import "base/mac/launch_services_util.h" 12 #import "base/mac/launch_services_util.h"
13 #include "base/mac/mac_util.h" 13 #include "base/mac/mac_util.h"
14 #include "base/mac/scoped_nsobject.h" 14 #include "base/mac/scoped_nsobject.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/process/launch.h" 17 #include "base/process/launch.h"
18 #include "base/strings/sys_string_conversions.h" 18 #include "base/strings/sys_string_conversions.h"
19 #include "base/test/scoped_feature_list.h"
19 #include "base/test/test_timeouts.h" 20 #include "base/test/test_timeouts.h"
20 #include "build/build_config.h" 21 #include "build/build_config.h"
21 #include "chrome/browser/apps/app_browsertest_util.h" 22 #include "chrome/browser/apps/app_browsertest_util.h"
22 #include "chrome/browser/apps/app_shim/app_shim_handler_mac.h" 23 #include "chrome/browser/apps/app_shim/app_shim_handler_mac.h"
23 #include "chrome/browser/apps/app_shim/app_shim_host_manager_mac.h" 24 #include "chrome/browser/apps/app_shim/app_shim_host_manager_mac.h"
24 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h" 25 #include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h"
25 #include "chrome/browser/browser_process.h" 26 #include "chrome/browser/browser_process.h"
26 #include "chrome/browser/extensions/launch_util.h" 27 #include "chrome/browser/extensions/launch_util.h"
27 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/ui/browser_list.h" 29 #include "chrome/browser/ui/browser_list.h"
29 #include "chrome/browser/ui/browser_window.h" 30 #include "chrome/browser/ui/browser_window.h"
30 #include "chrome/browser/web_applications/web_app_mac.h" 31 #include "chrome/browser/web_applications/web_app_mac.h"
32 #include "chrome/common/chrome_features.h"
31 #include "chrome/common/chrome_paths.h" 33 #include "chrome/common/chrome_paths.h"
32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/mac/app_mode_common.h" 34 #include "chrome/common/mac/app_mode_common.h"
34 #include "content/public/test/test_utils.h" 35 #include "content/public/test/test_utils.h"
35 #include "extensions/browser/app_window/native_app_window.h" 36 #include "extensions/browser/app_window/native_app_window.h"
36 #include "extensions/browser/extension_prefs.h" 37 #include "extensions/browser/extension_prefs.h"
37 #include "extensions/test/extension_test_message_listener.h" 38 #include "extensions/test/extension_test_message_listener.h"
38 #import "ui/base/test/windowed_nsnotification_observer.h" 39 #import "ui/base/test/windowed_nsnotification_observer.h"
39 #import "ui/events/test/cocoa_test_event_utils.h" 40 #import "ui/events/test/cocoa_test_event_utils.h"
40 41
41 namespace { 42 namespace {
42 43
43 // General end-to-end test for app shims. 44 // General end-to-end test for app shims.
44 class AppShimInteractiveTest : public extensions::PlatformAppBrowserTest { 45 class AppShimInteractiveTest : public extensions::PlatformAppBrowserTest {
45 protected: 46 protected:
46 // Type of app to install, when invoking InstallAppWithShim(). 47 // Type of app to install, when invoking InstallAppWithShim().
47 enum AppType { APP_TYPE_PACKAGED, APP_TYPE_HOSTED }; 48 enum AppType { APP_TYPE_PACKAGED, APP_TYPE_HOSTED };
48 49
49 AppShimInteractiveTest() 50 AppShimInteractiveTest()
50 : auto_reset_(&g_app_shims_allow_update_and_launch_in_tests, true) {} 51 : auto_reset_(&g_app_shims_allow_update_and_launch_in_tests, true) {}
51 52
53 // testing::Test:
54 void SetUp() override {
55 PlatformAppBrowserTest::SetUp();
56 scoped_feature_list_.InitAndEnableFeature(features::kBookmarkApps);
57 }
58
52 // Install a test app of |type| and reliably wait for its app shim to be 59 // Install a test app of |type| and reliably wait for its app shim to be
53 // created on disk. Sets |shim_path_|. 60 // created on disk. Sets |shim_path_|.
54 const extensions::Extension* InstallAppWithShim(AppType type, 61 const extensions::Extension* InstallAppWithShim(AppType type,
55 const char* name); 62 const char* name);
56 63
57 void SetUpCommandLine(base::CommandLine* command_line) override {
58 PlatformAppBrowserTest::SetUpCommandLine(command_line);
59 command_line->AppendSwitch(switches::kEnableNewBookmarkApps);
60 }
61
62 protected: 64 protected:
63 base::FilePath shim_path_; 65 base::FilePath shim_path_;
64 66
65 private: 67 private:
66 // Temporarily enable app shims. 68 // Temporarily enable app shims.
67 base::AutoReset<bool> auto_reset_; 69 base::AutoReset<bool> auto_reset_;
70 base::test::ScopedFeatureList scoped_feature_list_;
68 71
69 DISALLOW_COPY_AND_ASSIGN(AppShimInteractiveTest); 72 DISALLOW_COPY_AND_ASSIGN(AppShimInteractiveTest);
70 }; 73 };
71 74
72 // Watches for an app shim to connect. 75 // Watches for an app shim to connect.
73 class WindowedAppShimLaunchObserver : public apps::AppShimHandler { 76 class WindowedAppShimLaunchObserver : public apps::AppShimHandler {
74 public: 77 public:
75 WindowedAppShimLaunchObserver(const std::string& app_id) 78 WindowedAppShimLaunchObserver(const std::string& app_id)
76 : app_mode_id_(app_id), 79 : app_mode_id_(app_id),
77 observed_(false) { 80 observed_(false) {
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 // the shim is rebuilt. 621 // the shim is rebuilt.
619 WindowedAppShimLaunchObserver(app->id()).Wait(); 622 WindowedAppShimLaunchObserver(app->id()).Wait();
620 623
621 EXPECT_TRUE(GetFirstAppWindow()); 624 EXPECT_TRUE(GetFirstAppWindow());
622 EXPECT_TRUE(HasAppShimHost(profile(), app->id())); 625 EXPECT_TRUE(HasAppShimHost(profile(), app->id()));
623 } 626 }
624 627
625 #endif // defined(ARCH_CPU_64_BITS) 628 #endif // defined(ARCH_CPU_64_BITS)
626 629
627 } // namespace apps 630 } // namespace apps
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698