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

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

Issue 10689157: Switch to TimeDelta interfaces for TestTimeouts in sync code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/internal_api/syncapi_server_connection_manager.h" 5 #include "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 18 matching lines...) Expand all
29 BlockingHttpPost() : wait_for_abort_(false, false) {} 29 BlockingHttpPost() : wait_for_abort_(false, false) {}
30 virtual ~BlockingHttpPost() {} 30 virtual ~BlockingHttpPost() {}
31 31
32 virtual void SetExtraRequestHeaders(const char* headers) OVERRIDE {} 32 virtual void SetExtraRequestHeaders(const char* headers) OVERRIDE {}
33 virtual void SetURL(const char* url, int port) OVERRIDE {} 33 virtual void SetURL(const char* url, int port) OVERRIDE {}
34 virtual void SetPostPayload(const char* content_type, 34 virtual void SetPostPayload(const char* content_type,
35 int content_length, 35 int content_length,
36 const char* content) OVERRIDE {} 36 const char* content) OVERRIDE {}
37 virtual bool MakeSynchronousPost(int* error_code, int* response_code) 37 virtual bool MakeSynchronousPost(int* error_code, int* response_code)
38 OVERRIDE { 38 OVERRIDE {
39 wait_for_abort_.TimedWait(TimeDelta::FromMilliseconds( 39 wait_for_abort_.TimedWait(TestTimeouts::action_max_timeout());
40 TestTimeouts::action_max_timeout_ms()));
41 *error_code = net::ERR_ABORTED; 40 *error_code = net::ERR_ABORTED;
42 return false; 41 return false;
43 } 42 }
44 virtual int GetResponseContentLength() const OVERRIDE { 43 virtual int GetResponseContentLength() const OVERRIDE {
45 return 0; 44 return 0;
46 } 45 }
47 virtual const char* GetResponseContent() const OVERRIDE { 46 virtual const char* GetResponseContent() const OVERRIDE {
48 return ""; 47 return "";
49 } 48 }
50 virtual const std::string GetResponseHeaderValue( 49 virtual const std::string GetResponseHeaderValue(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 bool result = server.PostBufferToPath( 104 bool result = server.PostBufferToPath(
106 &params, "/testpath", "testauth", &watcher); 105 &params, "/testpath", "testauth", &watcher);
107 106
108 EXPECT_FALSE(result); 107 EXPECT_FALSE(result);
109 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, 108 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE,
110 params.response.server_status); 109 params.response.server_status);
111 abort_thread.Stop(); 110 abort_thread.Stop();
112 } 111 }
113 112
114 } // namespace syncer 113 } // namespace syncer
OLDNEW
« chrome/browser/sync/test/integration/sync_test.h ('K') | « sync/engine/sync_scheduler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698