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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 130 |
131 IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleTest, DoubleOpenDifferentBubbles) { | 131 IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleTest, DoubleOpenDifferentBubbles) { |
132 // Open the autosignin bubble first. | 132 // Open the autosignin bubble first. |
133 DoWithSwizzledNSWindow(^{ | 133 DoWithSwizzledNSWindow(^{ |
134 ScopedVector<autofill::PasswordForm> local_credentials; | 134 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials; |
135 local_credentials.push_back(new autofill::PasswordForm(*test_form())); | 135 local_credentials.emplace_back(new autofill::PasswordForm(*test_form())); |
136 SetupAutoSignin(std::move(local_credentials)); | 136 SetupAutoSignin(std::move(local_credentials)); |
137 }); | 137 }); |
138 EXPECT_TRUE(controller()); | 138 EXPECT_TRUE(controller()); |
139 EXPECT_TRUE(view()->active()); | 139 EXPECT_TRUE(view()->active()); |
140 | 140 |
141 // Open the save bubble. The previous one is closed twice (with and without | 141 // Open the save bubble. The previous one is closed twice (with and without |
142 // animation). It shouldn't cause DCHECK. | 142 // animation). It shouldn't cause DCHECK. |
143 DoWithSwizzledNSWindow(^{ SetupPendingPassword(); }); | 143 DoWithSwizzledNSWindow(^{ SetupPendingPassword(); }); |
144 EXPECT_TRUE(controller()); | 144 EXPECT_TRUE(controller()); |
145 EXPECT_TRUE(view()->active()); | 145 EXPECT_TRUE(view()->active()); |
146 } | 146 } |
OLD | NEW |