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

Side by Side Diff: chrome/browser/safe_browsing/ui_manager_unittest.cc

Issue 2821193005: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/safe_browsing (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/safe_browsing/ui_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/safe_browsing/ui_manager.h" 5 #include "chrome/browser/safe_browsing/ui_manager.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
10 #include "chrome/browser/safe_browsing/ui_manager.h" 10 #include "chrome/browser/safe_browsing/ui_manager.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 DCHECK_CURRENTLY_ON(BrowserThread::UI); 44 DCHECK_CURRENTLY_ON(BrowserThread::UI);
45 callback_called_ = true; 45 callback_called_ = true;
46 proceed_ = proceed; 46 proceed_ = proceed;
47 loop_.Quit(); 47 loop_.Quit();
48 } 48 }
49 49
50 void OnBlockingPageDoneOnIO(bool proceed) { 50 void OnBlockingPageDoneOnIO(bool proceed) {
51 DCHECK_CURRENTLY_ON(BrowserThread::IO); 51 DCHECK_CURRENTLY_ON(BrowserThread::IO);
52 BrowserThread::PostTask( 52 BrowserThread::PostTask(
53 BrowserThread::UI, FROM_HERE, 53 BrowserThread::UI, FROM_HERE,
54 base::Bind(&SafeBrowsingCallbackWaiter::OnBlockingPageDone, 54 base::BindOnce(&SafeBrowsingCallbackWaiter::OnBlockingPageDone,
55 base::Unretained(this), proceed)); 55 base::Unretained(this), proceed));
56 } 56 }
57 57
58 void WaitForCallback() { 58 void WaitForCallback() {
59 DCHECK_CURRENTLY_ON(BrowserThread::UI); 59 DCHECK_CURRENTLY_ON(BrowserThread::UI);
60 loop_.Run(); 60 loop_.Run();
61 } 61 }
62 62
63 private: 63 private:
64 bool callback_called_ = false; 64 bool callback_called_ = false;
65 bool proceed_ = false; 65 bool proceed_ = false;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 SimulateBlockingPageDone(resources, true); 414 SimulateBlockingPageDone(resources, true);
415 EXPECT_TRUE(delegate.visible_security_state_changed()); 415 EXPECT_TRUE(delegate.visible_security_state_changed());
416 416
417 waiter.WaitForCallback(); 417 waiter.WaitForCallback();
418 EXPECT_TRUE(waiter.callback_called()); 418 EXPECT_TRUE(waiter.callback_called());
419 EXPECT_TRUE(waiter.proceed()); 419 EXPECT_TRUE(waiter.proceed());
420 EXPECT_TRUE(IsWhitelisted(resource)); 420 EXPECT_TRUE(IsWhitelisted(resource));
421 } 421 }
422 422
423 } // namespace safe_browsing 423 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698