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

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

Issue 6247007: Fix autofill pyauto tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/message_box_flags.h" 7 #include "app/message_box_flags.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 3756 matching lines...) Expand 10 before | Expand all | Expand 10 after
3767 // json input. 3767 // json input.
3768 // Sample json output: {} 3768 // Sample json output: {}
3769 void TestingAutomationProvider::FillAutoFillProfile( 3769 void TestingAutomationProvider::FillAutoFillProfile(
3770 Browser* browser, 3770 Browser* browser,
3771 DictionaryValue* args, 3771 DictionaryValue* args,
3772 IPC::Message* reply_message) { 3772 IPC::Message* reply_message) {
3773 AutomationJSONReply reply(this, reply_message); 3773 AutomationJSONReply reply(this, reply_message);
3774 ListValue* profiles = NULL; 3774 ListValue* profiles = NULL;
3775 ListValue* cards = NULL; 3775 ListValue* cards = NULL;
3776 3776
3777 if (!args->GetList("profiles", &profiles)) { 3777 // It's ok for profiles/credit_cards elements to be missing.
3778 reply.SendError("Invalid or missing profiles list"); 3778 args->GetList("profiles", &profiles);
3779 return; 3779 args->GetList("credit_cards", &cards);
3780 }
3781
3782 if (!args->GetList("credit_cards", &cards)) {
3783 reply.SendError("Invalid or missing credit_cards list");
3784 return;
3785 }
3786 3780
3787 std::string error_mesg; 3781 std::string error_mesg;
3788 3782
3789 std::vector<AutoFillProfile> autofill_profiles; 3783 std::vector<AutoFillProfile> autofill_profiles;
3790 std::vector<CreditCard> credit_cards; 3784 std::vector<CreditCard> credit_cards;
3791 // Create an AutoFillProfile for each of the dictionary profiles. 3785 // Create an AutoFillProfile for each of the dictionary profiles.
3792 if (profiles) { 3786 if (profiles) {
3793 autofill_profiles = GetAutoFillProfilesFromList(*profiles, &error_mesg); 3787 autofill_profiles = GetAutoFillProfilesFromList(*profiles, &error_mesg);
3794 } 3788 }
3795 // Create a CreditCard for each of the dictionary values. 3789 // Create a CreditCard for each of the dictionary values.
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
4517 // If you change this, update Observer for NotificationType::SESSION_END 4511 // If you change this, update Observer for NotificationType::SESSION_END
4518 // below. 4512 // below.
4519 MessageLoop::current()->PostTask(FROM_HERE, 4513 MessageLoop::current()->PostTask(FROM_HERE,
4520 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); 4514 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider));
4521 } 4515 }
4522 } 4516 }
4523 4517
4524 void TestingAutomationProvider::OnRemoveProvider() { 4518 void TestingAutomationProvider::OnRemoveProvider() {
4525 AutomationProviderList::GetInstance()->RemoveProvider(this); 4519 AutomationProviderList::GetInstance()->RemoveProvider(this);
4526 } 4520 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698