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 "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/common/api/app_runtime.h" | 7 #include "apps/common/api/app_runtime.h" |
8 #include "apps/launcher.h" | 8 #include "apps/launcher.h" |
9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 #define MAYBE_AppWindowRestoreState DISABLED_AppWindowRestoreState | 741 #define MAYBE_AppWindowRestoreState DISABLED_AppWindowRestoreState |
742 #else | 742 #else |
743 #define MAYBE_AppWindowRestoreState AppWindowRestoreState | 743 #define MAYBE_AppWindowRestoreState AppWindowRestoreState |
744 #endif | 744 #endif |
745 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_AppWindowRestoreState) { | 745 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_AppWindowRestoreState) { |
746 ASSERT_TRUE(RunPlatformAppTest("platform_apps/restore_state")); | 746 ASSERT_TRUE(RunPlatformAppTest("platform_apps/restore_state")); |
747 } | 747 } |
748 | 748 |
749 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, | 749 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
750 AppWindowAdjustBoundsToBeVisibleOnScreen) { | 750 AppWindowAdjustBoundsToBeVisibleOnScreen) { |
751 // TODO(benwells): Remove this logging once flakiness has been observed. | |
752 // See http://crbug.com/377754. | |
753 ExtensionTestMessageListener launched_listener("Launched", false); | 751 ExtensionTestMessageListener launched_listener("Launched", false); |
754 | 752 |
755 LOG(WARNING) << "Loading minimal app"; | |
756 const Extension* extension = LoadAndLaunchPlatformApp("minimal"); | 753 const Extension* extension = LoadAndLaunchPlatformApp("minimal"); |
757 EXPECT_TRUE(launched_listener.WaitUntilSatisfied()); | 754 EXPECT_TRUE(launched_listener.WaitUntilSatisfied()); |
758 | 755 |
759 LOG(WARNING) << "Creating window"; | |
760 AppWindow* window = CreateAppWindow(extension); | 756 AppWindow* window = CreateAppWindow(extension); |
761 | 757 |
762 LOG(WARNING) << "Performing tests"; | |
763 // The screen bounds didn't change, the cached bounds didn't need to adjust. | 758 // The screen bounds didn't change, the cached bounds didn't need to adjust. |
764 gfx::Rect cached_bounds(80, 100, 400, 400); | 759 gfx::Rect cached_bounds(80, 100, 400, 400); |
765 gfx::Rect cached_screen_bounds(0, 0, 1600, 900); | 760 gfx::Rect cached_screen_bounds(0, 0, 1600, 900); |
766 gfx::Rect current_screen_bounds(0, 0, 1600, 900); | 761 gfx::Rect current_screen_bounds(0, 0, 1600, 900); |
767 gfx::Size minimum_size(200, 200); | 762 gfx::Size minimum_size(200, 200); |
768 gfx::Rect bounds; | 763 gfx::Rect bounds; |
769 CallAdjustBoundsToBeVisibleOnScreenForAppWindow(window, | 764 CallAdjustBoundsToBeVisibleOnScreenForAppWindow(window, |
770 cached_bounds, | 765 cached_bounds, |
771 cached_screen_bounds, | 766 cached_screen_bounds, |
772 current_screen_bounds, | 767 current_screen_bounds, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 | 815 |
821 // Don't resize the bounds smaller than minimum size, when the minimum size is | 816 // Don't resize the bounds smaller than minimum size, when the minimum size is |
822 // larger than the screen. | 817 // larger than the screen. |
823 CallAdjustBoundsToBeVisibleOnScreenForAppWindow(window, | 818 CallAdjustBoundsToBeVisibleOnScreenForAppWindow(window, |
824 big_cache_bounds, | 819 big_cache_bounds, |
825 gfx::Rect(0, 0, 1600, 1000), | 820 gfx::Rect(0, 0, 1600, 1000), |
826 gfx::Rect(0, 0, 800, 600), | 821 gfx::Rect(0, 0, 800, 600), |
827 gfx::Size(900, 900), | 822 gfx::Size(900, 900), |
828 &bounds); | 823 &bounds); |
829 EXPECT_EQ(bounds, gfx::Rect(0, 0, 900, 900)); | 824 EXPECT_EQ(bounds, gfx::Rect(0, 0, 900, 900)); |
830 LOG(WARNING) << "Tests complete"; | |
831 } | 825 } |
832 | 826 |
833 namespace { | 827 namespace { |
834 | 828 |
835 class PlatformAppDevToolsBrowserTest : public PlatformAppBrowserTest { | 829 class PlatformAppDevToolsBrowserTest : public PlatformAppBrowserTest { |
836 protected: | 830 protected: |
837 enum TestFlags { | 831 enum TestFlags { |
838 RELAUNCH = 0x1, | 832 RELAUNCH = 0x1, |
839 HAS_ID = 0x2, | 833 HAS_ID = 0x2, |
840 }; | 834 }; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 | 1321 |
1328 ExtensionApiTest::ResultCatcher result_catcher; | 1322 ExtensionApiTest::ResultCatcher result_catcher; |
1329 | 1323 |
1330 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 1324 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
1331 | 1325 |
1332 EXPECT_TRUE(result_catcher.GetNextResult()); | 1326 EXPECT_TRUE(result_catcher.GetNextResult()); |
1333 } | 1327 } |
1334 } | 1328 } |
1335 | 1329 |
1336 } // namespace extensions | 1330 } // namespace extensions |
OLD | NEW |