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

Side by Side Diff: chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc

Issue 2824363002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/ui (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/apps/chrome_app_delegate.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/guid.h" 6 #include "base/guid.h"
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"), 152 controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"),
153 base::ASCIIToUTF16("10"), 153 base::ASCIIToUTF16("10"),
154 base::ASCIIToUTF16("19"), false); 154 base::ASCIIToUTF16("19"), false);
155 EXPECT_EQ(base::ASCIIToUTF16("123"), delegate()->response().cvc); 155 EXPECT_EQ(base::ASCIIToUTF16("123"), delegate()->response().cvc);
156 controller()->OnVerificationResult(AutofillClient::SUCCESS); 156 controller()->OnVerificationResult(AutofillClient::SUCCESS);
157 157
158 // Simulate the user clicking [x] before the "Success!" message disappears. 158 // Simulate the user clicking [x] before the "Success!" message disappears.
159 CardUnmaskPromptViewTester::For(controller()->view())->Close(); 159 CardUnmaskPromptViewTester::For(controller()->view())->Close();
160 // Wait a little while; there should be no crash. 160 // Wait a little while; there should be no crash.
161 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 161 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
162 FROM_HERE, base::Bind(&content::MessageLoopRunner::Quit, 162 FROM_HERE,
163 base::Unretained(runner_.get())), 163 base::BindOnce(&content::MessageLoopRunner::Quit,
164 base::Unretained(runner_.get())),
164 2 * controller()->GetSuccessMessageDuration()); 165 2 * controller()->GetSuccessMessageDuration());
165 runner_->Run(); 166 runner_->Run();
166 } 167 }
167 #endif 168 #endif
168 169
169 // Makes sure the tab can be closed while the dialog is showing. 170 // Makes sure the tab can be closed while the dialog is showing.
170 // https://crbug.com/484376 171 // https://crbug.com/484376
171 IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, 172 IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest,
172 CloseTabWhileDialogShowing) { 173 CloseTabWhileDialogShowing) {
173 ShowDialog(kExpiryExpired); 174 ShowDialog(kExpiryExpired);
174 // Simulate AutofillManager (the delegate in production code) being destroyed 175 // Simulate AutofillManager (the delegate in production code) being destroyed
175 // before CardUnmaskPromptViewBridge::OnConstrainedWindowClosed() is called. 176 // before CardUnmaskPromptViewBridge::OnConstrainedWindowClosed() is called.
176 FreeDelegate(); 177 FreeDelegate();
177 browser()->tab_strip_model()->GetActiveWebContents()->Close(); 178 browser()->tab_strip_model()->GetActiveWebContents()->Close();
178 179
179 content::RunAllPendingInMessageLoop(); 180 content::RunAllPendingInMessageLoop();
180 } 181 }
181 182
182 } // namespace 183 } // namespace
183 184
184 } // namespace autofill 185 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/apps/chrome_app_delegate.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698