Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: chrome/browser/ui/cocoa/passwords/passwords_bubble_browsertest.mm

Issue 2253233005: Change ScopedVector to vector<unique_ptr> in the password's UI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android+ Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698