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

Side by Side Diff: chrome/browser/sync/util/event_sys_unittest.cc

Issue 279004: Made sync code build and pass unit tests on OS X. (Closed)
Patch Set: Fixed uninitialized var error. Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <iosfwd> 5 #include <iosfwd>
6 #include <sstream> 6 #include <sstream>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 delete *i; 80 delete *i;
81 } 81 }
82 82
83 void Hookup(const string name, Pair::Channel* channel) { 83 void Hookup(const string name, Pair::Channel* channel) {
84 hookups_.push_back(NewEventListenerHookup(channel, this, 84 hookups_.push_back(NewEventListenerHookup(channel, this,
85 &EventLogger::HandlePairEvent, 85 &EventLogger::HandlePairEvent,
86 name)); 86 name));
87 } 87 }
88 88
89 void HandlePairEvent(const string& name, const TestEvent& event) { 89 void HandlePairEvent(const string& name, const TestEvent& event) {
90 const char* what_changed; 90 const char* what_changed = NULL;
91 int new_value; 91 int new_value = 0;
92 Hookups::iterator dead; 92 Hookups::iterator dead;
93 switch (event.what_happened) { 93 switch (event.what_happened) {
94 case TestEvent::A_CHANGED: 94 case TestEvent::A_CHANGED:
95 what_changed = "A"; 95 what_changed = "A";
96 new_value = event.source->a(); 96 new_value = event.source->a();
97 break; 97 break;
98 case TestEvent::B_CHANGED: 98 case TestEvent::B_CHANGED:
99 what_changed = "B"; 99 what_changed = "B";
100 new_value = event.source->b(); 100 new_value = event.source->b();
101 break; 101 break;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 Pair sally("Sally"); 265 Pair sally("Sally");
266 HookupDeleter deleter; 266 HookupDeleter deleter;
267 deleter.hookup_ = NewEventListenerHookup(sally.event_channel(), 267 deleter.hookup_ = NewEventListenerHookup(sally.event_channel(),
268 &deleter, 268 &deleter,
269 &HookupDeleter::HandleEvent); 269 &HookupDeleter::HandleEvent);
270 sally.set_a(1); 270 sally.set_a(1);
271 ASSERT_TRUE(NULL == deleter.hookup_); 271 ASSERT_TRUE(NULL == deleter.hookup_);
272 } 272 }
273 273
274 } // namespace 274 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698