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

Side by Side Diff: chrome/browser/sync/internal_api/syncapi_server_connection_manager_unittest.cc

Issue 9572039: Convert uses of int ms to TimeDelta in chrome/browser/sync. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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 | « no previous file | chrome/browser/sync/syncable/syncable_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 (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 "chrome/browser/sync/internal_api/syncapi_server_connection_manager.h" 5 #include "chrome/browser/sync/internal_api/syncapi_server_connection_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 ServerConnectionManager::PostBufferParams params; 104 ServerConnectionManager::PostBufferParams params;
105 ScopedServerStatusWatcher watcher(&server, &params.response); 105 ScopedServerStatusWatcher watcher(&server, &params.response);
106 106
107 base::Thread abort_thread("Test_AbortThread"); 107 base::Thread abort_thread("Test_AbortThread");
108 ASSERT_TRUE(abort_thread.Start()); 108 ASSERT_TRUE(abort_thread.Start());
109 abort_thread.message_loop()->PostDelayedTask( 109 abort_thread.message_loop()->PostDelayedTask(
110 FROM_HERE, 110 FROM_HERE,
111 base::Bind(&ServerConnectionManager::TerminateAllIO, 111 base::Bind(&ServerConnectionManager::TerminateAllIO,
112 base::Unretained(&server)), 112 base::Unretained(&server)),
113 TestTimeouts::tiny_timeout_ms()); 113 TestTimeouts::tiny_timeout());
114 114
115 bool result = server.PostBufferToPath( 115 bool result = server.PostBufferToPath(
116 &params, "/testpath", "testauth", &watcher); 116 &params, "/testpath", "testauth", &watcher);
117 117
118 EXPECT_FALSE(result); 118 EXPECT_FALSE(result);
119 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, 119 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE,
120 params.response.server_status); 120 params.response.server_status);
121 abort_thread.Stop(); 121 abort_thread.Stop();
122 } 122 }
123 123
124 TEST(SyncAPIServerConnectionManagerTest, AbortCheckTime) { 124 TEST(SyncAPIServerConnectionManagerTest, AbortCheckTime) {
125 SyncAPIServerConnectionManager server( 125 SyncAPIServerConnectionManager server(
126 "server", 0, true, "1", new BlockingHttpPostFactory()); 126 "server", 0, true, "1", new BlockingHttpPostFactory());
127 127
128 base::Thread abort_thread("Test_AbortThread"); 128 base::Thread abort_thread("Test_AbortThread");
129 ASSERT_TRUE(abort_thread.Start()); 129 ASSERT_TRUE(abort_thread.Start());
130 abort_thread.message_loop()->PostDelayedTask( 130 abort_thread.message_loop()->PostDelayedTask(
131 FROM_HERE, 131 FROM_HERE,
132 base::Bind(&ServerConnectionManager::TerminateAllIO, 132 base::Bind(&ServerConnectionManager::TerminateAllIO,
133 base::Unretained(&server)), 133 base::Unretained(&server)),
134 TestTimeouts::tiny_timeout_ms()); 134 TestTimeouts::tiny_timeout());
135 135
136 int32 time = 0; 136 int32 time = 0;
137 bool result = server.CheckTime(&time); 137 bool result = server.CheckTime(&time);
138 EXPECT_FALSE(result); 138 EXPECT_FALSE(result);
139 abort_thread.Stop(); 139 abort_thread.Stop();
140 } 140 }
141 141
142 } // namespace sync_api 142 } // namespace sync_api
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698