| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/compiler_specific.h" | |
| 6 #include "base/macros.h" | 5 #include "base/macros.h" |
| 7 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 8 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 9 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 10 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
| 11 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
| 14 #include "components/version_info/version_info.h" | 13 #include "components/version_info/version_info.h" |
| 15 #include "extensions/browser/app_window/app_window.h" | 14 #include "extensions/browser/app_window/app_window.h" |
| 16 #include "extensions/browser/app_window/app_window_registry.h" | 15 #include "extensions/browser/app_window/app_window_registry.h" |
| 17 #include "extensions/browser/app_window/native_app_window.h" | 16 #include "extensions/browser/app_window/native_app_window.h" |
| 18 #include "extensions/common/features/feature_channel.h" | 17 #include "extensions/common/features/feature_channel.h" |
| 19 #include "extensions/test/extension_test_message_listener.h" | 18 #include "extensions/test/extension_test_message_listener.h" |
| 20 #include "ui/base/base_window.h" | 19 #include "ui/base/base_window.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
| 22 | 21 |
| 23 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 24 #include "ui/base/win/shell.h" | 23 #include "ui/base/win/shell.h" |
| 25 #endif | 24 #endif |
| 26 | 25 |
| 27 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 28 #include "ui/gfx/x/x11_switches.h" | |
| 29 #endif | |
| 30 | |
| 31 namespace extensions { | 26 namespace extensions { |
| 32 | 27 |
| 33 namespace { | 28 namespace { |
| 34 | 29 |
| 35 class TestAppWindowRegistryObserver : public AppWindowRegistry::Observer { | 30 class TestAppWindowRegistryObserver : public AppWindowRegistry::Observer { |
| 36 public: | 31 public: |
| 37 explicit TestAppWindowRegistryObserver(Profile* profile) | 32 explicit TestAppWindowRegistryObserver(Profile* profile) |
| 38 : profile_(profile), icon_updates_(0) { | 33 : profile_(profile), icon_updates_(0) { |
| 39 AppWindowRegistry::Get(profile_)->AddObserver(this); | 34 AppWindowRegistry::Get(profile_)->AddObserver(this); |
| 40 } | 35 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 123 } |
| 129 | 124 |
| 130 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiSetShapeNoPerm) { | 125 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiSetShapeNoPerm) { |
| 131 EXPECT_TRUE( | 126 EXPECT_TRUE( |
| 132 RunPlatformAppTest("platform_apps/windows_api_shape/no_permission")) | 127 RunPlatformAppTest("platform_apps/windows_api_shape/no_permission")) |
| 133 << message_; | 128 << message_; |
| 134 } | 129 } |
| 135 | 130 |
| 136 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, | 131 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
| 137 WindowsApiAlphaEnabledHasPermissions) { | 132 WindowsApiAlphaEnabledHasPermissions) { |
| 138 const char kNoAlphaDir[] = | 133 const char* no_alpha_dir = |
| 139 "platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha"; | 134 "platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha"; |
| 140 const char kHasAlphaDir[] = | 135 const char* test_dir = no_alpha_dir; |
| 141 "platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha"; | |
| 142 ALLOW_UNUSED_LOCAL(kHasAlphaDir); | |
| 143 const char* test_dir = kNoAlphaDir; | |
| 144 | 136 |
| 145 #if defined(USE_AURA) && (defined(OS_CHROMEOS) || !defined(OS_LINUX)) | 137 #if defined(USE_AURA) && (defined(OS_CHROMEOS) || !defined(OS_LINUX)) |
| 146 test_dir = kHasAlphaDir; | 138 test_dir = |
| 147 | 139 "platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha"; |
| 148 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
| 149 if (!ui::win::IsAeroGlassEnabled()) { | 141 if (!ui::win::IsAeroGlassEnabled()) { |
| 150 test_dir = kNoAlphaDir; | 142 test_dir = no_alpha_dir; |
| 151 } | 143 } |
| 152 #endif // OS_WIN | 144 #endif // OS_WIN |
| 153 #endif // USE_AURA && (OS_CHROMEOS || !OS_LINUX) | 145 #endif // USE_AURA && (OS_CHROMEOS || !OS_LINUX) |
| 154 | 146 |
| 155 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 156 if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | |
| 157 switches::kWindowDepth) == "32") { | |
| 158 test_dir = kHasAlphaDir; | |
| 159 } | |
| 160 #endif // USE_X11 && !OS_CHROMEOS | |
| 161 | |
| 162 EXPECT_TRUE(RunPlatformAppTest(test_dir)) << message_; | 147 EXPECT_TRUE(RunPlatformAppTest(test_dir)) << message_; |
| 163 } | 148 } |
| 164 | 149 |
| 165 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, | 150 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
| 166 WindowsApiAlphaEnabledNoPermissions) { | 151 WindowsApiAlphaEnabledNoPermissions) { |
| 167 EXPECT_TRUE(RunPlatformAppTest( | 152 EXPECT_TRUE(RunPlatformAppTest( |
| 168 "platform_apps/windows_api_alpha_enabled/no_permissions")) | 153 "platform_apps/windows_api_alpha_enabled/no_permissions")) |
| 169 << message_; | 154 << message_; |
| 170 } | 155 } |
| 171 | 156 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 command_line->AppendSwitchASCII(switches::kAppId, | 210 command_line->AppendSwitchASCII(switches::kAppId, |
| 226 "jkghodnilhceideoidjikpgommlajknk"); | 211 "jkghodnilhceideoidjikpgommlajknk"); |
| 227 | 212 |
| 228 EXPECT_TRUE(RunComponentExtensionTest( | 213 EXPECT_TRUE(RunComponentExtensionTest( |
| 229 "platform_apps/windows_api_ime/forced_app_mode_not_fullscreen")) | 214 "platform_apps/windows_api_ime/forced_app_mode_not_fullscreen")) |
| 230 << message_; | 215 << message_; |
| 231 } | 216 } |
| 232 #endif // OS_CHROMEOS | 217 #endif // OS_CHROMEOS |
| 233 | 218 |
| 234 } // namespace extensions | 219 } // namespace extensions |
| OLD | NEW |