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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 7753023: [Sync] Add tests for migration triggered by notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 #include "chrome/browser/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 4613 matching lines...) Expand 10 before | Expand all | Expand 10 after
4624 AutomationJSONReply reply(this, reply_message); 4624 AutomationJSONReply reply(this, reply_message);
4625 std::string username; 4625 std::string username;
4626 std::string password; 4626 std::string password;
4627 if (!args->GetString("username", &username) || 4627 if (!args->GetString("username", &username) ||
4628 !args->GetString("password", &password)) { 4628 !args->GetString("password", &password)) {
4629 reply.SendError("Invalid or missing args"); 4629 reply.SendError("Invalid or missing args");
4630 return; 4630 return;
4631 } 4631 }
4632 if (sync_waiter_.get() == NULL) { 4632 if (sync_waiter_.get() == NULL) {
4633 sync_waiter_.reset(new ProfileSyncServiceHarness( 4633 sync_waiter_.reset(new ProfileSyncServiceHarness(
4634 browser->profile(), username, password, 4634 browser->profile(), username, password));
4635 true /* expected_notifications_enabled */));
4636 } else { 4635 } else {
4637 sync_waiter_->SetCredentials(username, password); 4636 sync_waiter_->SetCredentials(username, password);
4638 } 4637 }
4639 if (sync_waiter_->SetupSync()) { 4638 if (sync_waiter_->SetupSync()) {
4640 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 4639 scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
4641 return_value->SetBoolean("success", true); 4640 return_value->SetBoolean("success", true);
4642 reply.SendSuccess(return_value.get()); 4641 reply.SendSuccess(return_value.get());
4643 } else { 4642 } else {
4644 reply.SendError("Signing in to sync was unsuccessful"); 4643 reply.SendError("Signing in to sync was unsuccessful");
4645 } 4644 }
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
6334 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); 6333 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl);
6335 6334
6336 Send(reply_message_); 6335 Send(reply_message_);
6337 redirect_query_ = 0; 6336 redirect_query_ = 0;
6338 reply_message_ = NULL; 6337 reply_message_ = NULL;
6339 } 6338 }
6340 6339
6341 void TestingAutomationProvider::OnRemoveProvider() { 6340 void TestingAutomationProvider::OnRemoveProvider() {
6342 AutomationProviderList::GetInstance()->RemoveProvider(this); 6341 AutomationProviderList::GetInstance()->RemoveProvider(this);
6343 } 6342 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/p2p_notifier.h » ('j') | chrome/browser/sync/profile_sync_service_harness.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698