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

Side by Side Diff: remoting/protocol/jingle_session_unittest.cc

Issue 8483003: Callback API Change: Reimplement Bind(); support IgnoreResult, full currying, and use less types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 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 | Annotate | Revision Log
« no previous file with comments | « media/tools/player_x11/player_x11.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 void OnTimeoutTerminateThread(bool* timeout) { 78 void OnTimeoutTerminateThread(bool* timeout) {
79 *timeout = true; 79 *timeout = true;
80 QuitCurrentThread(); 80 QuitCurrentThread();
81 } 81 }
82 82
83 bool RunMessageLoopWithTimeout(int timeout_ms) { 83 bool RunMessageLoopWithTimeout(int timeout_ms) {
84 bool timeout = false; 84 bool timeout = false;
85 MessageLoop::current()->PostDelayedTask( 85 MessageLoop::current()->PostDelayedTask(
86 FROM_HERE, base::Bind(OnTimeoutTerminateThread, &timeout), timeout_ms); 86 FROM_HERE, base::Bind(&OnTimeoutTerminateThread, &timeout), timeout_ms);
87 MessageLoop::current()->Run(); 87 MessageLoop::current()->Run();
88 return !timeout; 88 return !timeout;
89 } 89 }
90 90
91 ACTION_P(QuitThreadOnCounter, counter) { 91 ACTION_P(QuitThreadOnCounter, counter) {
92 (*counter)--; 92 (*counter)--;
93 EXPECT_GE(*counter, 0); 93 EXPECT_GE(*counter, 0);
94 if (*counter == 0) 94 if (*counter == 0)
95 QuitCurrentThread(); 95 QuitCurrentThread();
96 } 96 }
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 ASSERT_TRUE(tester->WaitFinished()); 788 ASSERT_TRUE(tester->WaitFinished());
789 LOG(INFO) << "Time for 500k bytes " 789 LOG(INFO) << "Time for 500k bytes "
790 << tester->GetElapsedTime().InMilliseconds() << " ms."; 790 << tester->GetElapsedTime().InMilliseconds() << " ms.";
791 791
792 // Connections must be closed while |tester| still exists. 792 // Connections must be closed while |tester| still exists.
793 CloseSessions(); 793 CloseSessions();
794 } 794 }
795 795
796 } // namespace protocol 796 } // namespace protocol
797 } // namespace remoting 797 } // namespace remoting
OLDNEW
« no previous file with comments | « media/tools/player_x11/player_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698