| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mac/foundation_util.h" | 5 #include "base/mac/foundation_util.h" |
| 6 #include "base/mac/scoped_objc_class_swizzler.h" | 6 #include "base/mac/scoped_objc_class_swizzler.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
| 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 [controller() retain]); | 120 [controller() retain]); |
| 121 EXPECT_TRUE(bubble_controller); | 121 EXPECT_TRUE(bubble_controller); |
| 122 EXPECT_TRUE(view()->active()); | 122 EXPECT_TRUE(view()->active()); |
| 123 | 123 |
| 124 // Open the bubble again, the first one should be replaced. | 124 // Open the bubble again, the first one should be replaced. |
| 125 DoWithSwizzledNSWindow(^{ SetupPendingPassword(); }); | 125 DoWithSwizzledNSWindow(^{ SetupPendingPassword(); }); |
| 126 EXPECT_NSNE(bubble_controller, controller()); | 126 EXPECT_NSNE(bubble_controller, controller()); |
| 127 EXPECT_TRUE(controller()); | 127 EXPECT_TRUE(controller()); |
| 128 EXPECT_TRUE(view()->active()); | 128 EXPECT_TRUE(view()->active()); |
| 129 } | 129 } |
| 130 |
| 131 IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleTest, DoubleOpenDifferentBubbles) { |
| 132 // Open the autosignin bubble first. |
| 133 DoWithSwizzledNSWindow(^{ |
| 134 ScopedVector<autofill::PasswordForm> local_credentials; |
| 135 local_credentials.push_back(new autofill::PasswordForm(*test_form())); |
| 136 SetupAutoSignin(std::move(local_credentials)); |
| 137 }); |
| 138 EXPECT_TRUE(controller()); |
| 139 EXPECT_TRUE(view()->active()); |
| 140 |
| 141 // Open the save bubble. The previous one is closed twice (with and without |
| 142 // animation). It shouldn't cause DCHECK. |
| 143 DoWithSwizzledNSWindow(^{ SetupPendingPassword(); }); |
| 144 EXPECT_TRUE(controller()); |
| 145 EXPECT_TRUE(view()->active()); |
| 146 } |
| OLD | NEW |