Chromium Code Reviews| Index: chrome/browser/ui/extensions/hosted_app_browsertest.cc |
| diff --git a/chrome/browser/ui/extensions/hosted_app_browsertest.cc b/chrome/browser/ui/extensions/hosted_app_browsertest.cc |
| index 97e02189983d15f772cec4e01326a125b9ad2b7a..439593eee30290146cb91691841a262e470364d9 100644 |
| --- a/chrome/browser/ui/extensions/hosted_app_browsertest.cc |
| +++ b/chrome/browser/ui/extensions/hosted_app_browsertest.cc |
| @@ -15,7 +15,6 @@ |
| #include "chrome/browser/ui/extensions/hosted_app_browser_controller.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| #include "chrome/browser/web_applications/web_app.h" |
| -#include "chrome/common/chrome_switches.h" |
| #include "chrome/test/base/ui_test_utils.h" |
| #include "content/public/browser/web_contents.h" |
| #include "extensions/browser/extension_registry.h" |
| @@ -23,6 +22,11 @@ |
| #include "extensions/common/extension.h" |
| #include "extensions/common/extension_set.h" |
| +#if defined(OS_MACOSX) |
| +#include "chrome/common/chrome_features.h" |
| +#include "content/public/common/content_switches.h" |
| +#endif |
| + |
| using content::WebContents; |
| using extensions::Extension; |
| @@ -39,6 +43,13 @@ void NavigateAndCheckForLocationBar(Browser* browser, |
| browser->hosted_app_controller()->ShouldShowLocationBar()); |
| } |
| +void EnsureBookmarkAppsEnabled() { |
| +#if defined(OS_MACOSX) |
| + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| + switches::kEnableFeatures, features::kBookmarkApps.name); |
|
dominickn
2017/03/22 04:18:12
Can you use base::FeatureList::RegisterOverride or
tapted
2017/03/23 02:59:58
Done.
|
| +#endif |
| +} |
| + |
| } // namespace |
| class HostedAppTest : public ExtensionBrowserTest { |
| @@ -82,8 +93,7 @@ class HostedAppTest : public ExtensionBrowserTest { |
| // Check that the location bar is shown correctly for bookmark apps. |
| IN_PROC_BROWSER_TEST_F(HostedAppTest, |
| ShouldShowLocationBarForBookmarkApp) { |
| - base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| - switches::kEnableNewBookmarkApps); |
| + EnsureBookmarkAppsEnabled(); |
| SetupApp("app", true); |
| @@ -105,8 +115,7 @@ IN_PROC_BROWSER_TEST_F(HostedAppTest, |
| // they navigate to a HTTPS page on the same origin. |
| IN_PROC_BROWSER_TEST_F(HostedAppTest, |
| ShouldShowLocationBarForHTTPBookmarkApp) { |
| - base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| - switches::kEnableNewBookmarkApps); |
| + EnsureBookmarkAppsEnabled(); |
| SetupApp("app", true); |
| @@ -124,8 +133,7 @@ IN_PROC_BROWSER_TEST_F(HostedAppTest, |
| // they navigate to a HTTP page on the same origin. |
| IN_PROC_BROWSER_TEST_F(HostedAppTest, |
| ShouldShowLocationBarForHTTPSBookmarkApp) { |
| - base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| - switches::kEnableNewBookmarkApps); |
| + EnsureBookmarkAppsEnabled(); |
| SetupApp("https_app", true); |