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

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: Address comments 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
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/p2p_notifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4611 matching lines...) Expand 10 before | Expand all | Expand 10 after
4622 AutomationJSONReply reply(this, reply_message); 4622 AutomationJSONReply reply(this, reply_message);
4623 std::string username; 4623 std::string username;
4624 std::string password; 4624 std::string password;
4625 if (!args->GetString("username", &username) || 4625 if (!args->GetString("username", &username) ||
4626 !args->GetString("password", &password)) { 4626 !args->GetString("password", &password)) {
4627 reply.SendError("Invalid or missing args"); 4627 reply.SendError("Invalid or missing args");
4628 return; 4628 return;
4629 } 4629 }
4630 if (sync_waiter_.get() == NULL) { 4630 if (sync_waiter_.get() == NULL) {
4631 sync_waiter_.reset(new ProfileSyncServiceHarness( 4631 sync_waiter_.reset(new ProfileSyncServiceHarness(
4632 browser->profile(), username, password, 4632 browser->profile(), username, password));
4633 true /* expected_notifications_enabled */));
4634 } else { 4633 } else {
4635 sync_waiter_->SetCredentials(username, password); 4634 sync_waiter_->SetCredentials(username, password);
4636 } 4635 }
4637 if (sync_waiter_->SetupSync()) { 4636 if (sync_waiter_->SetupSync()) {
4638 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 4637 scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
4639 return_value->SetBoolean("success", true); 4638 return_value->SetBoolean("success", true);
4640 reply.SendSuccess(return_value.get()); 4639 reply.SendSuccess(return_value.get());
4641 } else { 4640 } else {
4642 reply.SendError("Signing in to sync was unsuccessful"); 4641 reply.SendError("Signing in to sync was unsuccessful");
4643 } 4642 }
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
6332 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); 6331 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl);
6333 6332
6334 Send(reply_message_); 6333 Send(reply_message_);
6335 redirect_query_ = 0; 6334 redirect_query_ = 0;
6336 reply_message_ = NULL; 6335 reply_message_ = NULL;
6337 } 6336 }
6338 6337
6339 void TestingAutomationProvider::OnRemoveProvider() { 6338 void TestingAutomationProvider::OnRemoveProvider() {
6340 AutomationProviderList::GetInstance()->RemoveProvider(this); 6339 AutomationProviderList::GetInstance()->RemoveProvider(this);
6341 } 6340 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/notifier/p2p_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698