| 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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
| 6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
| 7 #include "apps/ui/native_app_window.h" | 7 #include "apps/ui/native_app_window.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/apps/app_browsertest_util.h" | 10 #include "chrome/browser/apps/app_browsertest_util.h" |
| 11 #include "chrome/browser/extensions/extension_test_message_listener.h" | 11 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/common/extensions/features/feature_channel.h" | 13 #include "chrome/common/extensions/features/feature_channel.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "ui/base/base_window.h" | 15 #include "ui/base/base_window.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 | 17 |
| 18 #if defined(OS_WIN) |
| 19 #include "ui/base/win/shell.h" |
| 20 #endif |
| 21 |
| 18 using apps::AppWindow; | 22 using apps::AppWindow; |
| 19 | 23 |
| 20 namespace { | 24 namespace { |
| 21 | 25 |
| 22 class TestAppWindowRegistryObserver : public apps::AppWindowRegistry::Observer { | 26 class TestAppWindowRegistryObserver : public apps::AppWindowRegistry::Observer { |
| 23 public: | 27 public: |
| 24 explicit TestAppWindowRegistryObserver(Profile* profile) | 28 explicit TestAppWindowRegistryObserver(Profile* profile) |
| 25 : profile_(profile), icon_updates_(0) { | 29 : profile_(profile), icon_updates_(0) { |
| 26 apps::AppWindowRegistry::Get(profile_)->AddObserver(this); | 30 apps::AppWindowRegistry::Get(profile_)->AddObserver(this); |
| 27 } | 31 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 WindowsApiAlwaysOnTopNoPermissions) { | 107 WindowsApiAlwaysOnTopNoPermissions) { |
| 104 EXPECT_TRUE(RunPlatformAppTest( | 108 EXPECT_TRUE(RunPlatformAppTest( |
| 105 "platform_apps/windows_api_always_on_top/no_permissions")) << message_; | 109 "platform_apps/windows_api_always_on_top/no_permissions")) << message_; |
| 106 } | 110 } |
| 107 | 111 |
| 108 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiGet) { | 112 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiGet) { |
| 109 EXPECT_TRUE(RunPlatformAppTest("platform_apps/windows_api_get")) | 113 EXPECT_TRUE(RunPlatformAppTest("platform_apps/windows_api_get")) |
| 110 << message_; | 114 << message_; |
| 111 } | 115 } |
| 112 | 116 |
| 117 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
| 118 WindowsApiAlphaEnabledHasPermissions) { |
| 119 const char* no_alpha_dir = |
| 120 "platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha"; |
| 121 const char* test_dir = no_alpha_dir; |
| 122 |
| 123 #if defined(USE_AURA) && (defined(OS_CHROMEOS) || !defined(OS_LINUX)) |
| 124 test_dir = |
| 125 "platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha"; |
| 126 #if defined(OS_WIN) |
| 127 if (!ui::win::IsAeroGlassEnabled()) { |
| 128 test_dir = no_alpha_dir; |
| 129 } |
| 130 #endif // OS_WIN |
| 131 #endif // USE_AURA && (OS_CHROMEOS || !OS_LINUX) |
| 132 |
| 133 EXPECT_TRUE(RunPlatformAppTest(test_dir)) << message_; |
| 134 } |
| 135 |
| 136 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
| 137 WindowsApiAlphaEnabledNoPermissions) { |
| 138 EXPECT_TRUE(RunPlatformAppTest( |
| 139 "platform_apps/windows_api_alpha_enabled/no_permissions")) |
| 140 << message_; |
| 141 } |
| 142 |
| 143 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiAlphaEnabledInStable) { |
| 144 extensions::ScopedCurrentChannel channel(chrome::VersionInfo::CHANNEL_STABLE); |
| 145 EXPECT_TRUE(RunPlatformAppTestWithFlags( |
| 146 "platform_apps/windows_api_alpha_enabled/in_stable", |
| 147 // Ignore manifest warnings because the extension will not load at all |
| 148 // in stable. |
| 149 kFlagIgnoreManifestWarnings)) |
| 150 << message_; |
| 151 } |
| 152 |
| 113 } // namespace extensions | 153 } // namespace extensions |
| OLD | NEW |