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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.h

Issue 7919001: test cases for server directed error handling code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 3 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
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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/file_util.h" 15 #include "base/file_util.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/memory/scoped_vector.h" 17 #include "base/memory/scoped_vector.h"
18 #include "base/process_util.h" 18 #include "base/process_util.h"
19 #include "chrome/browser/sync/protocol/sync_protocol_error.h"
19 #include "chrome/browser/sync/syncable/model_type.h" 20 #include "chrome/browser/sync/syncable/model_type.h"
20 #include "net/base/mock_host_resolver.h" 21 #include "net/base/mock_host_resolver.h"
21 #include "net/test/test_server.h" 22 #include "net/test/test_server.h"
22 23
23 class CommandLine; 24 class CommandLine;
24 class Profile; 25 class Profile;
25 class ProfileSyncServiceHarness; 26 class ProfileSyncServiceHarness;
26 class FakeURLFetcherFactory; 27 class FakeURLFetcherFactory;
27 class URLFetcherFactory; 28 class URLFetcherFactory;
28 29
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 void TriggerMigrationDoneError(const syncable::ModelTypeSet& model_types); 167 void TriggerMigrationDoneError(const syncable::ModelTypeSet& model_types);
167 168
168 // Triggers the server to set its birthday to a random value thereby 169 // Triggers the server to set its birthday to a random value thereby
169 // the server would return a birthday error on next sync. 170 // the server would return a birthday error on next sync.
170 void TriggerBirthdayError(); 171 void TriggerBirthdayError();
171 172
172 // Triggers a transient error on the server. Note the server will stay in 173 // Triggers a transient error on the server. Note the server will stay in
173 // this state until shut down. 174 // this state until shut down.
174 void TriggerTransientError(); 175 void TriggerTransientError();
175 176
177 // Triggers a sync error on the server.
178 void TriggerSyncError(const browser_sync::SyncProtocolError& error);
179
176 // Triggers setting the sync_tabs field of the nigori node. 180 // Triggers setting the sync_tabs field of the nigori node.
177 void TriggerSetSyncTabs(); 181 void TriggerSetSyncTabs();
178 182
179 protected: 183 protected:
180 // Add custom switches needed for running the test. 184 // Add custom switches needed for running the test.
181 virtual void AddTestSwitches(CommandLine* cl); 185 virtual void AddTestSwitches(CommandLine* cl);
182 186
183 // Append the command line switches to enable experimental types that aren't 187 // Append the command line switches to enable experimental types that aren't
184 // on by default yet. 188 // on by default yet.
185 virtual void AddOptionalTypesToCommandLine(CommandLine* cl); 189 virtual void AddOptionalTypesToCommandLine(CommandLine* cl);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 312
309 // The URLFetcherFactory instance used to instantiate |fake_factory_|. 313 // The URLFetcherFactory instance used to instantiate |fake_factory_|.
310 scoped_ptr<URLFetcherFactory> factory_; 314 scoped_ptr<URLFetcherFactory> factory_;
311 315
312 DISALLOW_COPY_AND_ASSIGN(SyncTest); 316 DISALLOW_COPY_AND_ASSIGN(SyncTest);
313 }; 317 };
314 318
315 DISABLE_RUNNABLE_METHOD_REFCOUNT(SyncTest); 319 DISABLE_RUNNABLE_METHOD_REFCOUNT(SyncTest);
316 320
317 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ 321 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698