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

Side by Side Diff: sync/test/accounts_client/test_accounts_client.h

Issue 1138113003: Remove Test Accounts service client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « sync/test/accounts_client/DEPS ('k') | sync/test/accounts_client/test_accounts_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SYNC_TEST_ACCOUNTS_CLIENT_TEST_ACCOUNTS_CLIENT_H_
6 #define SYNC_TEST_ACCOUNTS_CLIENT_TEST_ACCOUNTS_CLIENT_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/message_loop/message_loop.h"
12 #include "url/gurl.h"
13
14 using std::string;
15 using std::vector;
16
17 // The data associated with an account session.
18 struct AccountSession {
19 AccountSession();
20 ~AccountSession();
21
22 string username;
23 string account_space;
24 string session_id;
25 string expiration_time;
26 };
27
28 // A test-side client for the Test Accounts service. This service provides
29 // short-term, exclusive access to test accounts for the purpose of testing
30 // against real Chrome Sync servers.
31 class TestAccountsClient {
32 public:
33 // Creates a client associated with the given |server| URL (e.g.,
34 // http://service-runs-here.com), |account_space| (for account segregation),
35 // and |usernames| (the collection of accounts to be chosen from).
36 TestAccountsClient(const string& server,
37 const string& account_space,
38 const vector<string>& usernames);
39
40 virtual ~TestAccountsClient();
41
42 // Attempts to claim an account via the Test Accounts service. If
43 // successful, true is returned and the given |session| has its data set.
44 // If an error occurred, then false is returned.
45 bool ClaimAccount(AccountSession* session);
46
47 // Attempts to release an account via the Test Accounts service. The value
48 // of |session| should be one returned from ClaimAccount(). This function
49 // is best-effort and fails silently.
50 void ReleaseAccount(const AccountSession& session);
51
52 // Sends an HTTP POST request to the Test Accounts service.
53 virtual bool SendRequest(const GURL& url, string* response);
54
55 private:
56 GURL CreateGURLWithPath(const string& path);
57 base::MessageLoopForIO io_loop_;
58 const string server_;
59 const string account_space_;
60 vector<string> usernames_;
61 };
62
63 #endif // SYNC_TEST_ACCOUNTS_CLIENT_TEST_ACCOUNTS_CLIENT_H_
OLDNEW
« no previous file with comments | « sync/test/accounts_client/DEPS ('k') | sync/test/accounts_client/test_accounts_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698