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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
10 #include "chrome/browser/extensions/browser_action_test_util.h" | 10 #include "chrome/browser/extensions/browser_action_test_util.h" |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 EXPECT_FALSE(gfx::test::AreImagesEqual(first_icon, next_icon)); | 758 EXPECT_FALSE(gfx::test::AreImagesEqual(first_icon, next_icon)); |
759 } | 759 } |
760 | 760 |
761 // Test that we don't try and show a browser action popup with | 761 // Test that we don't try and show a browser action popup with |
762 // browserAction.openPopup if there is no toolbar (e.g., for web popup windows). | 762 // browserAction.openPopup if there is no toolbar (e.g., for web popup windows). |
763 // Regression test for crbug.com/584747. | 763 // Regression test for crbug.com/584747. |
764 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, BrowserActionOpenPopupOnPopup) { | 764 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, BrowserActionOpenPopupOnPopup) { |
765 // Open a new web popup window. | 765 // Open a new web popup window. |
766 chrome::NavigateParams params(browser(), GURL("http://www.google.com/"), | 766 chrome::NavigateParams params(browser(), GURL("http://www.google.com/"), |
767 ui::PAGE_TRANSITION_LINK); | 767 ui::PAGE_TRANSITION_LINK); |
768 params.disposition = NEW_POPUP; | 768 params.disposition = WindowOpenDisposition::NEW_POPUP; |
769 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 769 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
770 ui_test_utils::NavigateToURL(¶ms); | 770 ui_test_utils::NavigateToURL(¶ms); |
771 Browser* popup_browser = params.browser; | 771 Browser* popup_browser = params.browser; |
772 // Verify it is a popup, and it is the active window. | 772 // Verify it is a popup, and it is the active window. |
773 ASSERT_TRUE(popup_browser); | 773 ASSERT_TRUE(popup_browser); |
774 // The window isn't considered "active" on MacOSX for odd reasons. The more | 774 // The window isn't considered "active" on MacOSX for odd reasons. The more |
775 // important test is that it *is* considered the last active browser, since | 775 // important test is that it *is* considered the last active browser, since |
776 // that's what we check when we try to open the popup. | 776 // that's what we check when we try to open the popup. |
777 #if !defined(OS_MACOSX) | 777 #if !defined(OS_MACOSX) |
778 EXPECT_TRUE(popup_browser->window()->IsActive()); | 778 EXPECT_TRUE(popup_browser->window()->IsActive()); |
(...skipping 10 matching lines...) Expand all Loading... |
789 test_data_dir_.AppendASCII("browser_action/open_popup_on_reply"))); | 789 test_data_dir_.AppendASCII("browser_action/open_popup_on_reply"))); |
790 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 790 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
791 | 791 |
792 ResultCatcher catcher; | 792 ResultCatcher catcher; |
793 listener.Reply(std::string()); | 793 listener.Reply(std::string()); |
794 EXPECT_TRUE(catcher.GetNextResult()) << message_; | 794 EXPECT_TRUE(catcher.GetNextResult()) << message_; |
795 } | 795 } |
796 | 796 |
797 } // namespace | 797 } // namespace |
798 } // namespace extensions | 798 } // namespace extensions |
OLD | NEW |