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

Side by Side Diff: mojo/system/simple_dispatcher_unittest.cc

Issue 136343004: Mojo: Add a "GetType()" to Dispatchers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/message_pipe_dispatcher.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 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 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a 5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a
6 // heavily-loaded system). Sorry. |kEpsilonMicros| may be increased to increase 6 // heavily-loaded system). Sorry. |kEpsilonMicros| may be increased to increase
7 // tolerance and reduce observed flakiness. 7 // tolerance and reduce observed flakiness.
8 8
9 #include "mojo/system/simple_dispatcher.h" 9 #include "mojo/system/simple_dispatcher.h"
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 void SetSatisfiableFlags(MojoWaitFlags new_satisfiable_flags) { 50 void SetSatisfiableFlags(MojoWaitFlags new_satisfiable_flags) {
51 base::AutoLock locker(lock()); 51 base::AutoLock locker(lock());
52 52
53 if (new_satisfiable_flags == satisfiable_flags_) 53 if (new_satisfiable_flags == satisfiable_flags_)
54 return; 54 return;
55 55
56 satisfiable_flags_ = new_satisfiable_flags; 56 satisfiable_flags_ = new_satisfiable_flags;
57 StateChangedNoLock(); 57 StateChangedNoLock();
58 } 58 }
59 59
60 virtual Type GetType() OVERRIDE {
61 return kTypeUnknown;
62 }
63
60 private: 64 private:
61 friend class base::RefCountedThreadSafe<MockSimpleDispatcher>; 65 friend class base::RefCountedThreadSafe<MockSimpleDispatcher>;
62 virtual ~MockSimpleDispatcher() {} 66 virtual ~MockSimpleDispatcher() {}
63 67
64 virtual scoped_refptr<Dispatcher> 68 virtual scoped_refptr<Dispatcher>
65 CreateEquivalentDispatcherAndCloseImplNoLock() OVERRIDE { 69 CreateEquivalentDispatcherAndCloseImplNoLock() OVERRIDE {
66 scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher()); 70 scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher());
67 rv->satisfied_flags_ = satisfied_flags_; 71 rv->satisfied_flags_ = satisfied_flags_;
68 rv->satisfiable_flags_ = satisfiable_flags_; 72 rv->satisfiable_flags_ = satisfiable_flags_;
69 return scoped_refptr<Dispatcher>(rv.get()); 73 return scoped_refptr<Dispatcher>(rv.get());
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 EXPECT_TRUE(did_wait[i]); 517 EXPECT_TRUE(did_wait[i]);
514 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, result[i]); 518 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, result[i]);
515 } 519 }
516 } 520 }
517 521
518 // TODO(vtl): Stress test? 522 // TODO(vtl): Stress test?
519 523
520 } // namespace 524 } // namespace
521 } // namespace system 525 } // namespace system
522 } // namespace mojo 526 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698