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

Side by Side Diff: base/barrier_closure_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « base/atomicops_unittest.cc ('k') | base/base64_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/barrier_closure.h" 5 #include "base/barrier_closure.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/googletest/include/gtest/gtest.h"
9 9
10 namespace { 10 namespace {
11 11
12 void Increment(int* count) { (*count)++; } 12 void Increment(int* count) { (*count)++; }
13 13
14 TEST(BarrierClosureTest, RunImmediatelyForZeroClosures) { 14 TEST(BarrierClosureTest, RunImmediatelyForZeroClosures) {
15 int count = 0; 15 int count = 0;
16 base::Closure done_closure(base::Bind(&Increment, base::Unretained(&count))); 16 base::Closure done_closure(base::Bind(&Increment, base::Unretained(&count)));
17 17
18 base::Closure barrier_closure = base::BarrierClosure(0, done_closure); 18 base::Closure barrier_closure = base::BarrierClosure(0, done_closure);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // would crash inside Run(). 71 // would crash inside Run().
72 TEST(BarrierClosureTest, KeepingClosureAliveUntilDone) { 72 TEST(BarrierClosureTest, KeepingClosureAliveUntilDone) {
73 base::Closure barrier_closure; 73 base::Closure barrier_closure;
74 base::Closure done_closure = 74 base::Closure done_closure =
75 base::Bind(ResetBarrierClosure, &barrier_closure); 75 base::Bind(ResetBarrierClosure, &barrier_closure);
76 barrier_closure = base::BarrierClosure(1, done_closure); 76 barrier_closure = base::BarrierClosure(1, done_closure);
77 barrier_closure.Run(); 77 barrier_closure.Run();
78 } 78 }
79 79
80 } // namespace 80 } // namespace
OLDNEW
« no previous file with comments | « base/atomicops_unittest.cc ('k') | base/base64_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698