OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/browser/app_window/native_app_window.h" | 5 #include "extensions/browser/app_window/native_app_window.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
10 #import "base/mac/mac_util.h" | 10 #import "base/mac/mac_util.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 } // namespace | 177 } // namespace |
178 | 178 |
179 // Test Hide/Show and Hide/ShowWithApp() behavior when shims are enabled. | 179 // Test Hide/Show and Hide/ShowWithApp() behavior when shims are enabled. |
180 IN_PROC_BROWSER_TEST_P(NativeAppWindowCocoaBrowserTest, | 180 IN_PROC_BROWSER_TEST_P(NativeAppWindowCocoaBrowserTest, |
181 HideShowWithAppWithShim) { | 181 HideShowWithAppWithShim) { |
182 test::AppShimHostManagerTestApi test_api( | 182 test::AppShimHostManagerTestApi test_api( |
183 g_browser_process->platform_part()->app_shim_host_manager()); | 183 g_browser_process->platform_part()->app_shim_host_manager()); |
184 MockExtensionAppShimHandler* mock = new MockExtensionAppShimHandler(); | 184 MockExtensionAppShimHandler* mock = new MockExtensionAppShimHandler(); |
185 test_api.SetExtensionAppShimHandler( | 185 test_api.SetExtensionAppShimHandler( |
186 scoped_ptr<apps::ExtensionAppShimHandler>(mock)); // Takes ownership. | 186 std::unique_ptr<apps::ExtensionAppShimHandler>( |
| 187 mock)); // Takes ownership. |
187 MockAppShimHost mock_host; | 188 MockAppShimHost mock_host; |
188 | 189 |
189 SetUpAppWithWindows(1); | 190 SetUpAppWithWindows(1); |
190 extensions::AppWindowRegistry::AppWindowList windows = | 191 extensions::AppWindowRegistry::AppWindowList windows = |
191 extensions::AppWindowRegistry::Get(profile())->app_windows(); | 192 extensions::AppWindowRegistry::Get(profile())->app_windows(); |
192 | 193 |
193 extensions::AppWindow* app_window = windows.front(); | 194 extensions::AppWindow* app_window = windows.front(); |
194 extensions::NativeAppWindow* native_window = app_window->GetBaseWindow(); | 195 extensions::NativeAppWindow* native_window = app_window->GetBaseWindow(); |
195 NSWindow* ns_window = native_window->GetNativeWindow(); | 196 NSWindow* ns_window = native_window->GetNativeWindow(); |
196 | 197 |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 [expected_color getComponents:expected_components]; | 697 [expected_color getComponents:expected_components]; |
697 [color getComponents:color_components]; | 698 [color getComponents:color_components]; |
698 EXPECT_NEAR(expected_components[0], color_components[0], 0.01); | 699 EXPECT_NEAR(expected_components[0], color_components[0], 0.01); |
699 EXPECT_NEAR(expected_components[1], color_components[1], 0.01); | 700 EXPECT_NEAR(expected_components[1], color_components[1], 0.01); |
700 EXPECT_NEAR(expected_components[2], color_components[2], 0.01); | 701 EXPECT_NEAR(expected_components[2], color_components[2], 0.01); |
701 } | 702 } |
702 | 703 |
703 INSTANTIATE_TEST_CASE_P(NativeAppWindowCocoaBrowserTestInstance, | 704 INSTANTIATE_TEST_CASE_P(NativeAppWindowCocoaBrowserTestInstance, |
704 NativeAppWindowCocoaBrowserTest, | 705 NativeAppWindowCocoaBrowserTest, |
705 ::testing::Bool()); | 706 ::testing::Bool()); |
OLD | NEW |