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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/automation/automation_util.h" | 10 #include "chrome/browser/automation/automation_util.h" |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 const Extension* extension = | 764 const Extension* extension = |
765 LoadAndLaunchPlatformApp("optional_permission_request"); | 765 LoadAndLaunchPlatformApp("optional_permission_request"); |
766 ASSERT_TRUE(extension) << "Failed to load extension."; | 766 ASSERT_TRUE(extension) << "Failed to load extension."; |
767 | 767 |
768 WebContents* web_contents = GetFirstShellWindowWebContents(); | 768 WebContents* web_contents = GetFirstShellWindowWebContents(); |
769 ASSERT_TRUE(web_contents); | 769 ASSERT_TRUE(web_contents); |
770 | 770 |
771 // Verify that the shell window has a constrained window attached. | 771 // Verify that the shell window has a constrained window attached. |
772 ConstrainedWindowTabHelper* constrained_window_tab_helper = | 772 ConstrainedWindowTabHelper* constrained_window_tab_helper = |
773 ConstrainedWindowTabHelper::FromWebContents(web_contents); | 773 ConstrainedWindowTabHelper::FromWebContents(web_contents); |
774 EXPECT_EQ(1u, constrained_window_tab_helper->constrained_window_count()); | 774 EXPECT_EQ(1u, constrained_window_tab_helper->dialog_count()); |
775 | 775 |
776 // Close the constrained window and wait for the reply to the permission | 776 // Close the constrained window and wait for the reply to the permission |
777 // request. | 777 // request. |
778 ExtensionTestMessageListener listener("PermissionRequestDone", false); | 778 ExtensionTestMessageListener listener("PermissionRequestDone", false); |
779 constrained_window_tab_helper->CloseConstrainedWindows(); | 779 constrained_window_tab_helper->CloseAllDialogs(); |
780 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 780 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
781 } | 781 } |
782 | 782 |
783 // Tests that an app calling chrome.runtime.reload will reload the app and | 783 // Tests that an app calling chrome.runtime.reload will reload the app and |
784 // relaunch it if it was running. | 784 // relaunch it if it was running. |
785 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ReloadRelaunches) { | 785 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ReloadRelaunches) { |
786 ExtensionTestMessageListener launched_listener("Launched", true); | 786 ExtensionTestMessageListener launched_listener("Launched", true); |
787 const Extension* extension = LoadAndLaunchPlatformApp("reload"); | 787 const Extension* extension = LoadAndLaunchPlatformApp("reload"); |
788 ASSERT_TRUE(extension); | 788 ASSERT_TRUE(extension); |
789 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 789 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 916 |
917 ExtensionTestMessageListener launched_listener("Launched", false); | 917 ExtensionTestMessageListener launched_listener("Launched", false); |
918 application_launch::OpenApplication(application_launch::LaunchParams( | 918 application_launch::OpenApplication(application_launch::LaunchParams( |
919 browser()->profile(), extension, extension_misc::LAUNCH_NONE, | 919 browser()->profile(), extension, extension_misc::LAUNCH_NONE, |
920 NEW_WINDOW)); | 920 NEW_WINDOW)); |
921 | 921 |
922 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 922 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
923 } | 923 } |
924 | 924 |
925 } // namespace extensions | 925 } // namespace extensions |
OLD | NEW |