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

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

Issue 1306163003: Dynamically create Gaia accounts when running E2E sync integration tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Callback for CreateNewProfile() method. It runs the quit_closure once 278 // Callback for CreateNewProfile() method. It runs the quit_closure once
279 // profile is created successfully. 279 // profile is created successfully.
280 static void CreateProfileCallback(const base::Closure& quit_closure, 280 static void CreateProfileCallback(const base::Closure& quit_closure,
281 Profile* profile, 281 Profile* profile,
282 Profile::CreateStatus status); 282 Profile::CreateStatus status);
283 283
284 // Helper to Profile::CreateProfile that handles path creation. It creates 284 // Helper to Profile::CreateProfile that handles path creation. It creates
285 // a profile then registers it as a testing profile. 285 // a profile then registers it as a testing profile.
286 Profile* MakeProfile(const base::FilePath::StringType name); 286 Profile* MakeProfile(const base::FilePath::StringType name);
287 287
288 // Helper method used to create a Gaia account at runtime.
289 // This function should only be called when running against external servers
290 // which use local authentication servers.
pval...(no longer on Chromium) 2015/09/04 16:48:32 "external servers which use local authentication s
shadi 2015/09/04 21:43:45 Done.
291 // Returns true if account creation was successful, false otherwise.
292 bool CreateGaiaAccount(const std::string& username,
293 const std::string& password);
294
288 // Helper method used to read GAIA credentials from a local password file 295 // Helper method used to read GAIA credentials from a local password file
289 // specified via the "--password-file-for-test" command line switch. 296 // specified via the "--password-file-for-test" command line switch.
290 // Note: The password file must be a plain text file with exactly two lines -- 297 // Note: The password file must be a plain text file with exactly two lines --
291 // the username on the first line and the password on the second line. 298 // the username on the first line and the password on the second line.
292 void ReadPasswordFile(); 299 void ReadPasswordFile();
293 300
294 // Helper method that starts up a sync test server if required. 301 // Helper method that starts up a sync test server if required.
295 void SetUpTestServerIfRequired(); 302 void SetUpTestServerIfRequired();
296 303
297 // Helper method used to start up a local python test server. Note: We set up 304 // Helper method used to start up a local python test server. Note: We set up
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 Profile* verifier_; 397 Profile* verifier_;
391 398
392 // Indicates whether changes to a profile should also change the verifier 399 // Indicates whether changes to a profile should also change the verifier
393 // profile or not. 400 // profile or not.
394 bool use_verifier_; 401 bool use_verifier_;
395 402
396 // Indicates whether or not notifications were explicitly enabled/disabled. 403 // Indicates whether or not notifications were explicitly enabled/disabled.
397 // Defaults to true. 404 // Defaults to true.
398 bool notifications_enabled_; 405 bool notifications_enabled_;
399 406
407 // Indicates the need to create Gaia user account at runtime. This can only be
408 // set if tests are run against external servers with support for user
409 // creation via http requests.
410 bool create_gaia_account_at_runtime_;
411
400 // Sync integration tests need to make live DNS requests for access to 412 // Sync integration tests need to make live DNS requests for access to
401 // GAIA and sync server URLs under google.com. We use a scoped version 413 // GAIA and sync server URLs under google.com. We use a scoped version
402 // to override the default resolver while the test is active. 414 // to override the default resolver while the test is active.
403 scoped_ptr<net::ScopedDefaultHostResolverProc> mock_host_resolver_override_; 415 scoped_ptr<net::ScopedDefaultHostResolverProc> mock_host_resolver_override_;
404 416
405 // Used to start and stop the local test server. 417 // Used to start and stop the local test server.
406 base::Process test_server_; 418 base::Process test_server_;
407 419
408 // Fake URLFetcher factory used to mock out GAIA signin. 420 // Fake URLFetcher factory used to mock out GAIA signin.
409 scoped_ptr<net::FakeURLFetcherFactory> fake_factory_; 421 scoped_ptr<net::FakeURLFetcherFactory> fake_factory_;
410 422
411 // The URLFetcherImplFactory instance used to instantiate |fake_factory_|. 423 // The URLFetcherImplFactory instance used to instantiate |fake_factory_|.
412 scoped_ptr<net::URLFetcherImplFactory> factory_; 424 scoped_ptr<net::URLFetcherImplFactory> factory_;
413 425
414 // The contents to be written to a profile's Preferences file before the 426 // The contents to be written to a profile's Preferences file before the
415 // Profile object is created. If empty, no preexisting file will be written. 427 // Profile object is created. If empty, no preexisting file will be written.
416 std::string preexisting_preferences_file_contents_; 428 std::string preexisting_preferences_file_contents_;
417 429
418 DISALLOW_COPY_AND_ASSIGN(SyncTest); 430 DISALLOW_COPY_AND_ASSIGN(SyncTest);
419 }; 431 };
420 432
421 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_ 433 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_TEST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_test.cc » ('j') | chrome/browser/sync/test/integration/sync_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698